/* Fieldwise — every colour, size, radius and shadow below comes from
 * design/tokens.json. Nothing here is a value chosen at build time. */

/* ---------- Tokens: Daylight (light) is the base ---------- */
:root {
  --surface-100: #f8f4ea;
  --surface-200: #efe7d6;
  --surface-raised: #fffdf7;
  --hairline: #ded2ba;
  --hairline-strong: #8d7d58;
  --ink: #231d14;
  --ink-muted: #5c5240;
  --veld: #2c5c38;
  --on-veld: #fbf8f0;
  --veld-deep: #1d4026;
  --on-veld-deep: #f4f0e4;
  --maize: #8a5d0a;
  --maize-fill: #e3b24a;
  --soil: #9d4a24;
  --sky: #1f6382;
  --frost: #3b4f8a;
  --status-good: var(--veld);
  --status-watch: var(--maize);
  --status-urgent: #ad3418;
  --example-ground: #f0e2c2;

  --shadow-card: 0 1px 2px rgba(35, 29, 20, .07), 0 2px 8px rgba(35, 29, 20, .05);
  --shadow-lifted: 0 2px 4px rgba(35, 29, 20, .08), 0 8px 20px rgba(35, 29, 20, .1);

  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 18px;
  --radius-xl: 24px; --radius-pill: 999px;

  --tap-min: 48px; --screen-max: 430px;
  --icon-sm: 20px; --icon-md: 24px; --icon-lg: 40px; --focus-ring: 3px;

  color-scheme: light;
}

/* Dusk. Only the tokens that change are redefined — guarded so an explicit
 * light choice still wins under a dark system preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-100: #15130f;
    --surface-200: #1e1b15;
    --surface-raised: #262219;
    --hairline: #3a3428;
    --hairline-strong: #6b6350;
    --ink: #f4eee1;
    --ink-muted: #a9a08a;
    --veld: #7fc08f;
    --on-veld: #11271a;
    --veld-deep: #17311f;
    --on-veld-deep: #e4efe6;
    --maize: #e8b74e;
    --maize-fill: #e8b74e;
    --soil: #e08d5f;
    --sky: #78bcdd;
    --frost: #9ab0e8;
    --status-urgent: #f08a68;
    --example-ground: #2e2817;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .55), 0 2px 10px rgba(0, 0, 0, .4);
    --shadow-lifted: 0 2px 6px rgba(0, 0, 0, .6), 0 10px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* The toggle wins in both directions. */
:root[data-theme="dark"] {
  --surface-100: #15130f;
  --surface-200: #1e1b15;
  --surface-raised: #262219;
  --hairline: #3a3428;
  --hairline-strong: #6b6350;
  --ink: #f4eee1;
  --ink-muted: #a9a08a;
  --veld: #7fc08f;
  --on-veld: #11271a;
  --veld-deep: #17311f;
  --on-veld-deep: #e4efe6;
  --maize: #e8b74e;
  --maize-fill: #e8b74e;
  --soil: #e08d5f;
  --sky: #78bcdd;
  --frost: #9ab0e8;
  --status-urgent: #f08a68;
  --example-ground: #2e2817;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .55), 0 2px 10px rgba(0, 0, 0, .4);
  --shadow-lifted: 0 2px 6px rgba(0, 0, 0, .6), 0 10px 24px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--surface-100);
  color: var(--ink);
  font: 400 15px/22px var(--font-sans);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

#app {
  max-width: var(--screen-max);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface-100);
  overflow-x: hidden;
}

/* Solid ring, offset 2px. Never a glow — a glow is invisible outdoors. */
:focus-visible {
  outline: var(--focus-ring) solid var(--veld);
  outline-offset: 2px;
}

button { font: inherit; color: inherit; cursor: pointer; }

/* Almost no motion. A fill change on tap, a height change on the drawer. */
@media (prefers-reduced-motion: no-preference) {
  .btn, .seg button, .toggle { transition: background-color 120ms ease; }
  .drawer { transition: grid-template-rows 180ms ease; }
}

