/* ManningLab Pro — styles
   Direction: an engineering drawing sheet. Cool drafting paper, drafting-ink navy,
   one water teal, sediment brown for channel boundaries, ochre for critical flow. */

:root {
  --paper: #F2F5F5;
  --panel: #FFFFFF;
  --panel-2: #EBF1F2;
  --ink: #13222D;
  --text-2: #3A4D59;
  --muted: #62757F;
  --line: #D2DCE0;
  --line-2: #AFC0C7;
  --water: #0A6F82;
  --water-2: #1E97AB;
  --water-fill: rgba(24, 139, 160, .30);
  --water-soft: #D5ECF0;
  --earth: #7A5F46;
  --earth-soft: #E6DDD0;
  --crit: #A86400;
  --super: #B03A2E;
  --ok: #2A7448;
  --warn: #9A6100;
  --bad: #B03A2E;
  --info: #2D5F8A;
  --grid: rgba(19, 34, 45, .06);
  --grid-strong: rgba(19, 34, 45, .11);
  --on-water: #FFFFFF;
  --c1: #0A6F82; --c2: #A86400; --c3: #6A4C9C; --c4: #B03A2E; --c5: #2A7448; --c6: #7A5F46;
  --shadow: 0 1px 0 rgba(19, 34, 45, .04), 0 6px 18px -12px rgba(19, 34, 45, .25);
  --font: "Barlow", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E181E; --panel: #15222A; --panel-2: #1A2A33; --ink: #E3ECEF; --text-2: #BCCBD1; --muted: #8FA2AB;
    --line: #26363F; --line-2: #36505B; --water: #45B7C9; --water-2: #6FD0DE; --water-fill: rgba(69, 183, 201, .28);
    --water-soft: #173A43; --earth: #B8977A; --earth-soft: #2D2721; --crit: #E0A040; --super: #EC7A6D; --ok: #5FBF85;
    --warn: #E0A040; --bad: #EC7A6D; --info: #7FB2DD; --grid: rgba(227, 236, 239, .05); --grid-strong: rgba(227, 236, 239, .09);
    --c1: #45B7C9; --c2: #E0A040; --c3: #A98BDB; --c4: #EC7A6D; --c5: #5FBF85; --c6: #B8977A; --on-water: #0B161C;
    --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 8px 20px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E181E; --panel: #15222A; --panel-2: #1A2A33; --ink: #E3ECEF; --text-2: #BCCBD1; --muted: #8FA2AB;
  --line: #26363F; --line-2: #36505B; --water: #45B7C9; --water-2: #6FD0DE; --water-fill: rgba(69, 183, 201, .28);
  --water-soft: #173A43; --earth: #B8977A; --earth-soft: #2D2721; --crit: #E0A040; --super: #EC7A6D; --ok: #5FBF85;
  --warn: #E0A040; --bad: #EC7A6D; --info: #7FB2DD; --grid: rgba(227, 236, 239, .05); --grid-strong: rgba(227, 236, 239, .09);
  --c1: #45B7C9; --c2: #E0A040; --c3: #A98BDB; --c4: #EC7A6D; --c5: #5FBF85; --c6: #B8977A; --on-water: #0B161C;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 8px 20px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 110px); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.5; font-variant-numeric: tabular-nums;
}
html[lang="tr"] [data-lang="en"], html[lang="en"] [data-lang="tr"] { display: none !important; }
img, svg, canvas { max-width: 100%; }
a { color: var(--water); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar & tabs ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand svg { width: 34px; height: 26px; flex: none; }
.brand-name { font-family: var(--font-cond); font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; line-height: 1; }
.brand-name b { font-weight: 500; color: var(--water); }
.brand-sub { display: block; font-size: .78rem; color: var(--muted); font-family: var(--font); letter-spacing: 0; margin-top: 3px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 5px 11px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.icon-btn { border: 1px solid var(--line-2); background: transparent; border-radius: 6px; width: 34px; height: 30px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn svg { width: 17px; height: 17px; }

.tabs { max-width: 1240px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; padding: 0 12px; scrollbar-width: thin; }
.tabs button {
  flex: none; border: 0; background: transparent; padding: 10px 12px 11px; cursor: pointer; font-weight: 500;
  color: var(--muted); border-bottom: 3px solid transparent; font-size: .93rem; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--water); font-weight: 600; }

main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.panel { display: none; }
.panel.active { display: block; }

h1, h2, h3, h4 { font-family: var(--font-cond); line-height: 1.15; margin: 0; color: var(--ink); }
h2.page-title { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; margin-bottom: 4px; }
.page-lead { color: var(--text-2); max-width: 72ch; margin: 0 0 20px; }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }
h4 { font-size: 1.02rem; font-weight: 600; margin: 14px 0 6px; }
p { margin: 0 0 10px; }

/* ---------- blocks ---------- */
.block { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.block + .block { margin-top: 16px; }
.block.flat { box-shadow: none; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.block-head h3 { margin: 0; }
.note { font-size: .88rem; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.layout-side { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.stack > * + * { margin-top: 16px; }
@media (max-width: 1020px) { .layout-side { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } main { padding: 16px 12px 50px; } .block { padding: 14px; } }

/* ---------- forms ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.fields.one { grid-template-columns: 1fr; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 460px) { .fields, .fields.three { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field .lbl { font-size: .84rem; color: var(--text-2); display: flex; align-items: center; gap: 4px; font-weight: 500; }
.inp { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); overflow: hidden; }
.inp:focus-within { border-color: var(--water); box-shadow: 0 0 0 3px var(--water-soft); }
.inp input, .inp select { border: 0; background: transparent; padding: 7px 9px; width: 100%; min-width: 0; outline: none; }
.inp .unit { padding: 7px 9px; background: var(--panel-2); color: var(--muted); font-size: .82rem; white-space: nowrap; display: flex; align-items: center; border-left: 1px solid var(--line); }
.field.solved .inp { background: var(--water-soft); border-color: var(--water); }
.field.solved input { font-weight: 600; color: var(--water); }
.field.invalid .inp { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.field .err { color: var(--bad); font-size: .78rem; }
select.plain, input.plain { border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; background: var(--panel); min-width: 0; }
textarea.plain { border: 1px solid var(--line-2); border-radius: 6px; padding: 8px; width: 100%; background: var(--panel); min-height: 90px; font-size: .88rem; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--water); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-family: var(--font-cond); font-weight: 600; font-size: 1.02rem; margin-bottom: 8px; padding: 0; }
.fieldgroup + .fieldgroup { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); }

.info { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 50%; width: 17px; height: 17px; font-size: .7rem; line-height: 1; cursor: help; padding: 0; display: inline-grid; place-items: center; font-weight: 700; font-style: italic; font-family: Georgia, serif; }
.info:hover, .info:focus-visible { color: var(--water); border-color: var(--water); }
.popover { position: fixed; z-index: 60; max-width: 300px; background: var(--ink); color: var(--panel); padding: 9px 11px; border-radius: 6px; font-size: .84rem; line-height: 1.4; box-shadow: var(--shadow); display: none; }
.popover.show { display: block; }

/* shape picker */
.shape-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.shape-picker button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; padding: 6px 4px 5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .74rem; color: var(--text-2); line-height: 1.15; text-align: center; min-height: 64px; }
.shape-picker button svg { width: 40px; height: 26px; }
.shape-picker button svg .ch { fill: none; stroke: var(--earth); stroke-width: 2.2; stroke-linejoin: round; }
.shape-picker button svg .wt { fill: var(--water-fill); stroke: var(--water); stroke-width: 1.2; }
.shape-picker button[aria-pressed="true"] { border-color: var(--water); background: var(--water-soft); color: var(--ink); font-weight: 600; }
.solve-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.solve-seg button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; padding: 5px 11px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.solve-seg button[aria-pressed="true"] { background: var(--water); color: var(--on-water); border-color: var(--water); }
.solve-seg button:disabled { opacity: .4; cursor: not-allowed; }

/* buttons */
.btn { border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); padding: 7px 14px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--water); border-color: var(--water); color: var(--on-water); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--water); padding-left: 6px; padding-right: 6px; }
.btn.small { padding: 4px 9px; font-size: .82rem; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- results ---------- */
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid currentColor; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); } .chip.info { color: var(--info); } .chip.water { color: var(--water); }

