/* Split Frame — components and screens. Tokens live in tokens.css. */

/* ── Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--mist); color: var(--deep);
  font: 400 var(--fs-md)/var(--lh-body) var(--font);
  font-variation-settings: "opsz" 16;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s-3); top: -60px; z-index: 100; background: var(--deep); color: #fff; padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); }
.skip:focus { top: var(--s-3); }
[hidden] { display: none !important; }

.display { font-variation-settings: "opsz" 96; font-weight: 700; letter-spacing: -0.02em; line-height: var(--lh-tight); text-wrap: balance; margin: 0; }
.h1 { font-size: var(--fs-2xl); }
.h2 { font-size: var(--fs-xl); }
.h3 { font-size: var(--fs-lg); font-variation-settings: "opsz" 40; font-weight: 700; margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin: 0; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  --bg: var(--deep); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5);
  border: 0; border-radius: var(--r-pill);
  background: var(--bg); color: var(--fg);
  font-weight: 700; font-size: var(--fs-md); text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast);
}
.btn:hover { background: var(--bg-hover, var(--deep-2)); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { box-shadow: var(--focus); border-radius: var(--r-pill); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.lg { min-height: var(--tap-lg); font-size: var(--fs-lg); padding: 0 var(--s-6); }
.btn.block { width: 100%; }
.btn.brand { --bg: var(--brand-ink); --bg-hover: #085c70; }
.btn.go { --bg: var(--after-ink); --bg-hover: #115c40; }
.btn.ghost { --bg: transparent; --fg: var(--deep); --bg-hover: var(--mist-2); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn.ghost:focus-visible { box-shadow: inset 0 0 0 1.5px var(--line-strong), var(--focus); }
.btn.quiet { --bg: transparent; --fg: var(--brand-ink); --bg-hover: var(--brand-tint); padding: 0 var(--s-3); }
.btn.danger { --bg: var(--danger-ink); --bg-hover: #8a1c16; }
.btn.on-dark { --bg: #fff; --fg: var(--deep); --bg-hover: #e8f1f2; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 2s; } }
.icon-btn { width: var(--tap); height: var(--tap); display: inline-grid; place-items: center; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--deep); }
.icon-btn:hover { background: var(--mist-2); }
.icon-btn:focus-visible { border-radius: var(--r-pill); }
.icon { width: 22px; height: 22px; flex: none; }

/* ── Chips ────────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 var(--s-4);
  border-radius: var(--r-pill); border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--deep);
  font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.chip:hover { border-color: var(--deep); }
.chip[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: #fff; }
.chip[aria-pressed="true"]::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--tick) center/contain no-repeat; mask: var(--tick) center/contain no-repeat; }
.chip:focus-visible { border-radius: var(--r-pill); }
:root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7'/%3E%3C/svg%3E"); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.pill.draft { background: var(--mist-2); color: var(--ink-2); }
.pill.submitted { background: var(--brand-tint); color: var(--brand-ink); }
.pill.returned { background: var(--warn-tint); color: var(--warn-ink); }
.pill.published { background: var(--after-tint); color: var(--after-ink); }
.pill.stale { background: var(--warn-tint); color: var(--warn-ink); }
.pill.paid { background: var(--after-tint); color: var(--after-ink); }
.pill.unpaid { background: var(--mist-2); color: var(--ink-2); }

/* ── Fields ───────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: var(--fs-sm); }
.field small { color: var(--ink-2); font-size: var(--fs-xs); }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap);
  padding: 12px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  font-size: var(--fs-md); line-height: 1.4;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(15, 157, 189, 0.25); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input.big { font-size: var(--fs-2xl); font-variation-settings: "opsz" 96; font-weight: 700; min-height: 72px; text-align: center; }

.note { border-radius: var(--r-md); padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); line-height: 1.45; }
.note.warn { background: var(--warn-tint); color: var(--warn-ink); }
.note.info { background: var(--brand-tint); color: var(--brand-ink); }
.note.error { background: var(--danger-tint); color: var(--danger-ink); }
.note.ok { background: var(--after-tint); color: var(--after-ink); }
.note b { color: inherit; }

/* ── Split frame (the signature component) ────────────────────────── */
.split { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--mist-2); aspect-ratio: 3 / 2; max-width: 100%; isolation: isolate; }
.split img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split .after-img { clip-path: inset(0 0 0 var(--pos, 50%)); }
.split .divider { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px; background: #fff; pointer-events: none; z-index: 2; }
.split .divider::after { content: ""; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: #fff; box-shadow: var(--e-handle); }
.split input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.split input[type=range]:focus-visible + .divider::after { box-shadow: var(--e-handle), var(--focus); }
.tag { position: absolute; top: 12px; z-index: 2; padding: 5px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: #fff; pointer-events: none; }
.tag.b { left: 12px; background: var(--brand-ink); }
.tag.a { right: 12px; background: var(--after-ink); }

/* Edit mode: two tappable halves */
.split.edit { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #fff; }
.slot { position: relative; border: 0; padding: 0; background: var(--mist-2); display: grid; place-items: center; overflow: hidden; color: var(--deep); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .slot-empty { display: grid; justify-items: center; gap: 6px; padding: var(--s-3); text-align: center; font-weight: 700; font-size: var(--fs-sm); }
.slot .slot-empty .plus { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 28px; line-height: 1; }
.slot.b .plus { background: var(--brand-ink); }
.slot.a .plus { background: var(--after-ink); }
.slot:focus-visible { box-shadow: inset 0 0 0 4px var(--brand); border-radius: 0; }
.slot .replace { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); z-index: 2; background: rgba(6, 52, 61, 0.72); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.slot .progress { position: absolute; inset: auto 0 0 0; height: 5px; background: rgba(255,255,255,.5); z-index: 3; }
.slot .progress i { display: block; height: 100%; background: var(--brand); transition: width var(--t-med); }
.slot.pending::after { content: "Waiting for signal"; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--warn-tint); color: var(--warn-ink); font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: var(--r-pill); z-index: 3; white-space: nowrap; }

.extras-strip { display: flex; gap: var(--s-2); overflow-x: auto; padding: 2px; scrollbar-width: none; }
.extras-strip::-webkit-scrollbar { display: none; }
.extra { position: relative; flex: none; width: 76px; height: 56px; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--mist-2); }
.extra img { width: 100%; height: 100%; object-fit: cover; }
.extra.add { border: 1.5px dashed var(--line-strong); background: transparent; display: grid; place-items: center; font-size: 24px; font-weight: 700; color: var(--brand-ink); }
.extra .x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(6,52,61,.8); color: #fff; font-size: 13px; display: grid; place-items: center; }

/* ── Sentence composer ────────────────────────────────────────────── */
.sentence { font-size: clamp(1.3rem, 5.4vw, 1.6rem); line-height: var(--lh-sentence); font-weight: 500; font-variation-settings: "opsz" 30; margin: 0; text-wrap: pretty; }
.ring { flex: none; }
.ring circle { transition: stroke-dasharray var(--t-med) var(--ease-out); }

/* ── Bottom sheet ─────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(6, 30, 36, 0.45); animation: fade var(--t-sheet) var(--ease-out); }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
  max-height: min(88vh, 88dvh); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--e-sheet);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: rise var(--t-sheet) var(--ease-out);
}
@media (min-width: 720px) { .sheet { left: 50%; right: auto; width: 640px; transform: translateX(-50%); bottom: 24px; border-radius: var(--r-xl); animation: pop var(--t-sheet) var(--ease-out); } }
.sheet-head { padding: 10px var(--s-5) var(--s-3); }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-body { padding: 0 var(--s-5) var(--s-4); overflow-y: auto; overscroll-behavior: contain; display: grid; gap: var(--s-5); align-content: start; }
.sheet-foot { padding: var(--s-3) var(--s-5) var(--s-5); border-top: 1px solid var(--line); display: flex; gap: var(--s-3); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, 20px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ── Stepper ──────────────────────────────────────────────────────── */
.stepper { display: grid; grid-template-columns: 1fr 52px 64px 52px; align-items: center; gap: var(--s-2); padding: 6px 0; }
.stepper + .stepper { border-top: 1px solid var(--line); }
.stepper label { font-weight: 600; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 26px; font-weight: 600; line-height: 1; display: grid; place-items: center; }
.stepper button:hover { border-color: var(--deep); }
.stepper button:focus-visible { border-radius: 50%; }
.stepper button[disabled] { opacity: 0.35; }
.stepper input { width: 64px; height: 52px; text-align: center; border: 0; background: transparent; font-size: var(--fs-xl); font-weight: 800; font-variation-settings: "opsz" 60; font-variant-numeric: tabular-nums; border-radius: var(--r-sm); }
.stepper input:focus-visible { box-shadow: var(--focus); }

.group-label { font-weight: 800; font-size: var(--fs-sm); margin: 0 0 var(--s-2); }
.svc-block { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-md); background: var(--mist); }
.svc-block h3 { font-size: var(--fs-lg); }

/* ── Suggest list (address search) ────────────────────────────────── */
.suggest { list-style: none; margin: 0; padding: 0; border-radius: var(--r-md); border: 1.5px solid var(--line); overflow: hidden; }
.suggest li + li { border-top: 1px solid var(--line); }
.suggest button { all: unset; box-sizing: border-box; width: 100%; display: grid; gap: 2px; padding: 12px 14px; min-height: 56px; cursor: pointer; }
.suggest button:hover, .suggest button[aria-selected="true"] { background: var(--brand-tint); }
.suggest button:focus-visible { box-shadow: inset 0 0 0 3px var(--brand); }
.suggest small { color: var(--ink-2); }

/* ── Toast ────────────────────────────────────────────────────────── */
.toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: grid; gap: var(--s-2); width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--deep); color: #fff; padding: 14px 18px; border-radius: var(--r-md); box-shadow: var(--e-float); font-weight: 600; animation: rise var(--t-sheet) var(--ease-out); pointer-events: auto; }
.toast.error { background: var(--danger-ink); }
.toast.ok { background: var(--after-ink); }

/* ── Tech app shell ───────────────────────────────────────────────── */
.phone-shell { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 var(--s-4); padding-top: env(safe-area-inset-top, 0px); }
.topbar { display: flex; align-items: center; gap: var(--s-2); min-height: 60px; }
.topbar .title { font-weight: 800; font-size: var(--fs-lg); }
.page { flex: 1; display: grid; gap: var(--s-5); align-content: start; padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: var(--s-3) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--mist) 70%, rgba(234,243,244,0)); }
.dock-inner { max-width: 528px; margin: 0 auto; display: flex; gap: var(--s-3); align-items: center; }

