/* Mailferry components · Direction 1b "Ledger" · v0.1, 27 Oct 2026
   Requires tokens.css. Semantic HTML, BEM-ish class names, no inline styles.
   Square corners throughout. Focus ring sits inside the element edge. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 var(--space-4); line-height: var(--leading-heading); text-wrap: balance; }
h1 { font-size: var(--text-h1); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-heading); }
h2 { font-size: var(--text-h2); font-weight: var(--weight-bold); }
h3 { font-size: var(--text-h3); font-weight: var(--weight-medium); }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
small, .text-small { font-size: var(--text-small); }
.text-muted { color: var(--color-text-muted); }
.display { font-size: var(--text-display); line-height: var(--leading-tight); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-display); }
.num { font-variant-numeric: tabular-nums; }
code, kbd, samp, .mono { font-family: var(--font-mono); font-size: var(--text-mono); }
:not(pre) > code { background: var(--color-surface-code); padding: 0.1em 0.35em; }
img, svg { display: block; max-width: 100%; }
/* max-width: none: a percentage max-width (the svg rule above) makes a browser count the icon as zero wide when it works out how narrow a table cell or shrunk box can go, so the text beside it spilt out of badges. Icons have their own fixed size. */
.icon { width: 1.25em; height: 1.25em; max-width: none; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 1em; height: 1em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--width-marketing); margin-inline: auto; padding-inline: var(--gutter); }
.container--reading { max-width: calc(var(--width-reading) + 2 * var(--gutter)); }
.container--dashboard { max-width: var(--width-dashboard); }
.prose { max-width: var(--measure); }
.stack > * + * { margin-top: var(--space-4); }
.grid { display: grid; gap: var(--space-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.section { padding-block: var(--space-12); }
@media (min-width: 64rem) { .section { padding-block: var(--space-20); } }

/* ---------- Links ---------- */
a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-accent-hover); text-decoration-thickness: 2px; }
a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-focus); text-decoration: none; }
.link-quiet { color: inherit; text-decoration: none; }
.link-quiet:hover { color: var(--color-accent); text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height); padding: 0 var(--space-5);
  border: var(--border-width) solid transparent; border-radius: 0;
  font: inherit; font-weight: var(--weight-medium); line-height: 1.2; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn--sm { min-height: var(--control-height-sm); padding: 0 var(--space-3); font-size: var(--text-small); }
.btn--block { width: 100%; }
.btn--primary { background: var(--color-accent); color: var(--color-on-accent); }
.btn--primary:hover { background: var(--color-accent-hover); color: var(--color-on-accent); }
.btn--primary:active { background: var(--color-accent-active); }
.btn--secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn--secondary:hover { border-color: var(--color-text); color: var(--color-text); }
.btn--secondary:active { background: var(--color-surface-sunken); }
.btn--secondary:focus-visible, .btn--quiet:focus-visible { box-shadow: var(--focus-ring-plain); }
.btn--quiet { background: transparent; color: var(--color-accent); padding-inline: var(--space-3); }
.btn--quiet:hover { background: var(--color-accent-tint); color: var(--color-accent-hover); }
.btn--danger { background: var(--color-danger); color: var(--color-on-accent); }
.btn--danger:hover { background: var(--color-danger-hover); color: var(--color-on-accent); }
.btn--danger:focus-visible { box-shadow: inset 0 0 0 3px var(--color-danger), inset 0 0 0 5px var(--color-focus-inner); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--color-disabled-bg); color: var(--color-text-disabled); border-color: transparent; cursor: not-allowed; }
.btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.btn--loading::after {
  content: ""; position: absolute; width: 1.1em; height: 1.1em;
  border: 2px solid var(--color-on-accent); border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn--secondary.btn--loading::after, .btn--quiet.btn--loading::after { border-color: var(--color-text); border-right-color: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-5); }
.field__label { font-weight: var(--weight-medium); }
.field__optional { font-weight: var(--weight-regular); color: var(--color-text-muted); }
.field__hint { font-size: var(--text-small); color: var(--color-text-muted); }
.field__error { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-small); font-weight: var(--weight-medium); color: var(--color-danger-text); }
.field__annotation { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); } /* build field names in design annotations */
.input, .select, .textarea {
  width: 100%; min-height: var(--control-height); padding: var(--space-2) var(--space-3);
  background: var(--color-surface); color: var(--color-text);
  border: var(--border-width) solid var(--color-border-strong); border-radius: 0;
  font: inherit;
}
.input--mono { font-family: var(--font-mono); }
.input--short { max-width: 12rem; }
.textarea { min-height: 8rem; resize: vertical; }
.select { appearance: none; padding-right: var(--space-10);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--color-focus); box-shadow: var(--focus-ring-plain); }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { background: var(--color-surface-sunken); color: var(--color-text-muted); border-color: var(--color-border); }
.field--error .input, .field--error .select, .field--error .textarea, [aria-invalid="true"] { border-color: var(--color-danger); box-shadow: inset 0 0 0 1px var(--color-danger); }
.field--error { padding-left: var(--space-3); border-left: var(--border-width-strong) solid var(--color-danger); }

.password { display: flex; }
.password .input { border-right: 0; }
.password__toggle { min-height: var(--control-height); padding: 0 var(--space-4); background: var(--color-surface); color: var(--color-accent); border: var(--border-width) solid var(--color-border-strong); font: inherit; font-weight: var(--weight-medium); cursor: pointer; }
.password__toggle:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
.password-saved { display: flex; gap: var(--space-2); align-items: center; min-height: var(--control-height); color: var(--color-success-text); font-weight: var(--weight-medium); }
.secure-note { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-small); color: var(--color-text-muted); }

.choice { display: flex; gap: var(--space-3); align-items: flex-start; min-height: var(--control-height); padding-block: var(--space-2); cursor: pointer; }
.choice input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--color-accent); }
.choice input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.choice__hint { display: block; font-size: var(--text-small); color: var(--color-text-muted); }
.fieldset { border: 0; padding: 0; margin: 0 0 var(--space-5); }
.fieldset__legend { font-weight: var(--weight-medium); margin-bottom: var(--space-2); padding: 0; }

.toggle { display: inline-flex; gap: var(--space-3); align-items: center; min-height: var(--control-height); cursor: pointer; }
.toggle input { appearance: none; width: 2.75rem; height: 1.5rem; margin: 0; background: var(--color-border-strong); position: relative; cursor: pointer; transition: background-color var(--duration-fast) var(--ease); }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); background: var(--color-surface); transition: transform var(--duration-fast) var(--ease); }
.toggle input:checked { background: var(--color-accent); }
.toggle input:checked::after { transform: translateX(1.25rem); }
.toggle input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.toggle input:disabled { opacity: 0.5; cursor: not-allowed; }

.dropzone { position: relative; display: grid; gap: var(--space-2); justify-items: center; text-align: center; padding: var(--space-8) var(--space-4); border: var(--border-width-strong) dashed var(--color-border-strong); background: var(--color-surface); }
.dropzone input[type="file"] { max-width: 100%; }
.dropzone--over { border-color: var(--color-accent); background: var(--color-accent-tint); }
.dropzone:focus-within { border-color: var(--color-focus); }
.field--error .dropzone { border-color: var(--color-danger); }

.error-summary { padding: var(--space-5); margin-bottom: var(--space-6); border: var(--border-width-strong) solid var(--color-danger); background: var(--color-surface); }
.error-summary:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
.error-summary__title { font-size: var(--text-h3); font-weight: var(--weight-bold); margin: 0 0 var(--space-3); }
.error-summary__list { margin: 0; padding-left: var(--space-5); }
.error-summary__list a { color: var(--color-danger-text); font-weight: var(--weight-medium); }

/* ---------- Provider picker ---------- */
.provider-picker { border: var(--border-width) solid var(--color-border-strong); background: var(--color-surface); }
.provider-picker__search { border: 0; border-bottom: var(--border-width) solid var(--color-border); }
.provider-picker__list { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow-y: auto; }
.provider-option { display: flex; gap: var(--space-3); align-items: center; width: 100%; min-height: var(--control-height); padding: var(--space-2) var(--space-3); background: none; border: 0; border-top: var(--border-width) solid var(--color-border-subtle); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.provider-option:hover { background: var(--color-surface-sunken); }
.provider-option:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
.provider-option[aria-selected="true"] { background: var(--color-accent-tint); }
.provider-option__meta { margin-left: auto; font-size: var(--text-small); color: var(--color-text-muted); }
.monogram { display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: none; background: var(--color-neutral-tint); color: var(--color-text); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.02em; }

/* ---------- Cards, tables, definition lists ---------- */
.card { background: var(--color-surface); border: var(--border-width) solid var(--color-border); box-shadow: var(--shadow-1); }
.card__header { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-5); border-bottom: var(--border-width) solid var(--color-border); }
.card__title { margin: 0; font-size: var(--text-body); font-weight: var(--weight-bold); }
.card__body { padding: var(--space-5); }
.card__footer { padding: var(--space-4) var(--space-5); border-top: var(--border-width) solid var(--color-border); background: var(--color-surface-sunken); }