/* ---------- Type styles, named as tokens.json names them ---------- */
.t-hero         { font: 600 28px/32px var(--font-display); }
.t-screen-title { font: 600 22px/27px var(--font-display); }
.t-section      { font: 600 17px/22px var(--font-display); }
.t-body         { font: 400 15px/22px var(--font-sans); }
.t-body-strong  { font: 600 15px/22px var(--font-sans); }
.t-small        { font: 400 13px/19px var(--font-sans); }
.t-caption      { font: 500 12px/16px var(--font-sans); }
.t-label        { font: 700 11px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.t-button       { font: 600 15px/20px var(--font-sans); }
.t-figure-hero  { font: 600 32px/34px var(--font-mono); }
.t-figure       { font: 500 19px/24px var(--font-mono); }
.t-figure-sm    { font: 500 14px/18px var(--font-mono); }
.t-unit         { font: 500 11px/14px var(--font-mono); letter-spacing: .04em; color: var(--ink-muted); }

.muted { color: var(--ink-muted); }

/* ---------- Header band ---------- */
.hdr {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--veld-deep); color: var(--on-veld-deep);
  padding: var(--space-4);
}
.hdr h1 { font: 600 22px/27px var(--font-display); margin: 0; flex: 1; }
.hdr .mark { display: flex; }
.hdr button {
  min-width: var(--tap-min); min-height: var(--tap-min);
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: inherit;
  margin: -12px 0; border-radius: var(--radius-sm);
}
.hdr .fresh { font: 600 12px/16px var(--font-sans); padding: 0 var(--space-2); min-width: auto; }

/* ---------- Phase progress ---------- */
.pp { display: flex; padding: var(--space-4) var(--space-4) var(--space-3); }
.ph {
  flex: 1; min-width: var(--tap-min); min-height: var(--tap-min);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; background: transparent; border: 0; padding: 0;
}
.ph .disc {
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-200); border: 1.5px solid var(--hairline-strong);
  color: var(--ink-muted); z-index: 1;
}
.ph.done .disc, .ph.now .disc { background: var(--veld); border-color: var(--veld); color: var(--on-veld); }
.ph .nm { font: 700 11px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.ph.now .nm { color: var(--ink); }
.ph .rail { position: absolute; top: 20px; left: 50%; width: 100%; height: 2px; background: var(--hairline); z-index: 0; }
.ph .rail.fill { background: var(--veld); }
.ph:last-child .rail { display: none; }

/* The invitation a locked phase gives instead of a refusal. */
.phase-note {
  margin: 0 var(--space-4) var(--space-3);
  background: var(--surface-200); color: var(--ink);
  border-radius: var(--radius-sm); padding: 10px var(--space-3);
  font: 400 13px/19px var(--font-sans);
}

/* ---------- Layout ---------- */
.pad { padding: 0 var(--space-4) var(--space-6); }

/* ---------- Example ribbon ---------- */
.ribbon {
  background: var(--example-ground); color: var(--ink);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font: 500 12px/16px var(--font-sans);
}
.ribbon b { font-weight: 700; display: block; }
.ribbon span { display: block; color: var(--ink-muted); margin-top: 2px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-raised); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: var(--space-4);
  margin-bottom: 14px;
}
.card.lifted { border-radius: var(--radius-xl); box-shadow: var(--shadow-lifted); }
.card h3 { font: 600 17px/22px var(--font-display); margin: 0 0 4px; }
.card .sub { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); }

h2.hero { font: 600 28px/32px var(--font-display); margin: 22px 0 6px; }
.seasonline { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); margin: 0 0 14px; }

/* ---------- Form controls ---------- */
.field { margin-bottom: 14px; }
.inwrap { position: relative; display: block; }
.field:last-child { margin-bottom: 0; }
label.lab, span.lab {
  font: 700 11px/14px var(--font-sans); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted); display: block; margin-bottom: 6px;
}
.inp {
  width: 100%; min-height: var(--tap-min); padding: var(--space-3) 14px;
  background: var(--surface-200); border: 1.5px solid var(--hairline-strong);
  border-radius: var(--radius-md); font: 400 15px/22px var(--font-sans); color: var(--ink);
}
.inp.num { font: 500 19px/24px var(--font-mono); padding-right: 46px; }
.suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font: 500 11px/14px var(--font-mono); letter-spacing: .04em; color: var(--ink-muted);
  pointer-events: none;
}
.hint { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); margin-top: 6px; }
.err { font: 400 13px/19px var(--font-sans); color: var(--status-urgent); margin-top: 6px; }

