/* ShoalSheet: a field guide and water-test strip. Serif headings, sans body, mono numbers.
   One accent: deep pondweed teal. Radius 0 to 3px; rules and table rows do the structuring. */
:root {
  --paper: #f4f1e8;
  --surface: #fbfaf5;
  --ink: #17201e;
  --ink-2: #44504d;
  --rule: #cfc9b8;
  --rule-2: #e3ded0;
  --accent: #0b6259;
  --accent-ink: #ffffff;
  --accent-tint: #d7e8e3;
  --accent-tint-2: #a9cfc6;
  --pad-1: #e3ece5;
  --pad-2: #bcd7cd;
  --pad-3: #d9cfb6;
  --pad-4: #b9ab8a;
  --shared: rgba(11, 98, 89, .16);
  --focus: #0b6259;
  --serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1514; --surface: #151d1b; --ink: #e4ebe8; --ink-2: #a9b7b3; --rule: #34413e; --rule-2: #24302d;
    --accent: #6cc7b8; --accent-ink: #0b1312; --accent-tint: #173431; --accent-tint-2: #22504a;
    --pad-1: #1b2c28; --pad-2: #24453f; --pad-3: #3a3628; --pad-4: #5a5038; --shared: rgba(108, 199, 184, .2); --focus: #6cc7b8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1514; --surface: #151d1b; --ink: #e4ebe8; --ink-2: #a9b7b3; --rule: #34413e; --rule-2: #24302d;
  --accent: #6cc7b8; --accent-ink: #0b1312; --accent-tint: #173431; --accent-tint-2: #22504a;
  --pad-1: #1b2c28; --pad-2: #24453f; --pad-3: #3a3628; --pad-4: #5a5038; --shared: rgba(108, 199, 184, .2); --focus: #6cc7b8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 8px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.85rem; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; margin-top: 0; }
h3 { font-size: 1.1rem; margin-top: 1.4em; }
p { margin: 0 0 .9em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 50; }
.skip:focus { top: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* header */
.site-header { border-bottom: 2px solid var(--ink); background: var(--paper); }
.header-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 60px; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; min-height: 44px; }
.logo { color: var(--accent); flex: none; }
.wordmark { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.wordmark em { font-style: italic; color: var(--accent); font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 0 4px; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:hover { text-decoration: underline; }
nav[aria-label="Sections"] { margin-left: auto; }
.theme-toggle { min-height: 44px; min-width: 64px; }

/* buttons and inputs */
.btn { font: inherit; font-size: .95rem; min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 2px; background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; gap: 6px; }
.btn:hover { background: var(--accent-tint); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.step { width: 44px; padding: 0; font-family: var(--mono); font-size: 1.15rem; }
.btn.link-btn { border-color: transparent; background: none; color: var(--accent); text-decoration: underline; padding: 0 8px; }
.btn.link-btn:hover { background: var(--accent-tint); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--ink-2); border-radius: 2px; min-height: 44px; padding: 8px 10px; max-width: 100%; }
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
textarea { width: 100%; min-height: 88px; font-family: var(--mono); font-size: .85rem; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; min-width: 0; }
.field input, .field select { width: 100%; }
.hint { color: var(--ink-2); font-size: .9rem; }
.error { color: var(--ink); font-weight: 600; min-height: 0; margin: 0; }
.error:not(:empty) { border-left: 4px solid var(--ink); padding: 6px 10px; margin: 0 0 12px; background: var(--pad-3); }
.empty { color: var(--ink-2); font-style: italic; }
.note { font-size: .9rem; color: var(--ink-2); }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.with-unit { display: flex; gap: 6px; align-items: center; }
.with-unit input { flex: 1; min-width: 0; }
.with-unit .u { font-family: var(--mono); font-size: .9rem; color: var(--ink-2); min-width: 2ch; }
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; min-width: 0; }

/* hero */
.hero { padding: 24px 0 8px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.lede { font-size: 1.07rem; max-width: 70ch; }
.answer { border-left: 4px solid var(--accent); padding: 4px 0 4px 14px; max-width: 72ch; }
.noscript { border: 1px solid var(--ink); padding: 10px; }

/* planner layout */
.planner { display: grid; gap: 24px; }
@media (min-width: 900px) { .planner { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 16px; min-width: 0; }
.panel h2 { font-size: 1.25rem; }
fieldset { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; }
legend { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: 8px; }
.tank-summary { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: 8px; }

/* specimen rows */
.stock { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--ink); }
.specimen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .specimen { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) auto; align-items: center; } }
.spec-common { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.08rem; }
.spec-sci { display: block; font-family: var(--serif); color: var(--ink-2); font-size: .95rem; }
.spec-facts { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0; }
.spec-facts .fact { padding: 0 10px 0 8px; border-left: 1px solid var(--rule-2); min-width: 0; }
.spec-facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.spec-facts dd { margin: 0; font-size: .85rem; white-space: nowrap; }
.spec-count { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.count-input { width: 4.5em; text-align: right; }
.stock .empty { padding: 14px 0; border-bottom: 1px solid var(--rule); list-style: none; }

/* result */
.verdict { font-size: 1.15rem; font-family: var(--serif); }
.verdict strong { font-size: 1.35rem; display: block; }
.gauge-wrap { margin: 8px 0 0; }
.gauge { display: block; width: 100%; height: 56px; }
.gauge .g1 { fill: var(--pad-1); } .gauge .g2 { fill: var(--pad-2); } .gauge .g3 { fill: var(--pad-3); } .gauge .g4 { fill: var(--pad-4); }
.gauge .gtick { fill: var(--ink); }
.gauge .grange { fill: none; stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; }
.gauge-legend { position: relative; height: 1.4em; font-family: var(--mono); font-size: .75rem; color: var(--ink-2); margin-bottom: 10px; }
.gauge-legend span { position: absolute; top: 0; transform: translateX(-50%); }
.gauge-legend span:first-child { left: 0; transform: none; }
.gauge-legend .end { right: 0; transform: none; }
.method-line { font-size: .92rem; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: 8px; }
.flags, .pairs, .pair-reasons { list-style: none; padding: 0; margin: 0 0 12px; }
.flag { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule-2); }
.flag p { margin: 2px 0 0; font-size: .93rem; }
.chip { display: inline-block; font-family: var(--mono); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border: 1px solid var(--ink); border-radius: 2px; min-width: 6.2em; text-align: center; white-space: nowrap; }
.chip-avoid { background: var(--ink); color: var(--paper); }
.chip-caution { border-style: dashed; border-width: 2px; padding: 1px 5px; }
.chip-info { border-color: var(--rule); color: var(--ink-2); }
.chip-fine { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fine-line .chip { margin-right: 6px; }

/* band chart */
.bands { margin: 0 0 16px; border-top: 1px solid var(--ink); }
.band-row { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 5.5em; gap: 8px; align-items: center; min-height: 30px; border-bottom: 1px solid var(--rule-2); }
.band-head { min-height: 34px; }
.band-name { font-size: .85rem; line-height: 1.2; }
.band-head .band-name { font-weight: 700; }
.band-strip svg { display: block; width: 100%; height: 18px; }
.band-bar { fill: var(--accent); }
.band-shared { fill: var(--shared); }
.band-val { font-size: .8rem; text-align: right; }
.band-scale { position: relative; height: 1.4em; font-size: .75rem; color: var(--ink-2); }
.band-scale span { position: absolute; transform: translateX(-50%); top: 0; }
.band-scale span:first-child { transform: none; }
.band-scale span:last-child { transform: translateX(-100%); }
.band-foot { font-size: .88rem; margin: 6px 0 0; }

/* workings */
.workings { border: 1px solid var(--rule); padding: 0 12px; margin: 12px 0; background: var(--paper); }
.workings summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.workings ol { padding-left: 1.3em; font-size: .92rem; }
.table-scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total th, tr.total td { border-top: 2px solid var(--ink); font-weight: 700; }

/* compatibility */
.compat-picks { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.compat-pick { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--rule); padding-left: 10px; background: var(--surface); }
.compat-pick i { font-family: var(--serif); color: var(--ink-2); }
.pair { border-top: 1px solid var(--ink); padding: 10px 0; }
.pair-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.pair-head strong { font-family: var(--serif); font-size: 1.05rem; }
.pair-reasons li { font-size: .92rem; padding: 4px 0; }
.pair-reasons .chip { min-width: 0; margin-right: 4px; }

/* saved */
.saved-list { list-style: none; padding: 0; margin: 0 0 12px; border-top: 1px solid var(--ink); }
.saved { display: flex; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.saved-meta { color: var(--ink-2); font-size: .9rem; }
.saved-actions { display: flex; gap: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.file-btn { position: relative; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; min-height: 0; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.banner { border: 1px solid var(--ink); border-left: 6px solid var(--accent); background: var(--surface); padding: 10px 12px; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.banner p { margin: 0; flex: 1 1 260px; }
[role="status"] { min-height: 0; }

/* sections */
.section { padding: 32px 0; border-top: 1px solid var(--rule); }
.section-tint { background: var(--surface); }
.prose { max-width: 760px; }
.prose li { margin-bottom: .4em; }
.formula { font-family: var(--mono); font-size: .92rem; background: var(--surface); border-left: 4px solid var(--accent); padding: 10px 12px; overflow-x: auto; }
.faq { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; padding: 8px 0; }
.guide-list li { margin-bottom: .6em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 10px; }
.toolbar .field { margin: 0; flex: 1 1 220px; }
.idx td.sci, .idx .sci { font-family: var(--serif); font-style: italic; color: var(--ink-2); }
.idx th[scope="row"] { font-family: var(--serif); font-weight: 700; }
.idx td { font-size: .85rem; }
.idx .btn { min-height: 44px; font-size: .85rem; padding: 0 10px; }
.idx-wrap { max-height: none; }
.tank-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.tank-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--ink); text-decoration: none; font-family: var(--mono); color: var(--ink); background: var(--surface); }
.tank-links a:hover { background: var(--accent-tint); }

/* text pages */
.page { padding-top: 24px; padding-bottom: 40px; }
.crumb { font-size: .9rem; color: var(--ink-2); }
.meta { font-size: .9rem; color: var(--ink-2); }
.sources { font-size: .9rem; }
.example { border-top: 2px solid var(--ink); padding-top: 10px; margin-top: 20px; }
.example .verdict strong { font-size: 1.15rem; }

/* ads (off by default) */
.ad-slot { padding: 16px 0; }
.ad-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 4px; }
.ad-box { min-height: 280px; }
@media (min-width: 600px) { .ad-box { min-height: 120px; } }

/* mobile result bar */
.mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--ink); color: var(--paper); display: flex; align-items: center; gap: 8px; padding: 6px 16px; }
.mobile-bar p { margin: 0; flex: 1; font-size: .85rem; font-family: var(--mono); }
.mobile-bar a { color: var(--paper); min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--paper); text-decoration: none; }
@media (min-width: 900px) { .mobile-bar { display: none !important; } }

