:root {
  --bg: #f6f5f1; --panel: #fff; --ink: #1f2328; --muted: #5d636b; --line: #dcd9d1;
  --accent: #2f5d8a; --accent-soft: #e5edf5; --ok: #2e7d4f; --warn: #b26a00; --bad: #a33;
  --water: #4a90c8; --water2: #a9cdea; --stone: #8a8172; --hatchc: #c9c2b5;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181b; --panel: #1f2226; --ink: #e6e6e6; --muted: #9aa1a9; --line: #34383e; --accent: #7fb0e0; --accent-soft: #24313e; --water: #3b7fb8; --water2: #24425e; --stone: #6d6659; --hatchc: #3a3d42; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, sans-serif; }
header { padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
header h1 { font-size: 18px; margin: 0; }
.who { color: var(--muted); font-size: 13px; }
nav { display: flex; gap: 2px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav button { border: 0; background: none; padding: 12px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
nav button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.wrap { display: grid; grid-template-columns: 1fr 300px; gap: 20px; padding: 20px; max-width: 1200px; margin: auto; }
@media (max-width: 860px) { .wrap { grid-template-columns: 1fr; padding: 16px; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 10px; }
ol.steps { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 8px; flex-wrap: wrap; }
ol.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; font-size: 13px; }
ol.steps li.done { border-color: var(--ok); color: var(--ok); }
ol.steps li.cur { background: var(--accent); color: #fff; border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
select, input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; width: 100%; max-width: 360px; background: var(--panel); color: var(--ink); }
button.primary { font: inherit; padding: 6px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; margin-top: 10px; }
.tip { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); text-align: center; font-size: 11px; line-height: 16px; cursor: help; margin-left: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.empty { color: var(--bad); font-size: 12px; }
.bar { height: 14px; background: var(--accent-soft); border-radius: 7px; position: relative; overflow: hidden; margin: 6px 0; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--warn); }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.pill.bad { background: #fbe9e7; color: var(--bad); } .pill.ok { background: #e6f4ea; color: var(--ok); }
.refused { border-left: 4px solid var(--bad); }
aside .card { position: sticky; top: 16px; }
aside h3 { font-size: 14px; margin: 12px 0 4px; } aside h3:first-child { margin-top: 0; }
aside p { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.fict { background: #fff3cd; color: #6b4e00; font-weight: 600; font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 10px; }
.seg button { font: inherit; font-size: 13px; padding: 4px 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.seg button:first-child { border-radius: 6px 0 0 6px; } .seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
label.inline { display: inline-block; margin: 0; } label.inline select { display: block; width: auto; min-width: 120px; }
.canal { overflow-x: auto; } .canal svg { min-width: 760px; } .canal svg text { font-family: system-ui, sans-serif; } .canal svg text:not([style]) { fill: var(--ink); }
.basin:hover rect:first-child { stroke: var(--accent); }
button.linkish { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; }
footer { text-align: center; font-size: 13px; color: var(--muted); padding: 16px; }
a { color: var(--accent); }