.seg {
  display: flex; background: var(--surface-200);
  border: 1.5px solid var(--hairline-strong); border-radius: var(--radius-md);
  padding: 3px; gap: 3px;
}
/* The design preview sets these to 42px inside a 48px track, which puts the
 * actual tap target under the 48px floor (screens.md acceptance point 3).
 * The button is what a gloved thumb hits, so the button is 48 and the track
 * grows around it. Ledger STEVE-fieldwise-004. */
.seg button {
  flex: 1; min-height: var(--tap-min); border: 0; background: transparent; border-radius: 9px;
  color: var(--ink-muted); font: 400 15px/22px var(--font-sans);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.seg button[aria-pressed="true"] {
  background: var(--surface-raised); box-shadow: var(--shadow-card);
  color: var(--ink); font-weight: 600;
}
.seg button[aria-pressed="true"].wet { color: var(--sky); }

/* ---------- Crop choice ---------- */
.crop {
  background: var(--surface-raised); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: var(--space-4); margin-bottom: var(--space-3);
}
.crop.best { border-radius: var(--radius-xl); box-shadow: var(--shadow-lifted); }
.crop.sel { outline: 2.5px solid var(--veld); outline-offset: -1px; }
.crop .top { display: flex; align-items: flex-start; gap: var(--space-3); }
.crop .gl { flex: 0 0 var(--icon-lg); color: var(--ink); display: flex; }
.crop .nmb { flex: 1; min-width: 0; }
.crop .nmb h3 { font: 600 17px/22px var(--font-display); margin: 0; }
.crop .nmb p { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); margin: 2px 0 0; }
.chip {
  font: 600 11px/14px var(--font-sans); letter-spacing: .06em; text-transform: uppercase;
  background: var(--veld); color: var(--on-veld);
  border-radius: var(--radius-sm); padding: 5px var(--space-2); white-space: nowrap;
}
.chip.yours { background: var(--surface-200); color: var(--ink); }

/* The money figure. Positive is maize; a loss is ink plus the word. */
.fig { font: 600 32px/34px var(--font-mono); color: var(--maize); margin-top: var(--space-3); }
.fig.loss { color: var(--ink); }
.fig em { font: 500 11px/14px var(--font-mono); letter-spacing: .04em; color: var(--ink-muted); font-style: normal; margin-left: var(--space-1); }
.fig .lossword { font: 500 11px/14px var(--font-sans); letter-spacing: .04em; color: var(--ink-muted); font-style: normal; margin-left: var(--space-2); text-transform: none; }
.rng { font: 500 14px/18px var(--font-mono); color: var(--ink); margin-top: 5px; }
.why { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); margin-top: 3px; }
.tot {
  font: 400 13px/19px var(--font-sans); color: var(--ink-muted);
  margin-top: var(--space-2); padding-top: 10px; border-top: 1px solid var(--hairline);
}
.tot b { font: 500 14px/18px var(--font-mono); color: var(--ink); }
.nobudget {
  background: var(--surface-200); border-radius: var(--radius-md);
  padding: var(--space-3) 14px; margin-top: var(--space-3);
  font: 400 13px/19px var(--font-sans); color: var(--ink-muted);
}

.toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: var(--tap-min); margin-top: 6px;
  background: transparent; border: 0; border-top: 1px solid var(--hairline);
  color: var(--veld); font: 600 15px/20px var(--font-sans); padding: 0;
}
.drawer { display: grid; grid-template-rows: 0fr; }
.drawer[data-open="true"] { grid-template-rows: 1fr; }
.drawer > div { overflow: hidden; }
.work {
  background: var(--surface-200); border-radius: var(--radius-md);
  padding: var(--space-3) 14px; margin-top: 10px;
}
.wr {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline); min-height: 34px;
}
.wr:last-of-type { border-bottom: 0; }
.wr > span { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); }
.wr b { font: 500 14px/18px var(--font-mono); color: var(--ink); white-space: nowrap; }
.wr.sum b { color: var(--maize); font-weight: 600; }
.wr.sum b.loss { color: var(--ink); }
.wr .defn { display: block; font: 400 12px/16px var(--font-sans); color: var(--ink-muted); margin-top: 2px; }
.wr input {
  width: 108px; text-align: right; min-height: var(--tap-min);
  background: var(--surface-raised); border: 1.5px solid var(--hairline-strong);
  border-radius: var(--radius-md); padding: 6px 10px;
  font: 500 14px/18px var(--font-mono); color: var(--ink);
}
.breakeven {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline);
  font: 400 13px/19px var(--font-sans); color: var(--ink-muted);
}
.breakeven b { font: 500 14px/18px var(--font-mono); color: var(--ink); }
.own {
  display: block; width: 100%; min-height: var(--tap-min); margin-top: 10px;
  background: transparent; border: 1.5px solid var(--hairline-strong);
  border-radius: var(--radius-md); color: var(--ink); font: 600 15px/20px var(--font-sans);
}

/* No crop makes money. The one state the design did not have. */
.nomoney {
  background: var(--example-ground); color: var(--ink);
  border-radius: var(--radius-md); padding: 14px;
  margin-bottom: 14px;
}
.nomoney b { display: block; font: 600 15px/22px var(--font-sans); }
.nomoney span { display: block; font: 400 13px/19px var(--font-sans); color: var(--ink-muted); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  width: 100%; min-height: 52px; border-radius: var(--radius-md);
  border: 1.5px solid transparent; font: 600 15px/20px var(--font-sans);
}
.btn.primary { background: var(--veld); color: var(--on-veld); }
.btn.primary:active { background: var(--veld-deep); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--hairline-strong); }
.btn.secondary:active { background: var(--surface-200); }
.btn:disabled { background: var(--surface-200); color: var(--ink-muted); border-color: transparent; cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: var(--space-4); }
.btn-row .btn { flex: 1; min-height: var(--tap-min); }
.cta-wrap { margin-top: var(--space-8); }
.disabled-why { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); margin-top: var(--space-2); text-align: center; }
.foot { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); text-align: center; margin: 10px 0 var(--space-6); }

/* ---------- Field strip ---------- */
.strip {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 52px; width: 100%; padding: var(--space-2) 14px;
  background: var(--surface-raised); border: 0;
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  margin-bottom: 14px; text-align: left;
}
.strip .t { flex: 1; min-width: 0; }
.strip .t b { font: 600 15px/20px var(--font-sans); display: block; }
.strip .t span { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); }
.strip .chev { color: var(--ink-muted); display: flex; }

/* ---------- Weeks stepper ---------- */
.step { display: flex; align-items: center; gap: 14px; }
.step button {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  border: 1.5px solid var(--hairline-strong); background: var(--surface-200);
  color: var(--ink); font: 500 24px/1 var(--font-mono);
}
.stepval { flex: 1; text-align: center; }
.stepval b { font: 600 32px/34px var(--font-mono); display: block; }
.stepval b.today { font: 600 22px/27px var(--font-display); }
.stepval span { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); }
.link {
  display: inline-block; margin-top: 10px; min-height: var(--tap-min); line-height: var(--tap-min);
  font: 400 13px/19px var(--font-sans); color: var(--veld);
  text-decoration: underline; text-underline-offset: 3px;
  background: none; border: 0; padding: 0;
}