.table-wrap { overflow-x: auto; border: var(--border-width) solid var(--color-border); background: var(--color-surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: top; border-top: var(--border-width) solid var(--color-border-subtle); }
.table thead th { border-top: 0; background: var(--color-surface-sunken); color: var(--color-text-muted); font-weight: var(--weight-medium); white-space: nowrap; }
.table .is-num { text-align: right; }
.table tbody tr:hover { background: var(--color-surface-sunken); }
.table__sort { display: inline-flex; gap: var(--space-1); align-items: center; padding: 0; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.table__sort:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
[aria-sort="ascending"] .table__sort, [aria-sort="descending"] .table__sort { color: var(--color-text); }
.table--dense th, .table--dense td { padding: var(--space-2) var(--space-3); }
@media (max-width: 47.99rem) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { display: block; padding: var(--space-3) var(--space-4); border-top: var(--border-width) solid var(--color-border); }
  .table--stack td { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-1) 0; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); color: var(--color-text-muted); font-weight: var(--weight-medium); text-align: left; }
  .table--stack td.is-primary { display: block; text-align: left; font-weight: var(--weight-medium); }
  .table--stack td.is-primary::before { content: none; }
}

.dl { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.dl__row { display: grid; gap: var(--space-1); padding: var(--space-3) 0; border-top: var(--border-width) solid var(--color-border-subtle); }
.dl__row:first-child { border-top: 0; }
.dl dt { color: var(--color-text-muted); font-size: var(--text-small); }
.dl dd { margin: 0; display: flex; gap: var(--space-2); align-items: center; justify-content: space-between; }
@media (min-width: 36rem) { .dl__row { grid-template-columns: 12rem minmax(0, 1fr); gap: var(--space-4); } }

/* ---------- Status badges (icon + text always) ---------- */
.badge { display: inline-flex; gap: var(--space-1); align-items: center; padding: 0.125rem var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-medium); line-height: 1.4; white-space: nowrap; background: var(--color-neutral-tint); color: var(--color-text); }
.badge .icon { width: 0.875rem; height: 0.875rem; }
.badge--queued, .badge--stopped, .badge--draft { background: var(--color-neutral-tint); color: var(--color-text-muted); }
.badge--testing, .badge--starting { background: var(--color-info-tint); color: var(--color-info-text); }
.badge--ready, .badge--done { background: var(--color-success-tint); color: var(--color-success-text); }
.badge--running, .badge--copying { background: var(--color-progress-tint); color: var(--color-progress); }
.badge--retrying, .badge--paused, .badge--warnings { background: var(--color-warning-tint); color: var(--color-warning-text); }
.badge--attention, .badge--failed { background: var(--color-danger-tint); color: var(--color-danger-text); }
.badge--failed { box-shadow: inset 0 0 0 1px var(--color-danger); }
.badge--admin { background: var(--color-admin); color: var(--color-on-admin); }

/* ---------- Progress ---------- */
.progress { display: grid; gap: var(--space-1); }
.progress__bar { height: 0.5rem; background: var(--color-border-subtle); overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: var(--color-progress); transition: width var(--duration-base) var(--ease); }
/* Width set by a class step or the <progress> element; no inline styles. */
progress.progress__native { appearance: none; width: 100%; height: 0.5rem; border: 0; background: var(--color-border-subtle); }
progress.progress__native::-webkit-progress-bar { background: var(--color-border-subtle); }
progress.progress__native::-webkit-progress-value { background: var(--color-progress); }
progress.progress__native::-moz-progress-bar { background: var(--color-progress); }
.progress--done progress.progress__native::-webkit-progress-value { background: var(--color-success); }
.progress--done progress.progress__native::-moz-progress-bar { background: var(--color-success); }
.progress--warning progress.progress__native::-webkit-progress-value { background: var(--color-warning); }
.progress--warning progress.progress__native::-moz-progress-bar { background: var(--color-warning); }
.progress--danger progress.progress__native::-webkit-progress-value { background: var(--color-danger); }
.progress--danger progress.progress__native::-moz-progress-bar { background: var(--color-danger); }
.progress--batch progress.progress__native { height: 0.75rem; }
/* Starting: nothing is counted yet, so a stripe moves along the bar to show the mailbox is being worked on. */
.progress--starting { position: relative; overflow: hidden; }
.progress--starting::before { content: ""; position: absolute; top: 0; left: 0; width: 30%; height: 0.5rem; background: var(--color-progress); animation: indeterminate 1.4s var(--ease) infinite; }
@media (prefers-reduced-motion: reduce) { .progress--starting::before { animation: none; width: 100%; opacity: 0.35; } }
.progress__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); font-size: var(--text-small); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.progress--indeterminate .progress__bar { position: relative; }
.progress--indeterminate .progress__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--color-progress); animation: indeterminate 1.4s var(--ease) infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .progress--indeterminate .progress__bar::after { animation: none; width: 100%; opacity: 0.35; } }
.readout { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.readout__item { display: grid; }
.readout__label { color: var(--color-text-muted); font-size: var(--text-xs); }

/* ---------- Quote / receipt (signature component) ---------- */
.receipt { background: var(--color-surface); border: var(--border-width) solid var(--color-border); box-shadow: var(--shadow-1); font-variant-numeric: tabular-nums; }
.receipt__header { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: space-between; align-items: baseline; padding: var(--space-4) var(--space-5); border-bottom: var(--border-width) solid var(--color-border); }
.receipt__title { margin: 0; font-size: var(--text-body); font-weight: var(--weight-bold); }
.receipt__ref { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); font-weight: var(--weight-regular); }
.receipt__currency { font-size: var(--text-xs); color: var(--color-text-muted); }
.receipt__items { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
.receipt__items th, .receipt__items td { padding: var(--space-2) var(--space-5); border-top: var(--border-width) solid var(--color-border-subtle); text-align: right; }
.receipt__items th:first-child, .receipt__items td:first-child { text-align: left; overflow-wrap: anywhere; }
.receipt__items thead th { border-top: 0; background: var(--color-surface-sunken); color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.receipt__breakdown { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
.receipt__summary { display: grid; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-top: var(--border-width) solid var(--color-border); background: var(--color-surface-sunken); }
@media (min-width: 48rem) { .receipt__summary { grid-template-columns: minmax(0, 1fr) 16rem; align-items: end; gap: var(--space-6); } }
.receipt__totals { display: grid; gap: var(--space-1); margin: 0; }
.receipt__line { display: flex; justify-content: space-between; gap: var(--space-4); }
.receipt__line dt, .receipt__line dd { margin: 0; }
.receipt__line dd { text-align: right; }
@media (min-width: 48rem) { .receipt--wide .receipt__summary { grid-template-columns: minmax(0, 1fr) minmax(16rem, 28rem); } } /* the quote: room for its longer lines */
.receipt__line--total { padding-top: var(--space-2); margin-top: var(--space-1); border-top: var(--border-width-strong) solid var(--color-text); font-size: var(--text-h3); font-weight: var(--weight-heavy); }
.receipt__tax-label { font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--color-text-muted); } /* "+ VAT" / "inc. VAT" slot */
.receipt__compare { font-size: var(--text-small); color: var(--color-text-muted); }
.receipt__footnote { font-size: var(--text-xs); color: var(--color-text-muted); }
@media (max-width: 35.99rem) {
  .receipt__items thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .receipt__items tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-2) var(--space-4); border-top: var(--border-width) solid var(--color-border-subtle); }
  .receipt__items td { padding: 0; border: 0; }
  .receipt__items td.receipt__hide-sm { display: none; }
  .receipt__header, .receipt__summary { padding-inline: var(--space-4); }
}
.price-tag { display: inline-flex; gap: var(--space-1); align-items: baseline; font-variant-numeric: tabular-nums; }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 0; margin: 0 0 var(--space-8); padding: 0; list-style: none; counter-reset: step; border-bottom: var(--border-width) solid var(--color-border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.stepper__item { counter-increment: step; display: flex; gap: var(--space-2); align-items: center; padding: var(--space-3) var(--space-4) var(--space-3) 0; margin-right: var(--space-4); font-size: var(--text-small); color: var(--color-text-muted); white-space: nowrap; border-bottom: var(--border-width-strong) solid transparent; margin-bottom: -1px; }
.stepper__item::before { content: counter(step); display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border: var(--border-width) solid var(--color-border-strong); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.stepper__item--done { color: var(--color-text); }
.stepper__item--done::before { content: "✓"; background: var(--color-success-tint); color: var(--color-success-text); border-color: transparent; }
.stepper__item[aria-current="step"] { color: var(--color-text); font-weight: var(--weight-bold); border-bottom-color: var(--color-accent); }
.stepper__item[aria-current="step"]::before { background: var(--color-accent); color: var(--color-on-accent); border-color: transparent; }
.stepper a { color: inherit; text-decoration: none; }
.stepper a:hover { text-decoration: underline; }
.draft-note { font-size: var(--text-small); color: var(--color-text-muted); }

/* ---------- Alerts, banners, toasts, inline notes ---------- */
.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border: var(--border-width) solid; background: var(--color-surface); }
.alert__title { margin: 0 0 var(--space-1); font-size: var(--text-body); font-weight: var(--weight-bold); }
.alert__body > :last-child { margin-bottom: 0; }
.alert--info { background: var(--color-info-tint); border-color: var(--color-info); }
.alert--info > .icon { color: var(--color-info-text); }
.alert--success { background: var(--color-success-tint); border-color: var(--color-success); }
.alert--success > .icon { color: var(--color-success-text); }
.alert--warning { background: var(--color-warning-tint); border-color: var(--color-warning); }
.alert--warning > .icon { color: var(--color-warning-text); }
.alert--danger { background: var(--color-danger-tint); border-color: var(--color-danger); }
.alert--danger > .icon { color: var(--color-danger-text); }
.banner { border-width: 0 0 var(--border-width); padding-inline: var(--gutter); }
.toast-region { position: fixed; inset: auto var(--space-4) var(--space-4) auto; display: grid; gap: var(--space-2); z-index: 50; max-width: min(24rem, calc(100vw - 2 * var(--space-4))); }
.toast { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); background: var(--color-text); color: var(--color-bg); box-shadow: var(--shadow-2); font-size: var(--text-small); }
.note { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-small); color: var(--color-text-muted); }
.notes-box { padding: var(--space-4) var(--space-5); background: var(--color-surface-sunken); border: var(--border-width) solid var(--color-border); }
.notes-box ul { margin: 0; padding-left: var(--space-5); }

