
/* Pony Express design system. Palette: Canvas, Parchment, Ink, Moss, Brass, Faded Rose.
   Brass and Rose are never used for text; Moss text only on Parchment (see docs/experience.md). */
:root {
  --canvas: #E8E0D8; --parchment: #F7F1E7; --ink: #1E1B16; --moss: #5C6E52; --brass: #C79A5B; --rose: #C79385;
  --bg: var(--canvas); --surface: var(--parchment); --text: var(--ink); --text-2: #5E574D; --secondary: var(--moss);
  --hairline: rgba(30, 27, 22, .12); --separator: rgba(30, 27, 22, .10); --fill: rgba(30, 27, 22, .06);
  --on-ink: var(--parchment); --primary: var(--ink); --sheet-shadow: 0 -10px 40px rgba(30, 27, 22, .18);
  --card-shadow: 0 1px 0 rgba(30, 27, 22, .04), 0 8px 24px rgba(30, 27, 22, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --r-card: 14px; --r-control: 12px; --tabbar-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* Dark: Ink ground, Parchment text, Canvas for secondary text and unselected tabs. Moss only as a fill. */
    --bg: var(--ink); --surface: color-mix(in srgb, var(--ink) 90%, var(--parchment)); --text: var(--parchment); --text-2: var(--canvas); --secondary: var(--canvas);
    --hairline: rgba(247, 241, 231, .12); --separator: rgba(247, 241, 231, .10); --fill: rgba(247, 241, 231, .07);
    --on-ink: var(--ink); --primary: var(--parchment); --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
    --card-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 17px/22px var(--font); letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.has-sheet .tabbar { display: none; }
body.has-tabs { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button, input, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.footnote { font-size: 13px; line-height: 18px; letter-spacing: -0.006em; color: var(--text-2); }
.subhead { font-size: 15px; line-height: 20px; letter-spacing: -0.015em; color: var(--text-2); }
.headline { font-weight: 600; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Focus: ink ring inside a brass halo, visible on both surfaces. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--brass); border-radius: 10px; }
@media (prefers-color-scheme: dark) { :focus-visible { outline-color: var(--parchment); } }

/* Navigation bar + large title */
.navbar { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 0.5px solid transparent; transition: border-color .2s; }
.navbar.scrolled { border-bottom-color: var(--hairline); }
.navbar-inner { max-width: 680px; margin: 0 auto; height: 44px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
.nav-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.navbar.scrolled .nav-title { opacity: 1; }
.nav-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding-right: 8px; font-size: 17px; color: var(--text); justify-self: start; }
.nav-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw; }
.nav-action { justify-self: end; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px; font-weight: 600; color: var(--text); background: none; border: 0; cursor: pointer; }
main { max-width: 680px; margin: 0 auto; padding: 4px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 24px; }
body.bare main { padding-top: max(24px, env(safe-area-inset-top)); }
.large-title { display: flex; flex-direction: column; gap: 10px; padding: 6px 4px 0; }
.large-title h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.011em; }

/* Banner (inline toast) */
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-control); background: var(--surface);
  border: 1px solid var(--hairline); box-shadow: var(--card-shadow); font-size: 15px; line-height: 20px; }
.banner .icon { color: var(--moss); flex: none; }
.banner.error { border-left: 4px solid var(--rose); }
@media (prefers-reduced-motion: no-preference) { .banner { animation: drop .35s cubic-bezier(.2, .8, .2, 1) both; } }
@keyframes drop { from { transform: translateY(-6px); opacity: 0; } }

/* Grouped inset lists */
.group { display: flex; flex-direction: column; gap: 6px; }
.group-header { font-size: 13px; line-height: 18px; text-transform: uppercase; letter-spacing: .02em; color: var(--text-2); padding: 0 16px; }
.group-footer { font-size: 13px; line-height: 18px; color: var(--text-2); padding: 0 16px; }
.list { background: var(--surface); border-radius: var(--r-card); border: 1px solid var(--hairline); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; position: relative; width: 100%;
  background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); }
