/* ============================================================
   Network TCO Calculator
   Ported from the approved Claude Design artboard. Every colour,
   radius, shadow and easing resolves to a token already defined in
   styles.css :root - the artboard was derived from this codebase, so
   the hexes in it and the tokens here are the same values.

   TWO deliberate departures from the artboard, both required:

   1. WCAG. The artboard uses brand orange #F0641E on 0.6875rem
      eyebrows and brand blue #1E82BE on 0.75-0.875rem labels. Those
      fail AA at small sizes, which is why this site shipped the
      small-text remap in v2.3.1 (#B34F14 / --blue-deeper #155F8F).
      Small text here uses the accessible pair; full-brand orange is
      kept for large bold figures where it passes.

   2. Responsive. The artboard is a desktop-only 250px rail + canvas.
      A standalone page is served directly to phones (worker.js only
      swaps documents at "/"), so this carries its own breakpoints.
   ============================================================ */

.tco {
  --tco-rail-w: 250px;
  --tco-spring: cubic-bezier(.34, 1.56, .64, 1);
  --tco-accent-text: #B34F14;   /* orange, AA on white at small sizes */
  --tco-confirm-text: #155F8F;  /* blue,   AA on white at small sizes */
  padding: 88px 0 96px;
  background: var(--light);
}
.tco[data-bg="white"] { background: var(--white); }

.tco-wrap { max-width: 1140px; margin: 0 auto; padding: 0 var(--pad); }

/* ── Intro ─────────────────────────────────────────────────── */
.tco-intro { text-align: center; max-width: 760px; margin: 0 auto 44px; }
.tco-badge {
  display: inline-flex; align-items: center; padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: .6875rem; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  background: var(--orange-soft); color: #98420F;
  border: 1px solid var(--orange-ring);
}
.tco-intro h1 {
  font-size: clamp(1.875rem, 3vw, 2.5rem); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.2; color: var(--navy); margin: 18px 0 14px;
}
.tco-intro p { font-size: 1.0625rem; line-height: 1.75; color: var(--muted); margin: 0; }

/* ── Shell ─────────────────────────────────────────────────── */
.tco-shell {
  background: var(--white); border-radius: var(--r-xl);
  border: 1px solid var(--hairline); box-shadow: var(--elev-1); overflow: hidden;
}
.tco-grid { display: grid; grid-template-columns: var(--tco-rail-w) 1fr; min-height: 640px; }

/* ── Left rail ─────────────────────────────────────────────── */
.tco-rail {
  background: var(--navy);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(30,130,190,.20), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(240,100,30,.12), transparent 50%);
  padding: 28px 18px;
}
.tco-rail-inner { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 4px; }
.tco-rail-title {
  font-size: .6875rem; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  color: var(--on-dark-3); padding: 0 10px 14px;
}
.tco-step {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px;
  border: none; border-radius: var(--r-sm); background: transparent; cursor: pointer;
  text-align: left; font-family: inherit;
  transition: background var(--dur-fast) var(--ease-std);
}
.tco-step:hover { background: rgba(255,255,255,.06); }
.tco-step:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.tco-step[aria-current="step"] { background: rgba(255,255,255,.08); }
.tco-step-num {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  background: transparent; color: var(--on-dark-3);
  border: 1.5px solid rgba(255,255,255,.25);
}
.tco-step-label { font-size: .8125rem; font-weight: 600; color: var(--on-dark-3); line-height: 1.3; }
.tco-step[data-state="done"] .tco-step-num { background: var(--blue-dark); color: var(--white); border-color: var(--blue-dark); }
.tco-step[data-state="done"] .tco-step-label { color: rgba(255,255,255,.85); }
.tco-step[data-state="active"] .tco-step-num {
  background: #B34F14; color: var(--white); border-color: #B34F14;
  box-shadow: var(--elev-step);
}
.tco-step[data-state="active"] .tco-step-label { color: var(--on-dark); }
.tco-rail-note {
  margin-top: 24px; padding: 14px 10px 0; border-top: 1px solid var(--on-dark-line);
}
.tco-rail-note p { font-size: .75rem; line-height: 1.6; color: var(--on-dark-3); margin: 0; }

