/* Scroll lab: the finale CTA frame (final.js). A panel like the case block: the grid keeps the page's columns and the
 * panel is drawn 40 px outside it, so the side column (and the dock at its top) sits exactly on the route's lane. */
.fcta { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--side); grid-template-areas: "head side" "body side"; grid-template-rows: auto 1fr; gap: var(--space-lg) var(--gap-columns); align-items: start; margin: 0; }
.fcta::before { content: ""; position: absolute; inset: -40px; z-index: -1; border-radius: var(--radius-window); background: var(--color-paper-2); box-shadow: inset 0 0 0 1px var(--color-rule); }
.fcta__head { grid-area: head; display: grid; gap: var(--space-sm); align-content: start; }
.fcta__body { grid-area: body; display: grid; gap: var(--space-lg); align-content: start; min-width: 0; }
.fcta__side { grid-area: side; display: grid; justify-items: center; gap: 14px; align-content: start; }
.fcta__title { max-width: 18ch; margin: 0; font-size: clamp(2rem, 2.2vw + 1rem, 3.25rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1.04; text-wrap: balance; }
.fcta__title--sm { font-size: clamp(1.5rem, 1vw + 1rem, 2rem); color: var(--color-muted); }
.fcta__lede { max-width: 46ch; margin: 0; color: var(--color-ink-2); font-size: 1.0625rem; text-wrap: pretty; }
.fcta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.fcta__actions .fbtn { border: 0; font: inherit; font-weight: 500; cursor: pointer; }
.fcta__pick { color: var(--color-muted); font-size: var(--text-sm); }
.fcta__fine { margin: 0; color: var(--color-muted); font-size: 13px; }
.fcta__fine a { color: var(--color-ink-2); }
.fcta__cap { width: 288px; margin: 0; color: var(--color-muted); font-size: 13px; line-height: 1.4; }
.fcta .fbtn { border: 0; font-family: inherit; font-size: inherit; cursor: pointer; }

/* the dock: the Invoice stops here; it holds a still copy of the card (hidden under the rider on the live scroll) */
.fcta__dock { position: relative; display: grid; width: 288px; }
.fcta__copy { display: grid; }
.fcta__layer { grid-area: 1 / 1; }
.fcta__layer .o-station { box-shadow: 0 0 0 1px var(--color-rule), var(--shadow-card); }
html[data-variant="f"]:not(.is-phone):not(.is-reduced) .fcta__copy { visibility: hidden; }

/* fields */
.fcta input, .fcta textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-grid); color: var(--color-ink); font: 400 15px/1.35 var(--font-body); }
.fcta textarea { resize: vertical; }
.fcta input::placeholder, .fcta textarea::placeholder { color: #8794a2; }
.fcta input:focus-visible, .fcta textarea:focus-visible, .fcta button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.fform { display: grid; gap: 14px; width: 288px; }
.fform .fbtn { justify-self: start; }
.fform--row { grid-template-columns: repeat(2, minmax(0, 1fr)); width: auto; max-width: 560px; }
.ffield { display: grid; gap: 6px; min-width: 0; }
.ffield > span { font-size: 13px; font-weight: 500; color: var(--color-ink-2); }

/* B: what happens next */
.fsteps { display: grid; gap: 12px; max-width: 440px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.fsteps li { position: relative; padding-left: 40px; color: var(--color-ink-2); font-size: 15px; line-height: 1.45; counter-increment: s; }
.fsteps li::before { content: counter(s); position: absolute; top: -2px; left: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); color: var(--color-ink); font-size: 13px; font-weight: 500; }
.fsteps b { color: var(--color-ink); font-weight: 500; }

/* chips: checkboxes that look like pills */
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { position: relative; display: inline-flex; }
.fchip input, .ftile input, .fslot input, .fcheck input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.fchip span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-grid); font-size: 13.5px; font-weight: 500; }
.fchip input:checked + span { background: var(--color-primary); color: var(--color-primary-ink); box-shadow: none; }
.fchip input:focus-visible + span, .fslot input:focus-visible + span, .fcheck input:focus-visible ~ .fcheck__box, .ftile:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* A: calculator */
.fcalc { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)) minmax(0, 1fr); align-items: end; gap: 20px; }
.fstep { display: grid; gap: 6px; }
.fstep__label { font-size: 13px; font-weight: 500; color: var(--color-ink-2); }
.fstep__unit { font-size: 13px; color: var(--color-muted); }
.fstep__box { display: inline-grid; grid-template-columns: 44px 72px 44px; border-radius: 12px; background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-grid); }
.fstep__box button { min-height: 52px; border: 0; background: transparent; color: var(--color-ink); font: 400 20px/1 var(--font-body); cursor: pointer; border-radius: 12px; }
.fstep__box button:hover { background: var(--color-paper-2); }
.fcta .fstep__box input { min-height: 52px; padding: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: center; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.fstep__box input::-webkit-inner-spin-button, .fsent__in::-webkit-inner-spin-button { -webkit-appearance: none; }
.fcalc__out { display: grid; gap: 2px; align-self: stretch; align-content: end; padding-bottom: 20px; }
.fcalc__out b { font-size: clamp(2.5rem, 2vw + 1.5rem, 3.5rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.fcalc__out span { color: var(--color-muted); font-size: 13px; }
.fcalc__out[data-empty] b { color: var(--color-grid); }

/* D: the sentence with its blanks inside */
.fsent { max-width: 24ch; margin: 0; font-size: clamp(1.75rem, 2vw + 1rem, 2.75rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.35; }
.fcta .fsent__in { display: inline-block; width: auto; min-height: 0; padding: 0 4px; border-radius: 0; background: transparent; box-shadow: inset 0 -2px 0 var(--color-accent); font: inherit; letter-spacing: inherit; color: var(--color-accent-wash-ink); vertical-align: baseline; -moz-appearance: textfield; }
.fcta .fsent__in::placeholder { color: #9fadbc; }

/* E: the mini calendar */
.fcal { display: grid; gap: 12px; width: min(100%, 440px); padding: 16px; border-radius: 16px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule), var(--shadow-card); }
.fcal__head { font-size: 13px; font-weight: 500; color: var(--color-muted); }
.fcal__days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fcal__day { display: grid; gap: 6px; align-content: start; justify-items: stretch; text-align: center; }
.fcal__dname { font-size: 12px; color: var(--color-muted); }
.fcal__day b { font-size: 22px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fslot { position: relative; display: grid; }
.fslot span { display: grid; place-items: center; min-height: 40px; border-radius: 10px; background: var(--color-paper-2); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fslot input:checked + span { background: var(--color-primary); color: var(--color-primary-ink); }

/* F: the checks */
.fchecks { display: grid; gap: 8px; max-width: 520px; }
.fcheck { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px 8px 10px; border-radius: 12px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); font-size: 15px; }
.fcheck__box { display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px var(--color-grid); color: transparent; }
.fcheck input:checked ~ .fcheck__box { background: var(--color-primary); box-shadow: none; color: var(--color-primary-ink); }

/* G: the input tiles */
.ftiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ftile { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px; border-radius: 12px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.ftile:has(input:checked) { box-shadow: 0 0 0 2px var(--color-primary); }
.ftile:has(input:checked) .ico-chip { background: var(--color-primary); color: var(--color-primary-ink); }

/* H: the thread */
.fthread { display: grid; gap: 10px; max-width: 560px; }
.fmsg { display: flex; align-items: flex-end; gap: 10px; }
.fmsg p { margin: 0; padding: 12px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.fmsg--us p { border-bottom-left-radius: 4px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); }
.fmsg--you { justify-content: flex-end; }
.fmsg--you p { max-width: 80%; border-bottom-right-radius: 4px; background: var(--color-primary); color: var(--color-primary-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.fmsg[hidden] { display: none; }
.fcompose { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; max-width: 560px; padding: 8px; border-radius: 16px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); }
.fcta .fcompose textarea { min-height: 48px; box-shadow: none; resize: none; }

/* ---------- the AI versions (i, k, l, n, o): a calm prompt with an arrow, a printed answer ---------- */
.fcta__body--wide { grid-column: 1 / -1; }
.fai { display: grid; gap: 6px; max-width: 720px; padding: 14px 14px 10px 18px; border-radius: 24px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule), 0 2px 4px rgb(17 26 35 / 0.04), 0 24px 48px -24px rgb(17 26 35 / 0.22); }
.fai:focus-within { box-shadow: 0 0 0 1.5px var(--color-accent), 0 2px 4px rgb(17 26 35 / 0.04), 0 24px 48px -24px rgb(17 26 35 / 0.22); }
.fcta .fai textarea { min-height: 52px; padding: 4px 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 17px; line-height: 1.45; resize: none; }
.fcta .fai textarea:focus-visible { outline: 0; }
.fai__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fai__hint { color: var(--color-muted); font-size: 12px; }
.fai__go { display: inline-grid; margin-left: auto; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--color-primary); color: var(--color-primary-ink); cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.fai__go:hover { background: var(--color-primary-hover); }
.fai__go--wide { display: inline-flex; margin-left: 0; gap: 8px; justify-self: start; width: auto; height: 48px; padding: 0 22px 0 18px; border-radius: 999px; font: 500 15px/1 var(--font-body); }
.fai__ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 720px; }
.fai__ex > span { margin-right: 4px; color: var(--color-muted); font-size: 13px; }
.fai__chip { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-grid); color: var(--color-ink); font: 500 13.5px/1 var(--font-body); cursor: pointer; }
.fai__chip:hover { background: var(--color-paper-3); }
.fai__att { display: flex; justify-content: flex-end; }
.fatt { position: relative; display: inline-flex; }
.fatt__in { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border-radius: 10px; background: var(--color-paper-2); box-shadow: inset 0 0 0 1px var(--color-rule); color: var(--color-ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.fcta__copy--float { position: absolute; top: 50%; left: 50%; z-index: 3; transform: translate(-50%, -50%); pointer-events: none; }
html[data-variant="f"] .fcta--k .fcta__copy { display: none; }

/* the answer, printed */
.fans { position: relative; display: grid; gap: 8px; max-width: 720px; }
.fans[hidden] { display: none; }
.fans__msg { display: flex; align-items: flex-start; gap: 12px; }
.fans__msg > .app-icon, .fmsg > .app-icon { flex-shrink: 0; margin-top: 2px; }
.fans__body { display: grid; gap: 10px; min-width: 0; font-size: 15px; line-height: 1.5; }
.fans__body p { margin: 0; }
.fans [data-t]:empty { display: none; }
.fans__steps { display: grid; gap: 4px; margin: 0; padding-left: 22px; color: var(--color-ink-2); }
.fans__steps li::marker { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.fans__kv { color: var(--color-ink-2); }
.fans__price { justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--color-accent-wash); color: var(--color-accent-wash-ink); font-weight: 500; }
.fans__fine { color: var(--color-muted); font-size: 13px; }
.fans__foot[hidden] { display: none; }
.fans__skip { position: absolute; top: 0; right: 0; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--color-paper-3); color: var(--color-ink-2); font: 500 12px/1 var(--font-body); cursor: pointer; }
.fans__skip[hidden] { display: none; }
.fans__fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin: 0; }
.fans__fields div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); }
.fans__fields dt { color: var(--color-muted); font-size: 12px; }
.fans__fields dd { margin: 0; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.o-station--wide { width: min(100%, 440px); }
.o-station--wide .o-v { text-align: right; }

/* one-column frames (l, m) */
.fcta--solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; grid-template-rows: none; }
.fchat { display: grid; gap: 12px; max-width: 720px; }
.fmsg__col { display: grid; gap: 10px; justify-items: start; }
.fmsg__col > p { margin: 0; padding: 12px 14px; border-radius: 16px; border-bottom-left-radius: 4px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule); font-size: 15px; }
.fcta__dock--msg { justify-self: start; }
.fmsg__pad { width: 28px; flex-shrink: 0; }
.fchat .fai { margin-top: 4px; }

/* M: the form card in the middle, the mark on top until the invoice takes its place */
.fcta--center { justify-items: center; }
.fcard { display: grid; gap: 14px; width: min(100%, 480px); padding: 28px; border-radius: 28px; background: var(--color-card); box-shadow: 0 0 0 1px var(--color-rule), 0 2px 4px rgb(17 26 35 / 0.04), 0 32px 64px -32px rgb(17 26 35 / 0.28); }
.fcard__top { justify-self: center; min-height: 137px; place-items: center; }
.fcard__mark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.fcard__title { margin: 4px 0 0; font-size: 1.75rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; text-align: center; }
.fcard__lede { margin: 0 0 6px; color: var(--color-ink-2); font-size: 15px; text-align: center; }
.fcard__go { width: 100%; margin-top: 4px; }
.fcard .fcta__fine { text-align: center; }

/* O: three questions */
.fwiz { display: grid; gap: 18px; }

/* tablet: the calculator and tiles fold */
@media (max-width: 64rem) {
  .fcalc { grid-template-columns: repeat(2, minmax(0, max-content)); }
  .fcalc__out { grid-column: 1 / -1; padding-bottom: 0; }
  .ftiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* phone: one column; the dock comes right after the head so the card lands where it is seen */
@media (max-width: 47.5rem) {
  .fcta { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "side" "body"; grid-template-rows: none; }
  .fcta::before { inset: -24px -16px; }
  .fcta__side { justify-items: start; }
  .fform, .fcta__cap { width: 100%; }
  .fform--row { grid-template-columns: minmax(0, 1fr); }
  .fcalc { grid-template-columns: minmax(0, 1fr); }
  .fstep__box { grid-template-columns: 52px minmax(0, 1fr) 52px; }
  .fcompose { grid-template-columns: minmax(0, 1fr); }
  .fcompose .fbtn { width: 100%; }
  .fai__hint { display: none; }
  .fcard { padding: 20px 16px; }
  .fans__skip { position: static; justify-self: end; }
}