.empty-state { text-align: center; padding: var(--s-10) var(--s-4); display: grid; gap: var(--s-3); justify-items: center; color: var(--ink-2); }

/* Preview: tap-to-flag sentences */
.story p { margin: 0 0 var(--s-4); font-size: var(--fs-md); line-height: 1.7; }
.sent { all: unset; cursor: pointer; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sent:hover { background: var(--brand-tint); }
.sent:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.sent[aria-pressed="true"] { background: var(--flag); box-shadow: inset 0 -2px 0 var(--warn-mark); }
.hl { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.hl li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: var(--fs-sm); }
.hl li::before { content: ""; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: var(--after-ink); -webkit-mask: none; box-shadow: inset 0 0 0 5px var(--after-tint); }
.faq details { border-top: 1px solid var(--line); padding: var(--s-3) 0; }
.faq summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.faq details p { margin: var(--s-2) 0 0; color: var(--ink-2); }

.writing { display: grid; gap: var(--s-4); justify-items: center; text-align: center; padding: var(--s-10) var(--s-4); }
.writing .dots { display: flex; gap: 8px; }
.writing .dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); animation: bob 1s var(--ease-out) infinite; }
.writing .dots i:nth-child(2) { animation-delay: .15s; background: var(--brand-ink); }
.writing .dots i:nth-child(3) { animation-delay: .3s; background: var(--after); }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .writing .dots i { animation: none; } }

