/* CaseReader — the price checker and request flow (#estimator.flow) and the shared
   waitlist form. Everything is scoped under .flow. Extends the tokens in brand.css.
   Motion is purposeful and skipped entirely under prefers-reduced-motion. */

.flow {
  --pad: clamp(18px, 3.2vw, 36px);
  --oxblood: #7a2e2a;
  --amber-bg: #f6ecd2;
  --amber-rule: #b8860b;
  --amber-ink: #5c4300;
  --line: #b9b4a6;
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #c9c4b8;
  border-radius: 2px;
  box-shadow: 0 30px 60px -48px rgba(14, 38, 32, 0.45);
  display: block;
  text-align: left;
}
.flow[data-state="loading"] .flow-side .action { min-height: 150px; }
.flow-c { container: flow / inline-size; }
.flow .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.flow p { margin: 0; }
.flow a:not(.btn) { color: inherit; }
.flow button:not(.btn) { font: inherit; }
.flow .tk { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 180ms ease-out; }

/* ---------- step rail ---------- */
.flow .rail {
  list-style: none; margin: 0; padding: 18px var(--pad) 16px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 22px;
  border-bottom: 1px solid var(--stone-2);
}
.flow .rail li { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-items: start; transition: opacity 0.3s; }
.flow .rail-n {
  grid-row: 1 / span 2; position: relative;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink-2);
  display: grid; place-items: center;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.flow .rail-d { font: 400 1.05rem/1 var(--display); transform: translateY(1px); transition: opacity 0.15s; }
.flow .rail-n .tk { position: absolute; left: 6px; top: 6px; }
.flow .rail-t { font: 600 0.9rem/1.3 var(--sans); padding-top: 1px; }
.flow .rail-s { font-size: 0.78rem; line-height: 1.35; color: var(--ink-3); }
.flow .rail li[aria-current="step"] .rail-n { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 3px rgba(232, 96, 122, 0.22); }
.flow .rail li.done .rail-n { background: var(--green); border-color: var(--green); color: var(--paper); }
.flow .rail li.done .rail-d { opacity: 0; }
.flow .rail li.done .tk { stroke-dashoffset: 0; }
/* Preview has three steps (documents, questions, an opening email), all at full contrast. */
.flow:is([data-state="preview"], [data-state="loading"]) .rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container flow (max-width: 620px) {
  .flow .rail, .flow:is([data-state="preview"], [data-state="loading"]) .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow:is([data-state="preview"], [data-state="loading"]) .rail li[data-step="3"] { grid-column: 1 / -1; }
}

/* Preview: say plainly what works today, above the picker. */
.flow .flow-note {
  margin: 0 0 16px; padding: 10px 14px;
  background: var(--stone); border-left: 3px solid var(--brass); border-radius: 0 2px 2px 0;
  font-size: 0.92rem; line-height: 1.5; color: var(--ink);
}
.flow .flow-note b { font-weight: 600; }
.flow[data-state="loading"] .flow-note { visibility: hidden; }

/* ---------- columns ---------- */
.flow .flow-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.flow .flow-main { padding: var(--pad); min-width: 0; }
.flow .flow-side { padding: var(--pad); min-width: 0; border-top: 1px solid var(--stone-2); }
/* Wide (the estimator has the full page width): documents left, a sticky price-and-send
   column right. */
@container flow (min-width: 900px) {
  .flow .flow-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .flow .flow-main { padding-right: 20px; border-right: 1px solid var(--stone-2); }
  .flow .flow-side {
    padding-left: 20px; border-top: 0; align-self: start;
    position: sticky;
    /* Taller than the window? Then it sticks by its bottom, so the button stays reachable. */
    top: min(96px, calc(100vh - var(--side-h, 0px) - 16px));
  }
}
/* Medium (beside the "Who checks your pack" panel): documents across the top, then the
   receipt on the left, sticky, beside the questions and the button. */
@container flow (min-width: 640px) and (max-width: 899.98px) {
  .flow .flow-side { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); column-gap: 28px; align-items: start; }
  .flow .flow-side > * { grid-column: 2; }
  .flow .flow-side > .quote { grid-column: 1; grid-row: 1 / span 8; position: sticky; top: 96px; }
  .flow .flow-side > .questions > .ask:first-child { margin-top: 0; }
  .flow .flow-side > .chat-branch { margin-top: 0; }
  .flow .flow-side > .chat-branch:not([hidden]) + .questions > .ask:first-child { margin-top: 26px; }
}

