/* ==========================================================================
   PREGISTIC — design system
   --------------------------------------------------------------------------
   CLASS VOCABULARY (modules: use these, do not invent global classes)

   layout    .wrap .sec .sec-tight .sec-flush .head .sechead .rule
             .grid2 .grid3 .grid4 .grid-auto .split .stack .row .spread
   type      .eyebrow .lede .small .tiny .mono .num .display .quiet .balance
   surface   .card .card-lift .panel .sunk .callout .callout-gold .callout-navy
   data      .tbl .tbl-wrap .stat .kpi .kpigrid .barrow .meter
   market    .board .board-row .code .chip .chip-freight|chokepoint|policy|air
             .px .px-yes .px-no .delta .delta-up .delta-dn .spark .pill
             .status .status-live .status-closing .status-upcoming .status-resolved
             .book .book-row .ladder .ticket .demo-tag
   nav       .topbar .brand .navlinks .navbtn .menu .ticker .tickitem
   control   .btn .btn-primary .btn-ghost .btn-sm .field .input .select
             .tabs .tab .toggle .seg .segbtn .slider .ctl
   misc      .badge .flag .flag-src .flag-con .timeline .tl-item .faq .faq-item
             .srcline .footer .toast .skip
   ========================================================================== */

/* ---------- tokens: light is the bare :root ---------- */
:root {
  color-scheme: light dark;

  --ground:      #F2EFE7;
  --ground-2:    #E9E4D8;
  --surface:     #FFFFFF;
  --surface-2:   #F8F6F0;
  --sunk:        #E5E0D2;

  --ink:         #16203A;
  --ink-2:       #3C4A66;
  --muted:       #6C7890;
  --faint:       #98A1B4;

  --rule:        #D8D1C0;
  --rule-soft:   #E6E0D1;
  --rule-strong: #16203A;

  --gold:        #8E6A2A;
  --gold-bright: #B98E44;
  --gold-wash:   rgba(185, 142, 68, .15);
  --gold-line:   rgba(142, 106, 42, .40);

  --up:          #2C6B4C;
  --down:        #A8412D;
  --up-wash:     rgba(44, 107, 76, .13);
  --down-wash:   rgba(168, 65, 45, .13);

  --fam-freight:    #1D5FA8;
  --fam-chokepoint: #14706A;
  --fam-policy:     #A8412D;
  --fam-air:        #5A559B;

  --shadow: 0 1px 2px rgba(22, 32, 58, .05), 0 8px 24px -12px rgba(22, 32, 58, .14);

  --maxw: 1180px;
  --gutter: 22px;
  --s-sec: 68px;

  --ff-display: 'Playfair Display', 'Noto Serif TC', Georgia, 'Times New Roman', serif;
  --ff-body:    'Archivo', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --ff-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* zh locale swaps the display face to one with real CJK coverage */
:root[data-lang="zh"] {
  --ff-display: 'Noto Serif TC', 'Playfair Display', 'Songti TC', serif;
  --ff-body:    'Noto Sans TC', 'Archivo', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

/* ---------- dark: system default (unstamped) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #0B1220;
    --ground-2:    #0F1829;
    --surface:     #131E33;
    --surface-2:   #18243C;
    --sunk:        #080E1A;

    --ink:         #F0ECE2;
    --ink-2:       #C3CCDA;
    --muted:       #8693A9;
    --faint:       #5F6C83;

    --rule:        #25324B;
    --rule-soft:   #1C2739;
    --rule-strong: #C79A52;

    --gold:        #C79A52;
    --gold-bright: #DDB779;
    --gold-wash:   rgba(199, 154, 82, .13);
    --gold-line:   rgba(199, 154, 82, .38);

    --up:          #62A882;
    --down:        #CC6A53;
    --up-wash:     rgba(98, 168, 130, .13);
    --down-wash:   rgba(204, 106, 83, .13);

    --fam-freight:    #6FA3DC;
    --fam-chokepoint: #4FA79D;
    --fam-policy:     #D4826C;
    --fam-air:        #9691D8;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
  }
}

/* ---------- dark: explicit toggle ---------- */
:root[data-theme="dark"] {
  --ground:      #0B1220;
  --ground-2:    #0F1829;
  --surface:     #131E33;
  --surface-2:   #18243C;
  --sunk:        #080E1A;

  --ink:         #F0ECE2;
  --ink-2:       #C3CCDA;
  --muted:       #8693A9;
  --faint:       #5F6C83;

  --rule:        #25324B;
  --rule-soft:   #1C2739;
  --rule-strong: #C79A52;

  --gold:        #C79A52;
  --gold-bright: #DDB779;
  --gold-wash:   rgba(199, 154, 82, .13);
  --gold-line:   rgba(199, 154, 82, .38);

  --up:          #62A882;
  --down:        #CC6A53;
  --up-wash:     rgba(98, 168, 130, .13);
  --down-wash:   rgba(204, 106, 83, .13);

  --fam-freight:    #6FA3DC;
  --fam-chokepoint: #4FA79D;
  --fam-policy:     #D4826C;
  --fam-air:        #9691D8;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
}

/* ==========================================================================
   base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 15.5px;
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.014em;
  text-wrap: balance;
  margin: 0;
  color: var(--ink);
}
:root[data-lang="zh"] h1,
:root[data-lang="zh"] h2,
:root[data-lang="zh"] h3,
:root[data-lang="zh"] h4 { letter-spacing: .01em; line-height: 1.32; }

h1 { font-size: clamp(30px, 5vw, 54px); }
h2 { font-size: clamp(24px, 3.2vw, 34px); }
h3 { font-size: 19px; }
h4 { font-size: 16px; }

p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--gold); color: var(--ground);
  padding: 10px 16px; font-family: var(--ff-mono); font-size: 12px;
}
.skip:focus { left: 8px; top: 8px; }

/* ==========================================================================
   layout
   ========================================================================== */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); width: 100%; }