.qr-box { background: #fff; border-radius: var(--r-xl); padding: var(--s-5); display: grid; justify-items: center; gap: var(--s-3); }
.qr-box svg { width: min(78vw, 360px); height: auto; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.login form { width: min(100%, 400px); display: grid; gap: var(--s-4); }
.logo { display: block; width: auto; max-width: 100%; object-fit: contain; }
.logo.on-dark { filter: brightness(0) invert(1); }
.login form { background: var(--surface); border-radius: var(--r-xl); padding: var(--s-8) var(--s-6); box-shadow: 0 24px 60px -30px rgba(6, 52, 61, 0.35); }
@media (max-width: 420px) { .login form { padding: var(--s-6) var(--s-5); } }
.brandbar { display: flex; align-items: center; gap: var(--s-3); padding-top: var(--s-3); }
.brandbar-label { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); padding-left: var(--s-3); border-left: 1.5px solid var(--line-strong); line-height: 1.2; }

/* ── Office (desktop-first) ───────────────────────────────────────── */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s-4); margin: 0; font-size: var(--fs-sm); }
.facts dt { color: var(--ink-2); font-weight: 600; }
.facts dd { margin: 0; font-weight: 600; }
.editable { border-radius: var(--r-sm); padding: 6px 8px; margin: -6px -8px; }
.editable:hover { background: var(--mist); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin: 0 0 var(--s-2); }
.section-title h3 { font-size: var(--fs-md); }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-xs); color: var(--ink-2); }