/* ---------- prefill chip ---------- */
.flow .prefill {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 14px; padding: 2px 2px 2px 14px;
  background: var(--stone); border: 1px solid var(--rule); border-radius: 2px;
  font-size: 0.9rem; max-width: 100%;
}
.flow .prefill::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; background: var(--tape); border-radius: 2px 0 0 2px; }
.flow .prefill-k { color: var(--ink-2); }
.flow .prefill-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.flow .prefill-x {
  flex: none; width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; font-size: 1.2rem; color: var(--ink-2); border-radius: 2px;
}
.flow .prefill-x:hover { color: var(--ink); background: var(--stone-2); }

/* ---------- drop ---------- */
.flow .drop {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 6px;
  min-height: 176px; padding: 24px 22px; text-align: center;
  background: #fff; border: 1.5px dashed #8a857a; border-radius: 2px; cursor: pointer;
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out), border-color 0.2s, background-color 0.2s, min-height 0.3s var(--ease);
}
.flow .drop:hover { border-color: var(--tape-ink); background: #fffafb; }
.flow .drop:focus-within { outline: none; }
.flow .drop:has(input:focus-visible) { outline: 2px solid var(--tape-ink); outline-offset: 3px; }
.flow .drop input { position: absolute; inset: auto; left: 50%; top: 50%; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.flow .drop-ic { width: 32px; height: 32px; color: var(--tape-ink); transition: transform 0.28s var(--ease-out); }
.flow .drop-h { display: block; font: 400 1.45rem/1.2 var(--serif); margin-top: 4px; }
.flow .drop-h .long { display: inline; }
.flow .drop-h .short, .flow .drop-h .release { display: none; }
.flow .drop-help { display: block; max-width: 46ch; color: var(--ink-3); font-size: 0.9rem; line-height: 1.5; }
@media (max-width: 600px) {
  .flow .drop-h .long { display: none; }
  .flow .drop-h .short { display: inline; }
}
/* The tape strip that appears across the corner while files are over the page. */
.flow .drop::before {
  content: ""; position: absolute; left: -9px; top: 9px; width: 46px; height: 13px;
  background: var(--tape); transform: rotate(-40deg) scaleX(0.4); transform-origin: 50% 50%;
  opacity: 0; transition: opacity 0.2s, transform 0.28s var(--ease-out);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
.flow.dragging .drop {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -30px rgba(14, 38, 32, 0.45);
  border: 1.5px solid var(--ink); background: #fff;
}
.flow.dragging .drop::before { opacity: 1; transform: rotate(-40deg); }
.flow.dragging .drop-ic { transform: translateY(-3px); }
.flow.dragging .drop-h .long, .flow.dragging .drop-h .short { display: none; }
.flow.dragging .drop-h .release { display: inline; }
.flow.locked .drop { opacity: 0.55; cursor: default; pointer-events: none; }

/* ---------- how pages are counted ---------- */
.flow .counting { margin-top: 14px; font-size: 0.9rem; color: var(--ink-2); }
.flow .counting summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer;
  list-style: none; font-weight: 500; color: var(--ink);
}
.flow .counting summary::-webkit-details-marker { display: none; }
.flow .counting summary::before {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.2s var(--ease); margin-right: 2px;
}
.flow .counting[open] summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.flow .counting summary:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.flow .counting ul { list-style: none; margin: 0 0 6px; padding: 12px 16px; background: var(--stone); border-left: 2px solid var(--rule); display: grid; gap: 6px; line-height: 1.5; }
.flow .counting li:last-child { color: var(--ink-3); font-style: italic; font-family: var(--serif); }
.flow .counting b { font-weight: 600; color: var(--ink); }

/* ---------- ledger ---------- */
/* Two ruled lines are always reserved, and the footer is always there, so the first files
   fill space that already exists instead of pushing the price and questions down. */
.flow .ledger { --slot: 62px; position: relative; }
.flow .ledger-files {
  list-style: none; margin: 8px 0 0; padding: 0; min-height: calc(var(--slot) * 2);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--slot) - 1px), var(--rule) calc(var(--slot) - 1px) var(--slot));
}
.flow .ledger-empty {
  position: absolute; left: 0; right: 0; top: 8px; height: calc(var(--slot) - 1px);
  display: flex; align-items: center; pointer-events: none;
  font: italic 400 0.98rem/1.3 var(--serif); color: var(--ink-3);
}
.flow[data-has="yes"] .ledger-empty { visibility: hidden; }
.flow .lf { background: var(--paper); }
.flow .lf {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr;
  gap: 0; padding: 0; overflow: hidden;
  border-bottom: 1px solid var(--rule);
  transition: grid-template-rows 220ms var(--ease), opacity 220ms var(--ease), border-color 220ms;
}
.flow .lf.out { grid-template-rows: 0fr; opacity: 0; border-bottom-color: transparent; }
.flow .lf.out .lf-in { min-height: 0; }
.flow .lf-in {
  position: relative; min-height: calc(var(--slot) - 1px); overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; column-gap: 12px; row-gap: 1px; align-items: center;
  padding: 11px 0;
}
.flow .lf-name { grid-column: 1; grid-row: 1; font: 500 14px/1.4 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow .lf-detail { grid-column: 1; grid-row: 2; font-size: 0.84rem; line-height: 1.45; color: var(--ink-3); }
.flow .lf-pages, .flow .lf-pct { grid-column: 2; grid-row: 1 / span 2; font: 500 1.05rem/1 var(--mono); font-variant-numeric: tabular-nums; text-align: right; min-width: 2ch; }
.flow .lf-pct { display: none; font-size: 0.9rem; color: var(--green); }
.flow .lf.up .lf-pages { display: none; }
.flow .lf.up .lf-pct { display: block; }
.flow .lf-x {
  grid-column: 3; grid-row: 1 / span 2; justify-self: end;
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--ink-3); border-radius: 2px;
}
.flow .lf-x span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 2px; font-size: 1.3rem; line-height: 1; transition: background-color 0.15s, color 0.15s; }
.flow .lf-x:hover span { background: var(--stone); color: var(--ink); }
.flow .lf-x:disabled { opacity: 0.35; cursor: default; }
.flow .lf-x:disabled:hover span { background: none; }
.flow .lf-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; pointer-events: none; }
.flow .lf-bar i { display: block; height: 100%; background: var(--ink-3); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.18s linear; }
.flow .lf.measuring .lf-bar { background: var(--stone-2); }
.flow .lf.measuring .lf-detail::after {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 8px; vertical-align: -1px;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: flow-spin 0.8s linear infinite;
}
.flow .lf.up .lf-bar { height: 3px; background: var(--stone-2); }
.flow .lf.up .lf-bar i { background: var(--green); }
.flow .lf.err .lf-in { padding-left: 12px; }
.flow .lf.err .lf-in::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--oxblood); }
.flow .lf.err .lf-detail { color: var(--oxblood); }
.flow .lf.err .lf-name { color: var(--ink-2); }
@keyframes flow-spin { to { transform: rotate(360deg); } }