/* ---------- Stage timeline ---------- */
.railrow { display: flex; align-items: flex-start; margin: 2px 0 0; }
.st { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; gap: 7px; }
.st .dot {
  width: 16px; height: 16px; border-radius: var(--radius-pill);
  background: var(--surface-200); border: 1.5px solid var(--hairline-strong);
  display: flex; align-items: center; justify-content: center; z-index: 1; color: var(--on-veld);
}
.st.done .dot { background: var(--veld); border-color: var(--veld); }
.st.now .dot { width: 24px; height: 24px; background: var(--veld); border-color: var(--veld); margin-top: -4px; }
.st .ln { position: absolute; top: 7px; left: 50%; width: 100%; height: 2px; background: var(--hairline); z-index: 0; }
.st.done .ln { background: var(--veld); }
.st:last-child .ln { display: none; }
.st .sn { font: 400 12px/15px var(--font-sans); color: var(--ink-muted); text-align: center;
          overflow-wrap: anywhere; hyphens: auto; }
/* The current stage is named once, beneath the rail, at section size. */
.nowstage { font: 600 17px/22px var(--font-display); color: var(--ink); margin-top: var(--space-3); }
.dayrow { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.day { font: 500 19px/24px var(--font-mono); }
.day em { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); font-style: normal; margin-left: 6px; }
.bar { height: 6px; border-radius: var(--radius-pill); background: var(--surface-200); margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--veld); border-radius: var(--radius-pill); }

/* ---------- Alert rows ---------- */
.row {
  display: flex; gap: var(--space-3); padding: 14px 0;
  border-bottom: 1px solid var(--hairline); min-height: var(--tap-min);
}
.row:last-of-type { border-bottom: 0; }
.row .g { flex: 0 0 var(--icon-md); margin-top: 1px; display: flex; }
.row .b { flex: 1; min-width: 0; }
.row .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row .hd b { font: 600 15px/22px var(--font-sans); }
.stt { display: inline-flex; align-items: center; gap: 5px; font: 500 12px/16px var(--font-sans); white-space: nowrap; }
.stt i { width: 8px; height: 8px; border-radius: var(--radius-pill); display: inline-block; }
.wy { font: 400 15px/22px var(--font-sans); color: var(--ink-muted); margin-top: 2px; display: block; }
.next {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: var(--tap-min); margin-top: 6px;
  background: transparent; border: 0; border-top: 1px solid var(--hairline);
  color: var(--veld); font: 600 15px/20px var(--font-sans); padding: 0;
}
.hind {
  background: var(--surface-200); border-radius: var(--radius-md);
  padding: var(--space-3) 14px; font: 400 13px/19px var(--font-sans); color: var(--ink-muted);
}
.hind b { font: 500 14px/18px var(--font-mono); color: var(--ink); }

/* ---------- Harvest window ---------- */
.left { font: 500 19px/24px var(--font-mono); margin-top: 10px; }
.left em { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); font-style: normal; margin-left: 6px; }
.track { height: 16px; border-radius: var(--radius-pill); background: var(--surface-200); margin: var(--space-3) 0 6px; position: relative; }
.track .win { position: absolute; top: 0; bottom: 0; background: var(--veld); border-radius: var(--radius-pill); }
.track .today { position: absolute; top: -6px; bottom: -6px; width: 3px; background: var(--soil); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface-raised); }
.ends { position: relative; height: 19px; font: 400 13px/19px var(--font-sans); color: var(--ink-muted); }
.ends span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tmark { position: relative; height: 16px; font: 400 12px/16px var(--font-sans); color: var(--soil); margin-top: 2px; }
.tmark span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

.verdict { display: flex; align-items: center; gap: var(--space-3); }
.verdict .g { display: flex; }
.verdict b { font: 600 32px/34px var(--font-mono); letter-spacing: .02em; }
.verdict span { font: 600 15px/20px var(--font-sans); }
.cap { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); margin-top: var(--space-3); }

/* ---------- Price trend ---------- */
.price { font: 500 19px/24px var(--font-mono); margin-top: 10px; }
.price em { font: 500 11px/14px var(--font-mono); letter-spacing: .04em; color: var(--ink-muted); font-style: normal; margin-left: 3px; }
.price span { font: 500 14px/18px var(--font-mono); margin-left: 10px; }
.price span.up { color: var(--status-good); }
.price span.down { color: var(--status-urgent); }
svg.chart { display: block; margin-top: var(--space-2); width: 100%; height: auto; }
svg.chart text.ax { font: 400 12px/1 var(--font-sans); fill: var(--ink-muted); }
svg.chart text.val { font: 600 13px/1 var(--font-mono); fill: var(--maize); }
.src { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); margin-top: 10px; }

