  :root {
    --bg: #EFF1EE; --surface: #FAFBF9; --raised: #FFFFFF;
    --ink: #1A2126; --ink-soft: #47535C; --ink-faint: #78848D;
    --line: #D9DED8; --accent: #22636B; --accent-ink: #FFFFFF;
    --closed: #22636B; --open: #A05E2F;
    --tier-frontier: #22636B; --tier-work: #3A5A7E; --tier-small: #5E7A3F;
    --tier-open: #A05E2F; --tier-spec: #6E4E72;
    --chip-bg: rgba(0,0,0,0.04); --chip-line: #CCD3CC;
    --callout-bg: #E6EDE7; --bar: #22636B; --navbg: rgba(239,241,238,0.93);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #131920; --surface: #1B232B; --raised: #212A33;
      --ink: #E7EBE9; --ink-soft: #A7B2B6; --ink-faint: #74808A;
      --line: #2B343D; --accent: #74B6BC; --accent-ink: #0E1519;
      --closed: #74B6BC; --open: #DB9C68;
      --tier-frontier: #74B6BC; --tier-work: #8FB0D6; --tier-small: #A6C182;
      --tier-open: #DB9C68; --tier-spec: #BC95C0;
      --chip-bg: rgba(255,255,255,0.05); --chip-line: #38434D;
      --callout-bg: #1E2A28; --bar: #74B6BC; --navbg: rgba(19,25,32,0.93);
    }
  }
  :root[data-theme="light"] {
    --bg: #EFF1EE; --surface: #FAFBF9; --raised: #FFFFFF;
    --ink: #1A2126; --ink-soft: #47535C; --ink-faint: #78848D;
    --line: #D9DED8; --accent: #22636B; --accent-ink: #FFFFFF;
    --closed: #22636B; --open: #A05E2F;
    --tier-frontier: #22636B; --tier-work: #3A5A7E; --tier-small: #5E7A3F;
    --tier-open: #A05E2F; --tier-spec: #6E4E72;
    --chip-bg: rgba(0,0,0,0.04); --chip-line: #CCD3CC;
    --callout-bg: #E6EDE7; --bar: #22636B; --navbg: rgba(239,241,238,0.93);
  }
  :root[data-theme="dark"] {
    --bg: #131920; --surface: #1B232B; --raised: #212A33;
    --ink: #E7EBE9; --ink-soft: #A7B2B6; --ink-faint: #74808A;
    --line: #2B343D; --accent: #74B6BC; --accent-ink: #0E1519;
    --closed: #74B6BC; --open: #DB9C68;
    --tier-frontier: #74B6BC; --tier-work: #8FB0D6; --tier-small: #A6C182;
    --tier-open: #DB9C68; --tier-spec: #BC95C0;
    --chip-bg: rgba(255,255,255,0.05); --chip-line: #38434D;
    --callout-bg: #1E2A28; --bar: #74B6BC; --navbg: rgba(19,25,32,0.93);
  }

  * { box-sizing: border-box; }
  body {
    background: var(--bg); color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.55; margin: 0; padding: 0 1.25rem 4rem;
  }
  .wrap { max-width: 64rem; margin: 0 auto; }
  h1, h2 { font-family: Palatino, "Iowan Old Style", Charter, Georgia, serif; text-wrap: balance; letter-spacing: -0.005em; }
  h1 { font-size: clamp(2.1rem, 4.6vw, 3rem); font-weight: 600; margin: 0.4rem 0 0.55rem; }
  h1 em { font-style: italic; color: var(--accent); }
  h2 { font-size: 1.4rem; margin: 0 0 0.5rem; font-weight: 600; }
  h3 { font-size: 0.95rem; margin: 0; font-weight: 650; }
  .eyebrow { font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); font-weight: 650; margin: 0 0 0.15rem; }
  .lede { color: var(--ink-soft); max-width: 44rem; margin: 0 0 0.5rem; font-size: 1.02rem; }
  .sublede { color: var(--ink-soft); max-width: 45rem; margin: 0 0 1.1rem; font-size: 0.93rem; }
  header.page { padding: 2.75rem 0 1.25rem; }
  section { padding: 2.75rem 0 0; scroll-margin-top: 4rem; }
  .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

  /* ---------- Orientation + sticky nav ---------- */
  .contents { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin: 1.15rem 0 0; padding: 0; list-style: none; font-size: 0.9rem; }
  .contents li { color: var(--ink-faint); }
  .contents a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--chip-line); }
  .contents a:hover { border-bottom-color: var(--accent); color: var(--accent); }
  nav.sticky {
    position: sticky; top: 0; z-index: 20; margin: 1.5rem -1.25rem 0; padding: 0.55rem 1.25rem;
    background: var(--navbg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .navinner { max-width: 64rem; margin: 0 auto; display: flex; align-items: center; gap: 1.15rem; overflow-x: auto; }
  nav.sticky .brand { font-family: Palatino, Georgia, serif; font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
  nav.sticky a { color: var(--ink-soft); text-decoration: none; font-size: 0.84rem; white-space: nowrap; }
  nav.sticky a:hover { color: var(--accent); }

  /* ---------- Price sounding ---------- */
  .soundwrap { overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
  .sound { position: relative; height: 13.5rem; min-width: 68rem; margin: 0 3rem; }
  .sound-track { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--ink-faint); opacity: 0.55; }
  .gridline { position: absolute; top: 16%; bottom: 16%; width: 1px; background: var(--line); }
  .gridlabel { position: absolute; bottom: 1%; transform: translateX(-50%); font-family: ui-monospace, Menlo, monospace; font-size: 0.68rem; color: var(--ink-faint); }
  .mark { position: absolute; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); animation: rise 0.5s ease-out backwards; }
  .mark.up { bottom: calc(50% - 5px); }
  .mark.down { top: calc(50% - 5px); }
  .mark .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--t, var(--accent)); flex: none; }
  .mark .stem { width: 1px; height: 1.5rem; background: var(--t, var(--accent)); opacity: 0.6; flex: none; }
  .mark .mlabel { font-size: 0.72rem; white-space: nowrap; text-align: center; line-height: 1.3; padding: 0.15rem 0; }
  .mark .mprice { display: block; font-family: ui-monospace, Menlo, monospace; font-weight: 650; color: var(--t, var(--accent)); }
  .mark.up .mlabel { order: 1; } .mark.up .stem { order: 2; } .mark.up .dot { order: 3; }
  .mark.down .dot { order: 1; } .mark.down .stem { order: 2; } .mark.down .mlabel { order: 3; }
  .mark:nth-child(odd) { animation-delay: 0.08s; }
  .mark:nth-child(even) { animation-delay: 0.2s; }
  @keyframes rise { from { opacity: 0; transform: translateX(-50%) translateY(6px); } }
  .sound-caption { color: var(--ink-faint); font-size: 0.8rem; margin: 0.6rem 0 0; }

  /* ---------- Ranked board ---------- */
  .board { display: flex; flex-direction: column; gap: 0.5rem; }
  .board-row {
    display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: baseline; gap: 1rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.8rem 1.1rem;
  }
  .board-row .rank { color: var(--ink-faint); font-weight: 600; font-family: ui-monospace, Menlo, monospace; }
  .board-row .name { font-weight: 650; }
  .board-row .vendor { color: var(--ink-faint); font-weight: 400; font-size: 0.88em; margin-left: 0.5rem; }
  .board-row .score { color: var(--accent); font-weight: 600; font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 0.88rem; }
  .board-note { color: var(--ink-soft); font-size: 0.92rem; max-width: 46rem; margin-top: 0.9rem; }

  /* ---------- Tier ledger ---------- */
  .ledger { border-top: 1px solid var(--line); }
  .lrow { display: grid; grid-template-columns: 11rem 1fr; gap: 1.75rem; padding: 1.35rem 0; border-bottom: 1px solid var(--line); }
  .lrow .tname { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 750; color: var(--t, var(--accent)); line-height: 1.4; }
  .lrow .trange { display: block; margin-top: 0.4rem; font-family: ui-monospace, Menlo, monospace; font-size: 0.77rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
  .lrow .models { font-weight: 600; font-size: 0.94rem; margin: 0 0 0.3rem; }
  .lrow .buy { color: var(--ink-soft); font-size: 0.9rem; margin: 0; max-width: 42rem; }
  @media (max-width: 40rem) { .lrow { grid-template-columns: 1fr; gap: 0.45rem; } }

  /* ---------- Full reference ---------- */
  .grouphead { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; margin: 1.75rem 0 0; padding-bottom: 0.45rem; border-bottom: 2px solid var(--ink); }
  .grouphead .gname { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 750; }
  .grouphead .gnote { color: var(--ink-soft); font-size: 0.85rem; }
  details.mrow { border-bottom: 1px solid var(--line); }
  details.mrow summary {
    cursor: pointer; list-style: none; padding: 0.8rem 0.2rem;
    display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: baseline;
  }
  details.mrow summary::-webkit-details-marker { display: none; }
  details.mrow summary::after { content: "+"; font-family: ui-monospace, Menlo, monospace; color: var(--ink-faint); font-size: 1rem; }
  details.mrow[open] summary::after { content: "\2013"; }
  details.mrow summary:hover .sname { color: var(--accent); }
  details.mrow summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
  .sname { font-weight: 650; font-size: 0.95rem; }
  .sname .sorigin { display: block; font-weight: 400; font-size: 0.77rem; color: var(--ink-faint); margin-top: 0.1rem; }
  .sprice { font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 0.82rem; color: var(--ink-soft); white-space: nowrap; }
  .mbody { padding: 0 0.2rem 1.05rem; display: flex; flex-direction: column; gap: 0.6rem; }
  .specs { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; }
  .spec { display: flex; flex-direction: column; gap: 0.08rem; }
  .spec .k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.11em; color: var(--ink-faint); font-weight: 650; }
  .spec .v { font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 0.81rem; }
  .spec .v.plain { font-family: inherit; font-size: 0.85rem; }
  .spec .v.unk { color: var(--ink-faint); font-style: italic; font-family: inherit; font-size: 0.81rem; }
  .mbody .bestat { color: var(--ink-soft); font-size: 0.9rem; margin: 0; max-width: 44rem; }
  .mbody .bestat strong { color: var(--ink); font-weight: 600; }

  /* ---------- Cost bars ---------- */
  .bars { display: flex; flex-direction: column; gap: 0.65rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 1.25rem; }
  .bar-row { display: grid; grid-template-columns: 11.5rem 1fr 5.5rem; align-items: center; gap: 0.9rem; }
  .bar-row .blabel { font-size: 0.9rem; }
  .bar-row .blabel .bvendor { color: var(--ink-faint); font-size: 0.82em; display: block; }
  .bar-track { height: 0.85rem; border-radius: 2px; background: var(--chip-bg); overflow: hidden; }
  .bar-fill { height: 100%; border-radius: 2px; background: var(--bar); min-width: 3px; animation: grow 0.9s ease-out 0.15s backwards; }
  @keyframes grow { from { width: 0; } }
  .bar-row .bprice { text-align: right; font-weight: 600; font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 0.86rem; }
  .bars-note { color: var(--ink-soft); font-size: 0.88rem; max-width: 46rem; margin-top: 0.75rem; }
  @media (max-width: 34rem) { .bar-row { grid-template-columns: 8.5rem 1fr 4.5rem; gap: 0.6rem; } }

  /* ---------- Jobs table ---------- */
  .tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
  table { border-collapse: collapse; width: 100%; min-width: 44rem; }
  th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 650; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
  td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.93rem; vertical-align: top; }
  tr:last-child td { border-bottom: none; }
  td.pick { font-weight: 600; }
  td.alt { color: var(--ink-soft); }

  /* ---------- Routing ---------- */
  .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.8rem; }
  .step { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
  .step .sn { font-family: ui-monospace, Menlo, monospace; font-size: 0.75rem; color: var(--accent); font-weight: 700; }
  .step p { margin: 0; color: var(--ink-soft); font-size: 0.89rem; }
  .callout { background: var(--callout-bg); border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; padding: 0.95rem 1.2rem; max-width: 46rem; margin-top: 1.5rem; }
  .callout p { margin: 0.3rem 0; font-size: 0.93rem; }
  .callout .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; }

  /* ---------- Picker ---------- */
  .picker { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.35rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: 1.3rem; }
  .fgroup { display: flex; flex-direction: column; gap: 0.5rem; }
  .qlabel { font-size: 0.97rem; font-weight: 650; }
  .qhelp { color: var(--ink-faint); font-size: 0.85rem; margin: 0; max-width: 40rem; }
  .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.15rem; }
  .chip {
    font: inherit; font-size: 0.87rem; cursor: pointer;
    background: var(--chip-bg); color: var(--ink); border: 1px solid var(--chip-line);
    border-radius: 999px; padding: 0.36rem 0.85rem; transition: background 0.12s, border-color 0.12s, color 0.12s;
  }
  .chip:hover { border-color: var(--accent); }
  .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
  .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.9rem; margin-top: 0.55rem; }
  .vfield { display: flex; flex-direction: column; gap: 0.25rem; }
  .vfield label { font-size: 0.78rem; color: var(--ink-soft); }
  .vfield input {
    font: inherit; font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums;
    width: 6.5rem; padding: 0.4rem 0.55rem; background: var(--raised); color: var(--ink);
    border: 1px solid var(--chip-line); border-radius: 4px;
  }
  .vfield input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

  .resulthead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.75rem 0 0.9rem; }
  .rcount { font-size: 1rem; font-weight: 650; }
  .rcount span { color: var(--accent); }
  .rnote { color: var(--ink-faint); font-size: 0.84rem; }
  .reset { font: inherit; font-size: 0.84rem; background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
  .reset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .results { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 0.8rem; }
  .card {
    background: var(--raised); border: 1px solid var(--line); border-radius: 6px;
    padding: 0.95rem 1.05rem 1.05rem; display: flex; flex-direction: column; gap: 0.5rem;
    border-left: 3px solid var(--w, var(--accent));
  }
  .cardtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
  .card .cname { font-weight: 650; font-size: 0.98rem; line-height: 1.3; }
  .card .corigin { display: block; font-weight: 400; font-size: 0.78rem; color: var(--ink-faint); margin-top: 0.1rem; }
  .badge { flex: none; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 750; padding: 0.2rem 0.45rem; border-radius: 3px; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
  .badge.open { background: var(--open); }
  .cardspecs { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.79rem; }
  .cardspecs .cs { display: flex; gap: 0.35rem; align-items: baseline; }
  .cardspecs .csk { color: var(--ink-faint); }
  .cardspecs .csv { font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
  .cardspecs .csv.plain { font-family: inherit; }
  .cardspecs .csv.unk { font-family: inherit; font-style: italic; color: var(--ink-faint); }
  .cost { font-size: 0.88rem; padding: 0.4rem 0.55rem; background: var(--chip-bg); border-radius: 4px; }
  .cost strong { font-family: ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-size: 0.95em; }
  .cost.unk { color: var(--ink-faint); font-style: italic; }
  .card .why { color: var(--ink-soft); font-size: 0.87rem; margin: 0; }
  .empty { border: 1px dashed var(--chip-line); border-radius: 6px; padding: 1.75rem; text-align: center; color: var(--ink-soft); grid-column: 1 / -1; }

  footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 0.84rem; }
  footer a { color: var(--accent); text-decoration: none; }
  footer a:hover, footer a:focus-visible { text-decoration: underline; }
  a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

  @media (prefers-reduced-motion: reduce) { .mark, .bar-fill { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.noscript { padding: 1rem; border: 1px solid currentColor; margin: 1rem 0; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tablewrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
