/* Bioaccumulation Chain: the aquatic contaminant desk. Scenes by art.js, colors from the --bc-* properties below
   (light and dark). */
html {
  --bc-sky1: #cfe6f1; --bc-sky2: #eef6f4; --bc-water1: #9fd0d8; --bc-water2: #2f6f86; --bc-surface: #e9f7fa; --bc-mud1: #8a7354; --bc-mud2: #5b4a35;
  --bc-reed: #4f7a3a; --bc-pebble: #6b5a43; --bc-bubble: #ffffff; --bc-grid: rgba(16, 44, 58, .35); --bc-line: #183241;
  --bc-glass: #e7f4f7; --bc-hg1: #e0661c; --bc-hg2: #a8430d; --bc-model: #127a8a; --bc-flag: #b3261e; --bc-arrow: #1d4f63;
  --bc-card: #ffffff; --bc-energy: #e8b021; --bc-lab: #e6edef; --bc-bench1: #b58a5a; --bc-bench2: #7c5a36; --bc-dead: #9aa3a8;
  --bc-ink: #102b38; --bc-text: #102b38; --bc-panel1: #f7fbfc; --bc-panel2: #e9f2f4; --bc-chip: #ffffff; --bc-chip-on: #d7ecf2; --bc-chip-line: #8eaab5;
}
html[data-theme="dark"] {
  --bc-sky1: #182633; --bc-sky2: #263744; --bc-water1: #2b5866; --bc-water2: #0f2a36; --bc-surface: #5b8a99; --bc-mud1: #4f4234; --bc-mud2: #2f271e;
  --bc-reed: #7fae5f; --bc-pebble: #2a241b; --bc-bubble: #cfe8ef; --bc-grid: rgba(220, 238, 244, .3); --bc-line: #0a141a;
  --bc-glass: #c9dfe6; --bc-hg1: #ff8a3d; --bc-hg2: #d0601f; --bc-model: #5fd3e0; --bc-flag: #ff6b5e; --bc-arrow: #9fd8ea;
  --bc-card: #1d2f3a; --bc-energy: #f2c64a; --bc-lab: #1b262d; --bc-bench1: #6b5034; --bc-bench2: #463320; --bc-dead: #5d676c;
  --bc-ink: #e7f1f4; --bc-text: #e7f1f4; --bc-panel1: #16242c; --bc-panel2: #1d2f3a; --bc-chip: #1f333f; --bc-chip-on: #24566a; --bc-chip-line: #4f7383;
}

.core { height: 100%; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 16px; padding: 16px; overflow: auto; color: var(--bc-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-panel { padding: 14px 16px; background: linear-gradient(180deg, var(--bc-panel1), var(--bc-panel2)); border: 1px solid var(--bc-chip-line); box-shadow: 0 2px 10px rgba(16, 43, 56, .12); }
.core-scene { overflow: auto; border-radius: 14px; border: 2px solid var(--bc-line); background: var(--bc-water2); box-shadow: 0 4px 14px rgba(16, 43, 56, .25); }
.core-scene:focus-visible { outline: 3px solid #dd9823; outline-offset: 3px; }
.core-scene svg { display: block; width: 100%; min-width: 600px; height: auto; }
.core-scene svg text { font-family: inherit; fill: var(--bc-text); font-size: 20px; }
.core-scene svg .bc-head { font-size: 22px; font-weight: 700; }
.core-scene svg .bc-level { font-size: 22px; font-weight: 800; }
.core-scene svg .bc-factor, .core-scene svg .bc-flagtext, .core-scene svg .bc-tagtext { font-size: 20px; font-weight: 700; }
.core-scene svg .bc-flagtext { fill: var(--bc-flag); }
.core-scene svg .bc-small, .core-scene svg .bc-tick { font-size: 20px; }
.core[data-kind="chain"] .core-scene svg text:not(.bc-factor):not(.bc-flagtext), .core[data-kind="screen"] .core-scene svg text:not(.bc-factor):not(.bc-flagtext),
.core[data-kind="mechanism"] .core-scene svg text:not(.bc-tagtext) { paint-order: stroke; stroke: var(--bc-card); stroke-width: 4px; stroke-linejoin: round; }
.core-observation { margin: 0; min-height: 3em; padding: 10px 14px; line-height: 1.45; font-weight: 600; border-left: 5px solid var(--bc-hg1); background: var(--bc-panel1); border-radius: 0 10px 10px 0; }

.bc-case { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--bc-chip); border: 1px dashed var(--bc-chip-line); }
.bc-case p { margin: 4px 0; line-height: 1.45; }
.bc-case-kicker { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--bc-model); }
.bc-table { border-collapse: collapse; margin: 6px 0 2px; width: 100%; font-variant-numeric: tabular-nums; }
.bc-table th, .bc-table td { border: 1px solid var(--bc-chip-line); padding: 4px 6px; text-align: center; }
.bc-table th { text-align: left; font-weight: 700; }

.bc-field { display: grid; gap: 6px; margin: 0 0 12px; }
.bc-label { font-weight: 700; line-height: 1.35; }
.bc-kind { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 16px; font-weight: 800; background: var(--bc-hg1); color: #fff; }
html[data-theme="dark"] .bc-kind { color: #1b0d03; }
.bc-kind-predict { background: var(--bc-model); }
html[data-theme="dark"] .bc-kind-predict { color: #04252b; }
.bc-num { display: flex; align-items: center; gap: 8px; }
.bc-num input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 18px; font-weight: 700; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--bc-chip-line); background: var(--bc-chip); color: inherit; font-variant-numeric: tabular-nums; }
.bc-unit { flex: 0 0 auto; font-weight: 600; }
.bc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.core .bc-chip { font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--bc-chip-line); background: var(--bc-chip); color: inherit; cursor: pointer; text-align: left; line-height: 1.25; }
.core .bc-chip.on { background: var(--bc-chip-on); border-color: var(--bc-model); box-shadow: inset 0 0 0 1px var(--bc-model); }
.core .bc-chip.on::before { content: "✓ "; }
.core .bc-chip:hover:not(:disabled) { border-color: var(--bc-model); }
.bc-actions { display: flex; gap: 10px; margin-top: 4px; }
.core-run, .core-revise { font: inherit; font-size: 16px; font-weight: 800; min-height: 46px; border-radius: 12px; padding: 10px 16px; cursor: pointer; }
.core-run { flex: 1 1 auto; background: #245e76; color: #fff; border: 0; box-shadow: 0 3px 0 #163c4c; }
.core-revise { background: var(--bc-chip); color: inherit; border: 2px solid var(--bc-chip-line); }
.core button:disabled, .core input:disabled { opacity: .6; cursor: default; }
.core-run:disabled { box-shadow: none; }
.core :focus-visible { outline: 3px solid #dd9823; outline-offset: 2px; }
.core-status { margin: 8px 0; line-height: 1.4; }
.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 8px; }

body .ps-kicker, body .ps-hint-note, body .ps-badge { font-size: 16px; }

@media (max-width: 900px) {
  .core { height: auto; grid-template-columns: 1fr; padding: 12px; }
  .core-bench, .core-panel { overflow: visible; }
  .core-panel { padding-bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) { .core * { animation: none !important; transition: none !important; } }
