/* ==========================================================================
   Sextant — one stylesheet.

   GROUND  "Zoutelande, view of the North Sea" (Dietmar Rabich, CC BY-SA 4.0), mirrored, fixed.
           No word is ever written on it directly.
   SURFACES (the division every rule obeys; tools/audit.mjs re-checks it on painted pixels):
     .glass    thin warm sheet: nav, chips, display type          text: --ink / --ink-thin only
     .panel    body glass: prose, forms, tables                   text: any ink
     .solid    dense glass: numbers read at a glance, the planner  text: any ink
     .night    the dark band: footer, the hero's instrument strip  text: --on-night inks only
   Colours are read from the photograph: the sun, the amber haze, the dark sail, the evening sea.
   ========================================================================== */

:root {
  --ink: #1c1309;
  --ink-thin: #25190c;
  --ink-2: #4a3620;
  --ink-3: #6b5236;
  --night: #121c27;
  --night-2: #1c2b3a;
  --night-3: #2a3d50;
  --brass: #8a5a12;
  --brass-2: #a8701c;
  --amber: #e0922c;
  --amber-soft: #fbe6c0;
  --sun: #fff2cf;
  --on-night: #f6ead6;
  --on-night-2: #cdbba0;
  --up: #1b6a43;
  --up-soft: #dcefe2;
  --down: #9c2f1d;
  --down-soft: #f6dcd4;
  --line: rgba(28, 19, 9, 0.10);
  --line-2: rgba(28, 19, 9, 0.18);

  --g-thin: rgba(255, 247, 232, 0.66);
  --g-panel: rgba(255, 249, 238, 0.82);
  --g-solid: rgba(255, 251, 244, 0.93);
  --g-alt: rgba(252, 240, 219, 0.86);
  --g-edge: rgba(255, 255, 255, 0.62);
  --blur: blur(22px) saturate(1.25);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 30px 70px -28px rgba(40, 20, 2, 0.55), 0 3px 12px rgba(40, 20, 2, 0.10);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 40px 80px -30px rgba(40, 20, 2, 0.62), 0 6px 18px rgba(40, 20, 2, 0.14);

  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-xl: 30px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px;
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 44px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 100px; }
body { margin: 0; font: 400 16px/1.6 var(--sans); color: var(--ink); background: #8a4f14; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--brass); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--amber-soft); }
.serif, em.serif { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -0.01em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------------------------------------------------------------- ground */
.ground { position: fixed; inset: 0; z-index: -2; background: #b36a1d url("../img/ground-2400.jpg") 50% 30% / cover no-repeat; }
.ground::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40, 18, 0, 0) 55%, rgba(18, 10, 2, 0.30) 100%); }
@media (max-width: 1500px) { .ground { background-image: url("../img/ground-1440.jpg"); } }
@media (max-width: 760px) { .ground { background-image: url("../img/ground-900.jpg"); background-position: 50% 40%; } }

.wrap { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------------------------------------------------------------- surfaces */
.glass, .panel, .solid { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--g-edge); box-shadow: var(--shadow); }
.glass { background: var(--g-thin); }
.panel { background: var(--g-panel); border-radius: var(--r-lg); }
.solid { background: var(--g-solid); border-radius: var(--r-lg); }
.night { background: rgba(14, 22, 31, 0.9); color: var(--on-night); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid rgba(255, 255, 255, 0.08); }

/* ---------------------------------------------------------------- nav */
.nav { position: sticky; top: 14px; z-index: 50; margin-top: 14px; display: flex; align-items: center; gap: 6px; padding: 7px 7px 7px 10px; border-radius: 999px; background: rgba(255, 248, 235, 0.84); }
.brand { display: flex; align-items: center; gap: 9px; margin-right: auto; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand span { font: 400 29px/1 var(--serif); letter-spacing: -0.01em; transform: translateY(1px); }
.nav-links { display: flex; gap: 2px; }
.nav-links a { padding: 8px 13px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(255, 255, 255, 0.9); color: var(--ink); }
.menu-btn { display: none; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--ink); background: rgba(255, 255, 255, 0.88); border: 1px solid var(--g-edge); flex: none; transition: background .15s; }
.icon-btn:hover { background: #fff; color: var(--ink); }
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav.open .nav-links { display: flex; flex-direction: column; position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 10px; border-radius: 22px; background: rgba(255, 250, 241, 0.98); box-shadow: var(--shadow); }
  .nav.open .nav-links a { padding: 12px 14px; font-size: 16px; }
  .menu-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.85); cursor: pointer; }
}
@media (max-width: 520px) { .nav .btn-sm { padding: 0 12px; } .nav .btn-sm .arrow { display: none; } }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, transform .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--night); color: #fff; box-shadow: 0 12px 26px -12px rgba(18, 28, 39, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn-primary:hover { background: var(--night-2); color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, 0.9); color: var(--ink); border-color: var(--g-edge); }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-xs { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--g-edge); font-size: 13.5px; font-weight: 500; color: var(--ink-thin); white-space: nowrap; }
.chip b { font-weight: 600; color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #2f9a62; box-shadow: 0 0 0 3px rgba(47, 154, 98, 0.22); flex: none; }
.dot.live { animation: pulse 2.4s infinite; }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(224, 146, 44, 0.25); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(47, 154, 98, 0.05); } }