.sheet { width: 100%; border-collapse: collapse; font-size: .93rem; }
.sheet td, .sheet th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sheet th { font-weight: 600; color: var(--text-2); font-size: .82rem; background: var(--panel-2); position: sticky; top: 0; }
.sheet td.num, .sheet th.num { text-align: right; white-space: nowrap; }
.sheet td.sym { font-family: var(--font-cond); color: var(--water); font-weight: 600; white-space: nowrap; width: 1%; }
.sheet td.unit { color: var(--muted); white-space: nowrap; width: 1%; font-size: .85rem; }
.sheet tr.hl td { background: color-mix(in srgb, var(--water) 8%, transparent); }
.sheet tr.bad-row td { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.sheet tr.warn-row td { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.sheet .pass { color: var(--ok); font-weight: 700; } .sheet .fail { color: var(--bad); font-weight: 700; }
.summary-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
@media (max-width: 720px) { .summary-cols { grid-template-columns: 1fr; } }
.table-wrap { overflow: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }
.table-wrap.tall { max-height: 460px; }
.table-wrap .sheet th { cursor: default; }
.sheet th.sortable { cursor: pointer; user-select: none; }
.sheet th.sortable:hover { color: var(--ink); }
.edit-table input, .edit-table select { width: 100%; min-width: 64px; border: 1px solid transparent; background: transparent; padding: 4px 5px; border-radius: 4px; }
.edit-table input:focus, .edit-table select:focus { border-color: var(--water); background: var(--panel); outline: none; }
.edit-table td { padding: 2px 4px; }
.edit-table td.bad-cell input { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }

.warn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.warn-list li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: .92rem; align-items: start; }
.warn-list .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff; margin-top: 1px; }
.warn-list .lv-ok .ic { background: var(--ok); } .warn-list .lv-warn .ic { background: var(--warn); } .warn-list .lv-bad .ic { background: var(--bad); } .warn-list .lv-info .ic { background: var(--info); }
.interp { border-left: 3px solid var(--water); padding: 8px 12px; background: var(--panel-2); border-radius: 0 6px 6px 0; font-size: .95rem; }
.interp p:last-child { margin-bottom: 0; }
.error-box { border: 1px solid var(--bad); color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); padding: 10px 12px; border-radius: 6px; font-weight: 500; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .93rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; }