/* ---------- Empty, error, skeleton ---------- */
.empty { display: grid; gap: var(--space-3); justify-items: start; padding: var(--space-12) var(--space-6); border: var(--border-width) dashed var(--color-border-strong); background: var(--color-surface); }
.empty__title { margin: 0; font-size: var(--text-h3); font-weight: var(--weight-bold); }
.error-page { padding-block: var(--space-20); }
.error-page__code { font-family: var(--font-mono); color: var(--color-text-muted); }
.skeleton { display: block; height: 1em; background: var(--color-border-subtle); animation: pulse 1.6s ease-in-out infinite; }
.skeleton--line { width: 100%; margin-bottom: var(--space-2); }
.skeleton--short { width: 40%; }
@keyframes pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- Dialog ---------- */
.dialog { width: min(32rem, calc(100vw - 2 * var(--space-4))); padding: 0; border: var(--border-width) solid var(--color-border); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-2); }
.dialog::backdrop { background: oklch(0.15 0.01 255 / 0.5); }
.dialog__body { padding: var(--space-6); }
.dialog__title { margin: 0 0 var(--space-3); font-size: var(--text-h3); font-weight: var(--weight-bold); }
.dialog__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: flex-end; padding: var(--space-4) var(--space-6); border-top: var(--border-width) solid var(--color-border); background: var(--color-surface-sunken); }

/* ---------- Code / copy block ---------- */
.code-block { border: var(--border-width) solid var(--color-border); background: var(--color-surface-code); }
.code-block__header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4); border-bottom: var(--border-width) solid var(--color-border); font-size: var(--text-xs); color: var(--color-text-muted); }
.code-block pre { margin: 0; padding: var(--space-4); overflow-x: auto; font-family: var(--font-mono); font-size: var(--text-mono); line-height: 1.6; white-space: pre; }
.code-block .placeholder { color: var(--color-accent); font-weight: var(--weight-medium); } /* <angle-bracket> values */
.copy-btn { display: inline-flex; gap: var(--space-1); align-items: center; min-height: var(--control-height-sm); padding: 0 var(--space-3); background: transparent; border: 0; color: var(--color-accent); font: inherit; font-size: var(--text-small); font-weight: var(--weight-medium); cursor: pointer; }
.copy-btn:hover { background: var(--color-accent-tint); }
.copy-btn:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
.copy-btn[data-copied="true"] { color: var(--color-success-text); }
.copy-value { display: inline-flex; gap: var(--space-2); align-items: center; font-family: var(--font-mono); font-size: var(--text-mono); }

/* ---------- Disclosure (details/summary) ---------- */
.details { border-top: var(--border-width) solid var(--color-border); }
.details summary { display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; min-height: var(--control-height); padding: var(--space-3) 0; cursor: pointer; font-weight: var(--weight-medium); list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "+"; font-size: 1.25rem; line-height: 1; color: var(--color-text-muted); }
.details[open] summary::after { content: "–"; }
.details summary:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
.details__body { padding-bottom: var(--space-4); }
.details--tech summary { font-size: var(--text-small); color: var(--color-accent); min-height: var(--control-height-sm); }