.flow .files-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 18px; margin-top: 8px; }
.flow[data-has="no"] .clear-files { visibility: hidden; }
.flow .private { display: flex; gap: 8px; align-items: flex-start; max-width: 50ch; font-size: 0.84rem; line-height: 1.5; color: var(--green); }
.flow .private svg { flex: none; margin-top: 3px; }
.flow .clear-files {
  min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  color: var(--ink-2); font-size: 0.86rem; text-decoration: underline; text-underline-offset: 0.2em;
}
.flow .clear-files:hover { color: var(--ink); text-decoration-color: var(--tape-ink); }
.flow .clear-files:disabled { opacity: 0.4; cursor: default; }
.flow .drop-msg { font-size: 0.9rem; color: var(--ink-2); margin-top: 8px; }
.flow .drop-msg:empty { display: none; }
.flow .drop-msg[data-tone="warn"] { color: var(--oxblood); padding-left: 12px; border-left: 3px solid var(--oxblood); }
.flow .drop-msg a, .flow .field-err a { font-weight: 600; }

/* inline field errors */
.flow .field-err { position: relative; margin-top: 8px; padding-left: 22px; font-size: 0.9rem; line-height: 1.45; color: var(--oxblood); }
.flow .field-err::before {
  content: "!"; position: absolute; left: 0; top: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--oxblood); color: #fff; font: 700 0.66rem/15px var(--sans); text-align: center;
}

