:root {
  color-scheme: light;
  --bg: #eef4f3;
  --card: #ffffff;
  --sunk: #e5eeec;
  --ink: #0e2a31;
  --ink-2: #41585e;
  --muted: #6e8388;
  --line: #d6e2df;
  --deep: #0f4c5c;
  --on-deep: #ffffff;
  --teal: #0f8f84;
  --teal-2: #2ec4b6;
  --teal-soft: #d9f3ef;
  --amber: #b86b12;
  --amber-2: #f4a259;
  --amber-soft: #fdefd9;
  --coral: #cf3f33;
  --coral-2: #ff6b5b;
  --coral-soft: #fde4e0;
  --sky: #3b82c4;
  --plum: #7a5ab8;
  --erp: #0f8f84; --proc: #b86b12; --legacy: #7a5ab8;
  --display: "Sora", system-ui, sans-serif;
  --sans: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 1px 2px rgba(14, 42, 49, 0.05), 0 8px 24px rgba(14, 42, 49, 0.07);
  --side: #0b3a46;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1417; --card: #101e22; --sunk: #16282d; --ink: #e3f0ee; --ink-2: #b1c5c7; --muted: #7c9397; --line: #1f353a;
  --deep: #7fe0d6; --on-deep: #062a30; --teal: #5ad8cb; --teal-2: #2ec4b6; --teal-soft: #0f3330;
  --amber: #f4b56e; --amber-2: #f4a259; --amber-soft: #33240f; --coral: #ff8a7d; --coral-2: #ff6b5b; --coral-soft: #3a1b18;
  --sky: #82b6e8; --plum: #b59ae6; --erp: #5ad8cb; --proc: #f4b56e; --legacy: #b59ae6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --side: #08242b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0a1417; --card: #101e22; --sunk: #16282d; --ink: #e3f0ee; --ink-2: #b1c5c7; --muted: #7c9397; --line: #1f353a;
    --deep: #7fe0d6; --on-deep: #062a30; --teal: #5ad8cb; --teal-2: #2ec4b6; --teal-soft: #0f3330;
    --amber: #f4b56e; --amber-2: #f4a259; --amber-soft: #33240f; --coral: #ff8a7d; --coral-2: #ff6b5b; --coral-soft: #3a1b18;
    --sky: #82b6e8; --plum: #b59ae6; --erp: #5ad8cb; --proc: #f4b56e; --legacy: #b59ae6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --side: #08242b;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-ligatures: no-contextual; }
h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { padding: 0; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; background: var(--sunk); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--ink-2); font: 600 11px var(--mono); }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 22px; height: 100vh; padding: 20px 14px 16px; background: var(--side); color: #d8efec; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; font: 600 19px/1 var(--display); letter-spacing: -0.01em; text-decoration: none; color: #fff; }
.logo svg { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(127, 224, 214, 0.3); }
.logo b { color: #7fe0d6; font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; border-radius: 10px; color: rgba(216, 239, 236, 0.78); font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav a > svg { width: 18px; height: 18px; margin: 0 2px; }
.nav a:hover { background: rgba(127, 224, 214, 0.08); color: #fff; }
.nav a[aria-current="page"] { background: rgba(127, 224, 214, 0.14); color: #fff; }
.nav .lbl { flex: 1; }
.step { display: grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid rgba(127, 224, 214, 0.45); border-radius: 50%; color: #7fe0d6; font: 600 11.5px var(--mono); }
.nav a[aria-current="page"] .step { background: #7fe0d6; border-color: #7fe0d6; color: #0b3a46; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; background: #f4a259; border-radius: 99px; color: #3a2204; font: 700 11.5px var(--mono); }
.done { display: grid; place-items: center; width: 20px; height: 20px; color: #7fe0d6; }
.done svg { width: 16px; height: 16px; stroke-width: 2.2; }
.nav-gap { height: 1px; margin: 12px 10px; background: rgba(127, 224, 214, 0.16); }
.side-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px 6px 0; border-top: 1px solid rgba(127, 224, 214, 0.16); }
.dataset { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; color: rgba(216, 239, 236, 0.7); font-size: 12.5px; }
.dataset span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dataset svg { width: 16px; height: 16px; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: inherit; }
.icon-btn:hover { background: rgba(127, 224, 214, 0.12); }
.icon-btn svg { width: 18px; height: 18px; }
.main { width: 100%; max-width: 1280px; padding: 30px 32px 72px; }
.main:focus { outline: 0; }

/* ---------- headings, buttons, cards ---------- */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.eyebrow { color: var(--teal); font: 600 12px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.head h1 { margin-top: 6px; font: 700 31px/1.12 var(--display); letter-spacing: -0.025em; }
.head p { margin-top: 6px; max-width: 72ch; color: var(--ink-2); }
.head-act { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.btn svg { width: 17px; height: 17px; }
.btn kbd { margin-left: 2px; background: transparent; }
.btn:hover:not(:disabled) { border-color: var(--ink-2); }
.btn.primary { background: var(--deep); border-color: var(--deep); color: var(--on-deep); }
.btn.primary kbd { border-color: color-mix(in srgb, var(--on-deep) 35%, transparent); color: inherit; }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--deep); }
.btn.warn { border-color: var(--coral); color: var(--coral); }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--sunk); border-color: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.link { color: var(--teal); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.card { min-width: 0; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h2 { display: flex; align-items: center; gap: 8px; font: 600 18px/1.25 var(--display); letter-spacing: -0.01em; }
.card-h h2 svg { width: 19px; height: 19px; color: var(--teal); }
.hint { color: var(--muted); font-size: 13px; }
.foot-note { margin-top: 14px; color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 18px; align-content: start; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.in, .sel, .ta { width: 100%; min-height: 40px; padding: 8px 11px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.sel.small { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.ta { min-height: 140px; resize: vertical; font: 13px/1.5 var(--mono); }
.in:focus, .sel:focus, .ta:focus { outline: 0; border-color: var(--teal-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-2) 25%, transparent); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font: 700 11.5px var(--mono); white-space: nowrap; }
.tag svg { width: 13px; height: 13px; stroke-width: 2; }
.tag.teal { background: var(--teal-soft); color: var(--teal); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.coral { background: var(--coral-soft); color: var(--coral); }
.tag.grey { background: var(--sunk); color: var(--ink-2); }
.chip { display: inline-flex; padding: 1px 7px; border: 1px solid currentColor; border-radius: 6px; color: var(--ink-2); font: 600 11.5px/1.6 var(--mono); white-space: nowrap; }
.chip.erp { color: var(--erp); } .chip.proc { color: var(--proc); } .chip.legacy { color: var(--legacy); }
.meter { display: block; height: 7px; overflow: hidden; background: var(--sunk); border-radius: 99px; }
.meter i { display: block; height: 100%; background: var(--teal-2); border-radius: 99px; }
.meter.soft i { background: color-mix(in srgb, var(--teal-2) 45%, var(--sunk)); }
.meter.warn i { background: var(--amber-2); }
.banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 14px; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); border-radius: 12px; color: var(--ink); font-size: 14px; }
.banner svg { width: 18px; height: 18px; margin-top: 1px; color: var(--amber); }
.banner a { color: var(--amber); font-weight: 700; }
.note { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 13px; background: var(--teal-soft); border-radius: 11px; font-size: 14px; }
.note svg { width: 18px; height: 18px; margin-top: 1px; color: var(--teal); }
.note.bad { background: var(--coral-soft); }
.note.bad svg { color: var(--coral); }
.empty-state { padding: 26px; color: var(--muted); text-align: center; }
.empty-state .btn { margin-top: 12px; }

/* ---------- profile ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat small { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat strong { display: block; margin-top: 4px; font: 700 34px/1.1 var(--display); letter-spacing: -0.03em; }
.stat p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.srcbar { display: flex; height: 8px; margin-top: 10px; overflow: hidden; border-radius: 99px; gap: 2px; }
.srcbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--ink-2); font-size: 12.5px; }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.legend b { font-family: var(--mono); font-size: 11.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.health { width: 100%; border-collapse: collapse; font-size: 14px; }
.health th, .health td { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.health thead th { padding-top: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.health tbody th { width: 26%; font-weight: 700; }
.health td { width: 37%; }
.health .pct { display: block; margin-bottom: 5px; font: 600 13px var(--mono); }
.progress { display: grid; gap: 4px; }
.progress a { display: flex; gap: 12px; padding: 9px 8px; border-radius: 11px; text-decoration: none; }
.progress a:hover { background: var(--sunk); }
.progress .num { display: grid; place-items: center; width: 28px; height: 28px; background: var(--teal-soft); border-radius: 50%; color: var(--teal); font: 700 13px var(--mono); }
.progress .txt { display: grid; flex: 1; gap: 3px; }
.progress small { color: var(--muted); font-size: 13px; }
.progress .meter { margin-top: 4px; }
.fixes { display: grid; gap: 4px; }
.fixes li { display: flex; gap: 11px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.fixes li:last-child { border-bottom: 0; }
.fixes .ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }
.fixes .ic svg { width: 17px; height: 17px; }
.fixes .warn .ic { background: var(--amber-soft); color: var(--amber); }
.fixes .bad .ic { background: var(--coral-soft); color: var(--coral); }
.fixes .info .ic { background: var(--teal-soft); color: var(--teal); }
.fixes p { margin-top: 2px; color: var(--ink-2); font-size: 13.5px; }
.fixes a { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; color: var(--teal); font-size: 13px; font-weight: 700; text-decoration: none; }
.fixes a svg { width: 14px; height: 14px; }

/* ---------- duplicates ---------- */
.review-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.queue { position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); padding: 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--sunk); border-radius: 10px; }
.seg button { flex: 1; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.seg button span { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); color: var(--ink); }
.q-list { margin-top: 10px; overflow-y: auto; }
.q-list button { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 11px; width: 100%; padding: 10px; border-radius: 11px; text-align: left; }
.q-list button:hover { background: var(--sunk); }
.q-list button[aria-current="true"] { background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--teal-2); }
.q-score { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 30px; border-radius: 8px; font: 700 13px var(--mono); }
.q-score.likely { background: var(--teal-soft); color: var(--teal); }
.q-score.review { background: var(--amber-soft); color: var(--amber); }
.q-score.unlikely { background: var(--sunk); color: var(--muted); }
.q-names { display: grid; min-width: 0; font-size: 13.5px; }
.q-names b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.q-names b + b { color: var(--ink-2); font-weight: 500; }
.q-meta { display: flex; gap: 4px; grid-column: 2; }
.q-meta:empty { display: none; }
.q-empty { padding: 18px 10px; color: var(--muted); font-size: 14px; text-align: center; }
.q-empty a { color: var(--teal); font-weight: 700; }
.pair { padding: 24px; }
.pair-top { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.ring { position: relative; flex: none; display: grid; place-items: center; width: 76px; height: 76px; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 7; }
.ring .trk { stroke: var(--sunk); }
.ring .val { stroke-linecap: round; transition: stroke-dasharray 0.4s; }
.ring.likely .val { stroke: var(--teal-2); }
.ring.review .val { stroke: var(--amber-2); }
.ring.unlikely .val { stroke: var(--muted); }
.ring b { font: 700 19px var(--display); letter-spacing: -0.03em; }
.band { font: 600 12px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.band.likely { color: var(--teal); } .band.review { color: var(--amber); } .band.unlikely { color: var(--muted); }
.coral-t { color: var(--coral); }
.pair-t h2 { margin-top: 3px; font: 600 22px/1.25 var(--display); letter-spacing: -0.02em; }
.vs { color: var(--muted); font-family: var(--sans); font-weight: 500; }
.pair-s { margin-top: 3px; color: var(--muted); font-size: 13px; }
.cmp { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cmp-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); font-size: 14px; }
.cmp-row:first-child { border-top: 0; }
.cmp-row > span { min-width: 0; padding: 9px 12px; overflow-wrap: anywhere; }
.cmp-head { background: var(--sunk); }
.cmp-l { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.cmp-a { border-left: 1px solid var(--line); }
.cmp-b { border-left: 1px solid var(--line); }
.cmp em { color: var(--muted); font-style: normal; }
.v { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font: 700 12px var(--mono); font-style: normal; }
.same .v { background: var(--teal-soft); color: var(--teal); }
.near .v { background: var(--amber-soft); color: var(--amber); }
.diff .v { background: var(--coral-soft); color: var(--coral); }
.gap .v { background: var(--sunk); color: var(--muted); }
.info .v { color: var(--muted); }
.cmp-head .v { display: none; }
.diff .cmp-a, .diff .cmp-b { background: color-mix(in srgb, var(--coral-soft) 45%, transparent); }
.pair-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; margin-top: 20px; }
.pair-grid h3 { margin-bottom: 10px; font: 600 15px var(--display); }
.ev { display: grid; gap: 7px; }
.ev li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 46px; align-items: center; gap: 10px; font-size: 13.5px; }
.ev-t b { font-weight: 700; }
.ev-bar { height: 8px; overflow: hidden; background: var(--sunk); border-radius: 99px; }
.ev-bar i { display: block; height: 100%; background: var(--teal-2); border-radius: 99px; }
.ev .neg .ev-bar i { background: var(--coral-2); }
.ev-p { font: 700 13px var(--mono); text-align: right; color: var(--teal); }
.ev .neg .ev-p { color: var(--coral); }
.ev .zero .ev-p { color: var(--muted); }
.ev .tot { margin-top: 3px; padding-top: 9px; border-top: 1px dashed var(--line); }
.ev .tot .ev-bar { visibility: hidden; }
.ev .tot .ev-p { color: var(--ink); font-size: 15px; }
.ev .tot .ev-t { color: var(--muted); }
.ev .tot .ev-t b { color: var(--ink); }
.preview { padding: 16px; background: var(--sunk); border-radius: 12px; }
.pv-name { margin: 4px 0 10px; font: 600 17px/1.3 var(--display); }
.preview dl { display: grid; gap: 6px; font-size: 13.5px; }
.preview dl div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.preview dt { color: var(--muted); font-weight: 600; }
.preview dd { overflow-wrap: anywhere; }
.pv-issue { display: flex; gap: 7px; margin-top: 10px; color: var(--coral); font-size: 13px; font-weight: 600; }
.pv-issue svg { width: 16px; height: 16px; margin-top: 1px; }
.pair-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- categories ---------- */
.cats { display: grid; }
.cat { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) auto; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.cat:last-child { border-bottom: 0; }
.cat.is-done { opacity: 0.72; }
.cat-main b { display: block; font-size: 14.5px; }
.cat-src { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cat-sug { display: grid; justify-items: start; gap: 3px; font-size: 13px; }
.cat-sug small { color: var(--ink-2); font-size: 12.5px; }
.cat-act { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.cat-act .sel { width: 150px; }
.codes { display: grid; }
.codes li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.codes li:last-child { border-bottom: 0; }
.codes .mono { color: var(--teal); font-weight: 600; }
.codes small { display: block; color: var(--muted); font-size: 12px; }
.codes b { font: 600 13px var(--mono); }

/* ---------- golden records ---------- */
.cols-master { grid-template-columns: minmax(0, 1fr) 320px; }
.tbl-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; top: 11px; left: 11px; width: 18px; height: 18px; color: var(--muted); }
.search .in { padding-left: 36px; }
.tbl-tools .seg { flex: none; }
.tbl-wrap { position: relative; overflow-x: auto; }
.mt { width: 100%; border-collapse: collapse; font-size: 14px; }
.mt th, .mt td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.mt thead th { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.mt tbody tr:not(.detail):hover { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.mt tr.is-open { background: var(--teal-soft); }
.mt td.srcs { line-height: 1.9; }
.mt.mini { font-size: 13px; }
.row-btn { padding: 3px 6px; border-radius: 6px; color: var(--teal); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.row-btn:hover { background: var(--teal-soft); }
.detail > td { padding: 0 0 4px; background: var(--teal-soft); }
.det { margin: 0 8px 8px; padding: 14px; background: var(--card); border-radius: 12px; }
.prov { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.prov th, .prov td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.prov thead th { color: var(--muted); font-size: 12px; font-weight: 600; }
.prov tbody th { font-weight: 700; white-space: nowrap; }
.issues { display: grid; gap: 4px; margin-top: 10px; }
.issues li { display: flex; gap: 7px; color: var(--coral); font-size: 13.5px; font-weight: 600; }
.issues svg { width: 16px; height: 16px; margin-top: 2px; }
.exports { display: grid; gap: 8px; }
.exports .btn { justify-content: flex-start; font-family: var(--mono); font-size: 13.5px; }
.term pre { margin: 10px 0 12px; padding: 12px 14px; overflow-x: auto; background: #071f25; border-radius: 10px; color: #bff3ec; font: 12.5px/1.6 var(--mono); white-space: pre; }
.term p { color: var(--ink-2); font-size: 13.5px; }

/* ---------- rules ---------- */
.hist { position: relative; display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); align-items: end; gap: 3px; height: 150px; margin-top: 18px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.hist .b { position: relative; display: block; min-height: 0; border-radius: 4px 4px 0 0; }
.hist .b i { position: absolute; bottom: 100%; left: 0; right: 0; color: var(--muted); font: 600 10.5px var(--mono); font-style: normal; text-align: center; }
.hist .likely { background: var(--teal-2); }
.hist .review { background: var(--amber-2); }
.hist .unlikely { background: color-mix(in srgb, var(--muted) 35%, var(--sunk)); }
.hist .mark { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 2px dashed var(--ink-2); pointer-events: none; }
.hist .mark b { position: absolute; top: -14px; left: 4px; padding: 0 4px; background: var(--card); border-radius: 4px; font: 700 11px var(--mono); }
.hist .mark.likely b { color: var(--teal); } .hist .mark.review b { color: var(--amber); }
.hist .mark.likely { border-color: var(--teal); } .hist .mark.review { border-color: var(--amber); }
.hist-x { display: flex; justify-content: space-between; margin: 4px 0 18px; color: var(--muted); font: 11px var(--mono); }
.thr input[type="range"] { width: 100%; accent-color: var(--teal-2); }
.bands { display: flex; flex-wrap: wrap; gap: 8px; }
.bands li { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 11px; border-radius: 99px; font-size: 13px; }
.bands b { font: 700 14px var(--mono); }
.bands .likely { background: var(--teal-soft); color: var(--teal); }
.bands .review { background: var(--amber-soft); color: var(--amber); }
.bands .unlikely { background: var(--sunk); color: var(--ink-2); }
.weights { display: grid; }
.weights li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.weights li:last-child { border-bottom: 0; }
.weights .mono { color: var(--teal); font-weight: 600; }
.weights p { grid-column: 1 / -1; color: var(--ink-2); font-size: 13.5px; }
.try-out { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 22px; margin-top: 4px; }

/* ---------- data ---------- */
.facts { display: grid; gap: 9px; font-size: 14px; }
.facts div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
.facts dt { color: var(--muted); font-weight: 600; }
.drop { display: grid; justify-items: center; gap: 4px; padding: 26px; background: var(--sunk); border: 2px dashed var(--line); border-radius: 14px; color: var(--ink-2); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.is-over { border-color: var(--teal-2); background: var(--teal-soft); }
.drop svg { width: 26px; height: 26px; color: var(--teal); }
.drop b { color: var(--ink); }
.drop span { font-size: 13px; }
.paste { margin-top: 12px; }
.paste summary { color: var(--teal); font-size: 14px; font-weight: 700; cursor: pointer; }
.paste .ta { margin: 10px 0 8px; }
.incoming { margin-bottom: 18px; border-color: var(--teal-2); }
.ok { display: flex; gap: 9px; font-size: 14.5px; }
.ok svg { width: 19px; height: 19px; color: var(--teal); }
.incoming .tbl-wrap { margin-top: 12px; }

/* ---------- dialog, toast ---------- */
.dlg { width: min(480px, calc(100vw - 24px)); padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); color: var(--ink); }
.dlg::backdrop { background: rgba(6, 26, 31, 0.6); }
.dlg form { padding: 22px; }
.dlg h2 { margin-bottom: 10px; font: 600 20px var(--display); }
.dlg p { margin-bottom: 12px; color: var(--ink-2); }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 11px 12px 11px 16px; background: #0b3a46; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25); color: #e3f6f3; font-size: 14px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 0.2s, transform 0.2s; }
.toast.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast button { padding: 6px 10px; background: #7fe0d6; border-radius: 8px; color: #0b3a46; font-size: 13px; font-weight: 800; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .review-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .pair-grid { grid-template-columns: minmax(0, 1fr); }
  .cols-master { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { display: block; }
  .side { position: sticky; z-index: 30; flex-direction: row; align-items: center; gap: 10px; height: auto; padding: 0 12px; }
  .logo { padding: 0; font-size: 17px; }
  .logo svg { width: 30px; height: 30px; }
  .nav { flex-direction: row; flex: 1; gap: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav a { min-height: 56px; padding: 0 9px; border-radius: 0; font-size: 13.5px; }
  .nav a[aria-current="page"] { background: transparent; box-shadow: inset 0 -3px 0 #7fe0d6; }
  .nav-gap { width: 1px; height: 24px; margin: auto 6px; }
  .side-foot { margin: 0; padding: 0; border: 0; }
  .dataset { display: none; }
  .main { padding: 22px 18px 72px; }
  .cols, .review-grid { grid-template-columns: minmax(0, 1fr); }
  .queue { position: static; order: 2; max-height: 380px; }
}
@media (max-width: 620px) {
  .logo span { display: none; }
  .nav a > svg { display: none; }
  .head h1 { font-size: 25px; }
  .stats, .stats-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .stats-3 .stat:first-child { grid-column: 1 / -1; }
  .stat strong { font-size: 28px; }
  .card { padding: 16px; border-radius: 14px; }
  .pair { padding: 16px; }
  .pair-top { gap: 12px; }
  .ring { width: 62px; height: 62px; }
  .ring b { font-size: 16px; }
  .pair-t h2 { font-size: 18px; }
  .cmp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cmp-row > .cmp-l { grid-column: 1 / -1; padding-bottom: 0; }
  .cmp-head > .cmp-l { display: none; }
  .cmp-a { border-left: 0; }
  .cmp-row > span { padding: 7px 10px; font-size: 13.5px; }
  .ev li { grid-template-columns: minmax(0, 1fr) 44px; }
  .ev-bar { display: none; }
  .pair-act .btn { flex: 1; }
  .pair-act kbd { display: none; }
  .cat { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cat-act { justify-content: flex-start; }
  .row2, .try-out { grid-template-columns: minmax(0, 1fr); }
  .try-out .ring { justify-self: start; }
  .mt > * > tr > :nth-child(3), .mt > * > tr > :nth-child(5) { display: none; }
  .mt > * > tr.detail > td { display: table-cell; }
  .prov th:nth-child(4), .prov td:nth-child(4) { display: none; }
  .facts div { grid-template-columns: 100px minmax(0, 1fr); }
  .health tbody th { width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.map { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin: 12px 0 4px; }
.map-row { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.map-row b { color: var(--coral); font: 600 10.5px var(--mono); text-transform: uppercase; }
@media (max-width: 760px) { .map { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 620px), (hover: none) { .keys, .pair-act kbd { display: none; } }
@media (max-width: 620px) {
  .prov thead { display: none; }
  .prov tr { display: grid; grid-template-columns: 78px minmax(0, 1fr); padding: 6px 0; border-bottom: 1px solid var(--line); }
  .prov th, .prov td { padding: 2px 4px; border: 0; overflow-wrap: anywhere; }
  .prov td:nth-child(3) { grid-column: 2; }
  .det { margin: 0 4px 6px; padding: 10px; }
}
/* Touch screens: the fix links get a thumb-sized target. */
@media (pointer: coarse) { .fixes a { min-height: 44px; margin-top: 0; } }
