:root {
  --ground: #F4F1EA;
  --paper: #FFFDF8;
  --ink: #17211C;
  --ink-2: #3E4441;
  --muted: #5C625E;
  --line: #D9D2C3;
  --soft: #ECE7DC;
  --clay: #C9702F;
  --clay-text: #8A4517;
  --clay-soft: #F7E9DC;
  --clay-on-dark: #E08A4A;
  --on-dark: #F4F1EA;
  --on-dark-2: #C9CEC9;
  --ok: #DCEBDD;
  --warn: #F7E9DC;
  --off: #ECE7DC;
  --danger: #9B2C1F;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: 'Instrument Sans', system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--ink); }
a:hover { color: var(--clay); }
h1, h2, h3 { font-family: 'Newsreader', Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
main.wrap { padding-block: 36px 72px; display: flex; flex-direction: column; gap: 32px; outline: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 500; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Header */
.top { background: var(--ink); color: var(--on-dark); padding-top: env(safe-area-inset-top, 0px); }
.top-row { padding-block: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.brand { display: flex; align-items: flex-end; gap: 12px; text-decoration: none; color: var(--on-dark); }
.brand:hover { color: var(--on-dark); }
.brand-mark { display: flex; flex-direction: column; gap: 2px; }
.brand .bar { display: block; width: 32px; height: 3px; background: var(--clay-on-dark); }
.brand .eyebrow { font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-size: 10px; letter-spacing: 0.16em; color: var(--on-dark-2); }
.brand .word { font-family: 'Newsreader', Georgia, serif; font-weight: 600; font-size: 22px; line-height: 1; }
.pill { font-family: 'IBM Plex Mono', monospace; font-weight: 500; font-size: 12px; letter-spacing: 0.16em; padding: 4px 8px; border: 1px solid var(--clay-on-dark); border-radius: 4px; }
#nav { display: flex; flex-wrap: wrap; gap: 2px 20px; flex: 1 1 auto; }
#nav a { color: var(--on-dark-2); text-decoration: none; padding: 10px 0; border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
#nav a[aria-current="page"] { color: var(--on-dark); font-weight: 600; border-bottom-color: var(--clay-on-dark); }
#nav a:hover { color: var(--on-dark); }
#who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--on-dark-2); }
#who button { color: var(--on-dark); border-color: var(--on-dark-2); }

/* Controls */
.btn { font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--on-dark); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn:hover { background: #2B3732; color: var(--on-dark); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.quiet { background: transparent; color: var(--ink); border-color: #8A8F8B; font-weight: 500; }
.btn.quiet:hover { background: var(--soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, .chip:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: space-between; align-items: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }

/* Cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.accent { border: 2px solid var(--clay); }
.card.dashed { border-style: dashed; border-color: #8A8F8B; }
.card .actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--ink-2); }
.badge { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--off); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--ok); }
.badge.warn { background: var(--warn); color: var(--clay-text); }
.badge.new { background: var(--clay-soft); color: var(--clay-text); }
.signal { background: var(--ground); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.chip { font: inherit; font-size: 14px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; }
.chip[aria-pressed="true"] { border: 2px solid var(--clay); background: var(--clay-soft); color: var(--ink); }
.lock { display: inline-flex; align-items: center; gap: 6px; }
.hero { display: flex; flex-direction: column; gap: 14px; max-width: 780px; }
.hero p { font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.steps li { background: var(--soft); border-top: 3px solid var(--clay); border-radius: 0 0 8px 8px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.price { font-family: 'Newsreader', Georgia, serif; font-weight: 600; font-size: 24px; }
.price span { font-family: 'Instrument Sans', sans-serif; font-weight: 400; font-size: 14px; color: var(--muted); }
ul.clean { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.auth { max-width: 440px; width: 100%; margin: 0 auto; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
dl.facts { margin: 0; display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 16px; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.scores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.scores div { background: var(--ground); border-radius: 8px; padding: 6px 8px; text-align: center; font-size: 12px; color: var(--muted); }
.scores b { display: block; font-size: 18px; color: var(--ink); }
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--soft); vertical-align: top; }
.funnel { display: flex; flex-wrap: wrap; gap: 10px; }
.funnel div { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; min-width: 110px; }
.funnel b { display: block; font-family: 'Newsreader', Georgia, serif; font-size: 26px; }
.note { background: var(--clay-soft); color: var(--clay-text); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.error { color: var(--danger); font-size: 14px; }
pre.prompt { white-space: pre-wrap; background: var(--ground); border-radius: 8px; padding: 12px; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; margin: 0; max-height: 280px; overflow: auto; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--on-dark); padding: 12px 18px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); z-index: 20; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