.row + .row::before, .row + form > .row::before, form + .row::before, form + form > .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 0.5px; background: var(--separator); }
.row.has-avatar + .row.has-avatar::before { left: 72px; }
a.row:active, button.row:active { background: var(--fill); }
@media (hover: hover) { a.row:hover, button.row:hover { background: var(--fill); } }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 15px; line-height: 20px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .value { color: var(--text-2); font-size: 17px; white-space: nowrap; }
.row .chev { color: var(--text-2); opacity: .6; flex: none; }
.row .lead { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--text); }
.row.destructive .lead { background: var(--rose); color: var(--ink); }
.row.destructive { font-weight: 500; color: var(--text); }
.row-form { margin: 0; }
.list > form { margin: 0; }

/* Buttons */
.btn { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: var(--r-control); font-size: 17px; font-weight: 600; letter-spacing: -0.022em;
  background: var(--primary); color: var(--on-ink); width: 100%; max-width: 400px; transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.98); }
@media (hover: hover) { .btn:hover { filter: brightness(1.08); } }
.btn.tinted { background: color-mix(in srgb, var(--moss) 16%, var(--surface)); color: var(--text); }
.btn.plain { background: transparent; color: var(--text); }
.btn.destructive { background: var(--rose); color: var(--ink); }
.btn.small { min-height: 36px; width: auto; padding: 0 14px; font-size: 15px; border-radius: 18px; }
.btn.inline { width: auto; }
.actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.actions > form { width: 100%; display: flex; flex-direction: column; align-items: center; }
.actions.row-actions { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
.text-link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.link-button { background: none; border: 0; padding: 10px; cursor: pointer; font-weight: 600; color: var(--text); min-height: 44px; }

/* Cards */
.card { background: var(--surface); border-radius: var(--r-card); border: 1px solid var(--hairline); box-shadow: var(--card-shadow); padding: 20px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.tight { padding: 16px; gap: 12px; }
.card h2 { font-size: 22px; line-height: 28px; font-weight: 700; }
.card h3 { font-size: 17px; line-height: 22px; font-weight: 600; }

/* The agent card: the product's signature object */
.agent-card { position: relative; background: var(--surface); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 20px;
  border: 1px solid var(--hairline); box-shadow: 0 1px 0 rgba(30,27,22,.04), 0 18px 40px rgba(30,27,22,.10); overflow: hidden; }
.agent-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--brass); }
.agent-card .ac-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.agent-card .ac-label { font-size: 12px; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.agent-card .ac-number { font: 600 clamp(22px, 7.2vw, 36px)/1.1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.agent-card .ac-name { font-size: 22px; line-height: 28px; font-weight: 700; }
.agent-card .ac-handle { color: var(--text-2); }
.agent-card .ac-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
@media (prefers-reduced-motion: no-preference) { .agent-card.reveal { animation: settle .7s cubic-bezier(.2, .9, .25, 1.05) both; } }
@keyframes settle { from { transform: translateY(24px) scale(.96); opacity: 0; } }

/* Chips and pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; line-height: 18px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--moss); }
.pill.away .dot { background: var(--brass); }
.pill.status-button { align-self: flex-start; min-height: 32px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.title-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill.agent-switch { min-height: 32px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
fieldset.runtime-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.runtime-pick legend { padding: 0; margin-bottom: 8px; }
.chip.choice { position: relative; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.chip.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip.choice:has(input:checked) { background: var(--primary); color: var(--on-ink); border-color: var(--primary); }
.chip.choice:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--brass); }
.chip { border: 1px solid var(--hairline); background: var(--surface); border-radius: 999px; padding: 8px 14px; min-height: 36px; font-size: 15px; cursor: pointer; }
.tag { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 6px; background: var(--fill); color: var(--text-2); }
.badge { position: absolute; top: -4px; right: -10px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; background: var(--brass); color: var(--ink);
  font-size: 12px; line-height: 18px; font-weight: 700; text-align: center; box-shadow: 0 0 0 2px var(--surface); }

/* Avatars and the pairing visual */
.avatar { display: grid; place-items: center; flex: none; border-radius: 50%; font-weight: 600; color: var(--parchment); background: var(--moss); letter-spacing: 0; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.md { width: 44px; height: 44px; font-size: 17px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; box-shadow: 0 0 0 4px var(--bg), 0 10px 24px rgba(30,27,22,.15); }
.avatar.unknown { background: var(--surface); color: var(--text-2); border: 1.5px dashed var(--text-2); }
.pairing { display: flex; align-items: center; justify-content: center; gap: 0; padding: 12px 0 4px; }
.pairing-line { width: 72px; height: 3px; position: relative; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--brass) 0 7px, transparent 7px 13px); }
.pairing.connected .pairing-line { background: var(--brass); }
.pairing.connected .pairing-line span { position: absolute; inset: 0; background: var(--brass); }
@media (prefers-reduced-motion: no-preference) {
  .pairing.connected .pairing-line span { animation: draw .6s .1s ease-out both; transform-origin: left; }
  @keyframes draw { from { transform: scaleX(0); } }
}
.check-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--moss); color: var(--parchment); display: grid; place-items: center; margin: -18px auto 0; position: relative; box-shadow: 0 0 0 3px var(--bg); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span.label { font-size: 13px; line-height: 18px; color: var(--text-2); padding: 0 4px; text-transform: uppercase; letter-spacing: .02em; }
.input, textarea.input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-control); border: 1px solid var(--hairline);
  background: var(--surface); font-size: 17px; line-height: 22px; }
