/* HSK Meter app (Swift Bot Labs). Light by default, dark via prefers-color-scheme. Mobile first. */
:root {
  --bg: #f5f7fb;
  --bg-tint: #eef2fa;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --ink: #0e1628;
  --ink-2: #44506a;
  --ink-3: #66728a;
  --line: #e2e7f0;
  --line-2: #d3dae7;
  --accent: #2f6bff;
  --accent-ink: #1d4fd6;
  --accent-soft: #e9f0ff;
  --accent-2: #12b5a6;
  --ok: #0b8f61;
  --ok-soft: #e4f6ee;
  --warn: #a75a00;
  --warn-soft: #fdf1df;
  --bad: #c9342f;
  --bad-soft: #fdeceb;
  --test: #6b46c1;
  --test-soft: #f1ebff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .07);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 24px 60px rgba(30, 50, 110, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dot: rgba(47, 107, 255, .10);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c;
    --bg-tint: #0e1526;
    --surface: #111a2e;
    --surface-2: #16213a;
    --ink: #e9eef8;
    --ink-2: #b2bdd2;
    --ink-3: #8f9bb3;
    --line: #23304b;
    --line-2: #2e3d5d;
    --accent: #6f9bff;
    --accent-ink: #9ab8ff;
    --accent-soft: rgba(111, 155, 255, .14);
    --accent-2: #3fd0c2;
    --ok: #3ccf95;
    --ok-soft: rgba(60, 207, 149, .13);
    --warn: #f3b04f;
    --warn-soft: rgba(243, 176, 79, .13);
    --bad: #ff7b74;
    --bad-soft: rgba(255, 123, 116, .13);
    --test: #b79bff;
    --test-soft: rgba(183, 155, 255, .14);
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);
    --dot: rgba(111, 155, 255, .10);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.02em; margin: 0; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(47, 107, 255, .28); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06102a; } :root:not([data-theme="light"]) .btn-primary:hover { color: #06102a; } }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-quiet { background: var(--surface-2); border-color: var(--line); box-shadow: none; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }

/* ------------------------------------------------------------ nav */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; }
.nav-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 18px/1 var(--font-head); letter-spacing: -.02em; }
.logo-mark { color: var(--accent); display: inline-flex; }
.nav-links { display: none; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.nav-links a:hover { background: var(--surface); color: var(--ink); }
.nav-cta { margin-left: auto; }
@media (min-width: 900px) { .nav-links { display: flex; } .nav-cta { margin-left: 8px; } }

/* ------------------------------------------------------------ hero */
.hero { position: relative; padding: 36px 16px 20px; text-align: center; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, #000 40%, transparent 100%); mask-image: radial-gradient(ellipse 70% 70% at 50% 35%, #000 40%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; z-index: -2; width: 900px; height: 520px; left: 50%; top: -220px; transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.hero-in { max-width: 860px; margin: 0 auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: live 2.2s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.hero h1 { font-size: clamp(31px, 7.4vw, 58px); line-height: 1.06; font-weight: 800; letter-spacing: -.035em; }
.grad { background: linear-gradient(92deg, var(--accent) 10%, var(--accent-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 640px; margin: 18px auto 0; color: var(--ink-2); font-size: clamp(16px, 2.3vw, 18px); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.chips { list-style: none; padding: 0; margin: 28px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 680px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; box-shadow: var(--shadow-sm); text-align: center; min-width: 0; }
.chip-v { display: block; font: 800 clamp(20px, 5.4vw, 28px)/1.1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chip-l { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12.5px; line-height: 1.3; }
.hero-src { margin: 10px 0 0; color: var(--ink-3); font-size: 12.5px; }

/* ------------------------------------------------------------ sections */
.sec, .console-sec { padding: 48px 16px; }
.console-sec { padding-top: 28px; }
.sec-tint { background: var(--bg-tint); }
.sec-head { max-width: 760px; margin: 0 auto 24px; text-align: center; }
.sec-head h2 { font-size: clamp(26px, 5.6vw, 40px); line-height: 1.12; font-weight: 800; }
.sec-sub { color: var(--ink-2); margin: 12px auto 0; max-width: 680px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card p { color: var(--ink-2); }
.card-sub { margin: 6px 0 14px; font-size: 14.5px; }
.fine { color: var(--ink-3); font-size: 13px; max-width: 860px; margin: 16px auto 0; }
.center { text-align: center; margin-top: 14px; }
.more { text-align: center; color: var(--ink-2); margin: 18px 0 0; font-size: 15px; }

/* ------------------------------------------------------------ console */
.console { max-width: 1240px; margin: 0 auto; display: grid; gap: 14px; grid-template-columns: 1fr; }
.agent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; transition: box-shadow .35s ease, border-color .35s ease; }
.agent.is-active { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.agent-seller.is-active { border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 14%, transparent), var(--shadow); }
.agent-top { display: flex; align-items: center; gap: 12px; }
.agent-top h3 { font-size: 19px; font-weight: 800; }
.avatar { display: inline-flex; flex: none; }
.avatar-buyer { color: var(--accent); }
.avatar-seller { color: var(--accent-2); }
.agent-role { margin: 1px 0 0; color: var(--ink-3); font-size: 13px; }
.agent-state { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.agent-state.st-run { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.agent-state.st-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.agent-state.st-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.agent-state.st-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.agent-goal { margin: 12px 0; color: var(--ink-2); font-size: 14.5px; }
.agent-goal b { color: var(--ink); }
.limits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.limit { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; transition: background .4s ease, border-color .4s ease; }
.limit dt { color: var(--ink-3); font-size: 12px; }
.limit dd { margin: 2px 0 0; font: 800 20px/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.limit.flash { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.limit.flash-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.rules { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.rules li { position: relative; padding-left: 24px; font-size: 13.5px; color: var(--ink-2); }
.rules li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 14px; height: 14px; border-radius: 4px; background: var(--ok-soft); box-shadow: inset 0 0 0 1.5px var(--ok); }
.rules li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 6px; height: 4px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.agent-wallet { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }

.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-lg); min-width: 0; }
.wire { display: flex; align-items: center; gap: 10px; font: 700 13px/1 var(--font-head); color: var(--ink-2); }
.wire-line { position: relative; flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); border-radius: 2px; }
.wire-pulse { position: absolute; top: -5px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); opacity: 0; box-shadow: 0 0 0 4px var(--accent-soft); }
.wire-pulse.go-right { animation: toRight 1.1s cubic-bezier(.45, 0, .2, 1) forwards; }
.wire-pulse.go-left { background: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 18%, transparent); animation: toLeft 1.1s cubic-bezier(.45, 0, .2, 1) forwards; }
.wire-pulse.go-bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
@keyframes toRight { 0% { left: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: calc(100% - 12px); opacity: 0; } }
@keyframes toLeft { 0% { left: calc(100% - 12px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: 0; opacity: 0; } }
.wire-msg { margin: 8px 0 0; min-height: 20px; text-align: center; font: 500 13px/1.4 var(--font-mono); color: var(--ink-3); transition: color .3s; overflow-wrap: anywhere; }
.controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.clock { margin-left: auto; font: 500 13px/1 var(--font-mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--surface-2); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; transition: width .6s ease; }

.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface); transition: border-color .35s ease, background .35s ease, opacity .35s ease, transform .35s ease; }
.step[data-state="idle"] { opacity: .55; }
.step[data-state="idle"] .step-result, .step[data-state="idle"] .step-foot { display: none; }
.step[data-state="run"] { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.step[data-state="ok"] { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.step[data-state="refused"] { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.step[data-state="err"] { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 35%, var(--surface)); }
.step.enter { animation: enter .5s ease both; }
@keyframes enter { from { transform: translateY(6px); opacity: .4; } to { transform: none; } }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--font-head); background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); position: relative; }
.step[data-state="run"] .step-dot { background: var(--accent); color: #fff; border-color: transparent; }
.step[data-state="run"] .step-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.step[data-state="ok"] .step-dot { background: var(--ok); color: #fff; border-color: transparent; }
.step[data-state="refused"] .step-dot { background: var(--warn); color: #fff; border-color: transparent; }
.step[data-state="err"] .step-dot { background: var(--bad); color: #fff; border-color: transparent; }
.step-body { min-width: 0; }
.step-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.step-kicker { margin: 0; width: 100%; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.step-head h3 { font-size: 16.5px; font-weight: 700; line-height: 1.3; flex: 1; min-width: 0; }
.badge { font: 700 12px/1 var(--font); padding: 5px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.badge.b-ok { background: var(--ok-soft); color: var(--ok); }
.badge.b-warn { background: var(--warn-soft); color: var(--warn); }
.badge.b-bad { background: var(--bad-soft); color: var(--bad); }
.badge.b-info { background: var(--accent-soft); color: var(--accent-ink); }
.step-story { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; }
.step-result { margin-top: 10px; display: grid; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.fact { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.fact dt { font-size: 11.5px; color: var(--ink-3); }
.fact dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.fact.wide { grid-column: 1 / -1; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.checks li { display: grid; grid-template-columns: 20px 1fr; gap: 6px; font-size: 13.5px; color: var(--ink-2); align-items: start; }
.checks .mk { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; margin-top: 1px; }
.checks .ok .mk { background: var(--ok-soft); color: var(--ok); }
.checks .bad .mk { background: var(--bad-soft); color: var(--bad); }
.checks .warn .mk { background: var(--warn-soft); color: var(--warn); }
.checks .nm { overflow-wrap: anywhere; }
.checks .nm small { display: block; color: var(--ink-3); font-size: 12px; }
.callout { border-radius: 12px; padding: 10px 12px; font-size: 14.5px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.callout .big { font: 800 15px/1 var(--font-head); letter-spacing: .02em; padding: 6px 10px; border-radius: 8px; color: #fff; white-space: nowrap; }
.callout.c-ok { background: var(--ok-soft); color: var(--ok); }
.callout.c-ok .big { background: var(--ok); }
.callout.c-warn { background: var(--warn-soft); color: var(--warn); }
.callout.c-warn .big { background: var(--warn); }
.callout.c-bad { background: var(--bad-soft); color: var(--bad); }
.callout.c-bad .big { background: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .callout .big { color: #08111f; } }
.label-rec { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--test); background: var(--test-soft); border-radius: 6px; padding: 2px 6px; margin-right: 6px; vertical-align: 1px; }
.step-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.lat { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.raw { width: 100%; }
.raw summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; width: fit-content; }
.raw pre { margin: 8px 0 0; max-height: 260px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 12px/1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.waiting { color: var(--ink-3); font-size: 13.5px; margin: 8px 0 0; }

@media (max-width: 759px) {
  .console { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stage { grid-column: 1 / -1; order: 3; padding: 12px; }
  .stage-top { margin: -12px -12px 0; padding: 12px 12px 10px; }
  .agent-now { margin-top: 8px; padding: 6px 8px; }
  .agent { padding: 12px; }
  .agent .rules, .agent .agent-wallet, .agent-seller .agent-goal { display: none; }
  .agent-top { flex-wrap: wrap; gap: 8px; }
  .agent-top .avatar svg { width: 32px; height: 32px; }
  .agent-top h3 { font-size: 17px; }
  .agent-state { margin-left: 0; }
  .agent-goal { font-size: 13px; margin: 8px 0; }
  .limits { grid-template-columns: 1fr; gap: 6px; }
  .limit { padding: 8px 10px; }
  .limit dd { font-size: 17px; }
  .step { grid-template-columns: 28px 1fr; padding: 10px; gap: 8px; }
  .step-dot { width: 26px; height: 26px; font-size: 12px; }
}
@media (min-width: 760px) {
  .console { grid-template-columns: 1fr 1fr; }
  .stage { grid-column: 1 / -1; order: 3; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1120px) {
  .console { grid-template-columns: 300px minmax(0, 1fr) 300px; align-items: start; }
  .stage { grid-column: auto; order: 0; }
  .agent { position: sticky; top: 76px; }
}


.agent-now { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.now-l { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.agent-now .agent-state { margin-left: 0; font-size: 13px; }
.agent-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-top > div { min-width: 0; }
.stage-top { position: sticky; top: 56px; z-index: 6; background: var(--surface); margin: -16px -16px 0; padding: 16px 16px 12px; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.pay-tags { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pay-top { flex-wrap: nowrap; align-items: flex-start; }
.pay-amt { white-space: nowrap; }


.wire-end { display: grid; gap: 3px; }
.wire-end-r { text-align: right; }
.wire-end small { font: 600 11.5px/1 var(--font); color: var(--ink-3); transition: color .3s; }
.wire-end small.st-run { color: var(--accent-ink); }
.wire-end small.st-ok { color: var(--ok); }
.wire-end small.st-bad { color: var(--bad); }
.wire-end small.st-warn { color: var(--warn); }
.step-kicker { width: auto; flex: 1; align-self: center; }
.step-head .badge { order: 2; }
.step-head h3 { flex-basis: 100%; order: 3; }
@media (max-width: 759px) {
  .callout { flex-direction: column; align-items: flex-start; gap: 6px; }
  .wire-msg { font-size: 12px; }
}


.callout > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.checks small { overflow-wrap: anywhere; }
.out, .try-grid > .card { min-width: 0; }

/* ------------------------------------------------------------ try */
.try-grid { max-width: 1100px; margin: 0 auto; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .try-grid { grid-template-columns: 1fr 1fr; } }
.form { display: grid; gap: 8px; }
.form label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-size: 14px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.range { width: 100%; accent-color: var(--accent); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.out { margin-top: 14px; display: grid; gap: 8px; }
.err { color: var(--bad); font-weight: 600; margin: 0; }

/* ------------------------------------------------------------ hsp */
.hsp-stats { max-width: 980px; margin: 0 auto 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .hsp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hsp-flow { list-style: none; max-width: 1100px; margin: 0 auto 18px; padding: 0; display: grid; gap: 8px; grid-template-columns: 1fr; counter-reset: f; }
@media (min-width: 900px) { .hsp-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hsp-flow li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 2px; font-size: 13.5px; color: var(--ink-2); }
.hsp-flow b { font: 800 14px/1.2 var(--font-head); color: var(--test); }
.hsp-list { max-width: 1100px; margin: 0 auto; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .hsp-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1120px) { .hsp-list { grid-template-columns: 1fr 1fr 1fr; } }
.pay { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm); display: grid; gap: 8px; min-width: 0; }
.pay-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-amt { font: 700 14px/1 var(--font-head); margin-left: auto; font-variant-numeric: tabular-nums; }
.pay-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; color: var(--ink-3); margin: 0; }
.pay-meta dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 12px; }
.pay-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.pay-check { font-size: 13px; }

/* ------------------------------------------------------------ sellers */
.sell-grid { max-width: 1100px; margin: 0 auto; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .sell-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.stat-l { margin: 0; color: var(--ink-3); font-size: 13px; }
.stat-v { margin: 4px 0 0; font: 800 clamp(22px, 5vw, 30px)/1.1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-s { margin: 4px 0 0; color: var(--ink-3); font-size: 12.5px; }
.code-card { max-width: 1100px; margin: 16px auto 0; background: #0d1426; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid #1d2742; }
.code-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; color: #b7c3dc; font-size: 13px; font-weight: 600; border-bottom: 1px solid #1d2742; flex-wrap: wrap; }
.code-tag { color: #7f8db0; font-weight: 500; }
.code { margin: 0; padding: 14px; overflow-x: auto; color: #e6ecfa; font: 13px/1.6 var(--font-mono); }
.code .c { color: #7f8db0; }
.ticks { list-style: none; max-width: 1100px; margin: 16px auto 0; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .ticks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ticks li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--ink-2); font-size: 14.5px; }
.ticks b { color: var(--ink); display: block; }

/* ------------------------------------------------------------ proof */
.proof-grid { max-width: 1100px; margin: 0 auto; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .proof-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tag { font: 700 11.5px/1 var(--font); padding: 5px 8px; border-radius: 999px; letter-spacing: .02em; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-test { background: var(--test-soft); color: var(--test); }
.tag-plan { background: var(--warn-soft); color: var(--warn); }
.plain { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; display: grid; gap: 6px; }
.links { text-align: center; margin: 20px 0 0; }
.foot { padding: 28px 16px 40px; text-align: center; color: var(--ink-3); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------ ?demo=ext (show capture, 1920x1080 at 1x) */
html[data-demo="ext"] .controls .btn { display: none; }
html[data-demo="ext"] .clock { margin-left: 0; font-size: 14px; }
@media (min-width: 1600px) {
  html[data-demo="ext"] .console { max-width: 1640px; grid-template-columns: 360px minmax(0, 1fr) 360px; gap: 20px; }
  html[data-demo="ext"] .agent { padding: 20px; }
  html[data-demo="ext"] .agent-top h3 { font-size: 22px; }
  html[data-demo="ext"] .agent-goal, html[data-demo="ext"] .rules li { font-size: 16px; }
  html[data-demo="ext"] .limit dd { font-size: 24px; }
  html[data-demo="ext"] .agent-now .agent-state { font-size: 15px; }
  html[data-demo="ext"] .wire { font-size: 15px; }
  html[data-demo="ext"] .wire-end small { font-size: 13px; }
  html[data-demo="ext"] .wire-msg { font-size: 15px; }
  html[data-demo="ext"] .step-head h3 { font-size: 20px; }
  html[data-demo="ext"] .step-kicker { font-size: 13px; }
  html[data-demo="ext"] .badge { font-size: 13.5px; }
  html[data-demo="ext"] .step-story { font-size: 16.5px; }
  html[data-demo="ext"] .fact dt { font-size: 13px; }
  html[data-demo="ext"] .fact dd { font-size: 16px; }
  html[data-demo="ext"] .checks li { font-size: 15.5px; }
  html[data-demo="ext"] .checks .nm small { font-size: 13.5px; }
  html[data-demo="ext"] .callout { font-size: 16.5px; }
  html[data-demo="ext"] .callout .big { font-size: 17px; }
  html[data-demo="ext"] .step-foot { font-size: 14px; }
  html[data-demo="ext"] .step { padding: 14px 16px; }
  html[data-demo="ext"] .stage { margin-bottom: 620px; }
  html[data-demo="ext"] .nav-in { max-width: 1640px; }   /* room to scroll the last steps up while the agent cards stay put */
}
