* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #17211f;
  --muted: #64748b;
  --bg: #f5f7f6;
  --panel: #ffffff;
  --line: #dbe5e1;
  --green: #0f766e;
  --blue: #2563eb;
  --teal: #0d9488;
  --pink: #be185d;
  --gold: #b7791f;
  --red: #b42318;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: end;
  padding: 34px max(24px, calc((100vw - 1180px) / 2)) 28px;
  background: #102b27;
  color: #f8fffc;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: #b7e7dc;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

h1 {
  max-width: 780px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.topbar p {
  max-width: 760px;
  margin-top: 16px;
  color: #d6e9e4;
  font-size: 17px;
}

.status-box {
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}

.status-box span,
.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-box span { color: #b7e7dc; }
.status-box strong { display: block; font-size: 18px; }
.status-box small { display: block; margin-top: 8px; color: #d6e9e4; }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 56px;
}

.scenario-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px 0;
  overflow-x: auto;
  background: var(--bg);
}

.scenario-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.section {
  margin-top: 16px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.data-section {
  border-color: #cbd8d4;
}

.table-wrap {
  width: 100%;
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.assumption-table {
  min-width: 760px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf4f2;
  color: #33423f;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td:not(:first-child) {
  white-space: nowrap;
}

.assumption-table td:last-child,
.assumption-table th:last-child {
  white-space: normal;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f8fbfa;
}

.bad {
  color: var(--red);
  font-weight: 800;
}

.assumption-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.assumption-notes div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

.assumption-notes strong {
  display: block;
  color: var(--green);
  font-size: 16px;
}

.assumption-notes span {
  display: block;
  margin-top: 3px;
  color: #52615d;
  font-size: 13px;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.problem-card {
  border-top: 4px solid var(--green);
}

.problem-card:nth-child(2) { border-top-color: var(--teal); }
.problem-card:nth-child(3) { border-top-color: var(--gold); }
.problem-card:nth-child(4) { border-top-color: var(--red); }
.problem-card:nth-child(5) { border-top-color: var(--pink); }
.problem-card:nth-child(6) { border-top-color: var(--blue); }

.problem-tag {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.problem-card p + p {
  margin-top: 8px;
}

.why-link {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.data-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #b9d8d1;
  border-left: 5px solid var(--green);
  border-radius: 7px;
  background: #f1faf7;
  color: #20332f;
  font-size: 14px;
}

.data-callout strong {
  margin-right: 4px;
}

.data-callout.inverse {
  border-color: rgba(255,255,255,0.24);
  border-left-color: #8ee6d7;
  background: rgba(255,255,255,0.1);
  color: #eefaf7;
}

.takeaway.light {
  border: 1px solid #e4c76e;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 24px;
  align-items: center;
}

h2 {
  max-width: 820px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
}

.flow-card {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.flow-step {
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  text-align: center;
  font-weight: 800;
}

.flow-step.muted { color: var(--gold); }
.flow-step.success { color: var(--green); border-color: #7dd3c7; }
.arrow { color: var(--muted); font-weight: 900; }
.leak { grid-column: 1 / -1; color: var(--red); font-size: 13px; }

.scenario-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 5px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge.blue { background: #dbeafe; color: var(--blue); }
.badge.teal { background: #ccfbf1; color: var(--teal); }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.pink { background: #fce7f3; color: var(--pink); }
.badge.neutral { background: #e2e8f0; color: #334155; }

.card-grid,
.read-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.read-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 18px; }

article,
.combo-step {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfc;
}

article h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

article p,
.combo-step p {
  color: #52615d;
  font-size: 14px;
}

.mechanism-map {
  display: grid;
  grid-template-columns: repeat(7, auto);
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.node {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
}

.node.active { border-color: #7dd3c7; color: var(--green); }
.node.success { background: #ecfdf5; border-color: #34d399; color: #047857; }
.node.warning { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.connector {
  width: 28px;
  height: 2px;
  background: #94a3b8;
}
.connector::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 24px;
  margin-top: -4px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #94a3b8;
}
.connector.warning,
.connector.warning::after { background: #fb923c; border-left-color: #fb923c; }

.combo {
  background: #102b27;
  color: #f8fffc;
}

.combo .eyebrow { color: #8ee6d7; }
.combo h2 { color: #ffffff; }
.combo-maxim {
  margin-top: 12px;
  color: #8ee6d7;
  font-size: clamp(19px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.2;
}

.combo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.combo-rationale {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.combo-step {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
}

.combo-rationale article {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
}

.combo-rationale article h3 {
  color: #ffffff;
}

.combo-rationale article p {
  color: #d6e9e4;
}

.combo-step span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: 999px;
  background: #8ee6d7;
  color: #102b27;
  font-weight: 900;
}

.combo-step strong { display: block; margin-bottom: 7px; }
.combo-step p { color: #d6e9e4; }

.takeaway {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 7px;
  background: #fff7df;
  color: #4a3300;
}

@media (max-width: 900px) {
  .topbar,
  .intro-grid,
  .card-grid,
  .read-grid,
  .combo-grid,
  .combo-rationale,
  .assumption-notes,
  .problem-grid {
    grid-template-columns: 1fr;
  }

  .mechanism-map,
  .flow-card {
    grid-template-columns: 1fr;
  }

  .connector,
  .arrow {
    display: none;
  }
}