/* Phone/tablet progress bar, replacing the rail. */
.tco-progress { display: none; padding: 20px 24px 0; }
.tco-progress-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.tco-progress-step {
  font-size: .6875rem; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  color: var(--tco-accent-text);
}
.tco-progress-name { font-size: .875rem; font-weight: 600; color: var(--navy); }
.tco-progress-track { height: 4px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.tco-progress-fill {
  height: 100%; background: var(--orange); border-radius: inherit;
  transition: transform var(--dur-med) var(--ease-out); transform-origin: left center;
}

/* ── Canvas ────────────────────────────────────────────────── */
.tco-canvas { padding: 36px 40px 32px; min-width: 0; }
.tco-eyebrow {
  font-size: .6875rem; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  color: var(--tco-accent-text); margin-bottom: 8px;
}
.tco-canvas h2 {
  font-size: 1.625rem; font-weight: 700; letter-spacing: -.02em; color: var(--navy); margin: 0 0 8px;
}
/* Focused programmatically on step change, not by tabbing, so no ring. */
#tco-step-heading:focus { outline: none; }
.tco-lede { font-size: .9375rem; line-height: 1.7; color: var(--muted); margin: 0 0 28px; }

@media (prefers-reduced-motion: no-preference) {
  .tco-step-panel { animation: tcoFadeUp 350ms var(--ease-out) both; }
}
@keyframes tcoFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── Fields ────────────────────────────────────────────────── */
.tco-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 680px; }
.tco-field { min-width: 0; }
.tco-field > label,
.tco-legend {
  display: block; font-size: .8125rem; font-weight: 600; color: var(--navy); margin-bottom: 6px;
}
.tco-optional { font-weight: 400; color: var(--muted); }
.tco-help { font-size: .75rem; line-height: 1.6; color: var(--muted); margin: 6px 0 0; }
.tco-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Matches .cf-field in pages.css - same border weight, radius and focus ring. */
.tco-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  font-family: inherit; font-size: .9375rem; color: var(--navy);
  background: var(--white); outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.tco-input::placeholder { color: var(--subtle); }
.tco-input:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tco-input--sm { padding: 8px 10px; font-size: .875rem; }
.tco-input--xs { padding: 7px 10px; font-size: .8125rem; }
.tco-input--narrow { width: 110px; }
.tco-input--money { width: 160px; }
select.tco-input { cursor: pointer; }

/* Segmented control */
.tco-seg {
  display: inline-flex; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden; background: var(--white);
}
.tco-seg button {
  padding: 9px 16px; border: none; cursor: pointer; font-family: inherit;
  font-size: .875rem; font-weight: 600; background: var(--white); color: var(--muted);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.tco-seg button:hover { background: var(--light); }
.tco-seg button[aria-checked="true"] { background: var(--navy); color: var(--white); }
.tco-seg button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.tco-seg--sm button { padding: 8px 13px; font-size: .8125rem; }

/* Toggle switch */
.tco-switch {
  width: 46px; height: 26px; flex: none; border: none; border-radius: var(--r-pill);
  background: rgba(40,60,80,.2); cursor: pointer; position: relative; padding: 0;
  transition: background var(--dur-base) var(--ease-std);
}
.tco-switch[aria-checked="true"] { background: var(--blue); }
.tco-switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tco-switch span {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--white);
  transition: transform var(--dur-base) var(--tco-spring);
}
.tco-switch[aria-checked="true"] span { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) {
  .tco-switch, .tco-switch span, .tco-progress-fill { transition: none; }
}