/* ---------- page meter ---------- */
.flow .pmeter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 30px; margin-top: 26px; }
.flow .pm-fig { position: relative; padding: 22px 96px 0 0; }
.flow .pm-cap {
  position: absolute; left: 0; top: 0; width: 167px; padding-bottom: 5px;
  font: 600 0.66rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--green);
  border-bottom: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
}
.flow .pm-cells { display: grid; grid-template-columns: repeat(10, 14px); grid-auto-rows: 18px; gap: 3px; }
.flow .pm-extra {
  position: absolute; left: 177px; top: 43px; line-height: 18px; white-space: nowrap;
  font: 600 0.78rem/18px var(--sans); color: var(--tape-ink); font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateX(-4px); transition: opacity 0.24s, transform 0.24s var(--ease-out);
}
.flow .pm-extra::before { content: ""; display: inline-block; width: 8px; height: 1px; background: currentColor; vertical-align: middle; margin-right: 6px; }
.flow .pmeter.has-extra .pm-extra { opacity: 1; transform: none; }
.flow .pm-key { display: grid; gap: 2px; padding-bottom: 2px; }
.flow .pm-n { font: 400 2.3rem/1 var(--display); font-variant-numeric: tabular-nums; }
.flow .pm-l { font-size: 0.86rem; color: var(--ink-2); }
.flow .pm-split { font-size: 0.8rem; color: var(--ink-3); }
.flow .pm-over { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 0.88rem; color: var(--ink-2); }
.flow .pm-over a { font-weight: 600; }

