/* ==========================================================================
   Steel Warehouse — Designed for Savings
   Native iOS design system.
   --------------------------------------------------------------------------
   Replacing the artifact's web-app look (translucent cards, rounded-2xl,
   soft drop shadows, a simulated phone bezel) with real UIKit conventions:
   FLAT OPAQUE surfaces, HAIRLINE separators, grouped-inset lists, and
   material blur ONLY on the nav/tab bars, where iOS actually uses it.
   ========================================================================== */

:root {
  /* Steel Warehouse — Aug 2023 v8 brand guide. Red is PMS 185C. */
  --sw-red: #ed1c24;
  --sw-red-pressed: #c8161d;
  --sw-black: #0b0000;

  /* iOS system palette (light) */
  --bg: #ffffff;
  --bg-grouped: #f2f2f7;
  --bg-elevated: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.60);
  --label-3: rgba(60, 60, 67, 0.30);
  --separator: rgba(60, 60, 67, 0.29);
  --fill-q: rgba(116, 116, 128, 0.08);
  --gain: #248a3d;          /* iOS systemGreen, dark variant for text */
  --tint: var(--sw-red);
  --field-border: rgba(60, 60, 67, 0.28);

  --navbar-h: 44px;
  --tabbar-h: 49px;
  --radius: 10px;
  --hairline: 0.5px;
  --gutter: 16px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          system-ui, "Segoe UI", Roboto, sans-serif;
  --font-num: ui-rounded, -apple-system, "SF Pro Rounded", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-grouped: #000000;
    --bg-elevated: #1c1c1e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.60);
    --label-3: rgba(235, 235, 245, 0.30);
    --separator: rgba(84, 84, 88, 0.65);
    --fill-q: rgba(118, 118, 128, 0.24);
    --gain: #30d158;
    --sw-red: #ff453a;        /* lifted for contrast on black */
    --sw-red-pressed: #d70015;
    --field-border: rgba(235, 235, 245, 0.30);
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.294;
  letter-spacing: -0.022em;
  color: var(--label);
  background: var(--bg-grouped);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* NOTE: `overscroll-behavior-y: none` was set on <body> to suppress the iOS
   rubber-band bounce. Measured on the live page, it did not just stop the
   bounce — it stopped scrolling outright: a real wheel event moved 0px on
   desktop AND a synthetic swipe moved 0px under touch emulation, while an
   identical gesture on a control page moved 483px. Removed entirely.

   The bounce it was guarding against only misbehaves when the page itself is
   a fixed-height scroll container; this layout scrolls the document normally,
   so the standalone PWA does not reveal anything behind it. If the bounce ever
   needs suppressing again, do it on a scroll CONTAINER, never on <body>, and
   re-run test_scroll.py to confirm both pointer types still scroll. */

input, textarea, select { -webkit-user-select: text; user-select: text; }

/* ---------- nav bar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: var(--hairline) solid var(--separator);
}
/* The header is FIXED, not sticky, and the page reserves its full (expanded)
   height up front. A sticky header that changes height pushes the content up
   and down as it shrinks, which feeds back into the scroll position and
   jitters near the top. Fixed + a constant spacer means only the bar changes
   size; the content scrolls under it, like an iOS large-title bar. */
:root { --navbar-max: calc(var(--logo-top, 76px) + 29px); }
.app { padding-top: calc(var(--navbar-max) + env(safe-area-inset-top)); }

/* Logo far left, app name to its right (2026-10-08 call).
   Shrink on scroll (2026-10-08, Adam): the bar starts tall with a large logo
   and collapses to a compact bar as you scroll. --shrink runs 0 -> 1 over the
   first 64px of scroll and is set per frame by useHeaderShrink, so the logo
   tracks the finger rather than snapping. Sizes interpolate in plain calc():
     logo   76px tall at the top  ->  34px compact
     bar    padding 14px          ->  6px
   The logo is Steel Warehouse's own SVG, so it stays sharp at every size. */
.navbar { --shrink: 0; }
.navbar__inner {
  --logo-h: calc(var(--logo-top, 76px) - (var(--logo-top, 76px) - 34px) * var(--shrink));
  min-height: calc(var(--logo-h) + 2 * (14px - 8px * var(--shrink)));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(14px - 8px * var(--shrink)) var(--gutter);
}

