:root{
  --bg:#f6f4ef;
  --surface:#fffdf8;
  --ink:#171714;
  --muted:#6f6c64;
  --rule:#d8d4ca;
  --accent:#9b4f2f;
  --confirmed:#355f49;
  --suggested:#8a662c;
  --review:#7a4a65;
  --danger:#8a3e38;
  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:24px;
  --space-6:32px;
  --space-7:48px;
  --radius:7px;
  --font:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-family:var(--font);
  color:var(--ink);
  background:var(--bg);
}
*{box-sizing:border-box}
html{background:#dedbd3}
body{margin:0;background:#dedbd3;color:var(--ink)}
button,input,select{font:inherit}
button{cursor:pointer}
.app-shell{
  width:min(100%,1180px);
  min-height:100vh;
  margin:0 auto;
  padding-bottom:88px;
  background:var(--bg);
  box-shadow:0 0 0 1px rgba(23,23,20,.04);
}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:var(--space-5);
  padding:24px 20px 18px;
  border-bottom:1px solid var(--rule);
  background:rgba(246,244,239,.98);
}
h1,h2,h3,p{margin-top:0}
h1{
  font-size:34px;
  line-height:1;
  letter-spacing:-.04em;
  margin:7px 0 0;
  font-weight:760;
}
h2{
  font-size:11px;
  line-height:1.2;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--muted);
  margin:0 0 8px;
  font-weight:800;
}
h3{
  font-size:15px;
  line-height:1.25;
  letter-spacing:-.015em;
  margin:22px 0 8px;
}
p{line-height:1.48}
.eyebrow{
  font-size:10px;
  letter-spacing:.14em;
  text-transform:uppercase;
  font-weight:800;
  color:var(--muted);
  margin:0;
}
.badge{
  display:inline-block;
  max-width:210px;
  font-size:9px;
  line-height:1.35;
  letter-spacing:.09em;
  text-transform:uppercase;
  font-weight:850;
  border:1px solid currentColor;
  border-radius:999px;
  padding:5px 8px;
  color:var(--confirmed);
  text-align:center;
}
#screen{
  max-width:1080px;
  margin:0 auto;
  padding:20px;
  outline:none;
}
.screen-header{
  display:flex;
  justify-content:space-between;
  gap:var(--space-5);
  align-items:end;
  padding:4px 0 14px;
  border-bottom:1px solid var(--rule);
  margin-bottom:18px;
}
.screen-header h2{
  color:var(--ink);
  font-size:28px;
  letter-spacing:-.035em;
  text-transform:none;
  line-height:1.04;
  margin:0 0 5px;
  font-weight:750;
}
.screen-header p{
  color:var(--muted);
  font-size:14px;
  margin:0;
  max-width:62ch;
}
.grid{display:grid;gap:1px;background:var(--rule);border:1px solid var(--rule)}
.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
.card{
  background:var(--surface);
  border:1px solid var(--rule);
  border-radius:var(--radius);
  padding:15px;
}
.grid>.card{border:0;border-radius:0}
.metric-label{
  color:var(--muted);
  font-size:9px;
  line-height:1.3;
  font-weight:800;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.metric-value{
  font-size:26px;
  line-height:1.08;
  letter-spacing:-.04em;
  font-weight:750;
  margin-top:5px;
  font-variant-numeric:tabular-nums;
}
.metric-note{
  font-size:11px;
  color:var(--muted);
  margin:5px 0 0;
  line-height:1.4;
}
.section{margin-top:16px}
.row{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  padding:12px 0;
  border-bottom:1px solid var(--rule);
  font-size:13px;
  line-height:1.4;
}
.row:last-child{border-bottom:0}
.row strong{font-variant-numeric:tabular-nums;text-align:right}
.subtle,small{color:var(--muted)}
.subtle{font-size:12px;line-height:1.45}
.controls{display:grid;gap:14px}
.control label{
  display:block;
  font-size:9px;
  color:var(--muted);
  letter-spacing:.09em;
  text-transform:uppercase;
  font-weight:800;
  margin-bottom:6px;
}
.control input,.control select,.search{
  width:100%;
  background:var(--surface);
  color:var(--ink);
  border:1px solid var(--rule);
  border-radius:var(--radius);
  padding:12px;
  outline:none;
}
.control input[type="range"]{
  padding:10px 0;
  accent-color:var(--accent);
  border:0;
}
.compare{
  display:grid;
  grid-template-columns:1.2fr .8fr .8fr;
  gap:0;
  font-size:12px;
  border-top:1px solid var(--rule);
  border-left:1px solid var(--rule);
}
.compare>div{
  padding:10px;
  background:var(--surface);
  border-right:1px solid var(--rule);
  border-bottom:1px solid var(--rule);
  min-width:0;
}
.compare>.head{
  font-size:9px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:800;
}
.tree{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:11px;
  line-height:1.55;
  white-space:pre-wrap;
  background:var(--bg);
  border:1px solid var(--rule);
  padding:12px;
  border-radius:var(--radius);
  overflow:auto;
}
.button{
  min-height:44px;
  margin-top:12px;
  border:1px solid var(--ink);
  background:var(--ink);
  color:var(--surface);
  border-radius:var(--radius);
  padding:10px 13px;
  font-weight:700;
}
.timeline-row,.formula-row,.row-button{
  width:100%;
  background:transparent;
  color:inherit;
  border:0;
  text-align:left;
  font:inherit;
}
.timeline-row[aria-current="true"],[aria-current="true"]{
  background:rgba(155,79,47,.07);
}
.timeline-row[aria-current="true"]{
  margin:0 -8px;
  width:calc(100% + 16px);
  padding-left:8px;
  padding-right:8px;
}
.toggle{
  display:flex;
  gap:9px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
}
.toggle input{accent-color:var(--accent)}
.row-button:focus-visible,.bottom-nav button:focus-visible,.button:focus-visible,.search:focus-visible,
.control input:focus-visible,.control select:focus-visible,.timeline-row:focus-visible,.formula-row:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
.search-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}
.bottom-nav{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:2px;
  position:fixed;
  z-index:10;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:min(100%,1180px);
  padding:8px 6px calc(8px + env(safe-area-inset-bottom));
  background:rgba(246,244,239,.97);
  border-top:1px solid var(--rule);
  backdrop-filter:blur(14px);
}
.bottom-nav button{
  min-height:44px;
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:10px;
  font-weight:700;
  padding:8px 2px;
  border-radius:var(--radius);
}
.bottom-nav button[aria-current="page"]{
  color:var(--accent);
  background:rgba(155,79,47,.07);
}
details summary{
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  cursor:pointer;
}
@media(min-width:720px){
  .topbar{padding:30px 34px 22px}
  h1{font-size:42px}
  #screen{padding:28px 34px 40px}
  .metrics{grid-template-columns:repeat(4,minmax(0,1fr))}
  .two-col{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:16px}
  .controls{grid-template-columns:repeat(2,minmax(0,1fr))}
  .controls>.control:first-child,.controls>.toggle{grid-column:1/-1}
  .section{margin-top:20px}
}
@media(min-width:1020px){
  .app-shell{min-height:calc(100vh - 32px);margin:16px auto;border:1px solid var(--rule)}
  .bottom-nav{bottom:16px;border-left:1px solid var(--rule);border-right:1px solid var(--rule)}
}

