:root {
  --bg: #f7f8f8;
  --surface: #ffffff;
  --surface-2: #f3f4f5;
  --surface-3: #ecedef;
  --line: #e4e5e9;
  --line-strong: #d3d5da;
  --ink: #0f1011;
  --ink-2: #3c3f45;
  --ink-3: #62666d;
  --ink-4: #8a8f98;
  --primary: #5e6ad2;
  --primary-hover: #4c57c0;
  --primary-soft: #eef0fc;
  --primary-line: #c9cdf2;
  --ok: #1f8a3a;
  --ok-dot: #27a644;
  --ok-soft: #e8f6ec;
  --warn: #a8650a;
  --warn-dot: #e09b1d;
  --warn-soft: #fdf4e3;
  --crit: #c7353a;
  --crit-dot: #e5484d;
  --crit-soft: #fdeced;
  --info-soft: #eef0fc;
  --c-temp: #d9822b;
  --c-slate: #62666d;
  --c-teal: #2a8c8c;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow-phone: 0 1px 2px rgba(15, 16, 17, .06), 0 12px 32px rgba(15, 16, 17, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.6px; }
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -0.3px; }
h3 { font-size: 15px; line-height: 1.35; letter-spacing: -0.1px; }
p { margin: 0 0 12px; }
small, .caption { font-size: 12px; color: var(--ink-3); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid rgba(94, 106, 210, .5); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.topnav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  height: 56px; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav .inner { max-width: 1440px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: -0.2px; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand svg { flex: none; }
.brand small { font-weight: 400; color: var(--ink-3); }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { color: var(--ink-3); padding: 6px 10px; border-radius: var(--r-sm); font-weight: 500; font-size: 13.5px; }
.nav-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--ink); background: var(--surface-2); }
.nav-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: var(--r-md); width: 40px; height: 36px; cursor: pointer; }