/* ---------- Site header / nav ---------- */
.site-header { border-bottom: var(--border-width) solid var(--color-border); background: var(--color-surface); }
.site-header__inner { display: flex; align-items: center; gap: var(--space-6); min-height: 4rem; }
.wordmark { font-size: 1.0625rem; font-weight: var(--weight-heavy); color: var(--color-text); text-decoration: none; }
.wordmark:hover { color: var(--color-text); }
.site-nav { display: none; margin-left: auto; align-items: center; gap: var(--space-6); font-size: var(--text-small); }
.site-nav a:not(.btn) { color: var(--color-text); text-decoration: none; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { text-decoration: underline; }
.site-menu { margin-left: auto; }
.site-menu > summary { list-style: none; cursor: pointer; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu__panel { position: absolute; inset: 4rem 0 auto 0; display: grid; gap: var(--space-1); padding: var(--space-4) var(--gutter) var(--space-6); background: var(--color-surface); border-bottom: var(--border-width) solid var(--color-border); box-shadow: var(--shadow-2); z-index: 40; }
.site-menu__panel a:not(.btn) { display: block; padding: var(--space-3) 0; color: var(--color-text); text-decoration: none; border-bottom: var(--border-width) solid var(--color-border-subtle); }
/* The open menu blocks out the page, which can't scroll, though a long menu
   can. The overlay belongs to the summary, so tapping it closes the menu, with
   no JavaScript. */
.site-header:has(.site-menu[open]) { z-index: 50; }
.site-menu[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: -1; background: oklch(0.1 0.01 255 / 0.88); cursor: default; touch-action: none; animation: site-menu-overlay var(--duration-base) var(--ease); }
@keyframes site-menu-overlay { from { opacity: 0; } }
@media (max-width: 63.99rem) {
  html:has(.site-menu[open]), html:has(.site-menu[open]) body { overflow: hidden; }
  .site-menu__panel { max-height: calc(100dvh - 4rem); overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 64rem) { .site-nav { display: flex; } .site-menu { display: none; } }
.app-header .nav-count { display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 var(--space-1); background: var(--color-danger); color: var(--color-on-accent); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.admin-band { height: 0.375rem; background: var(--color-admin); }

/* ---------- Marketing blocks ---------- */
.hero { padding-block: var(--space-12) var(--space-16); }
.hero__grid { display: grid; gap: var(--space-8); }
@media (min-width: 64rem) { .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); align-items: end; gap: var(--space-10); } }
.hero__title { margin: 0; }
.hero__lede { font-size: 1.125rem; }

.answer-box { max-width: var(--measure); padding: var(--space-5) var(--space-6); margin-bottom: var(--space-8); background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-top: var(--border-width-strong) solid var(--color-accent); font-size: 1.0625rem; }
.answer-box > :last-child { margin-bottom: 0; }

/* A timeline: numbered square badges joined by a line, down the left side
   (and across the page for .steps--row on wide screens). */
.steps { --step-badge: 2rem; display: grid; margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.steps__item { position: relative; counter-increment: steps; padding: 0 0 var(--space-8) calc(var(--step-badge) + var(--space-4)); }
.steps__item:last-child { padding-bottom: 0; }
.steps__item::before { content: counter(steps); position: absolute; top: 0; left: 0; z-index: 1; display: grid; place-items: center; width: var(--step-badge); height: var(--step-badge); background: var(--color-bg); border: var(--border-width-strong) solid var(--color-accent); color: var(--color-accent); font-family: var(--font-mono); font-size: var(--text-small); font-weight: var(--weight-bold); }
.steps__item::after { content: ""; position: absolute; top: var(--step-badge); bottom: 0; left: calc(var(--step-badge) / 2 - 1px); border-left: var(--border-width-strong) solid var(--color-border); }
.steps__item:last-child::after { display: none; }
.steps__title { margin: 0 0 var(--space-2); padding-top: var(--space-1); font-size: var(--text-body); font-weight: var(--weight-bold); }
@media (min-width: 64rem) {
  .steps--row { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .steps--row .steps__item { padding: calc(var(--step-badge) + var(--space-4)) var(--space-6) 0 0; }
  .steps--row .steps__item::after { top: calc(var(--step-badge) / 2 - 1px); right: 0; bottom: auto; left: var(--step-badge); border-left: 0; border-top: var(--border-width-strong) solid var(--color-border); }
  .steps--row .steps__title { padding-top: 0; }
}

.calculator { display: grid; gap: var(--space-6); }
@media (min-width: 64rem) { .calculator { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

.compare-table th[scope="row"] { font-weight: var(--weight-medium); }
.compare-table .is-us { background: var(--color-accent-tint); }
.sources { font-size: var(--text-small); color: var(--color-text-muted); }

.faq .details summary { font-size: 1.0625rem; }

.trust-strip { display: grid; gap: var(--space-3) var(--space-8); margin: 0; padding: var(--space-5) 0; list-style: none; border-block: var(--border-width) solid var(--color-border); font-size: var(--text-small); font-weight: var(--weight-medium); }
.trust-strip li { display: flex; gap: var(--space-2); align-items: center; }
.trust-strip .icon { color: var(--color-accent); }
/* Columns as wide as their text, spread edge to edge: equal gaps between items. */
@media (min-width: 36rem) { .trust-strip { grid-template-columns: repeat(2, auto); justify-content: space-between; } }
@media (min-width: 64rem) { .trust-strip { grid-template-columns: repeat(4, auto); } }

.settings-card .dl dd { font-family: var(--font-mono); font-size: var(--text-mono); }

.route-card { display: grid; gap: var(--space-2); padding: var(--space-4); background: var(--color-surface); border: var(--border-width) solid var(--color-border); color: var(--color-text); text-decoration: none; }
.route-card:hover { border-color: var(--color-text); color: var(--color-text); }
.route-card:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
.route-card__path { display: flex; gap: var(--space-2); align-items: center; font-weight: var(--weight-bold); }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-4); padding: 0; list-style: none; font-size: var(--text-small); color: var(--color-text-muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--color-border-strong); }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs [aria-current="page"] { color: var(--color-text); }

.updated { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); font-size: var(--text-small); color: var(--color-text-muted); }
.updated time { color: var(--color-text); font-weight: var(--weight-medium); }

.days-left { font-variant-numeric: tabular-nums; font-weight: var(--weight-bold); }

.cta-band { padding: var(--space-10) var(--space-6); background: var(--color-surface); border-block: var(--border-width) solid var(--color-border); }
.cta-band__inner { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8); align-items: center; justify-content: space-between; }
.cta-band__title { margin: 0; font-size: var(--text-h2); }

.site-footer { padding-block: var(--space-12) var(--space-8); margin-top: var(--space-16); border-top: var(--border-width) solid var(--color-border); background: var(--color-surface); font-size: var(--text-small); }
.site-footer__cols { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.site-footer__heading { margin: 0 0 var(--space-3); font-size: var(--text-small); font-weight: var(--weight-bold); }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.site-footer a:not(.btn) { color: var(--color-text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; margin-top: var(--space-10); padding-top: var(--space-6); border-top: var(--border-width) solid var(--color-border); color: var(--color-text-muted); }
/* Ours: the company line and the theme switch sit on one centre line. */
.site-footer__legal { align-items: center; }
/* The columns only take the room they need, with equal space between them, edge to edge. */
@media (min-width: 48rem) {
  .site-footer__cols { display: flex; justify-content: space-between; }
  .site-footer__legal { flex-wrap: nowrap; gap: var(--space-8); }
  .site-footer__legal > span { text-wrap: balance; }
  .site-footer__legal .theme-switch { flex-shrink: 0; }
}

.theme-switch { display: inline-flex; border: var(--border-width) solid var(--color-border-strong); }
.theme-switch__option { display: inline-flex; align-items: center; min-height: var(--control-height-sm); padding: 0 var(--space-3); background: transparent; border: 0; color: var(--color-text); font: inherit; font-size: var(--text-small); cursor: pointer; }
.theme-switch__option + .theme-switch__option { border-left: var(--border-width) solid var(--color-border-strong); }
.theme-switch__option[aria-pressed="true"] { background: var(--color-text); color: var(--color-bg); }
.theme-switch__option:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }

/* ---------- Page layout (marketing) ---------- */
.site-header { position: relative; }
.site-header__actions { display: flex; gap: var(--space-4); align-items: center; }
.site-menu > summary.btn { min-height: var(--control-height); }
.page-section { padding-block: var(--space-16); }
.page-section + .page-section { border-top: var(--border-width) solid var(--color-border); }
.page-section--flush { padding-top: 0; }
@media (min-width: 64rem) { .page-section { padding-block: var(--space-24); } }
.section-head { max-width: 40rem; margin-bottom: var(--space-10); }
.section-head > :last-child { margin-bottom: 0; }
.section-head__lede { font-size: 1.125rem; color: var(--color-text-muted); }
.page-title { padding-block: var(--space-12) var(--space-4); }
@media (min-width: 64rem) { .page-title { padding-block: var(--space-20) var(--space-6); } }
.hero__grid--receipt { align-items: center; }
.hero__price { font-size: 1.25rem; font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.hero__copy { display: grid; gap: var(--space-6); align-content: start; }
.hero__copy > * { margin: 0; }
/* Home's first screen: what it is and why you'd want it, then the price
   hero. The same space on both sides of the full-width rule between them,
   like the page sections below. */
.hero--intro { padding-block: var(--space-16); }
.hero__intro { max-width: 46rem; }
.hero__next { justify-self: start; font-weight: var(--weight-medium); }
.hero--price { padding-top: var(--space-16); border-top: var(--border-width) solid var(--color-border); }
@media (min-width: 64rem) { .hero--intro { padding-block: var(--space-24); } .hero--price { padding-top: var(--space-24); } }
/* Sits close above the headline: pulls back most of the column's gap. */
.hero__copy > .hero__eyebrow { margin-bottom: calc(var(--space-4) * -1); color: var(--color-accent); font-size: var(--text-small); font-weight: var(--weight-bold); letter-spacing: 0.04em; text-transform: uppercase; }
.notice-bar { border-bottom: var(--border-width) solid var(--color-info); background: var(--color-info-tint); }
.notice-bar__inner { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; padding-block: var(--space-3); font-size: var(--text-small); }
.split { display: grid; gap: var(--space-10); }
@media (min-width: 64rem) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-16); align-items: start; } }
.route-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.formula { margin: 0 0 var(--space-6); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); line-height: var(--leading-heading); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-heading); font-variant-numeric: tabular-nums; }
.worked-example { padding: var(--space-5); background: var(--color-surface); border: var(--border-width) solid var(--color-border); font-variant-numeric: tabular-nums; }
.worked-example > :last-child { margin-bottom: 0; }
.fact-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-3); }
/* The tick sits in the left margin, so mixed text (bold, links) flows as one
   paragraph instead of splitting into flex columns. */
.fact-list li { position: relative; padding-left: calc(1.25em + var(--space-3)); }
.fact-list .icon { color: var(--color-accent); margin-top: 0.15em; }
.fact-list li > .icon:first-child { position: absolute; top: 0; left: 0; }
.calc { display: grid; gap: var(--space-6); }
.calc__fields { padding: var(--space-6); background: var(--color-surface); border: var(--border-width) solid var(--color-border); }
.calc__fields .field:last-child, .calc__fields .fieldset:last-child { margin-bottom: 0; }
.calc__inline { display: flex; flex-wrap: wrap; gap: 0 var(--space-6); }
.calc__estimate { font-size: var(--text-small); color: var(--color-text-muted); margin: 0; }
.placeholder-slot { padding: var(--space-3) var(--space-4); border: var(--border-width-strong) dashed var(--color-warning); background: var(--color-warning-tint); color: var(--color-warning-text); font-size: var(--text-small); font-weight: var(--weight-medium); }
.placeholder-inline { padding: 0 var(--space-1); background: var(--color-warning-tint); color: var(--color-warning-text); font-weight: var(--weight-medium); }