.navbar__logo {
  display: block;
  flex: 0 0 auto;
  height: var(--logo-h);
  line-height: 0;
}
.navbar__logo img {
  display: block;
  height: 100%;
  width: auto;
}

.navbar__title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  font-size: calc(19px - 2px * var(--shrink));
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
/* Narrower phones: the title must stay on one line beside the large logo, so
   the top-of-page logo height comes from the screen width rather than a fixed
   76px: whatever is left after the gutters, the gap and the title (~180px at
   17px bold), divided by the logo's 2.55:1 shape. 430px+ keeps the full 76px.
   Under 360px there isn't room for a big logo AND a one-line title, so the
   title wraps onto two lines there instead (never cut). */
:root { --logo-top: clamp(40px, calc((100vw - 226px) / 2.55), 76px); }
@media (max-width: 359px) { :root { --logo-top: 52px; } }
.navbar__inner { --logo-h: calc(var(--logo-top) - (var(--logo-top) - 34px) * var(--shrink)); }
@media (max-width: 439px) {
  .navbar__title { font-size: calc(17px - 1px * var(--shrink)); white-space: nowrap; }
}
@media (max-width: 359px) {
  .navbar__title { white-space: normal; font-size: calc(15.5px - 0.5px * var(--shrink)); }
  .is-shrunk .navbar__title { white-space: nowrap; }
}

/* ---------- body ---------- */
.body {
  padding: 12px 0 24px;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}

/* ---------- grouped list ---------- */
.group {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  margin: 0 var(--gutter) 22px;
  overflow: hidden;
}

/* Section headings. Janessa (2026-09-08): "Make the headings for each section
   bolder. It took a bit to find out what was being asked of me." Was 13px/
   regular in --label-2 grey, which iOS uses for incidental list captions and
   which disappeared against the field labels. Now near-black, semibold, and
   larger so the three sections read as instructions, not decoration. */
.group__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 0 calc(var(--gutter) * 2) 8px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--label);
}

/* A control that sits on the section heading (the Demo / Yours switches). */
.group__ctl {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

/* ---------- segmented control (iOS UISegmentedControl) ---------- */
.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.12);
}
.seg__btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  margin: 0;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  background: transparent;
  color: var(--label);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms var(--ease-ios), box-shadow 180ms var(--ease-ios);
}
.seg__btn.is-on {
  background: var(--bg-elevated);
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
.seg__btn:disabled { color: var(--label-3); cursor: default; }

/* ---------- examples ---------- */
/* Plain buttons, one per material pair. Tapping one fills the grades above;
   the one in use stays filled red so it reads as a choice, not a link. */
.examples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px var(--gutter);
}
.ex-btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 6px;
  border: 1.5px solid var(--sw-red);
  border-radius: 10px;
  background: transparent;
  color: var(--sw-red);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms linear, color 160ms linear, transform 140ms var(--ease-ios);
}
.ex-btn.is-on { background: var(--sw-red); color: #fff; }
.ex-btn:active { transform: scale(0.97); }
/* 320px phones: three buttons with nowrap labels spilled past their borders.
   Tighter type, and let a label wrap onto two lines rather than spill. */
@media (max-width: 359px) {
  .examples { gap: 6px; }
  .ex-btn { font-size: 13.5px; padding: 4px; white-space: normal; line-height: 1.2; }
}

/* Results: the This order / Truckload switch, centred over the headline */
.basis { display: flex; justify-content: center; margin: 0 var(--gutter) 12px; }

.group__footer {
  margin: -14px calc(var(--gutter) * 2) 22px;
  font-size: 13px;
  line-height: 18px;
  color: var(--label-2);
}

.tag {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--label-2);
  background: var(--fill-q);
  border-radius: 5px;
  padding: 2px 6px;
  text-transform: uppercase;
}

/* ---------- rows ---------- */
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;                 /* Apple HIG minimum target */
  padding: 8px var(--gutter);
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}

/* iOS inset hairline: begins at the label, not the card edge */
.row + .row::before,
.row + .disclose::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: 0;
  height: var(--hairline);
  background: var(--separator);
}

