/* Sustainable Harvest: the harbor council's planning desk. Scenes by art.js, colors from the --sh-* properties below
   (light and dark). Dead bycatch is hatched and drawn belly-up with a cross, fleet B bars are striped, and plan
   verdicts carry ✓/✗ text, so colour is never the only cue. */
html {
  --sh-sky1: #bfe0f0; --sh-sky2: #eaf6fb; --sh-sea1: #2f86ad; --sh-sea2: #164a68; --sh-wave: rgba(255, 255, 255, .55);
  --sh-hills: #8fb98a; --sh-sun: #ffd166; --sh-paper1: #fdfcf7; --sh-paper2: #f1f4ef; --sh-grid: rgba(36, 94, 118, .14);
  --sh-ink: #172c3a; --sh-muted: #4a5f6b; --sh-axis: #2a3f4b; --sh-curve: #1f7a5c; --sh-marker: #b8541a;
  --sh-fish: #f2b134; --sh-fish-line: #8a5a10; --sh-turtle: #2f9e8f; --sh-dead: #6e7880; --sh-net: rgba(255, 255, 255, .7);
  --sh-boatA: #c4473a; --sh-boatB: #3b6fb6; --sh-cabin: #f4f1ea; --sh-dock: #8a6a45; --sh-shed: #d8c7a6; --sh-roof: #a0483a;
  --sh-ground1: #d9cfa4; --sh-ground2: #c3b47e; --sh-tree1: #24603a; --sh-tree2: #4f9a50; --sh-trunk: #6b4a2b; --sh-stump: #d9b98a;
  --sh-stream: #3d9bd6; --sh-floor: #c0392b; --sh-model: #1d7a3a; --sh-miss: #a3361f;
  --sh-panel1: #f7fbfc; --sh-panel2: #e9f2f4; --sh-chipbg: #ffffff; --sh-chip-on: #d4ebf1; --sh-line: #8eaab5; --sh-accent: #245e76;
  --sh-plan: #9a4a12; --sh-predict: #245e76; --sh-explain: #5b3f8f; --sh-tag: rgba(253, 252, 247, .92);
}
html[data-theme="dark"] {
  --sh-sky1: #10283a; --sh-sky2: #1b3a50; --sh-sea1: #14506e; --sh-sea2: #082436; --sh-wave: rgba(190, 230, 255, .35);
  --sh-hills: #2f4f3a; --sh-sun: #e8c766; --sh-paper1: #13222b; --sh-paper2: #0f1b22; --sh-grid: rgba(150, 210, 230, .12);
  --sh-ink: #e6eef2; --sh-muted: #a9bcc6; --sh-axis: #b9cbd4; --sh-curve: #5fd3a3; --sh-marker: #ffa766;
  --sh-fish: #f7c35c; --sh-fish-line: #7a4f0c; --sh-turtle: #4fd1bf; --sh-dead: #9aa5ad; --sh-net: rgba(220, 240, 255, .6);
  --sh-boatA: #e0675a; --sh-boatB: #6c9be0; --sh-cabin: #d9dfe3; --sh-dock: #7a5c3a; --sh-shed: #6f6450; --sh-roof: #8a3f33;
  --sh-ground1: #3b3a25; --sh-ground2: #2c2b1b; --sh-tree1: #2f7a48; --sh-tree2: #5fb563; --sh-trunk: #8a6440; --sh-stump: #b89a6c;
  --sh-stream: #5ab4ee; --sh-floor: #ff7a68; --sh-model: #6fd68f; --sh-miss: #ff8a70;
  --sh-panel1: #16242c; --sh-panel2: #1d2f3a; --sh-chipbg: #1f333f; --sh-chip-on: #24566a; --sh-line: #4f7383; --sh-accent: #7fc4dc;
  --sh-plan: #ffad70; --sh-predict: #7fc4dc; --sh-explain: #c5a8ff; --sh-tag: rgba(19, 34, 43, .9);
}