/* footer */
.site-footer { border-top: 2px solid var(--ink); padding: 24px 0 32px; font-size: .9rem; color: var(--ink-2); margin-top: 24px; }
.footer-brand { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.footer-brand em { color: var(--accent); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 6px; list-style: none; padding: 0; margin: 8px 0; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.copyright { margin: 0; }

@media (max-width: 520px) {
  h1 { font-size: 1.5rem; }
  .row-3 { grid-template-columns: minmax(0, 1fr); }
  .band-row { grid-template-columns: minmax(0, 6.5em) minmax(0, 1fr) 4.8em; gap: 6px; }
  nav[aria-label="Sections"] { margin-left: 0; order: 3; width: 100%; }
  .nav a { padding: 0 6px; }
}
.inline-add select { width: auto; flex: none; }
input { text-overflow: clip; }
.table-scroll { position: relative; }
input[type="search"], input[type="text"] { text-overflow: clip; }
.flag .chip { align-self: start; }
@media (max-width: 520px) {
  .band-row { grid-template-columns: minmax(0, 1fr) 4.8em; grid-template-areas: "name name" "strip val"; gap: 0 6px; padding: 4px 0; }
  .band-row .band-name { grid-area: name; }
  .band-row .band-strip, .band-row .band-scale { grid-area: strip; }
  .band-row .band-val { grid-area: val; }
  .band-scale .tick-odd { display: none; }
}