table.grid { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--surface); border-radius: var(--r-md); overflow: hidden; }
table.grid th, table.grid td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid th { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: #f6fafa; }
table.grid td.num, table.grid th.num { text-align: right; }
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
.money-input { width: 96px; min-height: 40px; padding: 6px 10px; text-align: right; }

.cards2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; }
.status-dot.on { background: var(--after); }
.status-dot.off { background: var(--warn-mark); }

.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.full-preview { position: fixed; inset: 0; z-index: 50; background: rgba(6,30,36,.6); display: grid; grid-template-rows: auto 1fr; }
.full-preview .bar { background: var(--deep); color: #fff; display: flex; align-items: center; gap: var(--s-3); padding: 8px var(--s-4); }
.full-preview .device-toggle { display: flex; gap: 4px; margin-left: auto; }
.full-preview .stage { overflow: auto; display: grid; justify-items: center; padding: var(--s-4); }
.full-preview .stage iframe { background: #fff; border-radius: 12px; height: calc(100dvh - 90px); max-width: 100%; }

/* ── Full form ────────────────────────────────────────────────────── */
.ff { display: grid; gap: var(--s-3); }
.ff-jump {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--s-4)); padding: var(--s-2) var(--s-4);
  background: linear-gradient(var(--mist) 80%, rgba(234, 243, 244, 0));
}
.ff-jump::-webkit-scrollbar { display: none; }
.ff-pip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--deep); font-size: var(--fs-xs); font-weight: 700; }
.ff-pip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn-mark); }
.ff-pip.opt::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.ff-pip.done { border-color: transparent; background: var(--after-tint); color: var(--after-ink); }
.ff-pip.done::before { background: var(--after-ink); box-shadow: none; }
.ff-pip:focus-visible { border-radius: var(--r-pill); }
.ff-section { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-4); display: grid; gap: var(--s-4); scroll-margin-top: 64px; }
.ff-head { display: grid; grid-template-columns: 26px 1fr; gap: var(--s-3); align-items: start; }
.ff-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--warn-mark); color: #fff; }
.ff-mark.opt { box-shadow: inset 0 0 0 2px var(--line-strong); }
.ff-mark.done { background: var(--after-ink); box-shadow: none; }
.ff-mark svg { width: 14px; height: 14px; stroke-width: 3; }
.ff-opt { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.ff-body { display: grid; gap: var(--s-4); }
.ff-body .svc-block { background: var(--mist); }
.ff-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
@media (max-width: 380px) { .ff-pair { grid-template-columns: 1fr; } }
.ff-value { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--mist); }
.ff-value .icon { color: var(--brand-ink); }