.sec { padding-block: var(--s-sec); border-top: 1px solid var(--rule-soft); }
.sec-tight { padding-block: 42px; }
.sec-flush { border-top: 0; }
.head { padding-block: 54px 40px; }

.sechead { margin-bottom: 30px; max-width: 78ch; }
.sechead h2 { margin-top: 11px; }
.sechead .lede { margin-top: 13px; }

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }

@media (max-width: 1000px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --s-sec: 48px; --gutter: 18px; }
  .grid2, .grid3 { grid-template-columns: 1fr; gap: 20px; }
  .head { padding-block: 34px 28px; }
}
@media (max-width: 520px) {
  .grid4 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   type utilities
   ========================================================================== */
.eyebrow {
  font-family: var(--ff-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .21em; text-transform: uppercase; color: var(--gold);
  display: block;
}
:root[data-lang="zh"] .eyebrow { letter-spacing: .14em; }

.lede { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 68ch; }
.small { font-size: 13.5px; line-height: 1.58; color: var(--muted); }
.tiny { font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.quiet { color: var(--muted); }
.balance { text-wrap: balance; }
.mono { font-family: var(--ff-mono); }
.num { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
.display { font-family: var(--ff-display); }

.srcline {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: .05em;
  color: var(--faint); margin-top: 10px; display: block;
}

ul.k { list-style: none; }
ul.k li {
  position: relative; padding-left: 19px; font-size: 13.8px; line-height: 1.55;
  color: var(--ink-2); margin-bottom: 9px;
}
ul.k li:last-child { margin-bottom: 0; }
ul.k li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 9px; height: 1px; background: var(--gold);
}

/* ==========================================================================
   surfaces
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--rule);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 8px;
}
.card > h3 { margin-bottom: 2px; }
.card-lift { box-shadow: var(--shadow); }

.panel { background: var(--surface); border: 1px solid var(--rule); }
.sunk { background: var(--sunk); border: 1px solid var(--rule); padding: 24px; }

.callout { border-left: 2px solid var(--rule-strong); padding: 14px 0 14px 18px; }
.callout-gold {
  background: var(--gold-wash); border: 1px solid var(--gold-line);
  padding: 20px 22px; border-left-width: 1px;
}
.callout-navy {
  background: #101A2E; border: 1px solid #22304A; color: #E8E3D8;
  padding: 20px 22px;
}
.callout-navy h3, .callout-navy h4 { color: #F3EFE6; }
.callout-navy .small, .callout-navy p { color: #BFC8D6; }
.callout-navy .eyebrow { color: var(--gold-bright); }

/* ==========================================================================
   tables & data
   ========================================================================== */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13.6px; }
.tbl th {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); font-weight: 500;
  text-align: left; padding: 0 12px 9px 0; border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.tbl td {
  padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2); vertical-align: top; line-height: 1.48;
}
.tbl td.k { color: var(--ink); font-weight: 500; }
.tbl td.n, .tbl th.n {
  font-family: var(--ff-mono); text-align: right; font-variant-numeric: tabular-nums;
  white-space: nowrap; padding-right: 0;
}
.tbl tr.total td { border-top: 1px solid var(--rule-strong); border-bottom: 0; color: var(--ink); font-weight: 600; }
.tbl tr.hl td { background: var(--gold-wash); }
.tbl tbody tr:last-child td { border-bottom: 0; }

.stat .n {
  font-family: var(--ff-display); font-size: clamp(30px, 4vw, 40px); line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink);
}
.stat .l { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); margin-top: 10px; }
.stat { border-top: 2px solid var(--rule-strong); padding-top: 16px; }