.kicker{
  display:block;
  font-size:9px;
  line-height:1.2;
  font-weight:850;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--accent);
  margin-bottom:5px;
}
.baseline-callout,.inspect-callout{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:16px;
  border:1px solid var(--rule);
  background:var(--surface);
  border-radius:var(--radius);
}
.baseline-callout h3,.inspect-callout p{margin-bottom:0}
.text-button{
  min-height:44px;
  border:0;
  background:transparent;
  color:var(--accent);
  font-weight:800;
  padding:8px 0;
  text-align:left;
}
.question-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.question-card{
  min-height:72px;
  padding:12px;
  border:1px solid var(--rule);
  background:var(--surface);
  color:var(--ink);
  border-radius:var(--radius);
  text-align:left;
  font-weight:750;
  line-height:1.25;
}
.question-card.selected{
  border-color:var(--accent);
  box-shadow:inset 3px 0 0 var(--accent);
  background:rgba(155,79,47,.05);
}
.result-first{
  border-color:rgba(155,79,47,.35);
}
.delta-strip,.phase-strip{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1px;
  background:var(--rule);
  border:1px solid var(--rule);
  margin-top:12px;
}
.phase-strip{grid-template-columns:repeat(4,minmax(0,1fr))}
.delta-strip>div,.phase-strip>div{
  background:var(--bg);
  padding:10px;
  min-width:0;
}
.delta-strip span,.phase-strip span{
  display:block;
  color:var(--muted);
  font-size:9px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:4px;
}
.delta-strip strong,.phase-strip strong{
  font-size:13px;
  font-variant-numeric:tabular-nums;
}
.question-card:focus-visible,.text-button:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}
@media(max-width:560px){
  .baseline-callout,.inspect-callout{align-items:flex-start;flex-direction:column}
  .question-grid{grid-template-columns:1fr}
  .delta-strip,.phase-strip{grid-template-columns:1fr 1fr}
}

.formula-shortcut{
  width:100%;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:11px 0;
  border:0;
  border-bottom:1px solid var(--rule);
  background:transparent;
  color:var(--ink);
  text-align:left;
}
.formula-shortcut:last-child{border-bottom:0}
.formula-shortcut>span:last-child{color:var(--accent);font-size:11px;font-weight:800;white-space:nowrap}
.formula-quick{
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  align-items:center;
  padding:10px 0 4px;
  border-bottom:1px solid var(--rule);
}
.formula-detail{scroll-margin-top:24px}
.button.compact{min-height:42px;margin-top:0;padding:8px 11px}
.formula-row>span:last-child{color:var(--accent);font-size:11px;font-weight:800;white-space:nowrap}