/* ── App layout (MWW-style: one header, one page per task) ────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.app-bar { position: relative; z-index: 30; background: var(--deep); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.app-bar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px var(--s-4); padding: 10px var(--s-4); }
.brandmark { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brandmark:focus-visible { box-shadow: 0 0 0 3px var(--deep), 0 0 0 6px #fff; }
.logo-plate { display: inline-flex; align-items: center; background: #fff; border-radius: 10px; padding: 6px 12px; }
.brandmark-label { font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); padding-left: 12px; border-left: 1.5px solid rgba(255, 255, 255, 0.3); line-height: 1.2; }
.app-bar .hi { color: rgba(255, 255, 255, 0.85); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.app-bar .hi:hover { color: #fff; text-decoration: underline; }
.app-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.app-nav a, .app-nav button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: rgba(255, 255, 255, 0.85); font-size: var(--fs-sm); font-weight: 700; text-decoration: none; }
.app-nav a:hover, .app-nav button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.app-nav a[aria-current="page"] { background: #fff; color: var(--deep); }
.app-nav a:focus-visible, .app-nav button:focus-visible, .app-bar .hi:focus-visible { box-shadow: 0 0 0 3px var(--deep), 0 0 0 6px #fff; border-radius: var(--r-pill); }
@media (max-width: 720px) {
  .brandmark-label { display: none; }
  .app-nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-2)); }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav a, .app-nav button { flex: none; }
}
.app-main { width: 100%; max-width: 1100px; margin: 0 auto; padding: var(--s-6) var(--s-4) calc(120px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-content: start; }
.dash-card, .ff-section { min-width: 0; }
.btn.block, .btn.lg { white-space: normal; text-align: center; }
.app-main.narrow { max-width: 760px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: var(--fs-sm); text-decoration: none; color: var(--brand-ink); justify-self: start; min-height: 40px; }
.backlink:hover { text-decoration: underline; }
.dock-inner { max-width: 728px; }

/* Dashboard */
.dash-card { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-5); display: grid; gap: var(--s-3); align-content: start; }
.dash-hero { background: var(--deep); color: #fff; }
.dash-hero .muted { color: rgba(255, 255, 255, 0.78); }
.dash-hero .btn.ghost { --fg: #fff; --bg-hover: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45); }
.dash-hero .btn.brand { --bg: #fff; --fg: var(--deep); --bg-hover: #e6f2f4; }
.count-badge { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: var(--r-pill); background: var(--brand-ink); color: #fff; font-size: 13px; font-weight: 800; vertical-align: 2px; }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; }
.dash-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: var(--s-3) var(--s-4); align-items: center; padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.dash-row:first-child { border-top: 0; }
.dash-thumb { width: 72px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--mist-2); }
.dash-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dash-main { display: grid; gap: 2px; min-width: 0; }
.dash-main strong { font-size: var(--fs-md); }
.dash-main a { word-break: break-all; }
.dash-actions { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-2); }
.dash-actions > .row { justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
@media (max-width: 640px) {
  .dash-row { grid-template-columns: 56px minmax(0, 1fr); }
  .dash-thumb { width: 56px; height: 40px; }
  .dash-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
  .dash-actions > .row { justify-content: flex-start; }
}
.dash-filters .select { width: auto; min-width: 180px; }
.pay-row { gap: 6px; }
.pager { justify-content: space-between; padding-top: var(--s-3); border-top: 1px solid var(--line); }

/* Choose a service */
.service-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.service-card { display: flex; align-items: center; gap: var(--s-3); min-height: 72px; padding: var(--s-3) var(--s-4); border: 1.5px solid transparent; border-radius: var(--r-lg);
  background: var(--surface); color: var(--deep); font-weight: 700; font-size: var(--fs-md); text-align: left; }
.service-card:hover { border-color: var(--brand-ink); }
.service-card:focus-visible { border-radius: var(--r-lg); }
.service-card[disabled] { opacity: 0.6; }
.service-mark { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-ink); font-size: var(--fs-lg); font-weight: 800; }
.service-card .spin { width: 18px; height: 18px; margin-left: auto; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }

/* Review page */
.inline-preview { width: 100%; height: min(80vh, 900px); border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.actions-card { gap: var(--s-3); }
.card, .dash-card { min-width: 0; overflow-wrap: anywhere; }
/* Thumb-sized targets on touch screens (44px minimum). */
@media (pointer: coarse) {
  .app-nav a, .app-nav button, .backlink, .btn.quiet, .ff-pip, .money-input, .suggest button { min-height: 44px; }
}
