:root {
  --bg: #ede5d7;
  --paper: rgba(255, 252, 244, 0.76);
  --paper-solid: #fffaf0;
  --line: rgba(61, 43, 28, 0.18);
  --ink: #221a14;
  --muted: #72665a;
  --faint: #a99a87;
  --grenat: #4d1113;
  --bronze: #a87634;
  --stone: #c8baa2;
  --shadow: 10px 10px 0 rgba(77, 17, 19, 0.08);
}
* { box-sizing: border-box; border-radius: 0 !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  background:
    linear-gradient(90deg, rgba(77, 17, 19, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(77, 17, 19, 0.028) 1px, transparent 1px),
    linear-gradient(135deg, #fbf6eb, var(--bg) 52%, #d9ccb9);
  background-size: 42px 42px, 42px 42px, auto;
}
.shell { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px;
  border-right: 1px solid var(--line);
  background: rgba(250, 245, 235, 0.84);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; margin-bottom: 44px; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid rgba(77,17,19,0.42);
  color: var(--grenat); font: 700 27px "Cormorant Garamond", serif;
}
.brand strong, .brand small { display: block; }
.brand strong { font: 700 25px/0.9 "Cormorant Garamond", serif; }
.brand small { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.control-group { margin-bottom: 34px; }
.control-group h2 { margin: 0 0 14px; color: var(--grenat); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
label { display: grid; gap: 8px; margin-bottom: 16px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
select, input[type="range"] { width: 100%; }
select {
  appearance: none;
  padding: 12px 13px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper-solid);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
input[type="range"] { accent-color: var(--grenat); }
label span { color: var(--ink); font-size: 13px; letter-spacing: 0; text-transform: none; }
.gate {
  width: 100%; margin-bottom: 9px; padding: 12px 13px;
  border: 1px solid var(--line);
  background: var(--paper); color: var(--muted); text-align: left;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.gate.done { background: var(--grenat); color: #fff8ed; border-color: var(--grenat); }
.main { padding: 34px clamp(24px, 5vw, 64px) 70px; }
.dashboard-header { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-bottom: 26px; }
.eyebrow, .label { margin: 0 0 9px; color: var(--grenat); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, h4 { font-family: "Cormorant Garamond", serif; font-weight: 700; letter-spacing: -0.035em; }
h1 { font-size: clamp(48px, 7vw, 92px); line-height: 0.9; }
h2 { max-width: 880px; font-size: clamp(44px, 5.3vw, 82px); line-height: 0.9; }
h3 { font-size: 34px; line-height: 0.95; }
h4 { font-size: clamp(38px, 4vw, 58px); line-height: 0.9; }
.status-pill { padding: 11px 15px; border: 1px solid var(--line); background: var(--paper); color: var(--grenat); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; }
.answer-zone {
  display: grid; grid-template-columns: 1fr 260px; gap: 30px; align-items: center;
  min-height: 330px; padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,252,244,0.9), rgba(221,208,186,0.7));
  box-shadow: var(--shadow);
}
.answer-copy p:last-child { max-width: 720px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.answer-meter {
  width: 230px; height: 230px; display: grid; place-items: center; align-content: center; justify-self: end;
  color: #fff8ed;
  background: linear-gradient(135deg, var(--grenat), var(--bronze));
  border: 18px solid rgba(255,255,255,0.28);
  box-shadow: 10px 10px 0 rgba(81, 42, 18, 0.14);
}
.answer-meter span { font: 700 86px/0.8 "Cormorant Garamond", serif; }
.answer-meter small { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.signal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line); background: var(--line); }
.signal-grid article { padding: 22px; background: rgba(255,252,244,0.78); }
.signal-grid span { display: block; font: 700 36px/1 "Cormorant Garamond", serif; }
.signal-grid small { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.workbench { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 18px; margin-top: 18px; }
.panel { padding: 24px; border: 1px solid var(--line); background: var(--paper); box-shadow: 7px 7px 0 rgba(45, 31, 17, 0.06); }
.pipeline-panel { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 18px; }
.panel-head > span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; text-align: right; }
.stove-map { position: relative; height: 520px; border: 1px solid var(--line); overflow: hidden; background: linear-gradient(180deg, #f0e8da, #cabaa1); }
.stove-map > div { position: absolute; display: grid; place-items: center; text-align: center; border: 1px solid rgba(61,43,28,0.22); background: rgba(255,250,240,0.76); font-size: 12px; font-weight: 800; }
.chimney { left: 44%; top: 20px; width: 12%; height: 58px; }
.collector { left: 38%; top: 102px; width: 24%; height: 56px; color: var(--grenat); }
.header { left: 20%; top: 188px; width: 60%; height: 52px; }
.rings { left: 43%; top: 266px; width: 14%; height: 82px; color: #fff8ed; background: #6f5b48 !important; }
.firebox { left: 39%; top: 374px; width: 22%; height: 84px; color: #fff1db; background: linear-gradient(#251812, #4d1113) !important; }
.side { top: 182px; width: 27%; height: 276px; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; background: rgba(189,174,148,0.54) !important; }
.side.left { left: 5%; } .side.right { right: 5%; }
.side span { width: 100%; height: 100%; display: grid; place-items: center; background: rgba(255,250,240,0.56); color: var(--muted); }
.bench { left: 29%; bottom: 20px; width: 42%; height: 42px; color: #fff8ed; background: linear-gradient(90deg, #795121, #c4934c, #795121) !important; }
.stove-map svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stove-map path { fill: none; stroke: rgba(172,76,23,0.72); stroke-width: 7; stroke-linecap: butt; stroke-dasharray: 15 13; animation: flow 2.8s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -56; } }
.node-list, .body-list { margin: 14px 0 0; padding: 0; list-style: none; }
.node-list li { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.node-list b { color: var(--bronze); font: 700 24px/1 "Cormorant Garamond", serif; }
.node-list span { font-weight: 700; } .node-list strong { color: var(--grenat); font-size: 12px; }
.body-list { counter-reset: body; }
.body-list li { counter-increment: body; padding: 13px 0 13px 38px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 700; position: relative; }
.body-list li::before { content: counter(body); position: absolute; left: 0; top: 11px; width: 24px; height: 24px; display: grid; place-items: center; background: var(--grenat); color: #fff8ed; font-size: 11px; }
.pipeline-layout { display: grid; grid-template-columns: 360px 1fr; gap: 18px; }
.step-list { display: grid; gap: 8px; align-content: start; }
.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255,250,240,0.62);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.step:hover, .step.active { background: var(--grenat); color: #fff8ed; border-color: var(--grenat); }
.step b { color: var(--bronze); font: 700 24px/1 "Cormorant Garamond", serif; }
.step.active b, .step:hover b { color: #d7a862; }
.step span { font-size: 13px; font-weight: 800; }
.step-detail {
  min-height: 520px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,252,244,0.82), rgba(212,198,175,0.52));
}
.detail-kicker { margin: 0 0 12px; color: var(--bronze); font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.step-detail > p:not(.detail-kicker) { max-width: 850px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 28px; background: var(--line); border: 1px solid var(--line); }
.detail-grid div { padding: 20px; background: rgba(255,250,240,0.78); }
.detail-grid dt { margin-bottom: 8px; color: var(--grenat); font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.detail-grid dd { margin: 0; color: var(--ink); font-weight: 700; line-height: 1.55; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: relative; height: auto; }
  .answer-zone, .workbench, .pipeline-layout { grid-template-columns: 1fr; }
  .answer-meter { justify-self: start; }
  .signal-grid, .detail-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .main { padding: 24px 16px 44px; }
  .dashboard-header { display: block; }
  .status-pill { display: inline-block; margin-top: 16px; }
  .answer-zone { padding: 24px; }
  .answer-meter { width: 178px; height: 178px; }
  .answer-meter span { font-size: 66px; }
  .signal-grid, .detail-grid { grid-template-columns: 1fr; }
  .stove-map { height: 600px; }
  .side { width: 36%; }
  .side.left { left: 3%; } .side.right { right: 3%; }
  .header { left: 10%; width: 80%; }
  .bench { left: 12%; width: 76%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stove-map path { animation: none; }
}