/* ---------- Feed switch ---------- */
.feed {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  background: var(--surface-200); border: 0; border-radius: var(--radius-md);
  padding: 14px; min-height: 56px; margin-bottom: 14px; text-align: left;
}
.feed .t { flex: 1; min-width: 0; }
.feed .t b { font: 600 15px/20px var(--font-sans); display: block; }
.feed .t span { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); }
.sw { width: 52px; height: 30px; border-radius: var(--radius-pill); background: var(--hairline-strong); position: relative; flex: 0 0 52px; }
.sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--surface-raised); transition: left 120ms ease; }
.feed[aria-pressed="true"] .sw { background: var(--veld); }
.feed[aria-pressed="true"] .sw i { left: 25px; }

/* ---------- Loading and error states ---------- */
.skel { background: var(--surface-200); border-radius: var(--radius-sm); display: block; }
.skel.hero { height: 34px; width: 60%; margin-top: var(--space-3); }
.skel.sm { height: 18px; width: 45%; margin-top: 6px; }
.skel.line { height: 19px; width: 80%; margin-top: 6px; }
.errfig { font: 600 19px/24px var(--font-mono); color: var(--status-urgent); margin-top: var(--space-3); }
.retry {
  min-height: var(--tap-min); margin-top: 10px; padding: 0 var(--space-4);
  background: transparent; border: 1.5px solid var(--hairline-strong);
  border-radius: var(--radius-md); color: var(--ink); font: 600 15px/20px var(--font-sans);
}

/* ---------- Wide screens: centre, never stretch ---------- */
@media (min-width: 460px) {
  body { background: var(--surface-200); }
  #app { box-shadow: var(--shadow-card); }
}

/* ---------- Look-ahead banner (Nina idea 002) ----------
   Deliberately loud, and it always names the real date: the one thing this
   must never do is let a farmer think he is looking at today. */
.lookahead {
  background: var(--soil); color: var(--surface-raised);
  border-radius: var(--radius-md); padding: var(--space-3) 14px;
  margin-bottom: 14px;
}
.lookahead b { display: block; font: 600 15px/22px var(--font-sans); }
.lookahead span { display: block; font: 400 13px/19px var(--font-sans); opacity: .92; margin-top: 2px; }
.lookahead button {
  margin-top: 10px; min-height: var(--tap-min); width: 100%;
  background: var(--surface-raised); color: var(--ink);
  border: 0; border-radius: var(--radius-md); font: 600 15px/20px var(--font-sans);
}

/* ---------- Frost and the calendar, on Plant (Nina idea 005) ---------- */
.frostline {
  display: flex; gap: var(--space-3); align-items: flex-start;
  background: var(--surface-200); border-radius: var(--radius-md);
  padding: var(--space-3) 14px; margin-bottom: 14px;
}
.frostline .g { flex: 0 0 var(--icon-md); display: flex; margin-top: 1px; }
.frostline > span:last-child { font: 400 13px/19px var(--font-sans); color: var(--ink-muted); }
.frostline.late > span:last-child { color: var(--ink); }

/* ---------- Hero swap (Nina idea 008) ----------
   The total row is a control now: tapping it swaps which number is the hero. */
button.tot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  width: 100%; min-height: var(--tap-min); text-align: left;
  background: transparent; border: 0;
  border-top: 1px solid var(--hairline); border-radius: 0;
  margin-top: var(--space-2); padding: 10px 0 0;
  font: 400 13px/19px var(--font-sans); color: var(--ink-muted);
}
button.tot .totline { flex: 1; min-width: 0; }
button.tot .totline b { font: 500 14px/18px var(--font-mono); color: var(--ink); white-space: nowrap; }
button.tot .swap { color: var(--veld); font: 600 13px/19px var(--font-sans); white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 400px) {
  button.tot { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
}