.flow .pc {
  position: relative; display: block; width: 14px; height: 18px;
  background-color: var(--paper); box-shadow: inset 0 0 0 1px var(--rule);
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 0 100%);
  background-repeat: no-repeat; background-position: 50% 9px; background-size: 6px 6px;
  transition: background-color 0.16s;
}
.flow .pc::after { content: ""; position: absolute; top: 0; right: 0; width: 4px; height: 4px; background: var(--rule); clip-path: polygon(0 0, 0 100%, 100% 100%); }
.flow .pc.inc { background-color: color-mix(in srgb, var(--green) 18%, var(--paper)); box-shadow: none; }
.flow .pc.inc::after { background: color-mix(in srgb, var(--green) 34%, var(--paper)); }
.flow .pc[data-f="in"] { background-color: var(--green); box-shadow: none; }
.flow .pc[data-f="in"]::after { background: #123d2a; }
.flow .pc[data-f="ex"] { background-color: var(--tape); box-shadow: none; }
.flow .pc[data-f="ex"]::after { background: #b8455c; }
.flow .pc[data-k="image"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M0 1.6h1.3L1.9.8h2.2l.6.8H6v3.6H0zM3 2.4a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E"); }
.flow .pc[data-k="video"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 6'%3E%3Cpath fill='%23fff' d='M1.4.6v4.8L5.4 3z'/%3E%3C/svg%3E"); }
.flow .pc.pop { animation: flow-pop 240ms var(--ease-out); }
@keyframes flow-pop { from { transform: translateY(-3px) scale(0.6); } to { transform: none; } }

/* ---------- quote ---------- */
.flow .quote {
  container: quote / inline-size;
  background: #fff; border: 1px solid var(--rule); border-radius: 2px;
  padding: 16px 20px 18px; box-shadow: 0 20px 40px -36px rgba(14, 38, 32, 0.55);
}
.flow .q { margin: 0; }
.flow .q-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 0.94rem; }
.flow .q-row dt { color: var(--ink-2); }
.flow .q-row dd { margin: 0; font: 500 0.95rem/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.flow .q-tag {
  display: inline-block; margin-left: 6px; padding: 3px 5px 2px; vertical-align: 1px;
  font: 600 0.6rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase;
  color: #7a5307; border: 1px solid currentColor; border-radius: 2px;
}
/* Always on the receipt: muted at £0, ink once pages pass the included ten. */
.flow .q-extra-row dt, .flow .q-extra-row dd { color: var(--ink-3); transition: color 240ms var(--ease); }
.flow .q-extra-row.open dt { color: var(--ink-2); }
.flow .q-extra-row.open dd { color: var(--ink); }
.flow .q-row > * { min-width: 0; }
.flow .q-total-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 18px 0 8px; border-bottom: 2px solid var(--ink); }
.flow .q-total-row > * { min-width: 0; }
.flow .q-total-label { display: grid; font: 400 1.25rem/1.2 var(--serif); padding-bottom: 4px; }
.flow .q-total-label > span { grid-area: 1 / 1; opacity: 0; transition: opacity 0.24s; }
.flow .q-total-label > span.on { opacity: 1; }
.flow .q-total-row dd.q-total { display: block; gap: 0; }
.flow .q-total { margin: 0; text-align: right; font: 600 2.4rem/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
/* A narrow receipt (beside the questions, or zoomed): the label sits above the amount. */
@container quote (max-width: 300px) {
  .flow .q-total-row { display: grid; justify-content: stretch; align-items: end; gap: 6px; }
  .flow .q-total-label { padding-bottom: 0; }
  .flow .q-total { justify-self: end; }
}
.flow .q-fine { margin-top: 12px; font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.flow .q-launch { margin-top: 4px; font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); }
.flow .q-request { margin-top: 12px; padding: 10px 12px; background: #eef4f0; border-left: 3px solid var(--green); font-size: 0.88rem; line-height: 1.5; color: #143d2b; }
.flow .ticket {
  position: relative; margin-top: 14px; padding: 12px 16px 12px 24px;
  display: grid; gap: 3px; background: #f3efe4; border-radius: 0 2px 2px 0;
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 3.5px, #000 4px) 0 0 / 100% 12px repeat-y;
  mask: radial-gradient(circle at 0 50%, transparent 3.5px, #000 4px) 0 0 / 100% 12px repeat-y;
}
.flow .ticket::before { content: ""; position: absolute; left: 12px; top: 10px; bottom: 10px; border-left: 1px dashed #b5ab92; }
.flow .t-k { font-size: 0.8rem; color: var(--ink-2); }
.flow .t-day { font: 400 1.2rem/1.2 var(--display); }
.flow .t-time { font: 600 0.98rem/1.2 var(--sans); font-variant-numeric: tabular-nums; }

/* ---------- questions: radio cards ---------- */
.flow .ask { margin: 26px 0 0; padding: 0; border: 0; min-width: 0; }
.flow .ask:disabled { opacity: 0.6; }
.flow .ask legend { padding: 0; margin-bottom: 10px; font: 500 1rem/1.45 var(--sans); }
.flow .opts { display: grid; gap: 8px; }
.flow .opts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
.flow .opts-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 92px), 1fr)); }
.flow .opts-3 .opt { padding-inline: 10px; gap: 8px; white-space: nowrap; font-size: 0.93rem; }
.flow .opts-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); }
.flow .opt {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 12px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 2px;
  font-size: 0.95rem; line-height: 1.3;
  transition: border-color 0.15s, background-color 0.15s;
}
.flow .opt:hover { border-color: var(--ink-2); }
.flow .opt input { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin: -9px 0 0; opacity: 0; accent-color: var(--green); }
.flow .opt-box {
  flex: none; position: relative; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid #8a857a; background: #fff; color: #fff;
  display: grid; place-items: center; transition: background-color 0.15s, border-color 0.15s;
}
.flow .opt:has(input:checked) { border-color: var(--ink); background: var(--stone); }
.flow .opt:has(input:checked) .opt-box { background: var(--ink); border-color: var(--ink); }
.flow .opt:has(input:checked) .tk { stroke-dashoffset: 0; }
.flow .opt:has(input:focus-visible) { outline: 2px solid var(--tape-ink); outline-offset: 2px; }
.flow .opt:has(input[aria-invalid="true"]) { border-color: var(--oxblood); }
.flow .ask-help { margin-top: 10px; font-size: 0.9rem; line-height: 1.5; color: var(--ink-2); }
.flow .ask-help a { font-weight: 600; }

/* checkbox lines */
.flow .check { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); position: relative; }
.flow .check input { position: absolute; left: 0; top: 8px; width: 20px; height: 20px; margin: 0; opacity: 0; accent-color: var(--green); }
.flow .chk-box {
  flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 2px;
  border: 1px solid #8a857a; background: #fff; color: #fff;
  display: grid; place-items: center; transition: background-color 0.15s, border-color 0.15s;
}
.flow .check:has(input:checked) .chk-box { background: var(--ink); border-color: var(--ink); }
.flow .check:has(input:checked) .tk { stroke-dashoffset: 0; }
.flow .check:has(input:focus-visible) .chk-box { outline: 2px solid var(--tape-ink); outline-offset: 2px; }
.flow .check:has(input[aria-invalid="true"]) .chk-box { border-color: var(--oxblood); box-shadow: 0 0 0 1px var(--oxblood); }
.flow .check a { color: var(--ink); font-weight: 500; }