/* ---------- Dashboard shell ---------- */
.app-header { position: relative; border-bottom: var(--border-width) solid var(--color-border); background: var(--color-surface); }
.app-header__inner { display: flex; align-items: center; gap: var(--space-4) var(--space-6); min-height: 4rem; flex-wrap: wrap; }
.app-nav { display: flex; gap: var(--space-5); align-items: center; font-size: var(--text-small); font-weight: var(--weight-medium); }
.app-nav a:not(.btn) { display: inline-flex; gap: var(--space-2); align-items: center; color: var(--color-text); text-decoration: none; min-height: var(--control-height); }
.app-nav a:not(.btn):hover, .app-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.35em; }
.account-menu { margin-left: auto; position: relative; font-size: var(--text-small); }
.account-menu > summary { display: inline-flex; gap: var(--space-2); align-items: center; min-height: var(--control-height); cursor: pointer; list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu__panel { position: absolute; right: 0; top: 100%; z-index: 40; min-width: 16rem; padding: var(--space-2) 0; background: var(--color-surface); border: var(--border-width) solid var(--color-border); box-shadow: var(--shadow-2); }
.account-menu__panel a, .account-menu__panel .account-menu__email { display: block; padding: var(--space-2) var(--space-4); color: var(--color-text); text-decoration: none; }
.account-menu__panel a:hover { background: var(--color-surface-sunken); }
.account-menu__email { color: var(--color-text-muted) !important; border-bottom: var(--border-width) solid var(--color-border-subtle); margin-bottom: var(--space-1); }
.account-menu__panel .theme-switch { margin: var(--space-2) var(--space-4); }
@media (max-width: 47.99rem) { .app-nav__new { display: none; } .account-menu__label { display: none; } }
.app-main { padding-block: var(--space-8) var(--space-20); }
@media (min-width: 64rem) { .app-main { padding-block: var(--space-12) var(--space-24); } }
.page-header { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: flex-end; margin-bottom: var(--space-8); }
.page-header h1 { margin: 0; }
.page-header__meta { margin: var(--space-1) 0 0; color: var(--color-text-muted); font-size: var(--text-small); }
.form-narrow { max-width: 35rem; }
.form-wide { max-width: 48rem; } /* notes that read better on one or two lines */
.block { margin-bottom: var(--space-10); }
.block > :last-child { margin-bottom: 0; }
.panel-pair { display: grid; gap: var(--space-6); margin-bottom: var(--space-6); }
@media (min-width: 64rem) { .panel-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.panel__label { margin: 0 0 var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.panel .card__body > :last-child { margin-bottom: 0; }
.provider-chosen { display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-4); font-weight: var(--weight-bold); }
.provider-chosen a { margin-left: auto; font-weight: var(--weight-regular); font-size: var(--text-small); }
.check-result { display: flex; gap: var(--space-2); align-items: flex-start; margin: var(--space-4) 0 0; font-weight: var(--weight-medium); }
.check-result--ok { color: var(--color-success-text); }
.check-result--fail { color: var(--color-danger-text); }
.check-result--warn { color: var(--color-warning-text); }
.fingerprint { font-family: var(--font-mono); font-size: var(--text-xs); overflow-wrap: anywhere; }
.wizard-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center; margin-top: var(--space-10); padding-top: var(--space-6); border-top: var(--border-width) solid var(--color-border); }
.wizard-actions__primary { display: grid; gap: var(--space-2); justify-items: end; text-align: right; }
@media (max-width: 35.99rem) { .wizard-actions { flex-direction: column-reverse; align-items: stretch; } .wizard-actions__primary { justify-items: stretch; text-align: left; } .wizard-actions .btn { width: 100%; } }
.checklist { margin: 0 0 var(--space-6); padding: 0; list-style: none; counter-reset: check; display: grid; gap: var(--space-6); }
.checklist__item { counter-increment: check; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: var(--space-3); }
.checklist__item::before { content: counter(check); display: grid; place-items: center; width: 2rem; height: 2rem; border: var(--border-width) solid var(--color-border-strong); font-weight: var(--weight-bold); font-size: var(--text-small); }
.checklist__item--done::before { content: "✓"; background: var(--color-success-tint); color: var(--color-success-text); border-color: transparent; }
.checklist__title { margin: 0.25rem 0 var(--space-2); font-size: var(--text-body); font-weight: var(--weight-bold); }
.checklist__item > div > :last-child { margin-bottom: 0; }
.tabs { display: flex; gap: var(--space-6); margin-bottom: var(--space-6); border-bottom: var(--border-width) solid var(--color-border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs__tab { padding: var(--space-3) 0; margin-bottom: -1px; border-bottom: var(--border-width-strong) solid transparent; color: var(--color-text-muted); font-weight: var(--weight-medium); text-decoration: none; white-space: nowrap; }
.tabs__tab:hover { color: var(--color-text); }
.tabs__tab[aria-selected="true"], .tabs__tab[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-accent); }
.mailbox-rows td { vertical-align: middle; }
.mailbox-rows .input { min-width: 14rem; }
.mailbox-rows__n { width: 2.5rem; color: var(--color-text-muted); }
.icon-btn { display: inline-grid; place-items: center; width: var(--control-height); height: var(--control-height); padding: 0; background: transparent; border: 0; color: var(--color-text-muted); cursor: pointer; }
.icon-btn:hover { color: var(--color-danger-text); background: var(--color-danger-tint); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
.summary-bar { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); align-items: center; padding: var(--space-4) var(--space-5); margin-bottom: var(--space-6); background: var(--color-surface); border: var(--border-width) solid var(--color-border); font-weight: var(--weight-medium); }
.row-fix { padding: var(--space-4) var(--space-5) var(--space-5); background: var(--color-surface-sunken); }
.row-fix .field { max-width: 24rem; }
.row-sentence { display: block; margin-top: var(--space-1); font-size: var(--text-small); color: var(--color-text-muted); }
.row-sentence--danger { color: var(--color-danger-text); }
.row-sentence--warning { color: var(--color-warning-text); }
.status-sentence { margin: 0 0 var(--space-3); font-size: var(--text-h2); font-weight: var(--weight-bold); line-height: var(--leading-heading); }
.batch-header { display: grid; gap: var(--space-6); padding: var(--space-6); margin-bottom: var(--space-8); background: var(--color-surface); border: var(--border-width) solid var(--color-border); }
.batch-header__facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-8); margin: 0; font-size: var(--text-small); }
.batch-header__facts div { display: grid; }
.batch-header__facts dt { color: var(--color-text-muted); font-size: var(--text-xs); }
.batch-header__facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.progress-cell { min-width: 9rem; }
.live-note { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; font-size: var(--text-small); color: var(--color-text-muted); }
.spinner { display: inline-block; width: 1.25rem; height: 1.25rem; border: 2px solid var(--color-border-strong); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.spinner--lg { width: 2.5rem; height: 2.5rem; border-width: 3px; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--color-accent); } }
.centered-state { display: grid; gap: var(--space-4); justify-items: center; text-align: center; max-width: 32rem; margin: var(--space-16) auto; }
.centered-state > * { margin: 0; }
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--space-4); background: oklch(0.15 0.01 255 / 0.5); }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: start center; padding: var(--space-12) var(--gutter) var(--space-20); }
.auth__card { width: 100%; max-width: 28rem; }
.auth__card h1 { font-size: var(--text-h2); }
.auth__links { display: grid; gap: var(--space-2); margin-top: var(--space-6); font-size: var(--text-small); }
.code-input { font-family: var(--font-mono); font-size: 1.5rem; letter-spacing: 0.3em; max-width: 12rem; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-6); margin: 0 0 var(--space-4); padding: var(--space-4) var(--space-5); list-style: none; background: var(--color-surface-code); font-family: var(--font-mono); font-size: var(--text-mono); }
.image-placeholder { display: grid; place-items: center; text-align: center; padding: var(--space-4); color: var(--color-text-muted); font-family: var(--font-mono); font-size: var(--text-xs); border: var(--border-width) solid var(--color-border); background: repeating-linear-gradient(135deg, var(--color-surface-sunken) 0 8px, var(--color-surface) 8px 16px); }
.image-placeholder--qr { width: 11rem; aspect-ratio: 1; }
.image-placeholder--shot { width: 100%; aspect-ratio: 16 / 9; }

/* ---------- Settings layout (account, legal) ---------- */
.settings-layout { display: grid; gap: var(--space-8); }
@media (min-width: 64rem) { .settings-layout { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--space-12); } }
.subnav ul { display: flex; gap: var(--space-1) var(--space-5); flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
@media (min-width: 64rem) { .subnav ul { flex-direction: column; } }
.subnav a { display: block; padding: var(--space-2) 0; color: var(--color-text-muted); text-decoration: none; font-weight: var(--weight-medium); }
.subnav a:hover { color: var(--color-text); }
.subnav a[aria-current="page"] { color: var(--color-text); box-shadow: inset 0 -2px 0 var(--color-accent); }
@media (min-width: 64rem) { .subnav a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--color-accent); padding-left: var(--space-3); } }
.settings-section { padding-bottom: var(--space-10); margin-bottom: var(--space-10); border-bottom: var(--border-width) solid var(--color-border); }
.settings-section:last-child { border-bottom: 0; }
.settings-section > h2 { margin-bottom: var(--space-2); }
.danger-zone { padding: var(--space-6); border: var(--border-width-strong) solid var(--color-danger); background: var(--color-surface); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-6); }
.filters .field { margin: 0; flex: 1 1 16rem; }
.filters .field--status { flex: 0 1 12rem; }
.pinned-label { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-danger-text); }