.core { height: 100%; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; padding: 16px; overflow: auto; color: var(--sh-ink); font-size: 16px; box-sizing: border-box; }
.core * { box-sizing: border-box; }
.core-bench, .core-panel { min-width: 0; border-radius: 16px; overflow: auto; }
.core-bench { display: flex; flex-direction: column; gap: 10px; }
.core-bench > * { flex-shrink: 0; }
.core-panel { padding: 14px 16px; background: linear-gradient(180deg, var(--sh-panel1), var(--sh-panel2)); border: 1px solid var(--sh-line); box-shadow: 0 2px 10px rgba(16, 43, 56, .12); }
.sh-bench-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.core-kicker { text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--sh-accent); margin: 0; font-size: 16px; }
.core h2 { font-size: 24px; margin: 0; }
.core-scene { flex: 0 0 auto; overflow: auto; border-radius: 14px; border: 2px solid var(--sh-axis); background: var(--sh-paper1); box-shadow: 0 4px 14px rgba(16, 43, 56, .2); }
.core-scene:focus-visible { outline: 3px solid #dd9823; outline-offset: 3px; }
.core-scene svg { display: block; width: 100%; min-width: 460px; height: auto; }
.sh-plot { touch-action: pan-x; cursor: crosshair; }
.core.dragging .sh-plot { cursor: grabbing; }

/* scene text: ≥ 22 viewBox units, so ≥ 16 px at the 460 px minimum */
.core-scene svg text, .ps-art svg text, .sh-example svg text { font-family: inherit; fill: var(--sh-ink); font-size: 22px; pointer-events: none; }
.core-scene svg .sh-lab { font-weight: 800; fill: var(--sh-muted); }
.core-scene svg .sh-tick { font-variant-numeric: tabular-nums; }
.core-scene svg .sh-read { font-weight: 800; paint-order: stroke; stroke: var(--sh-paper1); stroke-width: 5px; }
.core-scene svg .sh-hint-t { fill: var(--sh-muted); font-style: italic; }
.core-scene svg .sh-band { font-weight: 800; fill: #fff; paint-order: stroke; stroke: rgba(8, 30, 44, .75); stroke-width: 5px; }
.core-scene svg .sh-band-dark { font-weight: 800; fill: var(--sh-ink); paint-order: stroke; stroke: var(--sh-paper1); stroke-width: 5px; }
.core-scene svg .sh-badge { font-size: 22px; font-weight: 900; fill: #fff; }
.core-scene svg .sh-model { font-weight: 800; fill: var(--sh-model); paint-order: stroke; stroke: var(--sh-paper1); stroke-width: 5px; }
.core-scene svg .sh-miss { font-weight: 800; fill: var(--sh-miss); paint-order: stroke; stroke: var(--sh-paper1); stroke-width: 5px; }
.core-scene svg .sh-floor-t { fill: var(--sh-floor); font-weight: 700; paint-order: stroke; stroke: var(--sh-paper1); stroke-width: 5px; }
.core-scene svg .sh-tag-t { font-weight: 800; }
.core-scene svg .sh-tag-m { font-weight: 700; paint-order: stroke; stroke: var(--sh-tag); stroke-width: 6px; }

.sh-grid path { stroke: var(--sh-grid); stroke-width: 1.5; fill: none; }
.sh-axis { fill: none; stroke: var(--sh-axis); stroke-width: 3; }
.sh-curve { fill: none; stroke: var(--sh-curve); stroke-width: 5; stroke-linecap: round; }
.sh-marker { fill: none; stroke: var(--sh-marker); stroke-width: 3; stroke-dasharray: 6 5; }
.sh-handle circle { fill: var(--sh-paper1); stroke: var(--sh-marker); stroke-width: 3; }
.sh-dot { fill: var(--sh-marker); stroke: var(--sh-paper1); stroke-width: 2.5; }
.sh-audit path { fill: var(--sh-explain); stroke: var(--sh-explain); stroke-width: 2.5; }
.sh-model-line { stroke: var(--sh-model); stroke-width: 3; stroke-dasharray: 10 6; fill: none; }
.sh-fish-body { fill: var(--sh-fish); stroke: var(--sh-fish-line); stroke-width: 1.2; }
.sh-fish-gill { fill: none; stroke: var(--sh-fish-line); stroke-width: 1.2; }
.sh-eye { fill: #1a1a1a; }
.sh-turtle .sh-shell { fill: var(--sh-turtle); stroke: #0f4a43; stroke-width: 1.2; }
.sh-turtle .sh-flipper { stroke: var(--sh-turtle); stroke-width: 4; stroke-linecap: round; }
.sh-turtle .sh-shell-line { stroke: #0f4a43; stroke-width: 1.2; fill: none; }
.sh-turtle.dead .sh-shell { fill: url(#sh-hatch); stroke: var(--sh-dead); }
.sh-turtle.dead .sh-flipper { stroke: var(--sh-dead); }
.sh-cross { stroke: #1a1a1a; stroke-width: 2.4; }
.sh-wave { fill: none; stroke: var(--sh-wave); stroke-width: 2; }
.sh-sun { fill: var(--sh-sun); }
.sh-hills { fill: var(--sh-hills); }
.sh-cabin { fill: var(--sh-cabin); stroke: #2a2a2a; stroke-width: 1; }
.sh-window { fill: #6fb6dc; }
.sh-rig { stroke: #3a3a3a; stroke-width: 2; fill: none; }
.sh-dock { fill: var(--sh-dock); }
.sh-piling { stroke: var(--sh-dock); stroke-width: 5; }
.sh-shed { fill: var(--sh-shed); }
.sh-roof { fill: var(--sh-roof); }
.sh-netline { stroke: var(--sh-net); stroke-width: 2; }
.sh-escape { fill: rgba(255, 255, 255, .15); stroke: #ffe08a; stroke-width: 3; stroke-dasharray: 5 3; }
.sh-hook { fill: none; stroke: #e6e6e6; stroke-width: 2; }
.sh-floor { stroke: var(--sh-floor); stroke-width: 3; stroke-dasharray: 10 6; fill: none; }
.sh-final { stroke: var(--sh-floor); stroke-width: 5; fill: none; }
.sh-stock { fill: none; stroke: var(--sh-curve); stroke-width: 4.5; stroke-linejoin: round; }
.sh-bar-a { fill: var(--sh-fish); stroke: var(--sh-fish-line); stroke-width: 1.5; }
.sh-bar-b { fill: var(--sh-boatB); stroke: #1f3f70; stroke-width: 1.5; }
.sh-bar-unmet { fill: none; stroke: var(--sh-floor); stroke-width: 2; stroke-dasharray: 4 3; }
.sh-bar-enc { fill: var(--sh-turtle); fill-opacity: .25; stroke: var(--sh-turtle); stroke-width: 3; }
.sh-patch { fill: var(--sh-paper1); fill-opacity: .55; stroke: var(--sh-axis); stroke-width: 2; cursor: pointer; }
.sh-patch.reserve { fill: #cfe6c8; fill-opacity: .7; }
.sh-patch.selection { fill: #e6e3c0; fill-opacity: .7; stroke-dasharray: 10 4; }
.sh-patch.clear { fill: #e9d3ae; fill-opacity: .75; stroke-dasharray: 2 6; }
html[data-theme="dark"] .sh-patch.reserve { fill: #234a31; }
html[data-theme="dark"] .sh-patch.selection { fill: #45472a; }
html[data-theme="dark"] .sh-patch.clear { fill: #4d3d26; }
.core-scene .sh-patch.active { stroke: var(--sh-marker); stroke-width: 6; stroke-dasharray: 12 4; }
.sh-tag { fill: var(--sh-tag); stroke: var(--sh-axis); stroke-width: 1; }
.sh-stream { fill: none; stroke: var(--sh-stream); stroke-width: 9; stroke-linecap: round; }
.sh-unset-dot { fill: var(--sh-muted); opacity: .4; }
.core-scene svg .deco { pointer-events: none; }

/* motion: the school drifts; a newly observed season draws in. Off for reduced motion. */
@keyframes sh-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(10px); } }
@keyframes sh-draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
.sh-school, .ps-art .sh-fish { animation: sh-drift 4s ease-in-out infinite; }
.core.stepped .sh-new { stroke-dasharray: 400; animation: sh-draw .7s ease-out both; }
@media (prefers-reduced-motion: reduce) { .sh-school, .ps-art .sh-fish, .core.stepped .sh-new { animation: none !important; } .core * { transition: none !important; } }

/* bench tools, notes, ledger */
.sh-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sh-tools-label { font-weight: 800; min-width: 74px; }
.sh-tool { font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; min-width: 64px; padding: 8px 14px; border-radius: 22px; border: 2px solid var(--sh-line); background: var(--sh-chipbg); color: inherit; cursor: pointer; }
.sh-tool[aria-pressed="true"] { background: var(--sh-chip-on); border-color: var(--sh-accent); box-shadow: inset 0 0 0 2px var(--sh-accent); }
.core-observation { min-height: 3em; line-height: 1.5; font-weight: 600; margin: 0; padding: 10px 14px; border-left: 5px solid var(--sh-accent); background: var(--sh-panel1); border-radius: 8px; }
.sh-note, .sh-precision { font-size: 16px; line-height: 1.5; color: var(--sh-muted); margin: 0; }
.sh-ledger { overflow: auto; }
.sh-table { font-size: 16px; border-collapse: collapse; width: 100%; }
.sh-table th, .sh-table td { padding: 7px 9px; text-align: right; border-bottom: 1px solid var(--sh-line); font-variant-numeric: tabular-nums; }
.sh-table th:first-child { text-align: left; }
.sh-ledger-table { min-width: 450px; }
.sh-ledger-table tr:first-child th { text-align: right; white-space: normal; }
.sh-ledger-table tr:first-child th:first-child { text-align: left; }
.core-about summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.core-about p { line-height: 1.5; margin: 0 0 10px; }

/* panel: evidence card, groups, chips */
.sh-case { background: var(--sh-chipbg); border: 1px solid var(--sh-line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.sh-case-kicker { margin: 0 0 6px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--sh-accent); }
.sh-case-sub { margin: 10px 0 4px; font-weight: 700; }
.sh-case .sh-table td { text-align: right; }
.sh-gear-table th, .sh-gear-table td { padding: 6px; }
.sh-rules summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.sh-rules ul { margin: 0; padding-left: 20px; }
.sh-rules li { line-height: 1.45; margin: 0 0 6px; }
.sh-step { margin: 14px 0 6px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: 16px; padding-left: 10px; border-left: 5px solid; }
.sh-step-plan { color: var(--sh-plan); }
.sh-step-predict { color: var(--sh-predict); }
.sh-step-explain { color: var(--sh-explain); }
.core-field { display: grid; gap: 6px; margin: 0 0 12px; }
.sh-label { font-weight: 700; }
.sh-num { display: flex; align-items: center; gap: 8px; }
.sh-num input { font: inherit; font-size: 16px; min-height: 44px; width: 100%; max-width: 220px; border-radius: 8px; border: 2px solid var(--sh-line); padding: 8px 10px; background: var(--sh-chipbg); color: inherit; }
.sh-unit { color: var(--sh-muted); font-weight: 600; }
.sh-range { font-size: 16px; width: 100%; min-height: 44px; accent-color: var(--sh-accent); }
.sh-chips { display: grid; gap: 6px; }
.sh-chips-row { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
.sh-chip { font: inherit; font-size: 16px; text-align: left; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--sh-line); background: var(--sh-chipbg); color: inherit; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; line-height: 1.3; }
.sh-chips-row .sh-chip { text-align: center; align-items: center; }
.sh-chip-main { font-weight: 700; }
.sh-chip-sub { font-size: 16px; color: var(--sh-muted); }
.sh-chip.on { background: var(--sh-chip-on); border-color: var(--sh-accent); box-shadow: inset 0 0 0 2px var(--sh-accent); }
.sh-chip.on .sh-chip-main::before { content: '✓ '; }
.sh-chip:disabled, .sh-tool:disabled { cursor: default; opacity: .62; }
.sh-chip.on:disabled { opacity: .9; }
.sh-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.core-run, .core-revise { font: inherit; font-size: 16px; font-weight: 800; min-height: 48px; border-radius: 10px; cursor: pointer; padding: 8px 12px; }
.core-run { background: #245e76; color: #fff; border: 2px solid #183f50; }
.core-revise { background: var(--sh-chipbg); color: inherit; border: 2px solid var(--sh-line); }
.core-run:disabled, .core-revise:disabled { opacity: .55; cursor: default; }
.core-status { line-height: 1.45; font-weight: 600; }
.core :focus-visible { outline: 3px solid #dd9823; outline-offset: 2px; }
body .ps-kicker, body .ps-hint-note, body .ps-badge { font-size: 16px; }
.sh-example svg { display: block; width: 100%; max-width: 560px; }

@media (max-width: 900px) {
  .core { height: auto; grid-template-columns: 1fr; padding: 12px; }
  .core-bench, .core-panel { overflow: visible; }
  .core-panel { padding-bottom: 30px; }
}
.core input, .core button, .core select { font-size: 16px; }