.row__label {
  flex: 1 1 auto;
  min-width: 0;                     /* lets flex children shrink; without it
                                       long labels force horizontal overflow */
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row__sub { font-size: 12.5px; color: var(--label-2); letter-spacing: 0; }

.row__value {
  flex: 0 0 auto;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* Recap rows that carry a grade name: the value may be long, so it gets the
   room and wraps instead of pushing the label (and itself) off the card. */
.row--stack .row__label { flex: 0 0 auto; }
.row--stack .row__value { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.row__value.gain { color: var(--gain); font-weight: 600; }

.row__control { flex: 0 1 auto; min-width: 0; display: flex; justify-content: flex-end; }
.row__control--full { flex: 1 1 auto; }

.row--readout .row__value { color: var(--label); font-weight: 600; }

/* Locked pricing rows (grade extras). Janessa asked for these to be
   non-editable, so they render as inset readouts rather than fields — the
   greyed track reads "system-supplied", matching her mock-up, without
   pretending to be a disabled input the rep might try to tap. */
.row--locked {
  background: var(--bg-grouped);
}
.row__value--locked {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--label-2);
  font-weight: 600;
}
.row--total { font-weight: 600; }
.row--total .row__value { color: var(--label); }

.row--tap { cursor: pointer; }
.row--tap:active { background: var(--fill-q); }

.disclosure { width: 8px; height: 13px; color: var(--label-3); flex: 0 0 auto; }

.row--bad .field { color: var(--sw-red); }
.row__err {
  position: absolute;
  left: var(--gutter);
  bottom: 2px;
  font-size: 11.5px;
  color: var(--sw-red);
  letter-spacing: 0;
}
.row--bad { padding-bottom: 18px; }

/* ---------- inputs ---------- */
/* Editable fields look editable (Mike, 2026-10-08 PDF: "visually indicate
   that this is a variable that the user can change"). Every number a rep can
   type sits in a bordered white box with the SW-red cursor; everything they
   can't change (grade-driven or calculated) is flat text on the grey track.
   The whole box is the tap target, not just the digits. */
.inputwrap {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1.5px solid var(--field-border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: text;
  transition: border-color 140ms linear, box-shadow 140ms linear;
}
.inputwrap:focus-within {
  border-color: var(--sw-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw-red) 18%, transparent);
}
.row--bad .inputwrap { border-color: var(--sw-red); }

.field {
  flex: 1 1 auto;
  min-width: 0;
  width: 80px;
  border: 0;
  background: transparent;
  font: inherit;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--label);
  caret-color: var(--sw-red);
  text-align: right;
  padding: 0;
  min-height: 30px;
}
.field:focus { outline: none; }
.field::placeholder { color: var(--label-3); font-weight: 400; }
.field--left { text-align: left; width: 100%; font-family: var(--font); font-weight: 400; }

.affix { color: var(--label-2); font-size: 15px; flex: 0 0 auto; }
.affix--pre { order: -1; }

/* Grade picker: a wrapping text label with the real (invisible) <select>
   stretched over the whole row, so the full grade name always shows and a tap
   anywhere on the row opens the native picker. The label gets the row's spare
   width and wraps to a second line rather than being cut. */
.row--grade .row__label { flex: 0 0 auto; }
.row--grade .row__control { flex: 1 1 auto; position: static; }
.selectwrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.select__label {
  min-width: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--label-2);
  text-align: right;
  overflow-wrap: anywhere;
}
.select {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;              /* keeps iOS from zooming on focus */
  cursor: pointer;
}
.select:focus { outline: none; }
.row--grade:has(.select:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--tint);
  border-radius: var(--radius);
}
.row--grade:active { background: var(--fill-q); }
.chev { width: 11px; height: 16px; color: var(--label-3); flex: 0 0 auto; }

/* ---------- headline ---------- */
.headline {
  margin: 0 var(--gutter) 22px;
  padding: 22px var(--gutter);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  text-align: center;
}
.headline__label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--label-2);
  margin-bottom: 6px;
}
.headline__big {
  font-family: var(--font-num);
  font-size: 44px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.headline__big.gain { color: var(--gain); }
.headline__big.flat { font-size: 24px; letter-spacing: -0.01em; }
.headline__sub {
  margin: 8px auto 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.33;
  color: var(--label-2);
}

/* Dollar line under the percent headline. Both units now show together
   (Janessa's note about the headline switching between % and $). */
.headline__money {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  color: var(--gain);
}
.headline__money.loss { color: var(--label-2); }

/* Percent under the dollar figure, deliberately smaller (Mick, 2026-10-08) */
.headline__pct {
  margin-top: 4px;
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gain);
}