.kpigrid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule-soft);
}
.kpi { background: var(--surface); padding: 16px 18px; }
.kpi .l {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 8px;
}
.kpi .v {
  font-family: var(--ff-mono); font-size: 25px; font-variant-numeric: tabular-nums;
  line-height: 1.1; color: var(--ink);
}
.kpi .v.gold { color: var(--gold); }
.kpi .s { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }

.barrow { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 12px; }
.barrow .lb { font-size: 13.5px; color: var(--ink-2); }
.barrow .track { height: 14px; background: var(--rule-soft); }
.barrow .fill { height: 100%; background: var(--fam-freight); }
.barrow .vl { font-family: var(--ff-mono); font-size: 12px; color: var(--ink); white-space: nowrap; }
@media (max-width: 640px) { .barrow { grid-template-columns: 1fr; gap: 5px; } }

.flag {
  display: inline-block; font-family: var(--ff-mono); font-size: 9px;
  letter-spacing: .13em; text-transform: uppercase; padding: 2px 7px;
  vertical-align: middle; margin-left: 7px; border-radius: 2px;
}
.flag-src { background: var(--gold-wash); color: var(--gold); }
.flag-con { background: var(--down-wash); color: var(--down); }

/* ==========================================================================
   navigation
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
@supports not (backdrop-filter: blur(4px)) { .topbar { background: var(--ground); } }

.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.brand .mark { width: 22px; height: 22px; flex: 0 0 auto; }
.brand .nm {
  font-family: var(--ff-display); font-size: 19px; font-weight: 600;
  letter-spacing: .01em; color: var(--ink); line-height: 1;
}
.brand .sub {
  font-family: var(--ff-mono); font-size: 8.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--faint); display: block; margin-top: 3px;
}

.navlinks { display: flex; align-items: center; gap: 3px; margin-left: auto; list-style: none; }
.navbtn {
  font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
  padding: 8px 11px; border: 1px solid transparent; background: none;
  cursor: pointer; transition: color .15s, border-color .15s; white-space: nowrap;
}
.navbtn:hover { color: var(--ink); }
.navbtn[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
.navbtn.is-icon { padding: 8px 9px; }

.menu { display: none; }
@media (max-width: 940px) {
  .navlinks.is-main {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule); padding: 8px;
  }
  .navlinks.is-main.open { display: flex; }
  .navlinks.is-main .navbtn { padding: 12px 14px; font-size: 12px; }
  .menu { display: inline-flex; }
}

/* ticker */
.ticker {
  border-bottom: 1px solid var(--rule-soft); background: var(--ground-2);
  overflow: hidden; height: 32px; position: relative;
}
.ticker .track { display: flex; gap: 0; width: max-content; animation: tick 68s linear infinite; }
.ticker:hover .track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .ticker .track { animation: none; }
  .ticker { overflow-x: auto; }
}
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tickitem {
  display: inline-flex; align-items: center; gap: 8px; height: 32px;
  padding: 0 16px; border-right: 1px solid var(--rule-soft);
  font-family: var(--ff-mono); font-size: 10.5px; white-space: nowrap;
  text-decoration: none; color: var(--muted);
}
.tickitem b { color: var(--ink); font-weight: 500; letter-spacing: .06em; }
.tickitem .px { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   market surfaces
   ========================================================================== */
.code {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .09em;
  color: var(--gold); text-transform: uppercase;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 2px;
  border: 1px solid currentColor; white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.chip-freight { color: var(--fam-freight); }
.chip-chokepoint { color: var(--fam-chokepoint); }
.chip-policy { color: var(--fam-policy); }
.chip-air { color: var(--fam-air); }

.status {
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 2px; white-space: nowrap;
}
.status-live { background: var(--up-wash); color: var(--up); }
.status-closing { background: var(--gold-wash); color: var(--gold); }
.status-upcoming { background: var(--rule-soft); color: var(--muted); }
.status-resolved { background: var(--rule-soft); color: var(--faint); }

.px { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
.px-yes { color: var(--up); }
.px-no { color: var(--down); }

.delta { font-family: var(--ff-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.delta-up { color: var(--up); }
.delta-dn { color: var(--down); }

.spark { display: block; }

.pill {
  display: inline-block; font-family: var(--ff-mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px;
  border: 1px solid var(--rule); color: var(--muted); border-radius: 2px;
}

.demo-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--gold);
  border: 1px dashed var(--gold-line); padding: 3px 9px; border-radius: 2px;
}

/* board */
.board { width: 100%; min-width: 1080px; border-collapse: collapse; font-size: 13.5px; }
/* the home-page preview carries six columns, not ten */
.board.is-compact { min-width: 620px; }
.board th {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--faint); font-weight: 500;
  text-align: left; padding: 0 12px 10px 0; border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.board th.sortable { cursor: pointer; user-select: none; }
.board th.sortable:hover { color: var(--ink); }
.board th[aria-sort] { color: var(--gold); }
.board th.n, .board td.n { text-align: right; padding-right: 0; }
.board td {
  padding: 13px 12px 13px 0; border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle; color: var(--ink-2);
}
.board-row { cursor: pointer; transition: background .12s; }
.board-row:hover { background: var(--surface-2); }
.board-row:focus-visible { background: var(--surface-2); }
.board-row .ttl { color: var(--ink); font-weight: 500; line-height: 1.4; display: block; margin-top: 4px; }
.board-row .meta { font-size: 11.5px; color: var(--faint); margin-top: 4px; }

/* order book */
.book { font-family: var(--ff-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.book-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 5px 8px; position: relative; align-items: center;
}
.book-row .bar { position: absolute; inset: 0 auto 0 0; opacity: .16; }
.book-row span { position: relative; }
.book-row .sz { text-align: right; color: var(--muted); }
.book-row .tot { text-align: right; color: var(--faint); }
.book-head {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 8px 7px;
  font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--rule);
}
.book-mid {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 9px 8px; border-block: 1px solid var(--rule); margin-block: 6px;
  font-family: var(--ff-mono); font-size: 12px;
}

/* ticket */
.ticket { background: var(--surface-2); border: 1px solid var(--rule); padding: 18px; }
.ticket .out {
  display: flex; justify-content: space-between; gap: 10px;
  font-family: var(--ff-mono); font-size: 12.5px; padding: 6px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.ticket .out:last-of-type { border-bottom: 0; }
.ticket .out b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   controls
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .13em;
  text-transform: uppercase; padding: 12px 20px; border: 1px solid var(--rule-strong);
  background: transparent; color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s; border-radius: 0;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #FFF9EC; }
.btn-primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: #1A1204; }
.btn-ghost { border-color: var(--rule); color: var(--muted); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 8px 13px; font-size: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { border-color: var(--rule-strong); color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.input, .select, textarea.input {
  font-family: var(--ff-body); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule);
  padding: 10px 12px; width: 100%; border-radius: 0; -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 2px var(--gold-wash); }
.select {
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px; cursor: pointer;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.55; }
::placeholder { color: var(--faint); opacity: 1; }

.seg { display: inline-flex; border: 1px solid var(--rule); }
.segbtn {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: .11em;
  text-transform: uppercase; padding: 8px 13px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; border-right: 1px solid var(--rule);
  transition: background .15s, color .15s;
}
.segbtn:last-child { border-right: 0; }
.segbtn:hover { color: var(--ink); }
.segbtn[aria-pressed="true"] { background: var(--gold); color: #FFF9EC; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.tab {
  font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; padding: 11px 15px; border: 0; background: none;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }

.ctl { margin-bottom: 19px; }
.ctl:last-child { margin-bottom: 0; }
.ctl > label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.ctl > label b {
  font-size: 14px; letter-spacing: 0; color: var(--ink); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ctl .hint { font-size: 10.5px; color: var(--faint); margin-top: 7px; line-height: 1.45; }

.slider {
  width: 100%; -webkit-appearance: none; appearance: none; height: 3px;
  background: var(--rule); outline: none; margin: 0; cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px;
  border-radius: 50%; background: var(--gold); cursor: pointer; border: 0;
}
.slider::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--gold);
  cursor: pointer; border: 0;
}

/* ==========================================================================
   timeline / faq
   ========================================================================== */
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 1px; background: var(--rule);
}
.tl-item { padding-top: 26px; position: relative; }
.tl-item::before {
  content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 11px;
  border-radius: 50%; background: var(--gold);
}
@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; gap: 26px; }
  .timeline::before { top: 0; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; }
  .tl-item { padding-top: 0; padding-left: 28px; }
}

.faq-item { border-bottom: 1px solid var(--rule-soft); }
.faq-item > summary {
  cursor: pointer; list-style: none; padding: 17px 30px 17px 0; position: relative;
  font-size: 15.5px; font-weight: 500; color: var(--ink);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; position: absolute; right: 4px; top: 15px;
  font-family: var(--ff-mono); font-size: 17px; color: var(--gold);
}
.faq-item[open] > summary::after { content: "\2013"; }
.faq-item > div { padding-bottom: 18px; }

/* ==========================================================================
   footer & toast
   ========================================================================== */
.footer { border-top: 1px solid var(--rule); padding-block: 44px 56px; background: var(--ground-2); }
.footer a { color: var(--muted); text-decoration: none; font-size: 13.5px; display: block; padding: 3px 0; }
.footer a:hover { color: var(--gold); }
.footer h4 {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint); font-weight: 500; margin-bottom: 10px;
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: 12px 20px;
  font-family: var(--ff-mono); font-size: 11.5px; letter-spacing: .05em;
  z-index: 90; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toastin .22s ease-out; }
  @keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }
}

/* ==========================================================================
   view transitions between routes
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .view-in { animation: viewin .3s ease-out; }
  @keyframes viewin { from { opacity: 0; transform: translateY(6px); } }
}
[hidden] { display: none !important; }