.big-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.big-read > div { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.big-read .k { display: block; font-size: .8rem; color: var(--muted); line-height: 1.25; }
.big-read .v { display: block; font-family: var(--font-cond); font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.big-read .v small { font-family: var(--font); font-size: .78rem; color: var(--muted); font-weight: 500; margin-left: 3px; }

/* ---------- charts ---------- */
.chart { margin: 0; min-width: 0; }
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.chart figcaption .ttl { font-family: var(--font-cond); font-weight: 600; font-size: 1.02rem; }
.chart-tools { display: flex; gap: 4px; }
.chart-tools button { border: 1px solid var(--line); background: var(--panel); border-radius: 4px; font-size: .74rem; padding: 2px 7px; cursor: pointer; color: var(--muted); font-weight: 600; }
.chart-tools button:hover { color: var(--ink); border-color: var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .82rem; }
.legend button { border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; color: var(--text-2); }
.legend button.off { opacity: .4; text-decoration: line-through; }
.legend .sw { width: 16px; height: 0; border-top: 3px solid; display: inline-block; }
.legend .sw.dash { border-top-style: dashed; }
.chart-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 6px 9px; font-size: .8rem; box-shadow: var(--shadow); display: none; max-width: 260px; }
.chart-tip b { font-weight: 600; }
.ax text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ax line, .ax path { stroke: var(--line-2); }
.gridl { stroke: var(--grid-strong); stroke-width: 1; }
.lbl-ax { fill: var(--text-2); font-size: 12px; font-family: var(--font); }
.mk-lbl { fill: var(--ink); font-size: 11px; font-weight: 600; font-family: var(--font); paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }

/* section drawing */
.sec-draw { width: 100%; }
.sec-draw .bank { fill: none; stroke: var(--earth); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.sec-draw .soil { fill: var(--earth-soft); stroke: none; }
.sec-draw .water { fill: var(--water-fill); stroke: none; }
.sec-draw .ws { stroke: var(--water); stroke-width: 2; }
.sec-draw .wave { stroke: var(--water-2); stroke-width: 1.4; fill: none; stroke-dasharray: 10 8; animation: flow 1.6s linear infinite; }
.sec-draw .crit { stroke: var(--crit); stroke-width: 1.6; stroke-dasharray: 6 4; }
.sec-draw .top { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.sec-draw .dim { stroke: var(--text-2); stroke-width: 1; fill: none; }
.sec-draw text { font-family: var(--font); font-size: 12px; fill: var(--text-2); }
.sec-draw text.strong { font-weight: 600; fill: var(--ink); }
.sec-draw text.wtxt { fill: var(--water); font-weight: 600; }
.sec-draw text.ctxt { fill: var(--crit); font-weight: 600; }
@keyframes flow { to { stroke-dashoffset: -36; } }

/* ---------- hero ---------- */
.hero {
  position: relative; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background-color: var(--panel);
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px), linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
}
.hero-top { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 10px; padding: 26px 26px 0; align-items: end; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -.01em; line-height: .95; }
.hero h1 .pro { color: var(--water); font-weight: 500; }
.hero .tag { font-size: 1.08rem; color: var(--text-2); max-width: 46ch; margin: 12px 0 16px; }
.hero .formula { font-family: var(--font-cond); font-size: clamp(1.2rem, 2.4vw, 1.7rem); color: var(--ink); justify-self: end; text-align: right; }
.hero .formula .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .75em; margin: 0 4px; line-height: 1.05; }
.hero .formula .frac span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }
.hero .formula small { display: block; font-family: var(--font); font-size: .8rem; color: var(--muted); margin-top: 4px; }
.sim-wrap { position: relative; }
#heroCanvas { display: block; width: 100%; height: 340px; }
.title-block {
  position: absolute; right: 16px; bottom: 16px; background: var(--panel); border: 1.5px solid var(--ink);
  display: grid; grid-template-columns: repeat(3, auto); font-size: .82rem; min-width: 290px;
}
.title-block > div { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 4px 9px; }
.title-block > div:nth-child(3n) { border-right: 0; }
.title-block .k { color: var(--muted); font-size: .72rem; display: block; }
.title-block .v { font-family: var(--font-cond); font-weight: 600; font-size: 1.05rem; }
.title-block .wide { grid-column: 1 / -1; border-right: 0; border-bottom: 0 !important; display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-cond); font-weight: 600; }
.sim-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; padding: 14px 26px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.slider { display: flex; flex-direction: column; gap: 3px; font-size: .84rem; }
.slider .row { display: flex; justify-content: space-between; color: var(--text-2); }
.slider .row b { font-family: var(--font-cond); font-size: 1rem; color: var(--ink); }
.slider input[type="range"] { width: 100%; accent-color: var(--water); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) {
  .hero-top { grid-template-columns: 1fr; padding: 20px 16px 0; }
  .hero .formula { justify-self: start; text-align: left; }
  .sim-controls { grid-template-columns: 1fr 1fr; padding: 12px 16px 16px; }
  .title-block { position: static; margin: 0 12px 12px; min-width: 0; }
  #heroCanvas { height: 250px; }
}
.module-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 22px; border-top: 1px solid var(--line-2); }
.module-index a { display: block; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.module-index a:hover .mi-t { color: var(--water); }
.module-index .mi-t { font-family: var(--font-cond); font-weight: 600; font-size: 1.1rem; display: block; }
.module-index .mi-d { color: var(--muted); font-size: .88rem; }
@media (max-width: 900px) { .module-index { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .module-index { grid-template-columns: 1fr; } }
.steps { counter-reset: st; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(st); width: 26px; height: 26px; border: 1.5px solid var(--water); color: var(--water); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

/* jump sketch */
.jump-draw text { font-family: var(--font); font-size: 12px; fill: var(--text-2); }
.jump-draw .bed { stroke: var(--earth); stroke-width: 3; }
.jump-draw .wfill { fill: var(--water-fill); }
.jump-draw .wline { stroke: var(--water); stroke-width: 2; fill: none; }
.jump-draw .roll { stroke: var(--water-2); stroke-width: 1.3; fill: none; stroke-dasharray: 5 5; animation: flow 1.2s linear infinite; }
.jump-draw .flowl { stroke: var(--water-2); stroke-width: 1.2; stroke-dasharray: 8 10; animation: flow 1s linear infinite; }
.jump-draw .egl { stroke: var(--crit); stroke-width: 1.4; stroke-dasharray: 6 4; fill: none; }

/* docs */
.doc { max-width: 78ch; }
.doc h3 { margin-top: 26px; }
.doc h3:first-child { margin-top: 0; }
.eq { font-family: var(--font-cond); font-size: 1.15rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 8px 0 12px; overflow-x: auto; white-space: nowrap; }
.doc ul { padding-left: 20px; } .doc li { margin-bottom: 4px; }
.refs li { margin-bottom: 6px; font-size: .92rem; }
.progress { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--water); transition: width .15s; }
.qc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.qc-dot.g { background: var(--ok); } .qc-dot.y { background: var(--warn); } .qc-dot.r { background: var(--bad); }
.drop { border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: .9rem; }
.drop.over { border-color: var(--water); background: var(--water-soft); color: var(--ink); }
.report-preview { border: 1px solid var(--line); border-radius: 6px; padding: 20px; background: var(--panel); max-height: 640px; overflow: auto; }
.report-preview h1 { font-size: 1.6rem; margin-bottom: 6px; }
.report-preview h2 { font-size: 1.2rem; margin: 18px 0 8px; }
.hist-list { list-style: none; padding: 0; margin: 0; }
.hist-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; align-items: center; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }
footer .inner { max-width: 1240px; margin: 0 auto; padding: 16px 20px 26px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 9px 16px; border-radius: 6px; font-size: .9rem; z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }
.hidden { display: none !important; }
details.adv > summary { cursor: pointer; color: var(--water); font-weight: 600; font-size: .9rem; margin-top: 4px; }
details.adv[open] > summary { margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) { .sec-draw .wave, .jump-draw .roll, .jump-draw .flowl { animation: none; } }
@media print {
  .topbar, .tabs, footer, .no-print, .chart-tools, #toast { display: none !important; }
  body { background: #fff; }
  .panel { display: none !important; } .panel.print-me { display: block !important; }
  .report-preview { max-height: none; border: 0; }
}