/* ---------- Admin ---------- */
.admin-header { background: var(--color-surface); border-bottom: var(--border-width) solid var(--color-border); }
.admin-header__inner { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: center; min-height: 3.25rem; font-size: var(--text-small); }
.admin-label { padding: 0.125rem var(--space-2); background: var(--color-admin); color: var(--color-on-admin); font-size: var(--text-xs); font-weight: var(--weight-heavy); letter-spacing: 0.1em; }
.admin-nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.admin-nav a { color: var(--color-text); text-decoration: none; }
.admin-nav a[aria-current="page"] { font-weight: var(--weight-bold); text-decoration: underline; text-underline-offset: 0.35em; }
.admin-main { padding-block: var(--space-6) var(--space-12); }
.stat-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: var(--space-6); }
.stat { padding: var(--space-3) var(--space-4); background: var(--color-surface); border: var(--border-width) solid var(--color-border); }
.stat__label { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
.stat__value { font-size: var(--text-h3); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.timeline { margin: 0; padding: 0; list-style: none; font-size: var(--text-small); }
.timeline li { display: grid; grid-template-columns: 9rem 5rem minmax(0, 1fr); gap: var(--space-3); padding: var(--space-2) 0; border-top: var(--border-width) solid var(--color-border-subtle); }
.mono-cell { font-family: var(--font-mono); font-size: var(--text-xs); }

/* ---------- Build additions (not in the design export) ---------- */
/* Skip link: hidden until it gets keyboard focus. */
.skip-link { position: absolute; left: var(--space-4); top: 0; z-index: 100; padding: var(--space-2) var(--space-4); background: var(--color-surface); color: var(--color-text); font-weight: var(--weight-medium); transform: translateY(-120%); }
.skip-link:focus, .skip-link:focus-visible { transform: none; box-shadow: var(--focus-ring-plain); text-decoration: none; }
/* Sign out is a POST form inside the account menu, styled like its links. */
.account-menu__panel form { margin: 0; }
.account-menu__action { display: block; width: 100%; padding: var(--space-2) var(--space-4); background: transparent; border: 0; color: var(--color-text); font: inherit; text-align: left; cursor: pointer; }
.account-menu__action:hover { background: var(--color-surface-sunken); }
.account-menu__action:focus-visible { outline: none; box-shadow: var(--focus-ring-plain); }
/* The Show/Hide button ships hidden until password-toggle.js runs; without
   JavaScript the field keeps its own right edge. */
.password__toggle[hidden] { display: none; }
.password:has(> .password__toggle[hidden]) > .input { border-right: var(--border-width) solid var(--color-border-strong); }
.field--error .password:has(> .password__toggle[hidden]) > .input { border-right-color: var(--color-danger); }
/* New migration (M3). Things shown only with JavaScript, or only in one
   state, use the hidden attribute; components that set display mustn't
   undo it. */
[hidden] { display: none !important; }
/* Step 1's "Change" and "Edit settings" are submit buttons (so nothing typed
   is lost without JavaScript), drawn as the links the design has. */
.link-button { padding: 0; background: none; border: 0; color: var(--color-accent); font: inherit; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; cursor: pointer; }
.link-button:hover { color: var(--color-accent-hover); text-decoration-thickness: 2px; }
.link-button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-focus); text-decoration: none; }
.provider-chosen .link-button { margin-left: auto; font-weight: var(--weight-regular); font-size: var(--text-small); }
/* 2FA set-up's QR code (App\Security\QrSvg), where the design has its
   image placeholder: the same size. Its own fill colours stay black on
   white in both themes; no rule here touches the SVG's insides. */
.qr-code { width: 11rem; height: auto; aspect-ratio: 1; }
/* Buttons that only work with JavaScript (Copy) ship hidden. */
.btn[hidden] { display: none; }
/* Copy buttons ship hidden until copy-button.js finds a clipboard; the
   calculator's receipt is hidden while its inputs have errors; the contact
   form's migration reference is hidden by contact-topic.js unless the topic
   needs it. */
.copy-btn[hidden], .receipt[hidden], .field[hidden] { display: none; }

/* ---------- Utilities ----------
   Named versions of the design export's small inline style="…" tweaks (the
   CSP has no 'unsafe-inline'). !important so they win over component rules,
   as the inline styles did. Combine them: class="u-m-0 u-mb-1" is
   "margin: 0 0 var(--space-1)" (the side utilities come after .u-m-0). */
.u-m-0 { margin: 0 !important; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-2 { margin-top: var(--space-2) !important; }
.u-mt-3 { margin-top: var(--space-3) !important; }
.u-mt-4 { margin-top: var(--space-4) !important; }
.u-mt-6 { margin-top: var(--space-6) !important; }
.u-mt-8 { margin-top: var(--space-8) !important; }
.u-mt-12 { margin-top: var(--space-12) !important; }
.u-mb-1 { margin-bottom: var(--space-1) !important; }
.u-mb-2 { margin-bottom: var(--space-2) !important; }
.u-mb-4 { margin-bottom: var(--space-4) !important; }
.u-mb-6 { margin-bottom: var(--space-6) !important; }
.u-my-3 { margin-block: var(--space-3) !important; }
.u-ml-auto { margin-left: auto !important; }
.u-pb-0 { padding-bottom: 0 !important; }
.u-pb-16 { padding-bottom: var(--space-16) !important; }
.u-pl-5 { padding-left: var(--space-5) !important; }
.u-px-0 { padding-inline: 0 !important; }
.u-code-pad { padding: var(--space-3) var(--space-4) !important; overflow-x: auto; }
.u-border-bottom { border-bottom: var(--border-width) solid var(--color-border) !important; }
.u-border-top-0 { border-top: 0 !important; }
.u-text-h2 { font-size: var(--text-h2) !important; }
.u-text-h3 { font-size: var(--text-h3) !important; }
.u-text-lead { font-size: 1.125rem !important; font-weight: var(--weight-medium) !important; }
.u-text-key { font-size: 1.0625rem !important; letter-spacing: 0.05em; }
.u-text-left { text-align: left !important; }
.u-bold { font-weight: var(--weight-medium) !important; }
.u-color-text { color: var(--color-text) !important; }
.u-color-danger { color: var(--color-danger-text) !important; }
.u-block { display: block !important; }
.u-inline { display: inline !important; }
.u-static { position: static !important; }
.u-gap-x-4 { gap: 0 var(--space-4) !important; }
.u-square { aspect-ratio: 1 / 1 !important; }
.u-bg-transparent { background: transparent !important; }
.u-pre-wrap { white-space: pre-wrap !important; }
.u-break-anywhere { overflow-wrap: anywhere !important; }

/* ---------- Scenes (decisions.md, "Animations") ----------
   Small drawings of the product on Home and How it works, built from the
   tokens so they follow both themes. The How it works slides play once when
   scene.js marks them .is-playing. Anything running past 5 seconds has a pause
   button, and Home's looping hero (.scene--loop) also stops off screen.
   Everything drawn here is the finished state: animation only ever comes on
   top, inside the media query below, so no script or reduced motion just
   shows the end. Only opacity and transform move, so the layout never shifts. */
.scene-wrap { display: grid; gap: var(--space-2); min-width: 0; }
.scene-pause { justify-self: end; }
.scene-pause[hidden] { display: none; }
.scene-pause.is-done { visibility: hidden; }
/* How it works, one step at a time (scene.js adds .is-stepping). The steps share
   one grid cell, so the box is as tall as the tallest and the buttons stay put. */
.how-steps__nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-block: var(--space-4) var(--space-8); }
.how-steps__nav[hidden], .how-steps__nav [hidden] { display: none; }
.how-steps__nav [data-how-pause].is-done { visibility: hidden; }
.how-steps__next { position: relative; margin-left: auto; overflow: hidden; }
.how-steps__fill { position: absolute; inset: 0; background: oklch(1 0 0 / 0.3); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.how-steps__label { position: relative; }
@media screen {
  .how-steps.is-stepping .how-steps__cards { display: grid; padding: var(--space-4); background: var(--color-surface); border: var(--border-width) solid var(--color-border); box-shadow: var(--shadow-1); }
  .how-steps.is-stepping .how-step { grid-area: 1 / 1; min-width: 0; margin: 0; visibility: hidden; }
  .how-steps.is-stepping .how-step.is-current { visibility: visible; }
}
@media screen and (min-width: 48rem) {
  .how-steps.is-stepping .how-steps__cards { padding: var(--space-6); }
}
.scene { position: relative; display: grid; gap: var(--space-3); align-content: start; margin: 0; padding: var(--space-4); overflow: hidden; background: var(--color-surface); border: var(--border-width) solid var(--color-border); box-shadow: var(--shadow-1); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.scene--shot { width: 100%; }
.scene .btn { pointer-events: none; }
.scene__head { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); justify-content: space-between; padding-bottom: var(--space-2); border-bottom: var(--border-width) solid var(--color-border); font-weight: var(--weight-bold); }
.scene__muted { color: var(--color-text-muted); font-weight: var(--weight-regular); }
.scene__mono { font-family: var(--font-mono); }
.scene__clip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene__end { text-align: right; }
.scene__rows { display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
.scene__rows--roomy { gap: var(--space-4); }
.scene__row { position: relative; display: flex; gap: var(--space-2); align-items: center; min-width: 0; min-height: 1.75rem; padding: var(--space-1) var(--space-2); background: var(--color-surface-sunken); }
.scene__row .icon { flex: none; }
.scene__row--split { justify-content: space-between; }
.scene__foot { display: flex; gap: var(--space-2); align-items: center; font-weight: var(--weight-medium); }
.scene__foot .icon { flex: none; color: var(--color-success); }
.scene__swap { display: inline-grid; flex: none; justify-items: end; }
.scene__swap > * { grid-area: 1 / 1; }
.scene__out { opacity: 0; }
.scene__hide-sm { display: none; }
.scene__bar { height: 0.375rem; overflow: hidden; background: var(--color-border-subtle); }
.scene__bar--strong { height: 0.625rem; }
.scene__fill { height: 100%; background: var(--color-progress); transform-origin: left; }
.scene__fill--done { background: var(--color-success); }
.scene-to-64 { transform: scaleX(0.64); }
.scene-to-79 { transform: scaleX(0.79); }

/* Slides: these show the idea, not the real forms, so they stay simple. */
.scene__card { display: grid; gap: var(--space-3); align-content: start; min-width: 0; }
.scene__input { position: relative; display: flex; align-items: center; min-width: 0; min-height: 2.25rem; padding-inline: var(--space-2); overflow: hidden; background: var(--color-bg); border: var(--border-width) solid var(--color-border-strong); font-family: var(--font-mono); white-space: nowrap; }
.scene__typed { position: relative; display: inline-block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.scene__typed::after { content: ""; position: absolute; inset: 0; background: var(--color-bg); transform: scaleX(0); transform-origin: right; }
.scene__options { display: grid; gap: var(--space-1); }
.scene__option { position: relative; display: flex; gap: var(--space-2); align-items: center; min-height: 1.75rem; padding-inline: var(--space-2); border: var(--border-width) solid var(--color-border-subtle); }
.scene__pick { position: absolute; inset: 0; background: var(--color-accent-tint); box-shadow: inset 0 0 0 var(--border-width-strong) var(--color-accent); }
.scene__mark { position: relative; flex: none; display: grid; place-items: center; width: 0.875rem; height: 0.875rem; background: var(--color-bg); border: var(--border-width) solid var(--color-border-strong); }
.scene__mark-fill { width: 0.5rem; height: 0.5rem; background: var(--color-accent); }
.scene__option-text { position: relative; }
.scene__group { display: grid; gap: var(--space-2); padding: var(--space-3); background: var(--color-surface-sunken); border: var(--border-width) solid var(--color-border-strong); }
.scene__group-title { font-weight: var(--weight-bold); }
.scene__map { display: grid; gap: var(--space-1); align-items: end; }
.scene__side { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--space-1) var(--space-2); align-items: center; min-width: 0; }
.scene__input[data-scene-click]::after { content: ""; position: absolute; inset: 0; box-shadow: var(--focus-ring-plain); opacity: 0; pointer-events: none; }
.scene__input--new { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); font-weight: var(--weight-medium); }
.scene__arrow .icon { transform: rotate(90deg); }
.scene__arrow { display: grid; place-items: center; min-height: 1.5rem; padding-left: calc(2.5rem + var(--space-2)); color: var(--color-accent); }

/* Test and measure: step 3 */
.scene__test { display: grid; gap: var(--space-1); }
.scene__test-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; }
.scene__result { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; }
.scene__result--ok { background: var(--color-success-tint); color: var(--color-success-text); }
.scene__result--testing { background: var(--color-info-tint); color: var(--color-info-text); }
.scene__result--problem { background: var(--color-warning-tint); color: var(--color-warning-text); }