textarea.input { min-height: 104px; resize: vertical; }
.input::placeholder { color: color-mix(in srgb, var(--text-2) 75%, transparent); }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 55%, transparent); }
.handle-input { position: relative; }
.handle-input .at { position: absolute; left: 14px; top: 13px; color: var(--text-2); }
.handle-input .input { padding-left: 32px; }
.field-hint { font-size: 13px; line-height: 18px; color: var(--text-2); padding: 0 4px; min-height: 18px; }
.field-hint.ok { color: var(--text); }
.field-hint.ok::before { content: "✓ "; color: var(--moss); font-weight: 700; }
.field-hint.bad::before { content: "! "; font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 10px; }

/* Segmented control (radio-based, no script needed) */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 2px; border-radius: 11px; background: var(--fill); }
.segmented label { position: relative; display: grid; place-items: center; min-height: 36px; border-radius: 9px; font-size: 15px; font-weight: 600; cursor: pointer; color: var(--text-2); text-align: center; padding: 0 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(30,27,22,.12), 0 3px 8px rgba(30,27,22,.08); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 1px; box-shadow: 0 0 0 4px var(--brass); }

/* Switch (checkbox) */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: rgba(30,27,22,.16); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s cubic-bezier(.3,.7,.4,1); }
.switch input:checked + span { background: var(--moss); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--brass); }

/* Checkmark list (privacy) */
.check-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; cursor: pointer; position: relative; }
.check-row + .check-row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 0.5px; background: var(--separator); }
.check-row input { position: absolute; opacity: 0; }
.check-row .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.check-row .tick { color: var(--moss); opacity: 0; }
.check-row:has(input:checked) .tick { opacity: 1; }
.check-row:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--ink); }

/* Conversation */
.thread { display: flex; flex-direction: column; gap: 2px; }
.day { text-align: center; font-size: 12px; color: var(--text-2); margin: 14px 0 6px; font-weight: 600; letter-spacing: .02em; }
.msg { display: flex; flex-direction: column; max-width: 78%; gap: 3px; margin-top: 8px; align-self: flex-start; align-items: flex-start; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 9px 14px; border-radius: 19px; background: var(--surface); border: 1px solid var(--hairline); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 22px; }
.mine .bubble { background: var(--primary); color: var(--on-ink); border-color: transparent; }
.msg-meta { font-size: 12px; line-height: 16px; color: var(--text-2); padding: 0 6px; }
.system-note { align-self: center; max-width: 88%; text-align: center; font-size: 13px; line-height: 18px; color: var(--text-2); padding: 8px 14px; margin: 10px 0 2px;
  border-radius: 14px; background: color-mix(in srgb, var(--brass) 14%, var(--surface)); border: 1px solid var(--hairline); }
