:root {
  color-scheme: dark;
  --ink: #f4f7f4;
  --muted: #96a3a1;
  --faint: #667270;
  --black: #090c0c;
  --panel: #0d1110;
  --panel-2: #121716;
  --line: rgba(211, 235, 226, .13);
  --line-strong: rgba(211, 235, 226, .24);
  --acid: #b9f65b;
  --acid-soft: rgba(185, 246, 91, .14);
  --aqua: #66e6cf;
  --warn: #f6c85b;
  --danger: #ff8f70;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Palatino Linotype, Book Antiqua, Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--black); color: var(--ink); font-family: var(--sans); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--aqua); }

.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 64px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; width: max-content; align-items: center; gap: 10px; color: #c9d3d0; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-decoration: none; text-transform: uppercase; }
.brand-mark { width: 10px; height: 10px; border: 1px solid var(--aqua); border-radius: 50%; box-shadow: 0 0 14px rgba(102,230,207,.55); }
.product-name { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 19px; }
.product-name strong { color: var(--acid); font-weight: inherit; }
.prototype-badge { padding: 4px 7px 3px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font: 700 9px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.topbar-meta { justify-self: end; color: var(--faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.page { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 32px 28px 48px; }

.intro { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 420px); justify-content: space-between; align-items: start; gap: 24px 48px; margin-bottom: 28px; }
.how-panel { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.how-panel h2 { margin: 0 0 10px; color: var(--muted); font: 800 10px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.how-steps { margin: 0 0 12px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.how-steps li + li { margin-top: 4px; }
.how-links { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.how-links a { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; text-decoration: none; }
.how-links a:hover { border-color: var(--line-strong); }
h1 { margin: 0 0 10px; font: 400 34px/1.1 var(--serif); }
.lede { max-width: 620px; margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }

.field-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; max-width: 760px; }
.repo-field { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; height: 42px; padding: 0 0 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); font-family: var(--mono); font-size: 13px; cursor: text; }
.repo-field:focus-within, .field-row select:focus { outline: 2px solid var(--acid); outline-offset: 1px; }
.repo-prefix { color: var(--faint); white-space: nowrap; }
.repo-field input { flex: 1; min-width: 0; height: 100%; padding: 0 12px 0 0; border: 0; background: transparent; font: inherit; outline: none; }
.field-row select { height: 42px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); font-size: 13px; }
#branch-select { max-width: 190px; }
.primary { height: 42px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--acid); color: #0b1000; font-weight: 800; cursor: pointer; }
.primary:disabled { opacity: .5; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; color: var(--faint); font-size: 12px; }
.chips button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11px; cursor: pointer; }
.chips button:hover { border-color: var(--line-strong); color: var(--ink); }

.gate { display: flex; flex-direction: column; gap: 6px; }
.gate[hidden] { display: none; }
.gate p { max-width: 300px; margin: 0; color: var(--faint); font-size: 11px; line-height: 1.45; }
.gate p[data-tone="error"] { color: var(--danger); }


.error { margin: 0 0 16px; padding: 10px 12px; border: 1px solid rgba(255,143,112,.35); border-radius: 10px; background: rgba(255,143,112,.08); color: var(--danger); font-size: 13px; line-height: 1.45; }

.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.results-head h2 { margin: 0; font: 400 24px/1.2 var(--serif); }
.results-head p { margin: 0; color: var(--faint); font-size: 13px; }
.pager { display: flex; gap: 6px; margin-left: auto; align-self: center; }
.pager button { width: 36px; height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 16px; cursor: pointer; }
.pager button:hover:not(:disabled) { border-color: var(--acid); color: var(--acid); }
.pager button:disabled { opacity: .35; cursor: default; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); transition: opacity .15s; }
.results.loading .table-wrap { opacity: .45; pointer-events: none; }
.pr-table { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 13px; }
.pr-table th { position: sticky; top: 0; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-align: left; text-transform: uppercase; line-height: 1.4; vertical-align: bottom; cursor: help; }
.pr-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pr-table tbody tr:hover td { background: rgba(211,235,226,.03); }
.pr-table .col-num { position: sticky; left: 0; z-index: 1; width: 76px; min-width: 76px; max-width: 76px; background: var(--panel); white-space: nowrap; }
.pr-table .col-pr { position: sticky; left: 76px; z-index: 1; width: 28%; min-width: 220px; background: var(--panel); }
.pr-table th.col-num, .pr-table th.col-pr { z-index: 2; background: var(--panel-2); cursor: default; }
.pr-table .col-num a { text-decoration: none; }
.pr-table .col-num a:hover { text-decoration: underline; }
.pr-table .col-pr a { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--ink); line-height: 1.35; text-decoration: none; }
.pr-table .col-pr a:hover { text-decoration: underline; }
.pr-num { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.pr-table .num { min-width: 92px; }
.pr-table .num .value { white-space: nowrap; }
.pr-table .col-cost { width: 1%; white-space: nowrap; text-align: right; }
.value { display: block; font-family: var(--mono); font-size: 13px; }
.verdict { display: block; font: 400 17px/1.2 var(--serif); white-space: nowrap; }
.level { display: block; font-size: 13px; font-weight: 600; }
.sub { display: block; margin-top: 4px; color: var(--faint); font-family: var(--mono); font-size: 11px; }
.pr-table .col-pr .sub { white-space: normal; }
.add { color: var(--acid); }
.del { color: var(--danger); }
.pending { color: var(--faint); }
.row-error { color: var(--danger); }
.spinner { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid var(--line); border-top-color: var(--acid); border-radius: 50%; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pr-table tfoot td { border-bottom: 0; background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.pr-table tfoot .col-num, .pr-table tfoot .col-pr { background: var(--panel-2); }
.trim-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 2px 8px 2px 3px; border: 1px solid rgba(246,200,91,.5); border-radius: 999px; background: rgba(246,200,91,.1); color: var(--warn); font-size: 11px; font-weight: 700; white-space: nowrap; cursor: help; }
.trim-badge b, .trim-mark { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: currentColor; font: 800 10px/1 var(--sans); }
.trim-badge b { color: var(--black); background: var(--warn); }
.trim-badge.none { border-color: rgba(255,143,112,.5); background: rgba(255,143,112,.1); color: var(--danger); }
.trim-badge.none b { background: var(--danger); }
.trim-mark { margin-left: 6px; vertical-align: 3px; color: var(--black); background: var(--warn); cursor: help; }
.trim-mark.none { background: var(--danger); }
.trim-count { color: var(--warn); }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.flag { padding: 2px 7px; border: 1px solid rgba(255,143,112,.45); border-radius: 999px; background: rgba(255,143,112,.08); color: var(--danger); font-size: 11px; white-space: nowrap; cursor: help; }
.map-dot { color: var(--faint); }
.legend { margin: 10px 2px 0; color: var(--faint); font-size: 12px; line-height: 1.5; }

.explainer { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.explainer > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; cursor: pointer; list-style: none; }
.explainer > summary::-webkit-details-marker { display: none; }
.explainer > summary:focus-visible { outline: 2px solid var(--acid); outline-offset: 6px; border-radius: 6px; }
.summary-title { font: 400 26px/1.2 var(--serif); }
.summary-title::before { content: '›'; display: inline-block; width: 18px; color: var(--acid); font-family: var(--sans); transition: transform .15s; }
.explainer[open] .summary-title::before { transform: rotate(90deg); }
.summary-hint { color: var(--faint); font-size: 13px; }
.explainer[open] > summary { margin-bottom: 32px; }
.explainer[open] .summary-hint { display: none; }
@media (prefers-reduced-motion: reduce) { .summary-title::before { transition: none; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.explainer-block { scroll-margin-top: 20px; }
.explainer-block + .explainer-block { margin-top: 48px; }
.explainer h2 { margin: 0 0 14px; font: 400 26px/1.2 var(--serif); }
.explainer-lede { max-width: 760px; margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.explainer code { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.explainer q { color: var(--ink); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.type-card { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); font-size: 13px; line-height: 1.55; }
.type-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.type-card p { margin: 0 0 8px; }
.type-card .returns { color: var(--faint); font-size: 12px; }
.type-ask { color: var(--ink); font: 400 16px/1.2 var(--serif); }
.type-badge { display: inline-block; padding: 3px 8px 2px; border: 1px solid currentColor; border-radius: 999px; font: 800 10px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.type-badge.noul { color: var(--aqua); }
.type-badge.choice { color: var(--warn); }
.type-badge.score { color: var(--acid); }
.viz { margin: auto 0 0; padding: 14px; border-radius: 10px; background: var(--black); }
.viz figcaption { margin-top: 10px; color: var(--faint); font-size: 12px; line-height: 1.5; }
.viz figcaption strong { color: var(--ink); font-weight: 600; }
.noul-track { position: relative; height: 8px; margin: 10px 0 6px; border-radius: 999px; background: var(--panel-2); }
.noul-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: rgba(102,230,207,.35); }
.noul-marker { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--aqua); }
.noul-scale { display: flex; justify-content: space-between; color: var(--faint); font-family: var(--mono); font-size: 11px; }
.choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-option { padding: 6px 10px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.choice-option b { margin-left: 4px; color: var(--faint); font-weight: 400; }
.choice-option.picked { border: 1px solid var(--warn); color: var(--ink); }
.choice-option.picked b { color: var(--warn); }
.score-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; height: 140px; align-items: end; }
.score-bars div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.score-bars span { order: 2; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: rgba(185,246,91,.45); }
.score-bars .top span { background: var(--acid); }
.score-bars b { order: 1; margin-bottom: 4px; color: var(--muted); font: 400 11px var(--mono); }
.score-bars i { order: 3; min-height: 2.6em; margin-top: 6px; color: var(--muted); font: normal 11px/1.25 var(--sans); text-align: center; }
.score-bars i small { display: block; margin-top: 2px; color: var(--faint); font: 10px var(--mono); }
.example-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.example-head .explainer-lede { margin-bottom: 12px; }
.example-pick { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--faint); font-size: 12px; }
.example-pick select { max-width: 320px; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); font-size: 12px; }
.json-details { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.json-details + .json-details { margin-top: 8px; }
.json-details summary { padding: 12px 16px; color: var(--muted); font-size: 13px; cursor: pointer; }
.json-details summary:hover { color: var(--ink); }
.json-details[open] summary { border-bottom: 1px solid var(--line); }
.json-details .json { border: 0; border-radius: 0 0 14px 14px; }
.json { max-height: 420px; margin: 0; padding: 16px 18px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); font: 12px/1.55 var(--mono); }
.json .k { color: var(--aqua); }
.json .s { color: #d7e3df; }
.json .n { color: var(--acid); }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.limit { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.limit strong { display: block; color: var(--acid); font: 400 28px/1.1 var(--serif); }
.limit span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.map-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.map-table th { padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.map-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.map-table tr:last-child td { border-bottom: 0; }
.map-name { color: var(--ink); font-weight: 600; white-space: nowrap; }
.map-range { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.map-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.map-level { font-weight: 600; white-space: nowrap; }
.map-arrow { color: var(--faint); }
.map-question { max-width: 380px; color: var(--muted); line-height: 1.5; }
.map-notes { max-width: 860px; margin: 16px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.map-notes li + li { margin-top: 6px; }
.map-notes strong { color: var(--ink); }

@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar-meta { display: none; }
  .page { padding: 24px 16px 40px; }
  .intro { grid-template-columns: minmax(0, 1fr); }
  .pr-table .col-num { width: 64px; min-width: 64px; max-width: 64px; }
  .pr-table .col-pr { left: 64px; width: 180px; min-width: 180px; }
}
.trim-note { color: var(--warn); white-space: nowrap; }
