:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --accent: #111111;
  --danger: #b3261e;
  --ok: #1a7f37;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #e9e9e9;
    --muted: #8a8a8a;
    --line: #262626;
    --accent: #e9e9e9;
    --danger: #ff6b63;
    --ok: #3fd67a;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  text-transform: lowercase;
}

button {
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 4px;
}

.btn-ghost.on {
  color: var(--ok);
  border-color: var(--ok);
}

.add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.add-form input {
  font-family: inherit;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 8px 10px;
  border-radius: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.add-form button {
  background: var(--fg);
  color: var(--bg);
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.msg {
  font-size: 12px;
  color: var(--danger);
  margin: 0 0 12px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.alias-box { flex: 1 1 auto; min-width: 0; }

.alias {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.alias-input {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 2px 4px;
  border-radius: 3px;
  width: 100%;
}

.codigo {
  color: var(--muted);
  font-size: 11px;
  flex: 0 0 auto;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.head-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--muted);
  padding: 4px 6px;
}

.btn-icon:hover { color: var(--fg); }
.btn-icon.danger:hover { color: var(--danger); }

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--fg);
  padding: 10px 12px;
  text-align: left;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
}

.status-dot.active { background: var(--ok); }

.status-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.chevron {
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.15s ease;
}

.chevron.open { transform: rotate(90deg); }

.commits {
  list-style: none;
  margin: 0;
  padding: 4px 12px 14px;
  border-top: 1px solid var(--line);
}

.commit {
  display: flex;
  gap: 10px;
}

.commit-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 14px;
}

.commit-dot {
  width: 8px;
  height: 8px;
  margin-top: 14px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: var(--bg);
  flex: 0 0 auto;
}

.commit:first-child .commit-dot {
  border-color: var(--ok);
}

.commit-branch {
  flex: 1 1 auto;
  width: 1px;
  background: var(--line);
}

.commit:last-child .commit-branch {
  display: none;
}

.commit-body {
  padding: 10px 0 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.commit-msg {
  margin: 0 0 4px;
  font-size: 13px;
}

.commit-meta {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
  text-transform: lowercase;
}

.commit-date { white-space: nowrap; }

.empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}