.page { max-width: 1440px; margin: 0 auto; padding-block: 24px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; font-weight: 500; letter-spacing: .4px; color: var(--primary); text-transform: uppercase; margin-bottom: 6px; }
.lead { font-size: 15px; color: var(--ink-2); max-width: 760px; margin: 6px 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head .meta { font-size: 12px; color: var(--ink-3); }
.card-body { padding: 16px; }
.section { margin-top: 32px; }
.section > h2 { margin-bottom: 4px; }
.section > .sub { color: var(--ink-3); margin: 0 0 14px; max-width: 820px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-3); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.pills { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.pills button { border: 0; background: transparent; color: var(--ink-3); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.pills button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #cfe9d6; }
.badge.ok .dot { background: var(--ok-dot); }
.badge.warning { background: var(--warn-soft); color: var(--warn); border-color: #f2dfb8; }
.badge.warning .dot { background: var(--warn-dot); }
.badge.critical { background: var(--crit-soft); color: var(--crit); border-color: #f6cfd1; }
.badge.critical .dot { background: var(--crit-dot); }
.badge.info { background: var(--info-soft); color: var(--primary); border-color: var(--primary-line); }
.badge.info .dot { background: var(--primary); }
.tag { display: inline-block; padding: 1px 6px; border-radius: var(--r-xs); background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.simbar {
  position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 40;
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 10px 14px; margin-bottom: 16px;
}
.simclock { display: flex; flex-direction: column; min-width: 190px; }
.simclock .date { font-family: var(--mono); font-size: 18px; font-weight: 500; letter-spacing: -0.2px; }
.simclock .sub { font-size: 12px; color: var(--ink-3); }
.simcontrols { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.play { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.play svg { width: 16px; height: 16px; }
.scrub { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scrub input[type=range] { width: 100%; accent-color: var(--primary); }
.scrub .ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-4); font-family: var(--mono); }
.simright { display: flex; align-items: center; gap: 8px; }
.select { height: 34px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 0 30px 0 10px; font-size: 13px; color: var(--ink); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; max-width: 260px; }
.loading-note { font-size: 12px; color: var(--ink-3); }

.live { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.live-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 140px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kpi { background: var(--surface); padding: 14px 16px; min-height: 96px; display: flex; flex-direction: column; gap: 2px; }
.kpi .k-label { font-size: 12px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi .k-value { font-size: 24px; font-weight: 600; letter-spacing: -0.6px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.kpi .k-sub { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kpi .k-sub.up { color: var(--ok); }
.kpi .k-sub.down { color: var(--crit); }
.kpi .bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: auto; }
.kpi .bar > i { display: block; height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }
.kpi.alert-crit { background: var(--crit-soft); }
.kpi.alert-warn { background: var(--warn-soft); }

.summary { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; }
.summary .narrative { padding: 16px 20px; border-right: 1px solid var(--line); }
.summary .narrative p { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 8px; }
.summary .narrative p strong { color: var(--ink); font-weight: 600; }
.summary .schematic { padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; }
.schematic svg { width: 100%; height: auto; }
.schematic .lbl { font: 500 11px var(--font); fill: var(--ink-3); }
.schematic .val { font: 500 12.5px var(--mono); fill: var(--ink); }

.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card .card-head { padding: 12px 14px; flex-wrap: wrap; row-gap: 4px; }
.chart-card .card-head h3 { white-space: nowrap; }
.chart-box { position: relative; height: 230px; padding: 8px 10px 6px; }
.chart-box.tall { height: 300px; }
.chart-box.xtall { height: 360px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.legend i.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; }

.feed { max-height: 420px; overflow: auto; }
.feed-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.alert-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.alert-row:last-child { border-bottom: 0; }
.alert-row .when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.alert-row .what h4 { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-row .what p { font-size: 13px; color: var(--ink-2); margin: 4px 0 0; }
.alert-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.alert-row.cleared { opacity: .62; }
.alert-row .explain { grid-column: 2 / 4; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.alert-row .explain ul, .alert-row .explain ol { margin: 6px 0 0 18px; padding: 0; }

.phone {
  width: 100%; max-width: 340px; margin: 0 auto; background: #0f1011; border-radius: 38px; padding: 10px;
  box-shadow: var(--shadow-phone);
}
.phone-screen { background: #fbfbfc; border-radius: 30px; overflow: hidden; height: 560px; display: flex; flex-direction: column; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px 4px; font-size: 12px; font-weight: 600; }
.phone-status .notch { width: 90px; height: 22px; background: #0f1011; border-radius: 12px; }
.phone-head { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.phone-head .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.phone-head .who { font-size: 13px; font-weight: 600; }
.phone-head .to { font-size: 11px; color: var(--ink-3); }
.phone-tabs { display: flex; gap: 4px; padding: 6px 10px; background: #fff; border-bottom: 1px solid var(--line); justify-content: center; }
.phone-tabs button { border: 0; background: transparent; font-size: 11.5px; padding: 4px 9px; border-radius: 999px; color: var(--ink-3); cursor: pointer; font-weight: 500; }
.phone-tabs button.on { background: var(--surface-2); color: var(--ink); }
.phone-tabs .count { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--crit-dot); color: #fff; font-size: 10px; margin-left: 4px; }
.sms-list { flex: 1; overflow-y: auto; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.sms-day { text-align: center; font-size: 10.5px; color: var(--ink-4); margin: 6px 0 2px; }
.sms { align-self: flex-start; max-width: 88%; background: #e9eaee; color: var(--ink); border-radius: 16px 16px 16px 4px; padding: 8px 11px; font-size: 13px; line-height: 1.4; animation: pop .25s ease-out; }
.sms.critical { background: #fde3e4; }
.sms.warning { background: #fcefd4; }
.sms.ok { background: #dff3e5; }
.sms .meta { display: block; font-size: 10px; color: var(--ink-3); margin-top: 4px; }
.sms-empty { margin: auto; text-align: center; color: var(--ink-4); font-size: 12px; padding: 0 20px; }
.phone-input { display: flex; gap: 6px; padding: 8px 10px 14px; background: #fff; border-top: 1px solid var(--line); }
.phone-input span { flex: 1; height: 30px; border: 1px solid var(--line); border-radius: 15px; font-size: 12px; color: var(--ink-4); display: flex; align-items: center; padding: 0 12px; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast .t { background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 10px 14px; font-size: 13px; max-width: 360px; box-shadow: var(--shadow-phone); animation: pop .2s; }

.mail-list { max-height: 260px; overflow: auto; }
.mail-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
.mail-item:hover { background: var(--surface-2); }
.mail-item .sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--ink-4); }
.mail-item .sev.critical { background: var(--crit-dot); }
.mail-item .sev.warning { background: var(--warn-dot); }
.mail-item .sev.info { background: var(--primary); }
.mail-item .sev.ok { background: var(--ok-dot); }
.mail-item .subj { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item .to { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item .tm { font-size: 11px; color: var(--ink-4); font-family: var(--mono); }

.modal { position: fixed; inset: 0; z-index: 90; background: rgba(15, 16, 17, .35); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal .sheet { background: var(--surface); border-radius: var(--r-xl); border: 1px solid var(--line); width: 100%; max-width: 680px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-phone); }
.mail-view .hdr { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.mail-view .hdr h3 { font-size: 17px; margin-bottom: 8px; }
.mail-view .hdr dl { display: grid; grid-template-columns: 64px 1fr; gap: 2px 8px; margin: 0; font-size: 12.5px; }
.mail-view .hdr dt { color: var(--ink-3); }
.mail-view .hdr dd { margin: 0; }
.mail-view .bd { padding: 18px 22px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.mail-view .bd h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); margin: 18px 0 6px; }
.mail-view .bd table { border-collapse: collapse; width: 100%; font-size: 13px; }
.mail-view .bd td { border-bottom: 1px solid var(--line); padding: 5px 4px; }
.mail-view .bd td:last-child { text-align: right; font-family: var(--mono); }
.mail-view .ft { padding: 12px 22px 18px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }

.assistant .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.assistant .chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: 12px; padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.assistant .chips button:hover { border-color: var(--primary-line); color: var(--primary); }
.assistant form { display: flex; gap: 6px; }
.assistant input { flex: 1; height: 36px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 12px; background: var(--surface); min-width: 0; }
.assistant input:focus { border-color: var(--primary-line); outline: 2px solid rgba(94, 106, 210, .25); }
.answers { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; }
.answer { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; line-height: 1.55; background: var(--surface-2); }
.answer .q { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.answer .src { font-size: 11px; color: var(--ink-4); margin-top: 6px; }
.answer ul, .answer ol { margin: 4px 0 0 18px; padding: 0; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fafafb; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }

.heat { border-collapse: separate; border-spacing: 2px; font-size: 12px; width: 100%; }
.heat th { font-weight: 500; color: var(--ink-3); padding: 4px; text-align: center; font-size: 11.5px; }
.heat td { text-align: center; padding: 7px 2px; border-radius: 4px; font-family: var(--mono); font-size: 11.5px; min-width: 34px; }

.statgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 16px; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -0.8px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.stat .l { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.insights { list-style: none; margin: 0; padding: 0; counter-reset: ins; }
.insights li { counter-increment: ins; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.insights li:last-child { border-bottom: 0; }
.insights li::before { content: counter(ins, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--primary); padding-top: 2px; }

.callout { border-left: 3px solid var(--primary); background: var(--primary-soft); padding: 12px 14px; border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 13.5px; color: var(--ink-2); margin-top: 12px; }
.callout strong { color: var(--ink); }

.prose { max-width: 860px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.prose h2 { margin: 36px 0 10px; font-size: 22px; }
.prose h3 { margin: 24px 0 8px; font-size: 16px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px 20px; padding: 0; }
.prose li { margin-bottom: 6px; }
.prose .eq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; margin: 10px 0 16px; overflow-x: auto; }
.prose .eq .where { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.methods-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 80px; font-size: 13px; }
.toc a { display: block; color: var(--ink-3); padding: 5px 10px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--ink); border-left-color: var(--ink-4); text-decoration: none; }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin: 12px 0 18px; overflow-x: auto; }
.figure svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.figure .cap { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.step .n { font-family: var(--mono); font-size: 11.5px; color: var(--primary); }
.step h4 { font-size: 14px; margin: 4px 0 6px; }
.step p { font-size: 13px; color: var(--ink-3); margin: 0; line-height: 1.5; }

.footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px; color: var(--ink-3); font-size: 12px; }
.footer .inner { max-width: 1440px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 1280px) {
  .live { grid-template-columns: minmax(0, 1fr) 340px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .statgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .live { grid-template-columns: minmax(0, 1fr); }
  .live-side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .live-side .phone-card { grid-row: span 2; }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .summary .narrative { border-right: 0; border-bottom: 1px solid var(--line); }
  .simbar { grid-template-columns: auto 1fr; }
  .simbar .scrub { grid-column: 1 / -1; order: 3; }
  .simright { justify-content: flex-end; }
  .methods-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .charts, .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .nav-links { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px 12px; margin: 0; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 8px; }
  .nav-meta { display: none; }
  .topnav .inner { padding: 0 16px; }
  .page { padding-block: 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  h1 { font-size: 24px; }
  .simbar { position: static; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .simright { justify-content: flex-start; flex-wrap: wrap; }
  .select { max-width: 100%; }
  .alert-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .alert-row .acts { justify-content: flex-start; }
  .alert-row .explain { grid-column: 1; }
  .kpi .k-value { font-size: 21px; }
  .chart-box { height: 210px; }
  .phone-screen { height: 500px; }
}

@media (max-width: 480px) {
  .heat td { min-width: 30px; padding: 6px 1px; font-size: 10.5px; }
  .prose { font-size: 14.5px; }
}