.scene__line { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); justify-content: space-between; }
.scene__line--total { padding-top: var(--space-2); border-top: var(--border-width-strong) solid var(--color-text); font-size: var(--text-body); font-weight: var(--weight-bold); }
.scene__action { justify-self: end; }

/* Progress: step 5 */
.scene__status { font-size: var(--text-small); font-weight: var(--weight-bold); }
.scene__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); justify-content: space-between; color: var(--color-text-muted); }
.scene__meta strong { color: var(--color-text); }
.scene__progress { display: grid; gap: var(--space-1); }
.scene__progress-head { display: flex; gap: var(--space-2); align-items: center; justify-content: space-between; min-width: 0; }

/* Fixing a problem: step 3. It floats over the rows, so nothing moves. */
.scene__dialog { position: absolute; inset: auto var(--space-4) var(--space-4) var(--space-4); z-index: 3; }
.scene__dialog-body { display: grid; gap: var(--space-2); padding: var(--space-3); background: var(--color-surface); border: var(--border-width) solid var(--color-border-strong); box-shadow: var(--shadow-2); }
.scene__dialog .scene__foot .icon { color: var(--color-warning-text); }

/* The pointer: only ever moved by scene.js. */
.scene__pointer { position: absolute; top: 0; left: 0; z-index: 5; width: 2rem; height: 2rem; opacity: 0; pointer-events: none; transform-origin: 20% 10%; }
.scene__pointer svg { display: block; width: 100%; height: 100%; fill: oklch(1 0 0); stroke: oklch(0.15 0.01 255); stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 2px 3px oklch(0.15 0.01 255 / 0.5)); }
.scene__ripple { position: absolute; top: -1rem; left: -1rem; z-index: 4; width: 2rem; height: 2rem; border: var(--border-width-strong) solid var(--color-accent); border-radius: 50%; opacity: 0; pointer-events: none; }

/* Home's hero: folders, then email, then the final re-sync, between splashes.
   The old panel stays full (we copy, never move) and nothing is held between
   the two (mail is never stored). */
.scene--copy { grid-template-columns: minmax(0, 1fr) 2.5rem minmax(0, 1fr); gap: var(--space-3) 0; }
.scene__stages { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.scene__stage { display: grid; gap: var(--space-1); align-content: end; font-weight: var(--weight-medium); }
.scene__stage .scene__bar { height: 0.25rem; }
.scene__stage .scene__fill { background: var(--color-accent); }
.scene__panel { display: grid; gap: var(--space-2); align-content: start; min-width: 0; }
.scene__panel-name { font-weight: var(--weight-bold); }
.scene__folder { display: grid; gap: 0.125rem; padding: var(--space-1) var(--space-2); position: relative; background: var(--color-surface-sunken); }
.scene__folder-name { display: flex; gap: var(--space-1); align-items: center; justify-content: space-between; min-height: 1.125rem; }
.scene__folder .icon { flex: none; color: var(--color-success); }
.scene__folder .scene__bar { height: 0.25rem; }
.scene__folder::after { content: ""; position: absolute; inset: 0; background: var(--color-accent); opacity: 0; pointer-events: none; }
.scene__link { position: relative; display: grid; gap: var(--space-1); place-items: center; align-content: center; color: var(--color-accent); }
.scene__flow { width: 1.75rem; height: 0.25rem; overflow: hidden; opacity: 0; }
.scene__flow-dots { display: block; width: 3.5rem; height: 100%; background: repeating-linear-gradient(90deg, var(--color-accent) 0 0.25rem, transparent 0.25rem 0.5rem); }
.scene__splash { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: var(--space-4); background: var(--color-accent); color: var(--color-on-accent); text-align: center; opacity: 0; pointer-events: none; }
.scene__splash-text { grid-area: 1 / 1; display: grid; gap: var(--space-1); justify-items: center; opacity: 0; }
.scene__splash-title { font-size: var(--text-h3); font-weight: var(--weight-heavy); letter-spacing: var(--tracking-heading); }
.scene__splash .icon { width: 2rem; height: 2rem; }

@media (min-width: 36rem) {
  .scene--shot { gap: var(--space-4); padding: var(--space-6); font-size: var(--text-small); }
  .scene--two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
  .scene__hide-sm { display: inline; }
  .scene__map { grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr); gap: var(--space-2); }
  .scene__side { grid-template-columns: minmax(0, 1fr); }
  .scene__arrow { min-height: 2.25rem; padding-left: 0; }
  .scene__arrow .icon { transform: none; }
}

.scene-d1 { --scene-delay: 0.3s; }
.scene-d2 { --scene-delay: 0.7s; }
.scene-d3 { --scene-delay: 1.1s; }
.scene-d4 { --scene-delay: 1.5s; }
.scene-d5 { --scene-delay: 1.9s; }
.scene-d6 { --scene-delay: 2.3s; }
.scene-d7 { --scene-delay: 2.7s; }
.scene-d8 { --scene-delay: 3.1s; }
.scene-d9 { --scene-delay: 3.5s; }
.scene-d10 { --scene-delay: 3.9s; }
.scene-d11 { --scene-delay: 4.3s; }
.scene-d12 { --scene-delay: 4.7s; }
.scene-d13 { --scene-delay: 5.1s; }
.scene-d14 { --scene-delay: 5.5s; }
.scene-d15 { --scene-delay: 5.9s; }
.scene-d16 { --scene-delay: 6.3s; }
.scene-d17 { --scene-delay: 6.7s; }
.scene-d18 { --scene-delay: 7.1s; }
.scene-l1 { --loop-delay: 0.45s; }
.scene-l2 { --loop-delay: 0.9s; }
.scene-l3 { --loop-delay: 1.35s; }