.system-note b { color: var(--text); font-weight: 600; }
.composer { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); display: flex; gap: 8px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 24px; padding: 6px 6px 6px 16px; box-shadow: var(--card-shadow); }
body:not(.has-tabs) .composer { bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 36px; max-height: 160px; padding: 7px 0; font-size: 17px; line-height: 22px; outline: none; }
.composer .send { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.auto-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--r-control);
  background: color-mix(in srgb, var(--moss) 14%, var(--surface)); border: 1px solid var(--hairline); font-size: 15px; }

/* Needs-you cards */
.need { display: flex; flex-direction: column; gap: 12px; }
.need-head { display: flex; align-items: center; gap: 10px; }
.need-head .grow { flex: 1; min-width: 0; }
.quote { border-left: 3px solid var(--brass); padding: 2px 0 2px 12px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.draft { background: var(--bg); border-radius: var(--r-control); padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--hairline); }
.need .actions { flex-direction: row; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.need .actions .btn { width: auto; min-height: 40px; padding: 0 16px; font-size: 15px; border-radius: 20px; }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 0;
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 0.5px solid var(--hairline); }
.tab { position: relative; flex: 1; max-width: 160px; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--secondary); }
.tab-icon { position: relative; display: grid; place-items: center; height: 26px; }
.tab-label { font-size: 11px; line-height: 13px; font-weight: 600; letter-spacing: .01em; }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brass); }

/* Sheets (server-rendered; Escape / backdrop closes) */
.sheet-layer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 18, 15, .38); }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 16px 16px 0 0;
  padding: 10px max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left));
  box-shadow: var(--sheet-shadow); display: flex; flex-direction: column; gap: 18px; }
.sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--hairline); margin: 0 auto 2px; flex: none; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: -8px; }
.sheet-bar h2 { font-size: 17px; font-weight: 600; text-align: center; }
.sheet-bar .cancel { justify-self: start; }
.sheet-bar .done { justify-self: end; }
.sheet .bg-row { background: var(--bg); }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .32s cubic-bezier(.2, .9, .3, 1) both; }
  .sheet-backdrop { animation: fade .25s ease-out both; }
  @keyframes up { from { transform: translateY(40%); opacity: .4; } }
  @keyframes fade { from { opacity: 0; } }
}
@media (min-width: 720px) { .sheet-layer { align-items: center; } .sheet { border-radius: 16px; max-height: 86vh; } }
/* Action sheet: stacked rows, Cancel separate */
.action-sheet { background: transparent; box-shadow: none; padding-top: 0; gap: 8px; }
.action-sheet::before { display: none; }
.action-group { background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--sheet-shadow); }
.action-group .as-title { padding: 16px 20px 12px; text-align: center; font-size: 13px; line-height: 18px; color: var(--text-2); }
.action-group .as-title b { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.action-group form, .action-group a { display: block; }
.action-group button, .action-group a { width: 100%; min-height: 56px; border: 0; background: none; font-size: 19px; cursor: pointer; border-top: 0.5px solid var(--separator); color: var(--text); display: grid; place-items: center; }
.action-group .confirm { padding: 4px 12px 12px; border-top: 0.5px solid var(--separator); }
.action-group .confirm button { min-height: 50px; border: 0; border-radius: var(--r-control); background: var(--rose); color: var(--ink); font-weight: 600; font-size: 17px; }
.action-group a.cancel { font-weight: 600; border-top: 0; }

/* QR */
.qr { width: 216px; max-width: 70%; align-self: center; padding: 14px; border-radius: 18px; background: #FFFDF8; border: 1px solid var(--hairline); }
.qr svg { display: block; width: 100%; height: auto; }
.copy-field { display: flex; gap: 8px; align-items: center; background: var(--bg); border-radius: var(--r-control); padding: 6px 6px 6px 14px; border: 1px solid var(--hairline); }
.copy-field input { flex: 1; min-width: 0; border: 0; background: transparent; font: 15px var(--font); font-variant-numeric: tabular-nums; color: var(--text); outline: none; }
.steps { display: flex; flex-direction: column; gap: 12px; padding-left: 22px; margin: 0; }
.steps li { padding-left: 2px; }
.steps li .subhead { display: inline; }
.steps code.block { margin: 8px 0; }
.handoff { gap: 10px; }
.handoff .btn { margin-right: 6px; }
a.chip { display: inline-flex; align-items: center; text-decoration: none; color: inherit; font-weight: 600; }
code.block { display: block; font: 13px/19px var(--mono); background: var(--bg); padding: 12px 14px; border-radius: var(--r-control); overflow-x: auto; white-space: pre; border: 1px solid var(--hairline); }

/* Landing */
.landing { display: flex; flex-direction: column; gap: 28px; padding-top: 12px; }
.brandline { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.mark { width: 34px; height: 34px; }
.mark.big { width: 72px; height: 72px; display: block; margin: 0 auto; filter: drop-shadow(0 10px 24px rgba(30,27,22,.18)); }
.hero h1 { font-size: clamp(34px, 9.6vw, 56px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; }
.hero .rotator { display: block; position: relative; overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; }
.hero .rot-phrase { display: block; text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: .07em; text-underline-offset: .12em; text-decoration-skip-ink: none; }
.hero .rot-phrase.next { position: absolute; left: 0; right: 0; top: 0; }
.hero p { font-size: 19px; line-height: 26px; color: var(--text-2); margin-top: 14px; max-width: 30ch; }
.hero-visual { position: relative; height: 230px; }
.hero-visual .agent-card { position: absolute; width: 62%; max-width: 280px; padding: 16px; gap: 10px; border-radius: 18px; }
.hero-visual .agent-card .ac-number { font-size: 17px; }
.hero-visual .agent-card .ac-name { font-size: 17px; line-height: 22px; }
.hero-visual .one { left: 0; top: 6px; transform: rotate(-4deg); }
.hero-visual .two { right: 0; top: 104px; transform: rotate(3deg); }
.hero-visual .link { position: absolute; left: 47%; top: 100px; width: 3px; height: 36px; background: var(--brass); border-radius: 2px; z-index: 2; }
@media (prefers-reduced-motion: no-preference) {
  .hero .rotator { transition: height .5s cubic-bezier(.2,.8,.2,1); }
  .hero .rot-phrase.in { animation: rotIn .6s cubic-bezier(.2,.8,.2,1) both; }
  .hero .rot-phrase.out { animation: rotOut .45s cubic-bezier(.4,0,.6,1) both; }
  @keyframes rotIn { from { transform: translateY(55%); opacity: 0; filter: blur(6px); } }
  @keyframes rotOut { to { transform: translateY(-55%); opacity: 0; filter: blur(6px); } }
  .hero-visual .one { animation: inLeft .8s cubic-bezier(.2,.9,.3,1) both; }
  .hero-visual .two { animation: inRight .8s .1s cubic-bezier(.2,.9,.3,1) both; }
  .hero-visual .link { animation: grow .4s .7s ease-out both; transform-origin: top; }
  @keyframes grow { from { transform: scaleY(0); } }
  @keyframes inLeft { from { transform: translateX(-30px) rotate(-8deg); opacity: 0; } }
  @keyframes inRight { from { transform: translateX(30px) rotate(7deg); opacity: 0; } }
}
.promise { display: grid; gap: 14px; }
.promise div { display: flex; gap: 12px; align-items: flex-start; }
.promise .icon { color: var(--moss); flex: none; margin-top: 1px; }
.allow-list, .never-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.allow-list li, .never-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 21px; }
.allow-list li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--moss)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4L18 8.5' stroke='%23F7F1E7' stroke-width='2.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.never-list li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1.6px solid var(--text-2);
  background: linear-gradient(45deg, transparent 45%, var(--text-2) 45%, var(--text-2) 55%, transparent 55%); }
.steps-indicator { display: flex; gap: 6px; justify-content: center; }
.steps-indicator span { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline); }
.steps-indicator span.on { background: var(--ink); width: 20px; border-radius: 4px; }
@media (prefers-color-scheme: dark) { .steps-indicator span.on { background: var(--parchment); } }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 20px; }
.empty .glyph { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--hairline); color: var(--moss); margin-bottom: 4px; }
.empty h2 { font-size: 22px; line-height: 28px; font-weight: 700; }
.empty p { color: var(--text-2); max-width: 32ch; }
details.disclosure > summary { list-style: none; cursor: pointer; }
details.disclosure > summary::-webkit-details-marker { display: none; }
@media (min-width: 1024px) {
  main { padding-top: 16px; }
}
