/* Feasibility Assessment Tools - one stylesheet, light/dark via tokens. */

:root {
  color-scheme: light;
  --page: #f5f5f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --surface-3: #e8e7e2;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6f6d68;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e3eefb;
  --focus: #2a78d6;
  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: #e3f4e3;
  --warn: #fab219;
  --warn-ink: #7a5200;
  --warn-soft: #fdf1d6;
  --bad: #d03b3b;
  --bad-ink: #a82727;
  --bad-soft: #fae3e3;
  --shadow: 0 1px 2px rgba(11, 11, 11, .06), 0 2px 8px rgba(11, 11, 11, .04);
  --ring: rgba(11, 11, 11, .10);

  /* chart roles (dataviz reference palette) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --grid: #e1e0d9; --axis: #c3c2b7; --muted: #898781;
  --div-neg: #e34948; --div-mid: #f0efec; --div-pos: #2a78d6;

  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", "Leelawadee UI", "Sukhumvit Set", Thonburi, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2c2c2a;
    --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #a3a29a;
    --line: #2c2c2a; --line-strong: #44443f;
    --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #17283d; --focus: #6da7ec;
    --good-ink: #0ca30c; --good-soft: #13261a; --warn-ink: #fab219; --warn-soft: #2e2510;
    --bad-ink: #e66767; --bad-soft: #301a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --ring: rgba(255, 255, 255, .10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --grid: #2c2c2a; --axis: #383835; --div-mid: #383835; --div-neg: #e66767; --div-pos: #3987e5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2c2c2a;
  --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #a3a29a;
  --line: #2c2c2a; --line-strong: #44443f;
  --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #17283d; --focus: #6da7ec;
  --good-ink: #0ca30c; --good-soft: #13261a; --warn-ink: #fab219; --warn-soft: #2e2510;
  --bad-ink: #e66767; --bad-soft: #301a1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --ring: rgba(255, 255, 255, .10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --grid: #2c2c2a; --axis: #383835; --div-mid: #383835; --div-neg: #e66767; --div-pos: #3987e5;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink); font: 14px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
}
/* Thai has stacked vowels and tone marks: give lines a little more room. */
html[lang="th"] body { line-height: 1.6; }
html[lang="th"] .tile .v, html[lang="th"] h1, html[lang="th"] h2 { line-height: 1.35; }
.lang-toggle { font-weight: 650; min-width: 44px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; } h4 { font-size: .9rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 52px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand .full { display: inline; }
.brand .short { display: none; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { color: var(--ink-2); padding: 6px 10px; border-radius: var(--radius-sm); }
.nav a:hover, .nav a.active { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 6px; }
.userbox .who { color: var(--ink-2); font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600;
  background: var(--surface-3); color: var(--ink-2); vertical-align: middle;
}
.badge.admin { background: var(--accent-soft); color: var(--accent); }

/* ---------- layout */
.container { max-width: 1880px; margin: 0 auto; padding: 20px 24px 48px; }
.container.narrow { max-width: 1200px; }
@media (max-width: 640px) { .container { padding: 16px 16px 40px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head .grow { flex: 1; min-width: 220px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card + .card { margin-top: 16px; }
.grid > .card, .project-list > .card { margin-top: 0; }   /* grid gap already spaces these */
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- forms & buttons */
label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 3px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 9px; min-height: 36px;
}
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
input[type=range] { padding: 0; border: 0; min-height: 24px; accent-color: var(--accent); background: transparent; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 550;
  padding: 7px 14px; min-height: 36px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad-ink); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 9px; min-height: 30px; font-size: 13px; }
.btn.icon { padding: 0; width: 36px; }
.btn.icon.sm { width: 30px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.alert.error { background: var(--bad-soft); border-color: transparent; color: var(--bad-ink); }
.alert.secret { background: var(--warn-soft); border-color: transparent; color: var(--ink); font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.alert.info { background: var(--accent-soft); border-color: transparent; }

/* ---------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--surface-2); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
table.proj th:first-child, table.proj td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 210px; }
table.proj th:first-child { background: var(--surface-2); }
table.proj tr.total td { font-weight: 650; }
table.proj tr.section td { background: var(--surface-2); font-weight: 650; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.neg { color: var(--bad-ink); }

/* ---------- login */
.auth-wrap { min-height: calc(100vh - 52px); display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.3rem; }

/* ---------- project list */
/* Cards grow to fill the row: 1 column on phones, 2-4 on wider screens. */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 8px; color: inherit; }
.project-card:hover { text-decoration: none; border-color: var(--line-strong); }
.project-card h3 { margin: 0; color: var(--ink); }
.project-card .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: auto; }
.project-card .kpis div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 8px; }
.project-card .kpis b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card .kpis b small { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.project-card .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.project-card .kpis span { font-size: 11px; color: var(--ink-2); }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }

/* ---------- status pills (icon + label, never color alone) */
.status { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: 12.5px; padding: 2px 9px; border-radius: 99px; }
.status::before { font-size: 11px; }
.status.good { background: var(--good-soft); color: var(--good-ink); }
.status.good::before { content: "✓"; }
.status.warning { background: var(--warn-soft); color: var(--warn-ink); }
.status.warning::before { content: "!"; font-weight: 800; }
.status.critical { background: var(--bad-soft); color: var(--bad-ink); }
.status.critical::before { content: "✕"; }

/* ---------- workbench */
.wb-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.wb-title { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.wb-title input { font-size: 1.15rem; font-weight: 650; border-color: transparent; background: transparent; padding: 2px 6px; margin-left: -6px; min-height: 32px; }
.wb-title input:hover { border-color: var(--line); }
.wb-title .meta { font-size: 12px; color: var(--ink-3); }
.save-state { font-size: 12px; color: var(--ink-3); min-width: 70px; }
.save-state.dirty { color: var(--warn-ink); }
.save-state.error { color: var(--bad-ink); }

.workbench { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: calc(100vh - 52px - 62px); }
.wb-inputs { border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; max-height: calc(100vh - 52px - 62px); position: sticky; top: calc(52px + 62px); }
.wb-results { padding: 16px; min-width: 0; }
.mobile-switch { display: none; }
@media (max-width: 980px) {
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .wb-inputs { position: static; max-height: none; border-right: 0; }
  .mobile-switch { display: flex; gap: 4px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 30; }
  .mobile-switch button { flex: 1; }
  .workbench[data-pane="results"] .wb-inputs { display: none; }
  .workbench[data-pane="inputs"] .wb-results { display: none; }
}

.section { border-bottom: 1px solid var(--line); }
.section > summary {
  list-style: none; cursor: pointer; padding: 12px 16px; font-weight: 650; display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.section > summary::-webkit-details-marker { display: none; }
.section > summary::before { content: "›"; display: inline-block; width: 12px; transition: transform .15s; color: var(--ink-3); font-size: 16px; }
.section[open] > summary::before { transform: rotate(90deg); }
.section > summary .count { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.section-body { padding: 0 16px 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fields .wide { grid-column: 1 / -1; }
.fields .field { margin: 0; }

.item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; background: var(--surface); }
.item-head { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.item-head input { font-weight: 600; }
.item .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.item .fields label { font-size: 11.5px; }
@media (max-width: 420px) { .item .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.slider-row { display: grid; grid-template-columns: 1fr 74px; gap: 4px 10px; align-items: center; margin-bottom: 8px; }
.slider-row label { grid-column: 1 / -1; margin: 0; display: flex; justify-content: space-between; }
.slider-row label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.slider-row input[type=number] { min-height: 30px; padding: 3px 6px; }

/* KPI tiles */
.verdict { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.verdict .checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.verdict .checks span::before { margin-right: 4px; font-weight: 700; }
.verdict .checks .pass::before { content: "✓"; color: var(--good-ink); }
.verdict .checks .fail::before { content: "✕"; color: var(--bad-ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); }
.tile .k { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 4px; }
.tile .v { font-size: 1.3rem; font-weight: 650; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .d { font-size: 11.5px; color: var(--ink-3); }
.tile .v small { font-size: .6em; font-weight: 600; color: var(--ink-2); }
#cmp-diff td:first-child, #cmp-table td:first-child { min-width: 220px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.tabs button {
  font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px;
  color: var(--ink-2); cursor: pointer; white-space: nowrap; font-weight: 550;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 380px; }
.chart-title { font-weight: 650; margin-bottom: 2px; }
.chart-sub { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; vertical-align: 2px; }

.heat td { text-align: right; font-variant-numeric: tabular-nums; }
.heat td.base { outline: 2px solid var(--ink); outline-offset: -2px; font-weight: 650; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.toolbar .field { margin: 0; min-width: 120px; }

.loading { opacity: .55; transition: opacity .2s; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* menus & dialogs */
.menu { position: relative; display: inline-block; }
.menu > .menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; z-index: 60; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 4px;
}
.menu-list a, .menu-list button {
  display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; color: var(--ink);
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink);
  width: min(480px, calc(100vw - 32px)); box-shadow: 0 16px 48px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form, dialog .dialog-body { padding: 18px; }
dialog h2 { margin-bottom: 12px; }

.scenario-row { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.scenario-row:last-child { border-bottom: 0; }
.scenario-row .name { flex: 1; min-width: 160px; }
.scenario-row .name b { display: block; }
.scenario-row .kv { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Compare: the picker column is sticky and uses the full window height. */
#cmp-layout { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); align-items: start; }
#cmp-layout > .card:first-child { position: sticky; top: 68px; }
.picker { max-height: calc(100vh - 170px); overflow: auto; margin-right: -8px; padding-right: 8px; }
.picker h4 { margin: 10px 0 4px; font-size: 13px; }
.picker label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; font-size: 13px; color: var(--ink); padding: 5px 4px; border-radius: 4px; cursor: pointer; margin: 0; }
.picker label:hover { background: var(--surface-2); }
.picker label input { margin-top: 3px; }
.picker label .when { grid-column: 2; font-size: 11.5px; color: var(--ink-3); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.delta-up { color: var(--good-ink); }
.delta-down { color: var(--bad-ink); }

footer.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 16px; }

@media (max-width: 640px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .brand .full, .brand .short { display: none; }
  .nav { margin-left: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 6px 7px; white-space: nowrap; }
  .topbar .spacer { flex: 0 0 auto; margin-left: auto; }
  .userbox .badge { display: none; }
  .userbox .who { display: none; }
  .tile .v { font-size: 1.1rem; }
  .fields { grid-template-columns: 1fr 1fr; }
  .chart-box { height: 260px; }
}
@media print {
  .topbar, .wb-inputs, .mobile-switch, .wb-head .btn-row, .tabs { display: none !important; }
  .workbench { display: block; }
}
@media (max-width: 900px) { #cmp-layout { grid-template-columns: minmax(0, 1fr); } #cmp-layout > .card:first-child { position: static; } .picker { max-height: 50vh; } }

/* ---------- guide */
.guide { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 20px; align-items: start; }
.guide-toc { position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow: auto; }
.guide-toc ol { margin: 0 0 12px; padding-left: 20px; }
.guide-toc li { margin: 2px 0; font-size: 13.5px; }
.guide-toc a { color: var(--ink-2); }
.guide-toc a.current { color: var(--accent); font-weight: 600; }
.guide-body { max-width: 980px; padding: 24px 28px; font-size: 14.5px; line-height: 1.65; }
.guide-body h1 { font-size: 1.6rem; margin-bottom: .25rem; }
.guide-body h2 { font-size: 1.25rem; margin: 2.2rem 0 .6rem; padding-top: .9rem; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.guide-body h2:first-of-type { border-top: 0; padding-top: 0; }
.guide-body h3 { font-size: 1.02rem; margin: 1.4rem 0 .4rem; }
.guide-body ul, .guide-body ol { padding-left: 22px; margin: 0 0 .9rem; }
.guide-body li { margin: 3px 0; }
.guide-body table { margin: .4rem 0 1rem; font-size: 13.5px; }
.guide-body td, .guide-body th { vertical-align: top; }
.guide-body td:first-child { font-weight: 600; white-space: nowrap; }
.guide-body .table-wrap { margin: .4rem 0 1rem; }
.guide-body .table-wrap table { margin: 0; }
.guide-body code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: .8rem 0 1rem; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout b:first-child { display: block; margin-bottom: 2px; }
.lead { font-size: 1.05rem; color: var(--ink-2); }
@media (max-width: 900px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
  .guide-toc { position: static; max-height: none; }
  .guide-body { padding: 18px 16px; }
  .guide-body td:first-child { white-space: normal; }
}