/* the deadline warning (amber) */
.flow .urgent {
  margin-top: 12px; padding: 14px 16px 10px;
  background: var(--amber-bg); border-left: 3px solid var(--amber-rule); border-radius: 0 2px 2px 0;
  color: var(--amber-ink); font-size: 0.92rem; line-height: 1.5;
}
.flow .urgent strong { display: block; margin-bottom: 2px; font-weight: 600; color: var(--amber-ink); }
.flow .urgent .check { color: var(--amber-ink); margin-top: 6px; }
.flow .urgent .chk-box { border-color: #9a7a2a; }
.flow .urgent .field-err { margin-bottom: 4px; }
.flow .urgent p { margin: 0 0 4px; }
.flow .urgent a { color: var(--amber-ink); font-weight: 600; }

.flow .agree { margin-top: 20px; display: grid; gap: 4px; }

/* notes */
.flow .notes-field { margin-top: 16px; }
.flow .notes-field summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; font-weight: 500; }
.flow .notes-field summary::-webkit-details-marker { display: none; }
.flow .notes-field summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 2px; font-weight: 400; line-height: 1; transition: transform 0.2s var(--ease); }
.flow .notes-field[open] summary::before { content: "−"; }
.flow .notes-field small { font-weight: 400; color: var(--ink-3); font-size: 0.86rem; }
.flow .notes-field textarea {
  display: block; width: 100%; min-height: 96px; margin-top: 6px; padding: 12px;
  border: 1px solid #8a857a; border-radius: 2px; background: #fff; resize: vertical;
  font: 400 0.96rem/1.5 var(--sans); color: var(--ink);
}
.flow .notes-field textarea:focus-visible { outline: 2px solid var(--tape-ink); outline-offset: 2px; border-color: var(--ink); }
.flow .notes-field .hint { margin-top: 6px; font-size: 0.84rem; color: var(--ink-3); }

/* ---------- readiness + action ---------- */
.flow .ready-line { display: flex; align-items: center; gap: 10px; margin: 24px 0 10px; font-size: 0.86rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.flow .pips { display: inline-flex; gap: 3px; }
.flow .pips i { display: block; width: 8px; height: 10px; background: var(--rule); clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 3px, 100% 100%, 0 100%); transition: background-color 0.2s; }
.flow .pips i.on { background: var(--green); }
.flow .ready-line.ready .ready-t { color: var(--green); font-weight: 600; }

.flow .go { width: 100%; justify-content: center; text-align: center; min-height: 56px; padding: 12px 18px; line-height: 1.25; position: relative; }
.flow .go[aria-disabled="true"] { --bg: var(--stone-2); --fg: var(--ink-2); box-shadow: none; transform: none; }
.flow .go[aria-disabled="true"]:hover { box-shadow: none; transform: none; }
.flow .go:disabled { opacity: 1; cursor: progress; transform: none; box-shadow: none; }
.flow .go-spin { display: none; width: 14px; height: 14px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: flow-spin 0.8s linear infinite; }
.flow .go.busy .go-spin { display: inline-block; }

.flow .up-status { margin-top: 12px; }
.flow .up-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.flow .up-cancel { min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; font-size: 0.88rem; color: var(--ink-2); }
.flow .up-cancel:hover { color: var(--ink); }
.flow progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 0; background: var(--stone-2); -webkit-appearance: none; appearance: none; }
.flow progress::-webkit-progress-bar { background: var(--stone-2); }
.flow progress::-webkit-progress-value { background: var(--green); transition: width 0.2s linear; }
.flow progress::-moz-progress-bar { background: var(--green); }