/* ── Panels and tables ────────────────────────────────────── */
.tco-panel {
  border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 18px 20px;
}
.tco-panel--proposed {
  border-color: var(--blue-ring); box-shadow: var(--elev-blue);
}
.tco-panel-title { font-size: .875rem; font-weight: 700; color: var(--navy); margin-bottom: 14px; }
.tco-panel-note { font-size: .8125rem; line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.tco-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.tco-sub { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.tco-sub-title { font-size: .8125rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.tco-sub-figure { font-weight: 600; color: var(--tco-confirm-text); }
.tco-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tco-mini-grid label {
  display: block; font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: 5px;
}

.tco-table { border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.tco-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tco-row {
  display: grid; gap: 12px; padding: 10px 18px; align-items: center;
  border-top: 1px solid var(--hairline);
}
.tco-row--head {
  padding: 12px 18px; background: var(--light); border-top: 0;
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.tco-row--equip { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; }
.tco-row--review { grid-template-columns: 2fr 1.2fr 1.4fr .6fr; }
.tco-row--bd { grid-template-columns: 2fr 1fr 1fr 1fr; padding: 11px 20px; }
.tco-row--total {
  border-top: 2px solid var(--navy); background: var(--light);
  padding: 13px 20px; font-weight: 700; color: var(--navy);
}
.tco-row[data-excluded="true"] { opacity: .45; }
.tco-cell-label { font-size: .875rem; font-weight: 600; color: var(--navy); }
.tco-cell-value { font-size: .875rem; color: var(--muted); }
.tco-num { text-align: right; font-variant-numeric: tabular-nums; }

.tco-totals-strip {
  display: flex; gap: 24px; flex-wrap: wrap; margin-top: 22px; padding: 14px 18px;
  background: var(--light); border-radius: var(--r-lg); max-width: 560px;
}
.tco-totals-strip dt {
  font-size: .6875rem; font-weight: 700; letter-spacing: .10em; text-transform: uppercase; color: var(--muted);
}
.tco-totals-strip dd {
  margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* Repeatable editors */
.tco-stack { display: flex; flex-direction: column; gap: 16px; }
.tco-card {
  border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 18px 20px;
  background: var(--white); box-shadow: var(--elev-1);
}
.tco-card-head { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.tco-card-head > *:first-child { flex: 1; min-width: 160px; }
.tco-colhead {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 10px; padding: 8px 0;
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.tco-catrow { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 10px; padding: 6px 0; align-items: center; }
.tco-catrow-label { font-size: .8125rem; font-weight: 600; color: var(--navy); }
.tco-tranche { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tco-tranche label { font-size: .75rem; color: var(--muted); font-weight: 600; }

.tco-btn-quiet {
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--white); color: var(--muted);
  font-family: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.tco-btn-quiet:hover { border-color: var(--orange); color: var(--tco-accent-text); }
.tco-btn-quiet:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tco-btn-add {
  align-self: flex-start; padding: 10px 18px;
  border: 1.5px dashed var(--line); border-radius: var(--r-sm);
  background: var(--white); color: var(--tco-confirm-text);
  font-family: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.tco-btn-add:hover { border-color: var(--blue); background: var(--blue-soft); }
.tco-btn-add:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tco-btn-link {
  border: none; background: none; color: var(--tco-confirm-text);
  font-family: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer;
  /* min-height keeps the hit target at 24px; the row is only 20px of text. */
  text-align: right; padding: 4px 0; min-height: 24px; text-decoration: underline; text-underline-offset: 2px;
}
.tco-btn-link:hover { color: var(--tco-accent-text); }
.tco-btn-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ── Badges, warnings, option rows ────────────────────────── */
.tco-pill {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--blue-soft); color: var(--tco-confirm-text); border: 1px solid var(--blue-ring);
  white-space: nowrap;
}
.tco-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.tco-dot[data-status="estimate"] { background: var(--orange); }
.tco-dot[data-status="excluded"] { background: var(--subtle); }
.tco-dot[data-status="quote-supported"],
.tco-dot[data-status="customer-confirmed"] { background: var(--blue); }

.tco-warnings { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.tco-warning {
  display: flex; gap: 10px; padding: 11px 14px; align-items: flex-start;
  background: var(--orange-soft); border: 1px solid var(--orange-ring); border-radius: var(--r-sm);
}
.tco-warning-mark { color: var(--tco-accent-text); font-weight: 800; font-size: .875rem; line-height: 1.5; }
.tco-warning p { font-size: .8125rem; line-height: 1.6; color: var(--navy); margin: 0; }

.tco-option {
  border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 16px 20px;
}
.tco-option-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tco-option-title { font-size: .875rem; font-weight: 700; color: var(--navy); }
.tco-option-tag {
  font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-left: 6px;
}
.tco-option p { font-size: .8125rem; line-height: 1.6; color: var(--muted); margin: 4px 0 0; }
.tco-note-blue { padding: 12px 14px; background: var(--blue-soft); border-radius: var(--r-sm); }
.tco-note-blue p { font-size: .75rem; line-height: 1.6; color: var(--muted); margin: 0; }
.tco-note-blue strong { color: var(--tco-confirm-text); }

/* ── Results ───────────────────────────────────────────────── */
.tco-results-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.tco-cards { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; margin-bottom: 20px; }
.tco-total-card { border-radius: var(--r-lg); padding: 20px 22px; }
.tco-total-card dt {
  font-size: .6875rem; font-weight: 700; letter-spacing: .10em; text-transform: uppercase; margin-bottom: 8px;
}
.tco-total-card dd {
  margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tco-total-card--current { background: var(--navy); }
.tco-total-card--current dt { color: var(--on-dark-3); }
.tco-total-card--current dd { color: var(--on-dark); }
.tco-total-card--proposed { background: var(--white); border: 1px solid var(--hairline); box-shadow: var(--elev-1); }
.tco-total-card--proposed dt { color: var(--muted); }
.tco-total-card--proposed dd { color: var(--navy); }
.tco-card-foot { font-size: .75rem; margin-top: 6px; }
.tco-total-card--current .tco-card-foot { color: var(--on-dark-2); }
.tco-total-card--proposed .tco-card-foot { color: var(--muted); }
/* Savings figure is 2rem/800, where full-brand orange passes AA as large text. */
.tco-total-card--delta { background: var(--orange-soft); border: 1px solid var(--orange-ring); }
.tco-total-card--delta dt { color: var(--tco-accent-text); }
.tco-total-card--delta dd { color: var(--orange-deep); }
.tco-total-card--delta[data-positive="false"] { background: var(--light); border-color: var(--hairline); }
.tco-total-card--delta[data-positive="false"] dt { color: var(--muted); }
.tco-total-card--delta[data-positive="false"] dd { color: var(--navy); }
.tco-delta-pct { font-size: 1rem; font-weight: 700; color: #98420F; }

.tco-chart-card {
  border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 20px 22px;
  margin-bottom: 20px; background: var(--white);
}
.tco-chart-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.tco-chart-title { font-size: .9375rem; font-weight: 700; color: var(--navy); }
.tco-legend { display: flex; gap: 18px; flex-wrap: wrap; }
.tco-legend span {
  display: flex; align-items: center; gap: 7px; font-size: .75rem; font-weight: 600; color: var(--muted);
}
.tco-swatch { width: 18px; height: 3px; border-radius: 2px; }
.tco-chart { width: 100%; height: auto; display: block; }
.tco-chart-wide { min-width: 560px; }
.tco-chart-caption { font-size: .75rem; color: var(--muted); margin: 0 0 12px; }
.tco-swipe-hint { display: none; font-size: .75rem; color: var(--muted); margin: 8px 0 0; }

.tco-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.tco-info-card {
  border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 18px 20px; background: var(--white);
}
.tco-info-card h3 { font-size: .875rem; font-weight: 700; color: var(--navy); margin: 0 0 10px; }
.tco-info-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.tco-info-card li, .tco-info-card p { font-size: .8125rem; line-height: 1.7; color: var(--muted); margin: 0; }

/* Capture band */
.tco-capture {
  background: var(--navy); border-radius: var(--r-lg); padding: 26px 28px;
  position: relative; overflow: hidden;
}
.tco-capture-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: center; }
.tco-capture-grid > * { min-width: 0; }
.tco-capture h3 {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; color: var(--on-dark); margin: 0 0 6px;
}
.tco-capture p { font-size: .875rem; line-height: 1.7; color: var(--on-dark-2); margin: 0; }
.tco-capture-form { display: flex; flex-direction: column; gap: 10px; }
.tco-capture-form label {
  font-size: .75rem; font-weight: 600; color: var(--on-dark-2);
}
.tco-input--dark {
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.35); color: var(--on-dark);
}
.tco-input--dark::placeholder { color: rgba(255,255,255,.5); }
.tco-input--dark:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30,130,190,.35); }
.tco-consent { display: flex; gap: 10px; align-items: flex-start; min-height: 24px; padding: 2px 0; cursor: pointer; }
.tco-consent input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--orange); flex: none; }
.tco-consent span { font-size: .75rem; line-height: 1.6; color: var(--on-dark-2); }
.tco-form-error {
  font-size: .8125rem; font-weight: 600; color: #FFC4A3;
  display: flex; gap: 8px; align-items: flex-start;
}
.tco-sent { display: flex; align-items: center; gap: 16px; }
.tco-sent-mark {
  width: 44px; height: 44px; flex: none; border-radius: 50%; background: rgba(30,130,190,.25);
  display: flex; align-items: center; justify-content: center; color: var(--on-dark);
}
.tco-sent h3 { font-size: 1.125rem; margin: 0; }
.tco-sent p { margin: 2px 0 0; }
.tco-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; }

/* ── Footer nav ────────────────────────────────────────────── */
.tco-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--hairline);
}
.tco-disclaimer {
  text-align: center; font-size: .75rem; line-height: 1.7; color: var(--muted);
  max-width: 720px; margin: 22px auto 0;
}
/* Phone-only row labels. Hidden by default: these spans exist in the markup at
   every width, and without this they render inline on desktop, printing
   "Current modelNone" into the breakdown table. */
.tco-stacked-label { display: none; }

.tco-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .tco { padding: 64px 0 72px; }
  .tco-grid { grid-template-columns: 1fr; min-height: 0; }
  .tco-rail { display: none; }
  .tco-progress { display: block; }
  .tco-canvas { padding: 24px 24px 28px; }
  /* The phone progress bar already states "Step N of 7", so the canvas
     eyebrow would print it a second time. */
  .tco-canvas .tco-eyebrow { display: none; }
  .tco-cards { grid-template-columns: 1fr; }
  .tco-capture-grid { grid-template-columns: 1fr; gap: 20px; }
  .tco-swipe-hint { display: block; }

  /* iOS Safari zooms the whole viewport when a focused input's font-size is
     under 16px. With ~60 numeric fields in this form that would jerk the page
     on every tap, so every input is exactly 16px below the desktop breakpoint
     - which is precisely the band where the touch layout applies. The viewport
     meta deliberately does NOT set maximum-scale: disabling pinch-zoom to dodge
     this would trade an accessibility feature for a layout convenience. */
  .tco-input,
  .tco-input--sm,
  .tco-input--xs,
  .tco-input--dark,
  select.tco-input { font-size: 16px; }
}

@media (max-width: 767px) {
  .tco { padding: 48px 0 64px; }
  .tco-intro { margin-bottom: 28px; }
  .tco-canvas { padding: 20px 16px 24px; }
  .tco-fields,
  .tco-two-col,
  .tco-info-grid,
  .tco-mini-grid { grid-template-columns: 1fr; gap: 16px; }
  .tco-input--narrow, .tco-input--money { width: 100%; }

  .tco-seg { width: 100%; }
  .tco-seg button { flex: 1; padding: 10px 8px; }

  /* Equipment and audit tables stop being grids and become stacked
     label/value pairs - a 4-column grid at 360px is unreadable. */
  .tco-row--equip,
  .tco-row--review,
  .tco-row--bd,
  .tco-row--total,
  .tco-colhead,
  .tco-catrow { grid-template-columns: 1fr; gap: 8px; }
  .tco-row--head, .tco-colhead { display: none; }
  .tco-row, .tco-catrow { padding: 14px 16px; }
  .tco-row--bd, .tco-row--total { padding: 14px 16px; }
  .tco-stacked-label {
    display: block; font-size: .6875rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
  }
  .tco-num { text-align: left; }
  .tco-btn-link { text-align: left; }

  /* Sticky action bar, so Continue is never buried under a long form. */
  .tco-nav {
    position: sticky; bottom: 0; margin-top: 24px; padding: 14px 16px;
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); margin-left: -16px; margin-right: -16px;
    z-index: 5;
  }
  .tco-nav .btn { flex: 1; justify-content: center; }
}

@media (max-width: 479px) {
  .tco-total-card dd { font-size: 1.75rem; }
  .tco-card-head > * { width: 100%; }
  /* The band is overflow:hidden, so anything that does not fit is clipped
     rather than scrollable. Give the padding back to the content. */
  .tco-capture { padding: 20px 16px; }
  /* .btn is nowrap by default; at this width the label has to be allowed to
     wrap or it sets a min-content floor wider than the band. */
  .tco-capture-form .btn { white-space: normal; width: 100%; }
  .tco-chart-card { padding: 16px 14px; }
  .tco-panel { padding: 14px 14px; }
  .tco-card { padding: 14px 14px; }
  .tco-option { padding: 14px 14px; }
  .tco-totals-strip { padding: 12px 14px; gap: 16px; }
}