/* ---------- thickness vs weight chart ---------- */
.chart { padding: 14px var(--gutter) 4px; }
/* Capped so the SVG (and its viewBox-scaled axis labels) can't balloon on a
   1440px desktop window. Phone width is under the cap, so phones are unchanged. */
.chart svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; overflow: visible; }
.chart .today {
  fill: none;
  stroke: var(--label);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
/* Light green fills today's whole box; the red proposed block covers its
   share, so the green left showing is the steel you stop buying. */
.chart .saved { fill: #d5e8d8; }
.chart .proposed {
  fill: var(--sw-red);
  transform-box: fill-box;
  transform-origin: left bottom;
}
.chart .thin-label {
  fill: #fff;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.chart .thin-label--out { fill: var(--sw-red); }
.chart .tick-label {
  fill: var(--label);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chart .ax-title {
  fill: var(--label);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
@media (prefers-color-scheme: dark) {
  .chart .saved { fill: #1f3a26; }
}

.legend {
  list-style: none;
  margin: 0 auto;
  max-width: calc(420px + 2 * var(--gutter));
  padding: 6px var(--gutter) 12px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.legend li { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.legend__txt {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 1px;
  justify-content: space-between;
}
.legend__name { min-width: 0; overflow-wrap: anywhere; }
.legend .sw { margin-top: 3px; }
.legend .v {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--label-2);
}
.legend__saved { font-weight: 600; }
.legend__saved .v { color: var(--gain); }
.sw { flex: 0 0 auto; width: 14px; height: 10px; border-radius: 2px; }
.sw.today { border: 1.5px dashed var(--label); background: #d5e8d8; }
.sw.proposed { background: var(--sw-red); }
.sw.saved { background: #d5e8d8; }

/* ---------- comparison rows ---------- */
.row--cmp { gap: 8px; font-size: 15px; }
.row--cmp .c1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.row--cmp .c2, .row--cmp .c3 {
  flex: 0 0 82px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--label-2);
}
/* Narrow phones (iPhone SE and smaller): 82px value columns left no room for
   "Proposed" in the header row. Tighten the type and columns a touch. */
@media (max-width: 389px) {
  .row--cmp { gap: 6px; font-size: 14px; }
  .row--cmp .c2, .row--cmp .c3 { flex-basis: 76px; }
  .row--cmphead { font-size: 11px; letter-spacing: 0.03em; }
}
.row--cmp .c3.up { color: var(--label); font-weight: 600; }
.row--cmphead {
  min-height: 32px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--label-2);
}
.row--cmphead .c2, .row--cmphead .c3 { color: var(--label-2); font-weight: 400; }

/* ---------- flags ---------- */
.flag {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 var(--gutter) 22px;
  padding: 12px var(--gutter);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 19px;
  letter-spacing: 0;
}
.flag__ico {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sw-red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- disclosure ---------- */
.disclose {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  margin: 0 var(--gutter) 22px;
  overflow: hidden;
}
.disclose > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 11px var(--gutter);
  cursor: pointer;
  list-style: none;
  color: var(--tint);
}
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::after {
  content: "";
  margin-left: auto;
  width: 7px; height: 7px;
  border-right: 2px solid var(--label-3);
  border-bottom: 2px solid var(--label-3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.disclose[open] > summary::after { transform: rotate(-135deg); }
.disclose__body {
  padding: 0 var(--gutter) 14px;
  font-size: 13.5px;
  line-height: 19px;
  color: var(--label-2);
  letter-spacing: 0;
}
.disclose__body p { margin: 0 0 10px; }
.disclose__body b { color: var(--label); }

.formula {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 17px;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--fill-q);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 12px;
  color: var(--label);
  overflow-x: auto;
}

/* ---------- buttons ---------- */
.cta { padding: 2px var(--gutter) 6px; }

.btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  cursor: pointer;
  transition: transform 140ms var(--ease-ios), background-color 160ms linear, opacity 160ms linear;
}
.btn--primary { background: var(--tint); color: #fff; }
.btn--primary:active { background: var(--sw-red-pressed); transform: scale(0.972); }

.formerr {
  margin: 0 calc(var(--gutter) * 2) 10px;
  font-size: 13px;
  color: var(--sw-red);
  text-align: center;
}

.fineprint, .stagefoot {
  margin: 0 calc(var(--gutter) * 2) 18px;
  font-size: 11.5px;
  line-height: 16px;
  color: var(--label-3);
  letter-spacing: 0;
}
.stagefoot { margin-top: 20px; }

/* ---------- sent confirmation ---------- */
.sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 56px var(--gutter) 24px;
}
.sent__ring {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--gain);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sent__ring svg { width: 34px; height: 34px; }
.sent__title { font-size: 20px; font-weight: 700; }
.sent__sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 19px;
  color: var(--label-2);
  max-width: 32ch;
  letter-spacing: 0;
}

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: var(--hairline) solid var(--separator);
}

.tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--label-2);
  font-family: var(--font);
  font-size: 10px;
  line-height: 12px;
  letter-spacing: 0.006em;
  transition: color 200ms var(--ease-out);
}
.tab svg {
  width: 26px;
  height: 26px;
  display: block;
  transition: transform 260ms var(--ease-ios);
}
.tab.is-active { color: var(--tint); }
.tab.is-active svg { transform: translateY(-1px) scale(1.06); }
.tab.is-locked { color: var(--label-3); }
.tab:active svg { transform: scale(0.9); }
.tab:active { opacity: 0.55; }

/* ==========================================================================
   Motion
   --------------------------------------------------------------------------
   iOS-flavoured: short, decisive, mostly opacity + small translate. Nothing
   bounces or overshoots hard — that reads as "web animation library", not
   native. Durations 180-420ms; the system spring is roughly cubic-bezier
   (0.32, 0.72, 0, 1).
   Every rule here is switched off by the reduced-motion block at the bottom.
   ========================================================================== */

:root {
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Screen transition — direction-aware, mirrors a push/pop */
@keyframes screen-in-fwd {
  from { opacity: 0; transform: translate3d(14px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes screen-in-back {
  from { opacity: 0; transform: translate3d(-14px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.anim-in-fwd  { animation: screen-in-fwd 320ms var(--ease-ios) both; }
.anim-in-back { animation: screen-in-back 320ms var(--ease-ios) both; }

/* Large title swaps with the screen */
@keyframes title-in {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.anim-title { animation: title-in 300ms var(--ease-out) both; }

/* Cards rise in, staggered via --stagger */
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.anim-rise {
  animation: rise 380ms var(--ease-out) both;
  animation-delay: var(--stagger, 0ms);
}

/* Hero result — a restrained pop, no elastic overshoot */
@keyframes pop {
  0%   { opacity: 0; transform: scale(0.965); }
  60%  { opacity: 1; transform: scale(1.006); }
  100% { opacity: 1; transform: scale(1); }
}
.anim-pop { animation: pop 420ms var(--ease-out) both; }

/* Chart: the proposed block starts at today's size and shrinks to its own,
   then the green "less steel" strip fades in. --sx/--sy are set inline. */
@keyframes shrink-in {
  from { transform: scale(var(--sx, 1), var(--sy, 1)); }
  to   { transform: scale(1, 1); }
}
@keyframes fade-in {
  from { opacity: 0; }
}
.chart .proposed { animation: shrink-in 700ms var(--ease-ios) 150ms both; }
.chart .thin-label { animation: fade-in 300ms var(--ease-out) 750ms both; }

/* Validation error: a short lateral nudge, not a cartoon shake */
@keyframes nudge {
  0%, 100% { transform: translate3d(0, 0, 0); }
  25%      { transform: translate3d(-4px, 0, 0); }
  75%      { transform: translate3d(4px, 0, 0); }
}
.anim-shake { animation: nudge 240ms var(--ease-out) both; }

/* Sent confirmation: ring scales in, then the tick draws itself */
@keyframes ring-in {
  0%   { opacity: 0; transform: scale(0.7); }
  70%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tick-draw {
  from { stroke-dashoffset: 30; }
  to   { stroke-dashoffset: 0; }
}
.anim-ring { animation: ring-in 380ms var(--ease-out) both; }
.anim-ring .tick {
  stroke-dasharray: 30;
  animation: tick-draw 320ms var(--ease-out) 200ms both;
}

/* Rows respond to touch like native table cells */
.row--tap { transition: background-color 120ms linear; }

@media (prefers-color-scheme: dark) {
  .seg { background: rgba(118, 118, 128, 0.24); }
  .seg__btn.is-on { background: #636366; box-shadow: none; }
}

/* Smooth in-page scrolling; JS passes behavior explicitly, this covers
   anchor/keyboard cases too. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}