.flow .reload { margin-top: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; background: #f7edeb; border-left: 3px solid var(--oxblood); font-size: 0.9rem; line-height: 1.45; color: var(--oxblood); }
.flow .reload p { flex: 1 1 200px; }
.flow .btn.ghost { --bg: transparent; --fg: var(--ink); min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); box-shadow: none; }
.flow .btn.ghost:hover { --bg: #fff; box-shadow: none; }

.flow .est-msg { margin-top: 12px; font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); min-height: 1.5em; }
.flow .est-msg[data-tone="warn"] { color: var(--oxblood); }

/* ---------- waitlist (preview) ---------- */
.flow .waitlist { display: grid; gap: 8px; }
.flow .wl-label { font: 400 1.2rem/1.3 var(--serif); }
.flow .wl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.flow .wl-row input {
  flex: 999 1 200px; min-width: 0; min-height: 52px; padding: 0 14px;
  border: 1px solid #8a857a; border-radius: 2px; background: #fff; color: var(--ink);
  font: 400 1rem/1.2 var(--sans);
}
.flow .wl-row input:focus-visible { outline: 2px solid var(--tape-ink); outline-offset: 2px; border-color: var(--ink); }
.flow .wl-row input[aria-invalid="true"] { border-color: var(--oxblood); }
.flow .wl-go { flex: 1 0 auto; justify-content: center; }
.flow .wl-go.busy { cursor: progress; }
.flow .wl-small { font-size: 0.82rem; line-height: 1.5; color: var(--ink-3); }
.flow .wl-msg { font-size: 0.9rem; line-height: 1.5; }
.flow .wl-msg:empty { display: none; }
.flow .wl-msg[data-tone="warn"] { color: var(--oxblood); }
.flow .wl-msg a { font-weight: 600; }
.flow .wl-done { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: #e6f0ea; border-left: 3px solid var(--green); font-size: 0.95rem; line-height: 1.5; color: #143d2b; outline: none; }
.flow .wl-tick { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.flow .wl-tick circle, .flow .wl-tick path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.flow .wl-done.in .wl-tick circle { stroke-dashoffset: 0; transition: stroke-dashoffset 400ms ease-out; }
.flow .wl-done.in .wl-tick path { stroke-dashoffset: 0; transition: stroke-dashoffset 200ms ease-out 400ms; }

/* ---------- confirmation ---------- */
.flow .sent { display: grid; justify-items: start; gap: 14px; padding: clamp(36px, 6vw, 72px) var(--pad); max-width: 64ch; opacity: 0; transition: opacity 240ms ease-out; }
.flow .sent.in { opacity: 1; }
.flow .sent h3 { font: 400 clamp(1.7rem, 3.2vw, 2.4rem)/1.12 var(--display); letter-spacing: -0.01em; outline: none; }
.flow .sent p { color: var(--ink-2); line-height: 1.6; }
.flow .sent .btn { margin-top: 8px; }
.flow .sent-tick { width: 52px; height: 52px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flow .sent-tick circle, .flow .sent-tick path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.flow .sent.in .sent-tick circle { stroke-dashoffset: 0; transition: stroke-dashoffset 400ms ease-out; }
.flow .sent.in .sent-tick path { stroke-dashoffset: 0; transition: stroke-dashoffset 200ms ease-out 400ms; }

/* ---------- intake conversation: a collapsed, optional branch after the price ---------- */
.flow .chat-branch { container: cb / inline-size; position: relative; margin-top: 18px; }
.flow .flow-main > .chat-branch { margin-top: 26px; }
.flow .cb { background: #fff; border: 1px solid var(--rule); border-radius: 2px; }
.flow .cb-sum {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
  min-height: 64px; padding: 11px 14px; cursor: pointer; list-style: none; border-radius: 2px;
  transition: background-color 0.15s;
}
.flow .cb-sum::-webkit-details-marker { display: none; }
.flow .cb-sum:hover { background: #fffafb; }
.flow .cb-sum:focus-visible { outline: 2px solid var(--tape-ink); outline-offset: 2px; }
.flow .cb-ic { width: 22px; height: 22px; fill: none; stroke: var(--tape-ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.2s; }
.flow .cb-txt { display: grid; gap: 1px; min-width: 0; }
.flow .cb-t { font: 400 1.08rem/1.3 var(--serif); color: var(--ink); }
.flow .cb-opt { font: 400 0.84rem/1 var(--sans); color: var(--ink-3); }
.flow .cb-s { font-size: 0.84rem; line-height: 1.45; color: var(--ink-3); }
@container cb (max-width: 520px) { .flow .cb-s { min-height: calc(2 * 1.45em); } }
.flow .cb-open { font-size: 0.86rem; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--tape-ink); }
.flow .cb-c { display: none; }
.flow .cb[open] .cb-o { display: none; }
.flow .cb[open] .cb-c { display: inline; }
.flow .cb[open] > .cb-sum { border-bottom: 1px solid var(--stone-2); border-radius: 2px 2px 0 0; }
.flow .chat-branch.waiting .cb-sum { cursor: default; }
.flow .chat-branch.waiting .cb-sum:hover { background: none; }
.flow .chat-branch.waiting .cb-ic { stroke: var(--ink-3); }
.flow .chat-branch.waiting .cb-open { visibility: hidden; }
/* Open, the branch is one card: the conversation sits flush inside it, not as a card in a card. */
.flow .cb-body { padding: 0; }
.flow .cb .cx-intro, .flow .cb .cx-live { border: 0; border-radius: 0 0 2px 2px; box-shadow: none; }
.flow .cb .cx-head { background: #fffdf8; }
/* Opened, the summary already names the conversation, so the chat card's own kicker and
   heading step back (the heading stays for screen readers: it labels #intake-chat). */
.flow .cb .cx-intro .cx-kicker { display: none; }
.flow .cb .cx-intro .cx-h,
.flow .cb .cx-head .cx-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* ...and the conversation's own header becomes a quiet byline under that one heading. */
.flow .cb .cx-head .cx-sub { margin: 0 !important; font-size: 0.84rem; color: var(--ink-2); }
.flow .cb .cx-who img { width: 22px; height: 22px; }
.flow .flow-side > .chat-branch { margin: 18px 0 0; }
.flow .flow-side > .chat-branch:not([hidden]) + .questions > .ask:first-child { margin-top: 26px; }
.flow .cb .chat-host { margin: 0; }
.flow .chat-host:empty { display: none; }
.flow .cb-skip { margin: 0; padding-top: 8px; }
.flow .cb-skip-b {
  min-height: 44px; padding: 0 2px; border: 0; background: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--tape-ink);
}
.flow .cb-skip-b:hover { text-decoration-thickness: 2px; }
/* The way out sits in the flow under the card and never floats over it. On two columns the
   receipt, questions and button stay in view beside the chat; phones have the continue bar. */

/* ---------- mobile continue bar (appended to <body> by estimate.js) ---------- */
.flow-mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding: 0 16px env(safe-area-inset-bottom, 0px);
  display: flex; align-items: center; justify-content: center;
  border: 0; border-top: 1px solid var(--night-line); border-radius: 0;
  background: var(--night); color: var(--on-night); cursor: pointer;
  font: 600 0.98rem/1 var(--sans); font-variant-numeric: tabular-nums;
  box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, 0.5);
  transform: translateY(100%); visibility: hidden;
  transition: transform 300ms ease-out, visibility 0s linear 300ms;
}
.flow-mbar.show { transform: none; visibility: visible; transition: transform 300ms ease-out, visibility 0s; }
.flow-mbar:focus-visible { outline: 2px solid var(--on-night); outline-offset: -4px; }
.flow-mbar .mbar-v { display: inline-block; }
@media (min-width: 700px) { .flow-mbar { display: none; } }

/* ---------- compact light variant (used on /app for the waitlist) ---------- */
.flow.flow-lite { background: none; border: 0; box-shadow: none; }

/* ---------- reduced motion: final states, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .flow *, .flow *::before, .flow *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
  .flow.dragging .drop, .flow.dragging .drop-ic { transform: none; }
  .flow-mbar, .flow-mbar.show { transition: none; }
}