/* ---------------------------------------------------------------- hero */
.hero { min-height: calc(100svh - 76px); display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 20px; align-items: center; padding: 40px 0 30px; }
.hero-copy { padding: clamp(26px, 3.8vw, 48px); border-radius: var(--r-xl); }
.hero h1 { font: 400 clamp(46px, 6vw, 84px)/0.95 var(--serif); letter-spacing: -0.02em; margin: 20px 0 18px; color: var(--ink); }
.hero h1 em { font-style: italic; color: var(--brass); }
.lede { font-size: clamp(16px, 1.4vw, 18.5px); color: var(--ink-thin); margin: 0; max-width: 540px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 20px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; color: var(--ink-thin); align-items: center; }
.trust b { font-weight: 600; color: var(--ink); }
.trust .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }
.hero-side { align-self: end; display: flex; justify-content: flex-end; }
.reading { width: min(360px, 100%); padding: 16px 18px; border-radius: var(--r-lg); }
.reading h2 { margin: 0 0 10px; font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--on-night-2); display: flex; justify-content: space-between; }
.reading .rrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.09); font-size: 14px; }
.reading .rrow b { font-weight: 600; color: #fff; }
.reading .rrow span { color: var(--on-night-2); font-size: 12.5px; }
.reading .rrow i { font: 500 14px var(--mono); font-style: normal; color: #fff; }
.reading .foot { margin-top: 8px; font-size: 12.5px; color: var(--on-night-2); }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; padding-top: 28vh; min-height: 0; } .hero-side { justify-content: stretch; } .reading { width: 100%; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 8px; border-radius: 26px; }
.stat { padding: 18px 16px 16px; border-radius: 19px; background: rgba(255, 255, 255, 0.72); }
.stat:nth-child(even) { background: rgba(252, 238, 214, 0.9); }
.stat .v { font: 400 40px/1 var(--serif); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- sections */
.section { padding: 56px 0 8px; }
.head { max-width: 780px; padding: 26px clamp(22px, 3.4vw, 40px); margin-bottom: 16px; border-radius: var(--r-xl); }
.head.center { margin-inline: auto; text-align: center; }
.eyebrow { font: 600 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin: 0 0 12px; }
.head h2, .h2 { font: 400 clamp(36px, 4.4vw, 56px)/1 var(--serif); letter-spacing: -0.015em; margin: 0 0 10px; }
.head h2 em { color: var(--brass); }
.head p { margin: 0; font-size: 17px; color: var(--ink-thin); }

/* the live planner on the front page */
.try { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; }
.try > * { min-width: 0; }
.try-in { padding: 24px; }
.try-in h3, .try-out h3 { margin: 0 0 12px; font: 600 15px/1.2 var(--sans); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pick { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 7px 13px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.pick[aria-pressed="true"] { background: var(--night); color: #fff; border-color: var(--night); }
.amt { display: flex; align-items: baseline; gap: 4px; font: 400 60px/1 var(--serif); letter-spacing: -0.02em; border-bottom: 1px solid var(--line-2); padding-bottom: 8px; }
.amt input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; letter-spacing: inherit; padding: 0; min-width: 0; }
.amt .cur { color: var(--ink-3); }
.range { width: 100%; margin: 14px 0 4px; accent-color: var(--brass-2); }
.try-out { padding: 24px; }
.legs { display: grid; gap: 4px; }
.leg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.78); font-size: 14.5px; }
.leg:nth-child(even) { background: rgba(252, 240, 219, 0.92); }
.leg .what { min-width: 0; }
.leg .what b { font-weight: 600; }
.leg .what small { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg .n { font: 500 14px var(--mono); text-align: right; white-space: nowrap; letter-spacing: -0.02em; }
.leg .n small { display: block; font: 400 12px var(--sans); color: var(--ink-2); letter-spacing: 0; }
.side { font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 5px 7px; border-radius: 7px; }
.side.buy { background: var(--up-soft); color: var(--up); }
.side.sell { background: var(--down-soft); color: var(--down); }
.summary { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.summary > div { padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.78); }
.summary > div:nth-child(even) { background: rgba(252, 240, 219, 0.92); }
.summary b { display: block; font: 500 18px var(--mono); letter-spacing: -0.02em; }
.summary span { font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 900px) { .try { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .summary { grid-template-columns: 1fr 1fr; } }

.badge { display: inline-grid; place-items: center; min-width: 44px; height: 26px; padding: 0 7px; border-radius: 8px; font: 700 11.5px var(--sans); letter-spacing: .02em; color: #fff; background: var(--night-2); }
.badge.long { font-size: 10.5px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps > * { min-width: 0; }
.step { padding: 26px; display: flex; flex-direction: column; }
.step:nth-child(even) { background: var(--g-alt); }
.step .n { font: 400 44px/1 var(--serif); color: var(--brass); margin-bottom: 12px; }
.step h3 { font: 600 21px/1.2 var(--sans); letter-spacing: -0.02em; margin: 0 0 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: 15px; }
.step .fig { margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--ink-2); }
.step .fig b { font: 500 15px var(--mono); color: var(--ink); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- tables */
.table-card { padding: 8px; }
.table-scroll { overflow-x: auto; max-width: 100%; border-radius: var(--r-md); }
table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 14.5px; }
th { text-align: left; font: 600 11.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 12px 14px 6px; white-space: nowrap; }
td { padding: 12px 14px; background: rgba(255, 255, 255, 0.78); white-space: nowrap; }
tr:nth-child(even) td { background: rgba(252, 240, 219, 0.92); }
td:first-child { border-radius: 12px 0 0 12px; } td:last-child { border-radius: 0 12px 12px 0; }
td.n, th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
td .sub { display: block; font: 400 12.5px var(--sans); color: var(--ink-2); letter-spacing: 0; }
.tk { display: flex; align-items: center; gap: 10px; }
.tk .nm { font-weight: 600; } .tk .sub { font-size: 12.5px; color: var(--ink-2); }
.good { color: var(--up); } .bad { color: var(--down); }
.more-row { display: flex; justify-content: center; margin-top: 14px; }
@media (max-width: 640px) { .hide-sm { display: none; } }

.guards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.guards > * { min-width: 0; }
.guard { padding: 24px; }
.guard:nth-child(4n+2), .guard:nth-child(4n+3) { background: var(--g-alt); }
.guard h3 { margin: 0 0 6px; font: 600 19px/1.25 var(--sans); letter-spacing: -0.02em; }
.guard p { margin: 0; color: var(--ink-2); font-size: 15px; }
.guard .proof { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.guard .proof b { color: var(--up); font-weight: 600; }
@media (max-width: 760px) { .guards { grid-template-columns: 1fr; } }
.note { padding: 16px 20px; border-radius: var(--r-md); background: rgba(255, 244, 226, 0.96); border: 1px solid rgba(168, 112, 28, 0.35); color: #3d2507; font-size: 14.5px; }
.note b { color: #2c1a04; }

.faq { max-width: 840px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { border-radius: var(--r-md); }
.faq details:nth-child(even) { background: var(--g-alt); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 24px/1 var(--sans); color: var(--brass); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 18px; color: var(--ink-2); }

.closer { margin-top: 56px; padding: clamp(28px, 5vw, 56px); border-radius: var(--r-xl); text-align: center; }
.closer h2 { font: 400 clamp(38px, 5vw, 64px)/1 var(--serif); margin: 0 0 12px; }
.closer h2 em { color: var(--brass); }
.closer p { margin: 0 auto 22px; max-width: 560px; color: var(--ink-thin); }
.closer .cta { justify-content: center; margin: 0; }

/* ---------------------------------------------------------------- footer */
.footer { margin-top: 56px; padding: 32px clamp(22px, 4vw, 40px); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 24px; }
.footer .brand { color: #fff; } .footer .brand span { font-size: 27px; }
.footer h4 { font: 600 11.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--on-night-2); margin: 4px 0 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.footer a { color: var(--on-night); text-decoration: none; } .footer a:hover { text-decoration: underline; color: #fff; }
.footer .blurb { color: var(--on-night-2); font-size: 14.5px; max-width: 340px; }
.footer .fine { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 13px; color: var(--on-night-2); display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.footer .fine a { color: var(--on-night); text-decoration: underline; }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- app */
.page-top { margin: 22px 0 16px; padding: 24px clamp(22px, 3.4vw, 36px); border-radius: var(--r-xl); display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; justify-content: space-between; }
.page-top h1 { font: 400 clamp(40px, 5vw, 62px)/1 var(--serif); letter-spacing: -0.015em; margin: 0 0 8px; }
.page-top h1 em { color: var(--brass); }
.page-top p { margin: 0; color: var(--ink-thin); max-width: 600px; }
.page-top .total { text-align: right; }
.page-top .total b { display: block; font: 400 48px/1 var(--serif); font-variant-numeric: tabular-nums; }
.page-top .total span { font-size: 13px; color: var(--ink-2); }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-grid > * { min-width: 0; }
@media (max-width: 980px) { .app-grid { grid-template-columns: 1fr; } }
.box { padding: 22px; }
.box + .box { margin-top: 16px; }
.box h2 { font: 400 32px/1.05 var(--serif); margin: 0; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(28, 19, 9, 0.07); gap: 2px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(40, 20, 2, 0.16); }
.explain { font-size: 14.5px; color: var(--ink-2); margin: 0 0 14px; }
.explain b { color: var(--ink); }
.sub-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 0 8px; }
.sub-h h3 { margin: 0; font: 600 14px var(--sans); }
.sub-h span { font-size: 13px; color: var(--ink-2); }

/* targets */
.targets { display: grid; gap: 4px; }
.trow { display: grid; grid-template-columns: auto minmax(0, 1fr) 92px 28px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.8); }
.trow:nth-child(even) { background: rgba(252, 240, 219, 0.92); }
.trow .info { min-width: 0; }
.trow .info .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.trow .info .top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .info .top span { font: 500 12.5px var(--mono); color: var(--ink-2); white-space: nowrap; }
.bars { position: relative; height: 16px; margin-top: 6px; }
.bars .rail { position: absolute; inset: 6px 0; border-radius: 99px; background: rgba(28, 19, 9, 0.08); }
.bars .now { position: absolute; left: 0; top: 6px; height: 4px; border-radius: 99px; background: var(--night-2); }
.bars .aim { position: absolute; top: 1px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--brass-2); }
.wt { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; padding: 0 8px; }
.wt input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: 600 16px var(--mono); padding: 7px 0; text-align: right; }
.wt span { color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.wt:focus-within { border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(168, 112, 28, 0.18); }
.x { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--ink-3); font-size: 18px; line-height: 1; }
.x:hover { background: rgba(28, 19, 9, 0.08); color: var(--ink); }
.tfoot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.tfoot .sum { font: 600 14px var(--mono); }
.tfoot .sum.off { color: var(--down); }
.add { display: flex; gap: 6px; align-items: center; }
select.pickstock { border: 1px solid var(--line-2); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%231c1309' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 12px; border-radius: 999px; padding: 7px 30px 7px 13px; font-weight: 600; font-size: 13.5px; appearance: none; cursor: pointer; max-width: 210px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brass); font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.field { display: block; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line-2); padding: 12px 16px; margin: 14px 0 12px; }
.field:focus-within { border-color: var(--brass-2); box-shadow: 0 0 0 3px rgba(168, 112, 28, 0.18); }
.field .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; font-weight: 500; }
.field .row { display: flex; align-items: center; gap: 10px; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 600 28px/1.2 var(--sans); letter-spacing: -0.03em; padding: 0; }
.unit { font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 10px; background: rgba(28, 19, 9, 0.06); white-space: nowrap; }
.maxbtn { border: 0; background: rgba(168, 112, 28, 0.14); color: var(--brass); font-weight: 600; font-size: 12.5px; padding: 3px 9px; border-radius: 8px; cursor: pointer; }
.opts { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px; }
.opts .seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(28, 19, 9, 0.07); }
.opts .seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.opts .seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(40, 20, 2, 0.16); }
.pcts { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }

.plan-box { margin-top: 6px; }
.msgs { display: grid; gap: 6px; margin: 10px 0 0; }
.msg { font-size: 13.5px; padding: 10px 14px; border-radius: 12px; }
.msg.warn { background: rgba(255, 240, 214, 0.95); color: #4a2c04; border: 1px solid rgba(224, 146, 44, 0.4); }
.msg.bad { background: rgba(251, 229, 223, 0.95); color: #5c1b0f; border: 1px solid rgba(156, 47, 29, 0.35); }
.msg.good { background: rgba(224, 242, 230, 0.95); color: #123f27; border: 1px solid rgba(27, 106, 67, 0.3); }
.msg a { color: inherit; }
.go-row { margin-top: 14px; }
.steps-mini { display: flex; gap: 6px; margin: 12px 0 0; flex-wrap: wrap; }
.steps-mini span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(28, 19, 9, 0.07); color: var(--ink-2); }
.steps-mini span.on { background: var(--night); color: #fff; }
.steps-mini span.done { background: var(--up-soft); color: var(--up); }
.status { margin-top: 10px; font-size: 14px; min-height: 20px; color: var(--ink-2); }

/* the reading: allocation dial */
.dial { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
.dial svg { width: 150px; height: 150px; }
.dial .legend { display: grid; gap: 4px; font-size: 13.5px; }
.dial .legend div { display: flex; align-items: center; gap: 8px; }
.dial .legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dial .legend span { margin-left: auto; font: 500 13px var(--mono); color: var(--ink-2); }
@media (max-width: 420px) { .dial { grid-template-columns: 1fr; justify-items: center; } }
.hold { display: grid; gap: 4px; margin-top: 14px; }
.hold > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.8); font-size: 14px; }
.hold > div:nth-child(even) { background: rgba(252, 240, 219, 0.92); }
.hold .mid { min-width: 0; }
.hold .mid small { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hold .r { text-align: right; font: 500 14px var(--mono); }
.hold .r small { display: block; font: 400 12px var(--sans); color: var(--ink-2); }
.empty { padding: 18px; text-align: center; color: var(--ink-2); font-size: 14.5px; border-radius: 14px; background: rgba(255, 255, 255, 0.7); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; padding: 12px 18px; border-radius: 14px; background: rgba(18, 28, 39, 0.96); color: #fff; font-size: 14.5px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast a { color: #fff; }

/* ---------------------------------------------------------------- docs */
.doc-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 22px; }
.doc-grid > * { min-width: 0; }
.toc { position: sticky; top: 100px; padding: 18px; }
.toc a { display: block; padding: 6px 0; text-decoration: none; color: var(--ink-2); font-size: 14.5px; } .toc a:hover { color: var(--ink); }
.doc { padding: clamp(22px, 4vw, 44px); overflow-wrap: anywhere; }
.doc h1 { font: 400 clamp(40px, 5vw, 58px)/1 var(--serif); margin: 0 0 14px; }
.doc h2 { font: 400 36px/1.05 var(--serif); margin: 34px 0 10px; }
.doc h3 { font: 600 17px/1.3 var(--sans); margin: 20px 0 6px; }
.doc p, .doc li { color: var(--ink-thin); }
.doc code { font: 500 13px var(--mono); background: rgba(28, 19, 9, 0.07); padding: 2px 6px; border-radius: 6px; }
.doc table td { white-space: normal; }
@media (max-width: 900px) { .doc-grid { grid-template-columns: 1fr; } .toc { position: static; } }

/* motion: things arrive once, and only if the reader hasn't asked for less */
.motion .rise:not(.in) { opacity: 0; transform: translateY(14px); }
.motion .rise { transition: opacity .6s ease, transform .6s ease; }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; transition: none; } .dot.live { animation: none; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(168, 112, 28, 0.6); outline-offset: 2px; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 560px) {
  .nav .icon-btn { display: none; }
  .brand span { font-size: 26px; }
  .brand img { width: 30px; height: 30px; }
  .page-top .total { text-align: left; }
  .trow { grid-template-columns: auto minmax(0, 1fr) 84px 24px; gap: 8px; padding: 10px; }
  .trow .info .top { flex-direction: column; gap: 0; }
  .trow .info .top b { white-space: normal; line-height: 1.25; }
  .box { padding: 16px; }
  .leg { grid-template-columns: minmax(0, 1fr) auto; }
  .leg .side { grid-column: 1 / -1; justify-self: start; }
  .summary b { font-size: 16px; }
}
