:root {
  color-scheme: light dark;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --ink: #10201e;
  --muted: #4b615d;
  --line: #cad8d4;
  --green: #0d6b57;
  --green-strong: #084d3f;
  --green-soft: #dff3ec;
  --amber: #8a4b00;
  --amber-soft: #fff1d6;
  --red: #a11b2b;
  --red-soft: #ffe5e8;
  --blue: #134f86;
  --blue-soft: #e2eefb;
  --focus: #ffbf47;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 32, 30, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071513;
    --surface: #0e211e;
    --surface-2: #142d29;
    --ink: #f0faf7;
    --muted: #a8c2bc;
    --line: #2c4a44;
    --green: #5fe0bf;
    --green-strong: #8cf0d6;
    --green-soft: #103c33;
    --amber: #ffc46b;
    --amber-soft: #3c2b10;
    --red: #ff96a2;
    --red-soft: #46151c;
    --blue: #8ec8ff;
    --blue-soft: #102b45;
    --focus: #ffd166;
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 20;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
}

.demo-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--amber-soft);
  color: var(--amber);
  border-bottom: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  text-align: center;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}
.demo-ribbon strong { letter-spacing: 0.08em; }

.site-header {
  padding: 34px 0 24px;
  background:
    radial-gradient(1100px 420px at -10% -30%, var(--green-soft), transparent 65%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.015em; }
h1 { max-width: 22ch; margin: 0; font-size: clamp(1.75rem, 7vw, 3.25rem); }
h2 { margin: 0; font-size: clamp(1.25rem, 4.5vw, 1.75rem); }
h3 { margin: 0 0 8px; font-size: 1.02rem; }

.lede {
  max-width: 70ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions, .ticket-actions, .certificate-actions, .verifier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  min-height: 46px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}
.button:hover:not(:disabled) { border-color: var(--green); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .button.primary { color: #03211b; }
}
.button.primary:hover:not(:disabled) { background: var(--green-strong); border-color: var(--green-strong); }
.button.ghost { background: transparent; box-shadow: none; }
.button:disabled { cursor: not-allowed; opacity: 0.55; }

.status-line {
  min-height: 1.55em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.offline-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
}

main { padding: 22px 0 40px; }

.panel {
  margin: 18px 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mode-panel { border-width: 2px; }
.mode-switch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.mode-button {
  appearance: none;
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mode-button strong { font-size: 0.96rem; }
.mode-button span { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.mode-button:hover { border-color: var(--green); }
.mode-button[aria-pressed="true"] {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
  background: var(--green-soft);
}
.mode-button#mode-fixture[aria-pressed="true"] {
  border-color: var(--amber);
  box-shadow: inset 0 0 0 1px var(--amber);
  background: var(--amber-soft);
}
.mode-note { margin: 12px 0 0; color: var(--muted); font-size: 0.84rem; }

.fixture-banner {
  margin: 18px 0;
  padding: 14px 16px;
  border: 2px dashed var(--amber);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.9rem;
  line-height: 1.5;
}
.fixture-banner strong { letter-spacing: 0.04em; }
.fixture-banner code { background: color-mix(in srgb, var(--surface) 70%, transparent); color: inherit; }
.badge.fixture { background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }
.fixture-card { border-style: dashed; border-color: var(--amber); }
.fixture-callout {
  margin-top: 14px;
  padding: 14px;
  border: 2px dashed var(--amber);
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
}
.fixture-callout p { margin: 6px 0 0; color: inherit; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.badge.paper { background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.badge.public { background: var(--blue-soft); color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent); }

.muted { color: var(--muted); }
.fine-print, .help {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}
.fine-print { margin: 14px 0 0; }
.help { margin: 6px 0 0; }

code {
  padding: 0.1em 0.3em;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.progress { margin: 0; color: var(--green); font-weight: 750; }

.checklist {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  counter-reset: checklist;
}
.checklist li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.checklist li[data-complete="true"] {
  border-color: color-mix(in srgb, var(--green) 45%, transparent);
  background: var(--green-soft);
}
.checkmark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8rem;
}
.checklist li[data-complete="true"] .checkmark {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .checklist li[data-complete="true"] .checkmark { color: #03211b; }
}
.checklist li > div { min-width: 0; }
.checklist strong { display: block; font-size: 0.93rem; }
.step-detail { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.4; overflow-wrap: anywhere; }
.step-state {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.step-state[data-state="done"] { background: var(--green); border-color: var(--green); color: #ffffff; }
@media (prefers-color-scheme: dark) {
  .step-state[data-state="done"] { color: #03211b; }
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.metric.boundary-metric {
  border-style: dashed;
  background: transparent;
}
.metric-label { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.metric-value { display: block; margin-top: 4px; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.metric-note { display: block; margin-top: 3px; color: var(--muted); font-size: 0.78rem; }

.paper-positions { margin-top: 18px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.plain-list li.empty-state { border-style: dashed; color: var(--muted); }
.fill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  justify-content: space-between;
}
.fill-meta { color: var(--muted); font-size: 0.78rem; }
.link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.market-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}
.source { font-family: var(--mono); font-size: 0.72rem; overflow-wrap: anywhere; }

.tranche-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.asset-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.asset-card[data-selected="true"] {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.asset-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}
.asset-symbol { font-size: 1.08rem; font-weight: 800; }
.asset-name { color: var(--muted); font-size: 0.82rem; }
.asset-price { font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.asset-meta { color: var(--muted); font-size: 0.76rem; }
.asset-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.freshness-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.freshness-badge[data-state="fresh"] { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.freshness-badge[data-state="stale"] { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.freshness-badge[data-state="synthetic"] { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); border-style: dashed; }
.freshness-badge[data-state="missing"], .freshness-badge[data-state="invalid"] { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }

.skeleton-card {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  align-content: center;
}
.skeleton-card span {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton-card span:nth-child(2) { width: 70%; }
.skeleton-card span:nth-child(3) { width: 45%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.ticket-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}
.ticket-name { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.quote-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}
.quote-grid > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.quote-grid dt { color: var(--muted); font-size: 0.7rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.quote-grid dd { margin: 3px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.field-label { display: block; margin: 16px 0 6px; font-weight: 750; }
.amount-row { display: flex; flex-wrap: wrap; gap: 8px; }
input[type="text"] {
  min-height: 46px;
  width: min(180px, 100%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.preset-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.chip:hover { border-color: var(--green); }

.ticket-table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.ticket-table th, .ticket-table td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ticket-table th { color: var(--muted); font-weight: 600; }
.ticket-table td { text-align: right; font-weight: 700; }
.ticket-table .total th, .ticket-table .total td { border-bottom-width: 2px; color: var(--ink); font-size: 1.06rem; }

.review-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.review-row input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); flex: none; }
.fill-reason { color: var(--muted); font-size: 0.82rem; max-width: 56ch; }
.fill-reason[data-state="pending"] { color: var(--muted); font-weight: 600; }
.fill-reason[data-state="blocked"] { color: var(--red); font-weight: 700; }
.fill-reason[data-state="ok"] { color: var(--green); font-weight: 700; }

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.demo-complete-panel {
  margin-top: 16px;
  padding: 18px;
  border: 2px solid color-mix(in srgb, var(--green) 55%, transparent);
  border-radius: 14px;
  background:
    radial-gradient(640px 220px at 0% 0%, var(--green-soft), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}
.demo-complete-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.demo-complete-head h3 {
  margin: 0;
  font-size: 1.18rem;
}
.badge.verified-complete {
  background: var(--green);
  color: #ffffff;
}
@media (prefers-color-scheme: dark) {
  .badge.verified-complete { color: #03211b; }
}
.demo-complete-copy {
  margin: 10px 0 0;
  max-width: 72ch;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}
.demo-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.verifier-result, .local-check {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.local-check { border-style: dashed; background: transparent; }
.verdict {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.verdict[data-verdict="invalid"], .verdict[data-verdict="error"], .verdict[data-verdict="malformed"] {
  background: var(--red-soft);
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
}
.verdict[data-verdict="unverified"] { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.reason-list, .check-list { margin: 8px 0 0; padding-left: 1.2em; }
.reason-list li, .check-list li { margin: 3px 0; overflow-wrap: anywhere; }
.reason-code { font-family: var(--mono); font-size: 0.8rem; }
.verifier-error {
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  background: var(--red-soft);
  color: var(--red);
}
.local-check[data-ok="true"] { border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.local-check[data-ok="false"] { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.check-list .ok { color: var(--green); }
.check-list .fail { color: var(--red); }

.curl-details { margin-top: 14px; }
.curl-details summary { cursor: pointer; font-weight: 750; padding: 8px 0; }
pre {
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.boundaries { margin: 10px 0 0; padding-left: 1.2em; }
.boundaries li { margin: 7px 0; }

.site-footer {
  padding: 22px 0 36px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
}
.site-footer p { margin: 4px 0; }

dialog {
  width: min(760px, 100% - 24px);
  max-height: min(88vh, 900px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
dialog::backdrop { background: rgba(3, 15, 13, 0.65); }
.certificate { padding: 20px; }
.certificate-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; }
.certificate-watermark {
  margin: 12px 0;
  padding: 8px 10px;
  border: 2px dashed var(--amber);
  border-radius: 8px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-align: center;
}
.cert-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cert-table th, .cert-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cert-table th { width: 38%; color: var(--muted); font-weight: 600; }
.cert-table td { overflow-wrap: anywhere; }
.cert-hash { font-family: var(--mono); font-size: 0.76rem; }
.cert-note { margin: 10px 0 0; padding: 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 0.8rem; }
.certificate-actions { margin-top: 14px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.hero-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.judge-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.judge-flow li {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--green-soft));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.judge-flow strong {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}

.judge-flow span {
  font-size: 0.82rem;
  color: var(--muted);
}

.workspace-grid,
.decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 18px 0;
}

.workspace-grid > .panel,
.decision-grid > .panel {
  margin: 0;
}

/* End-to-End Financial Context Lenses */
.context-panel {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
}

.badge.context[data-state="balanced"] {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
}

.badge.context[data-state="tight"] {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
}

.badge.context[data-state="goal"] {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--blue) 45%, transparent);
}

.context-presets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.preset-card {
  appearance: none;
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.preset-card:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.preset-card[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}

.preset-card[data-context-lens="tight-buffer"][aria-pressed="true"] {
  border-color: var(--amber);
  background: var(--amber-soft);
  box-shadow: inset 0 0 0 1px var(--amber);
}

.preset-card[data-context-lens="goal-aligned"][aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.preset-card strong {
  font-size: 0.92rem;
  line-height: 1.3;
}

.preset-card span:last-child {
  font-size: 0.78rem;
  color: var(--muted);
}

.preset-tag {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preset-tag.ok { background: var(--green-soft); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }
.preset-tag.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.preset-tag.info { background: var(--blue-soft); color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 35%, transparent); }

.context-readout {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.context-readout[data-advisory="true"] {
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}

.context-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.context-k {
  display: block;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.context-v {
  display: block;
  margin-top: 2px;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.context-cost-note {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
}

.context-pros-cons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.context-pro-con-card {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.context-pro-con-card.pros {
  border-color: color-mix(in srgb, var(--green) 38%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--green-soft));
}

.context-pro-con-card.cons {
  border-color: color-mix(in srgb, var(--amber) 38%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--amber-soft));
}

.context-pro-con-card strong {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.context-pro-con-card.pros strong { color: var(--green); }
.context-pro-con-card.cons strong { color: var(--amber); }

.context-pro-con-card p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--ink);
}

.context-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.context-message {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--ink);
}

.context-readout[data-advisory="true"] .context-message {
  color: var(--amber);
}

.small-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.ticket-context-pill {
  margin: 10px 0 6px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.82rem;
}

.ticket-context-pill[data-state="advisory"] {
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
  background: var(--amber-soft);
  color: var(--amber);
}

/* Zero-Blind-Signing Payload Inspector */
.badge.inspector-badge[data-state="verified"] {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 40%, transparent);
}

.badge.inspector-badge[data-state="tampered"] {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
}

.inspector-banner {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.84rem;
}

.inspector-banner[data-state="tampered"] {
  border-color: color-mix(in srgb, var(--red) 55%, transparent);
  background: var(--red-soft);
  color: var(--red);
}

.intent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0;
}

.intent-cell {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.intent-cell[data-tampered="true"] {
  border-color: color-mix(in srgb, var(--red) 60%, transparent);
  background: var(--red-soft);
}

.intent-cell dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: lowercase;
}

.intent-cell dd {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.intent-cell[data-tampered="true"] dd { color: var(--red); }

.hash-compare {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.hash-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.hash-code {
  display: block;
  margin-top: 3px;
  font-size: 0.73rem;
}

.hash-code[data-match="false"] {
  background: var(--red-soft);
  color: var(--red);
}

.contrast-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.contrast-box {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.contrast-box.blind { background: var(--surface-2); color: var(--muted); }
.contrast-box.maweng[data-state="verified"] { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.contrast-box.maweng[data-state="tampered"] { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.button.danger-outline {
  border-color: color-mix(in srgb, var(--red) 50%, transparent);
  color: var(--red);
  background: var(--red-soft);
}

.button.danger-outline:hover:not(:disabled) {
  border-color: var(--red);
}

/* Verified Mainnet Settlement Proof */
.proof-panel {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
}

.badge.proof-badge {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent);
}

.proof-separation-banner {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--blue) 45%, transparent);
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.84rem;
}

.proof-records {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.proof-record {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.proof-record h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.proof-grid > div {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.proof-grid dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.proof-grid dd {
  margin: 4px 0 0;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.solscan-link {
  font-weight: 750;
}

@media (min-width: 620px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .tranche-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-grid { grid-template-columns: repeat(4, 1fr); }
  .panel { padding: 26px; }
  .mode-switch { grid-template-columns: 1fr 1fr; }
  .context-presets { grid-template-columns: repeat(3, 1fr); }
  .context-metrics { grid-template-columns: repeat(4, 1fr); }
  .context-pros-cons { grid-template-columns: repeat(2, 1fr); }
  .intent-grid { grid-template-columns: repeat(2, 1fr); }
  .contrast-strip { grid-template-columns: repeat(2, 1fr); }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 920px) {
  .hero-top { grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr); }
  .workspace-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: start; }
  .decision-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: start; }
}

@media (max-width: 480px) {
  .checklist li { grid-template-columns: 30px minmax(0, 1fr); }
  .step-state { grid-column: 2; justify-self: start; }
  .quote-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .demo-ribbon, .site-header .hero-actions, .site-footer, .certificate-actions, .skip-link, .button { display: none !important; }
  body { background: #fff; color: #000; }
  dialog { position: static; width: auto; max-height: none; border: 2px solid #000; box-shadow: none; }
  dialog::backdrop { display: none; }
  .certificate-watermark { color: #000; border-color: #000; background: #fff; }
}
