/* Tokens de color: contraste ≥ 4.5:1 (WCAG AA) en ambos temas. */
:root {
  --bg: #f7f7f5; --panel: #ffffff; --text: #1b1d21; --muted: #4f5561; --line: #d5d8de;
  --accent: #0b5cad; --accent-text: #ffffff; --ok: #1a6b33; --warn: #8a4b00; --bad: #a3182a;
  --win: #7a4bd1; --focus: #ffbf47; --code: #eef1f5;
  --c0: #0b5cad; --c1: #b24d00; --c2: #1a7a44; --c3: #8a2f86; --c4: #6b6200; --c5: #5a5a5a;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121418; --panel: #1b1e24; --text: #e8eaee; --muted: #aab1bd; --line: #343a45;
  --accent: #6fb1ff; --accent-text: #0b1220; --ok: #6ad48c; --warn: #f0b35a; --bad: #ff8a96;
  --win: #c3a6ff; --focus: #ffbf47; --code: #242933;
  --c0: #6fb1ff; --c1: #ffa25a; --c2: #6ad48c; --c3: #e59be2; --c4: #d9cf55; --c5: #b5b5b5;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--panel); padding: 8px; }
.skip:focus { left: 8px; z-index: 10; }
.top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .08em; }
.brand small { font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.top-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.who { color: var(--muted); font-size: 13px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; color: var(--muted); font: inherit; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
main { padding: 16px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 16px 0 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
textarea { width: 100%; min-height: 90px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 13px; }
button { font: inherit; cursor: pointer; background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); border-radius: 6px; padding: 6px 12px; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button:disabled { opacity: .55; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; background: var(--code); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); margin-right: 4px; }
.badge.win { border-color: var(--win); color: var(--win); font-weight: 600; }
.badge.taint { border-color: var(--warn); color: var(--warn); }
.status { position: fixed; bottom: 12px; right: 12px; max-width: 480px; }
.status .msg { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 8px 12px; margin-top: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.status .msg.error { border-left-color: var(--bad); }
svg { max-width: 100%; }
svg text { fill: var(--text); font-size: 11px; }
.dag { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); touch-action: none; }
.node { cursor: pointer; }
.node:focus { outline: none; }
.node:focus circle { stroke: var(--focus); stroke-width: 4; }
.edge { stroke: var(--line); stroke-width: 1.2; fill: none; }
.bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.diff { font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: pre-wrap; background: var(--code); border-radius: 6px; padding: 8px; max-height: 320px; overflow: auto; }
.diff .add { color: var(--ok); } .diff .del { color: var(--bad); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.timeline { position: relative; }
.login { max-width: 560px; margin: 40px auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