@keyframes scene-in { from { opacity: 0; transform: translateY(0.375rem); } }
@keyframes scene-pop { from { opacity: 0; transform: scale(0.8); } }
@keyframes scene-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes scene-grow { from { transform: scaleX(0); } }
@keyframes scene-type { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes scene-focus { 0%, 100% { opacity: 0; } 15%, 75% { opacity: 1; } }
@keyframes scene-sweep { from { opacity: 0.14; transform: translateY(-100%); } to { opacity: 0.14; transform: translateY(100%); } }
/* One 18-second loop. Start splash to 12%, folders to 30%, email to 62%,
   final re-sync to 84%, end splash to 100%. A delayed piece wraps round while
   the splash covers it (--loop-delay stays under 9% of the loop). */
@keyframes scene-loop-splash { 0%, 9% { opacity: 1; } 12%, 85% { opacity: 0; } 88%, 100% { opacity: 1; } }
@keyframes scene-loop-start { 0% { opacity: 0; transform: translateY(0.5rem); } 2%, 9% { opacity: 1; transform: translateY(0); } 12%, 100% { opacity: 0; } }
@keyframes scene-loop-end { 0%, 85% { opacity: 0; transform: scale(0.9); } 88%, 97% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes scene-loop-stage1 { 0%, 12% { transform: scaleX(0); } 30%, 100% { transform: scaleX(1); } }
@keyframes scene-loop-stage2 { 0%, 30% { transform: scaleX(0); } 62%, 100% { transform: scaleX(1); } }
@keyframes scene-loop-stage3 { 0%, 62% { transform: scaleX(0); } 84%, 100% { transform: scaleX(1); } }
@keyframes scene-loop-label1 { 0%, 11% { opacity: 0.5; } 13%, 100% { opacity: 1; } }
@keyframes scene-loop-label2 { 0%, 29% { opacity: 0.5; } 31%, 100% { opacity: 1; } }
@keyframes scene-loop-label3 { 0%, 61% { opacity: 0.5; } 63%, 100% { opacity: 1; } }
@keyframes scene-loop-folder { 0%, 13% { opacity: 0; transform: translateY(0.375rem); } 16%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes scene-loop-bar { 0%, 31% { transform: scaleX(0); } 52%, 100% { transform: scaleX(1); } }
@keyframes scene-loop-sync { 0%, 63% { opacity: 0; } 66% { opacity: 0.22; } 70%, 100% { opacity: 0; } }
@keyframes scene-loop-tick { 0%, 66% { opacity: 0; transform: scale(0.5); } 68%, 100% { opacity: 1; transform: scale(1); } }
@keyframes scene-loop-foot { 0%, 77% { opacity: 0; } 79%, 100% { opacity: 1; } }
@keyframes scene-loop-flow { 0%, 13% { opacity: 0; } 15%, 80% { opacity: 1; } 83%, 100% { opacity: 0; } }
@keyframes scene-loop-dots { from { transform: translateX(-0.5rem); } to { transform: translateX(0); } }

@media screen and (prefers-reduced-motion: no-preference) {
  /* Drawings wait at their start, even before scene.js has run, so the first
     screen doesn't flash its end. If the script never loads they stay there:
     they're decoration, and the text beside them is untouched. */
  @media (scripting: enabled) {
    .scene:not(.is-playing) .scene__in, .scene:not(.is-playing) .scene__pop { opacity: 0; }
    .scene:not(.is-playing) .scene__out { opacity: 1; }
    .scene:not(.is-playing) .scene__fill { transform: scaleX(0); }
    .scene:not(.is-playing) .scene__typed::after { transform: scaleX(1); }
    .scene--loop:not(.is-playing) .scene__splash, .scene--loop:not(.is-playing) .scene__splash-start { opacity: 1; }
  }
  .scene.is-playing .scene__in { animation: scene-in 400ms var(--ease) var(--scene-delay, 0s) backwards; }
  .scene.is-playing .scene__pop { animation: scene-pop 300ms var(--ease) var(--scene-delay, 0s) backwards; }
  .scene.is-playing .scene__out { animation: scene-out 200ms linear var(--scene-delay, 0s) backwards; }
  .scene.is-playing .scene__typed::after { animation: scene-type 700ms steps(16) var(--scene-delay, 0s) backwards; }
  .scene.is-playing .scene__input[data-scene-click]::after { animation: scene-focus 1.1s linear var(--scene-delay, 0s); }
  .scene.is-playing .scene__fill { animation: scene-grow 800ms linear var(--scene-delay, 0.2s) backwards; }
  .scene.is-playing .scene-fill--long { animation-duration: 3s; animation-timing-function: var(--ease); }

  .scene--loop.is-playing { --loop: 18s; }
  .scene--loop.is-playing .scene__splash { animation: scene-loop-splash var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene__splash-start { animation: scene-loop-start var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene__splash-end { animation: scene-loop-end var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene-stage-1 .scene__fill { animation: scene-loop-stage1 var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene-stage-2 .scene__fill { animation: scene-loop-stage2 var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene-stage-3 .scene__fill { animation: scene-loop-stage3 var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene-stage-1 > span { animation: scene-loop-label1 var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene-stage-2 > span { animation: scene-loop-label2 var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene-stage-3 > span { animation: scene-loop-label3 var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene__panel--new .scene__folder { animation: scene-loop-folder var(--loop) linear var(--loop-delay, 0s) infinite backwards; }
  .scene--loop.is-playing .scene__panel--new .scene__folder .scene__fill { animation: scene-loop-bar var(--loop) linear var(--loop-delay, 0s) infinite backwards; }
  .scene--loop.is-playing .scene__folder::after { animation: scene-loop-sync var(--loop) linear var(--loop-delay, 0s) infinite backwards; }
  .scene--loop.is-playing .scene__folder .icon { animation: scene-loop-tick var(--loop) linear var(--loop-delay, 0s) infinite backwards; }
  .scene--loop.is-playing .scene__panel--new .scene__foot { animation: scene-loop-foot var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene__flow { animation: scene-loop-flow var(--loop) linear infinite backwards; }
  .scene--loop.is-playing .scene__flow-dots { animation: scene-loop-dots 600ms linear infinite; }
  .scene--loop.is-offscreen *, .scene--loop.is-offscreen *::after { animation-play-state: paused !important; }

  /* The real example quote and trust strip are page content, so they only
     hide once scene.js is running (.is-armed): a failed script leaves them
     in place. */
  .receipt.scene-play.is-armed:not(.is-playing) tbody tr,
  .receipt.scene-play.is-armed:not(.is-playing) .receipt__compare,
  .receipt.scene-play.is-armed:not(.is-playing) .receipt__line,
  .trust-strip.scene-play.is-armed:not(.is-playing) li { opacity: 0; }
  .receipt.scene-play.is-playing { position: relative; overflow: clip; }
  .receipt.scene-play::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(transparent, var(--color-accent), transparent); opacity: 0; pointer-events: none; }
  .receipt.scene-play.is-playing::before { animation: scene-sweep 1.9s linear 0.2s; }
  .receipt.scene-play.is-playing tbody tr { animation: scene-in 400ms var(--ease) var(--scene-delay) backwards; }
  .receipt.scene-play.is-playing tbody td:last-child { animation: scene-pop 300ms var(--ease) calc(var(--scene-delay) + 200ms) backwards; }
  .receipt.scene-play tbody tr:nth-child(1) { --scene-delay: 0.2s; }
  .receipt.scene-play tbody tr:nth-child(2) { --scene-delay: 0.5s; }
  .receipt.scene-play tbody tr:nth-child(3) { --scene-delay: 0.8s; }
  .receipt.scene-play tbody tr:nth-child(4) { --scene-delay: 1.1s; }
  .receipt.scene-play tbody tr:nth-child(5) { --scene-delay: 1.4s; }
  .receipt.scene-play tbody tr:nth-child(6) { --scene-delay: 1.7s; }
  .receipt.scene-play.is-playing .receipt__compare { animation: scene-in 400ms var(--ease) 2.1s backwards; }
  .receipt.scene-play.is-playing .receipt__line { animation: scene-in 400ms var(--ease) 2.4s backwards; }
  .receipt.scene-play.is-playing .receipt__line:nth-child(2) { animation-delay: 2.7s; }
  .receipt.scene-play.is-playing .receipt__line--total { animation: scene-pop 400ms var(--ease) 3s backwards; transform-origin: right; }
  .trust-strip.scene-play.is-playing li { animation: scene-in 400ms var(--ease) backwards; }
  .trust-strip.scene-play.is-playing li:nth-child(2) { animation-delay: 150ms; }
  .trust-strip.scene-play.is-playing li:nth-child(3) { animation-delay: 300ms; }
  .trust-strip.scene-play.is-playing li:nth-child(4) { animation-delay: 450ms; }
}

/* ---------- Print (report page) ---------- */
@media print {
  .site-header, .site-footer, .btn, .theme-switch, .toast-region { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap, .receipt { box-shadow: none; border-color: #999; }
  /* The migration report (M6): only the report itself, rows kept whole. */
  .app-header, .skip-link, .live-note, .account-menu { display: none !important; }
  .report .table-wrap { overflow: visible; }
  .report tr, .report .batch-header__facts > div { break-inside: avoid; }
  .report .page-header__meta, .report .text-muted { color: #333; }
}

/* The analytics question (templates/partials/cookie-banner.php). Not in the
   design export: a bar fixed to the foot of the page, in the footer's colours. */
.cookie-banner { position: sticky; bottom: 0; z-index: 20; padding-block: var(--space-4); border-top: var(--border-width) solid var(--color-border-strong); background: var(--color-surface); font-size: var(--text-small); }
.cookie-banner__inner { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; }
.cookie-banner__inner > div { flex: 1 1 24rem; }
.cookie-banner__title { margin: 0 0 var(--space-1); font-size: var(--text-body); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
