/* Free Energy Forecaster: the reaction forecast desk. Scenes by art.js, colors from the --fe-* properties below (light
   and dark). Markers differ by line style and knob shape (solid/round desk temperature, dashed/diamond zero marker), and
   model reveals are green, hatched and labelled, so colour is never the only cue. */
html {
  --fe-bezel1: #dfe6ea; --fe-bezel2: #c3cfd6; --fe-screen1: #fbfdfc; --fe-screen2: #eef4f6; --fe-grid: rgba(36, 94, 118, .06);
  --fe-line: #3b5260; --fe-ink: #142833; --fe-text: #142833; --fe-muted: #4a5f6b; --fe-chip: #ffffff;
  --fe-axis: #2a3f4b; --fe-gridline: rgba(36, 94, 118, .16);
  --fe-curve: #245e76; --fe-point: #b8541a; --fe-neg: #1f8a8c; --fe-pos: #c4532a;
  --fe-hot1: #e04a3a; --fe-hot2: #a8261c; --fe-glass1: #d9e6ec; --fe-glass2: #ffffff;
  --fe-lampbg: #f4f7f8; --fe-lamp-on: #18b26b; --fe-lamp-off: #9aa8b0;
  --fe-card1: #ffffff; --fe-card2: #edf4f6; --fe-metal1: #f1f4f6; --fe-metal2: #b9c4ca; --fe-metal3: #8d9ba3;
  --fe-water1: #cfe8f4; --fe-water2: #9fcde3; --fe-bridge: #e7d7a8; --fe-wire: #b8693a; --fe-elec: #2b5797;
  --fe-ball: #f2c94c; --fe-ball2: #b9841a; --fe-cat: #9fd8c4; --fe-fb: #245e76; --fe-rb: #8a4fc7; --fe-gb: #b8541a;
  --fe-model: #1d7a3a; --fe-model-bg: #e3f4e8;
  --fe-panel1: #f7fbfc; --fe-panel2: #e9f2f4; --fe-chipbg: #ffffff; --fe-chip-on: #d7ecf2; --fe-chip-line: #8eaab5; --fe-accent: #245e76;
  --fe-setup: #9a4a12; --fe-predict: #245e76;
}
html[data-theme="dark"] {
  --fe-bezel1: #2a363e; --fe-bezel2: #1a232a; --fe-screen1: #0f1d24; --fe-screen2: #0b161c; --fe-grid: rgba(120, 220, 200, .05);
  --fe-line: #8fa9b6; --fe-ink: #e8f0f3; --fe-text: #e8f0f3; --fe-muted: #a9bcc6; --fe-chip: #1c2d36;
  --fe-axis: #b9cbd4; --fe-gridline: rgba(150, 210, 230, .14);
  --fe-curve: #6fcbe6; --fe-point: #ffa462; --fe-neg: #4fd1c5; --fe-pos: #ff8a5c;
  --fe-hot1: #ff6b5a; --fe-hot2: #c0392b; --fe-glass1: #2c3d47; --fe-glass2: #4a5f6b;
  --fe-lampbg: #14232b; --fe-lamp-on: #3ee68e; --fe-lamp-off: #4d5d66;
  --fe-card1: #1f333f; --fe-card2: #172833; --fe-metal1: #9aa8b0; --fe-metal2: #5d6b73; --fe-metal3: #3e4a51;
  --fe-water1: #1f4a5e; --fe-water2: #173a4a; --fe-bridge: #7c6d44; --fe-wire: #e3a273; --fe-elec: #8fb6ff;
  --fe-ball: #f2d36b; --fe-ball2: #a77d1c; --fe-cat: #2f7a63; --fe-fb: #7fc4dc; --fe-rb: #c39bff; --fe-gb: #ffa462;
  --fe-model: #6fd68f; --fe-model-bg: #183526;
  --fe-panel1: #16242c; --fe-panel2: #1d2f3a; --fe-chipbg: #1f333f; --fe-chip-on: #24566a; --fe-chip-line: #4f7383; --fe-accent: #7fc4dc;
  --fe-setup: #ffad70; --fe-predict: #7fc4dc;
}

.core { height: 100%; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, 1fr); gap: 16px; padding: 16px; overflow: auto; color: var(--fe-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(--fe-panel1), var(--fe-panel2)); border: 1px solid var(--fe-chip-line); box-shadow: 0 2px 10px rgba(16, 43, 56, .12); }
.core-scene { flex: 0 0 auto; overflow: auto; border-radius: 14px; border: 2px solid var(--fe-line); background: var(--fe-bezel2); box-shadow: 0 4px 14px rgba(16, 43, 56, .22); }
.core-scene:focus-visible { outline: 3px solid #dd9823; outline-offset: 3px; }
.core-scene svg { display: block; width: 100%; height: auto; touch-action: pan-x pan-y; }
.core-scene.fe-plot svg { cursor: crosshair; }
.core.locked .core-scene.fe-plot svg { cursor: default; }
:is(.core-scene, .ps-start-art) svg text { font-family: inherit; fill: var(--fe-text); font-size: 20px; }
:is(.core-scene, .ps-start-art) svg .fe-head { font-size: 22px; font-weight: 800; }
:is(.core-scene, .ps-start-art) svg .fe-chiptext, .core-scene svg .fe-lamptext { font-size: 20px; font-weight: 700; }
:is(.core-scene, .ps-start-art) svg .fe-tick { font-variant-numeric: tabular-nums; }
:is(.core-scene, .ps-start-art) svg .fe-axislab { font-weight: 700; fill: var(--fe-muted); }
:is(.core-scene, .ps-start-art) svg .fe-zerolab { font-weight: 700; fill: var(--fe-muted); font-style: italic; }
:is(.core-scene, .ps-start-art) svg .fe-muted { fill: var(--fe-muted); font-style: italic; }
:is(.core-scene, .ps-start-art) svg .fe-model { fill: var(--fe-model); font-weight: 800; }
:is(.core-scene, .ps-start-art) svg .fe-chiplabel { font-weight: 700; font-variant-numeric: tabular-nums; }
:is(.core-scene, .ps-start-art) svg .fe-pointlab { font-weight: 800; fill: var(--fe-point); font-variant-numeric: tabular-nums; }
:is(.core-scene, .ps-start-art) svg .fe-endlab { font-weight: 600; fill: var(--fe-curve); font-variant-numeric: tabular-nums; }
:is(.core-scene, .ps-start-art) svg .fe-cardlab { font-weight: 800; font-size: 22px; }
:is(.core-scene, .ps-start-art) svg .fe-cardval { font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
:is(.core-scene, .ps-start-art) svg .fe-link { fill: var(--fe-muted); font-style: italic; }
:is(.core-scene, .ps-start-art) svg .fe-bannerlab { font-weight: 700; fill: var(--fe-muted); }
:is(.core-scene, .ps-start-art) svg .fe-eq { font-weight: 800; font-size: 22px; }
:is(.core-scene, .ps-start-art) svg .fe-eq.fe-eq-sm { font-size: 20px; }
:is(.core-scene, .ps-start-art) svg .fe-panlab { font-weight: 800; }
:is(.core-scene, .ps-start-art) svg .fe-metallab { font-weight: 800; fill: #142833; }
:is(.core-scene, .ps-start-art) svg .fe-ionlab { font-weight: 800; fill: var(--fe-ink); }
:is(.core-scene, .ps-start-art) svg .fe-rolelab, .core-scene svg .fe-legend { fill: var(--fe-muted); font-weight: 600; }
:is(.core-scene, .ps-start-art) svg .fe-eleclab { fill: var(--fe-elec); font-weight: 800; }
:is(.core-scene, .ps-start-art) svg .fe-catlab { font-weight: 700; }
:is(.core-scene, .ps-start-art) svg .fe-axis { fill: none; stroke: var(--fe-axis); stroke-width: 2.4; }
:is(.core-scene, .ps-start-art) svg .fe-gridline { fill: none; stroke: var(--fe-gridline); stroke-width: 1.4; stroke-dasharray: 4 5; }
:is(.core-scene, .ps-start-art) svg .fe-zero { fill: none; stroke: var(--fe-axis); stroke-width: 2; stroke-dasharray: 10 6; }
:is(.core-scene, .ps-start-art) svg .fe-curve { fill: none; stroke: var(--fe-curve); stroke-width: 5; stroke-linecap: round; }
:is(.core-scene, .ps-start-art) svg .fe-curve-shadow { fill: none; stroke: var(--fe-curve); stroke-width: 13; stroke-linecap: round; opacity: .14; }
:is(.core-scene, .ps-start-art) svg .fe-tmark { stroke: var(--fe-hot1); stroke-width: 2.6; }
:is(.core-scene, .ps-start-art) svg .fe-zmark { stroke: var(--fe-ink); stroke-width: 2.4; stroke-dasharray: 8 6; }
:is(.core-scene, .ps-start-art) svg .fe-tmark.fe-on { stroke-width: 4; }
:is(.core-scene, .ps-start-art) svg .fe-zmark.fe-on { stroke-width: 3.6; }
:is(.core-scene, .ps-start-art) svg .fe-knob { stroke: var(--fe-line); stroke-width: 2; }
:is(.core-scene, .ps-start-art) svg .fe-knob-t { fill: var(--fe-hot1); }
:is(.core-scene, .ps-start-art) svg .fe-knob-z { fill: var(--fe-chip); }
:is(.core-scene, .ps-start-art) svg .fe-knob.fe-on { stroke: #dd9823; stroke-width: 4; }
:is(.core-scene, .ps-start-art) svg .fe-point { fill: var(--fe-point); stroke: var(--fe-chip); stroke-width: 2.4; }
:is(.core-scene, .ps-start-art) svg .fe-path { fill: none; stroke: var(--fe-curve); stroke-width: 5; stroke-linecap: round; }
:is(.core-scene, .ps-start-art) svg .ghost, .core-scene svg .fe-ghost-key { fill: none; stroke: var(--fe-muted); stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
:is(.core-scene, .ps-start-art) svg .fe-fb, .core-scene svg .fe-rb, .core-scene svg .fe-gb { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
:is(.core-scene, .ps-start-art) svg .fe-fb { stroke: var(--fe-fb); }
:is(.core-scene, .ps-start-art) svg .fe-rb { stroke: var(--fe-rb); stroke-dasharray: 6 4; }
:is(.core-scene, .ps-start-art) svg .fe-gb { stroke: var(--fe-gb); }
:is(.core-scene, .ps-start-art) svg .fe-fblab { fill: var(--fe-fb); font-weight: 800; }
:is(.core-scene, .ps-start-art) svg .fe-rblab { fill: var(--fe-rb); font-weight: 800; }
:is(.core-scene, .ps-start-art) svg .fe-gblab { fill: var(--fe-gb); font-weight: 800; }
.core-observation { margin: 0; min-height: 3em; padding: 10px 14px; line-height: 1.45; font-weight: 600; border-left: 5px solid var(--fe-accent); background: var(--fe-panel1); border-radius: 0 10px 10px 0; }
.fe-tools-note { margin: 0; line-height: 1.45; color: var(--fe-muted); }

.fe-case { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--fe-chipbg); border: 1px dashed var(--fe-chip-line); }
.fe-case p { margin: 6px 0; line-height: 1.45; }
.fe-case .fe-case-kicker { margin-top: 0; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--fe-predict); }
.fe-case .fe-eq { font-size: 18px; }
.fe-case .fe-note { color: var(--fe-muted); }
.fe-table { border-collapse: collapse; margin: 6px 0; width: 100%; font-variant-numeric: tabular-nums; }
.fe-table th, .fe-table td { border: 1px solid var(--fe-chip-line); padding: 5px 8px; text-align: center; }
.fe-table tr:first-child th { background: var(--fe-panel2); }
.fe-table tr > th:first-child { text-align: left; }

.fe-step { margin: 14px 0 8px; padding-top: 10px; border-top: 1px solid var(--fe-chip-line); font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.fe-step-setup { color: var(--fe-setup); }
.fe-step-predict { color: var(--fe-predict); }
.fe-field { display: grid; gap: 6px; margin: 0 0 12px; }
.fe-label { font-weight: 700; line-height: 1.35; }
.fe-num { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fe-num input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 18px; font-weight: 700; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--fe-chip-line); background: var(--fe-chipbg); color: inherit; font-variant-numeric: tabular-nums; }
.fe-unit { flex: 0 0 auto; font-weight: 600; max-width: 45%; }
.core .fe-range { width: 100%; min-height: 44px; margin: 0; accent-color: #c4532a; font-size: 16px; }
.fe-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fe-chips-stack { flex-direction: column; align-items: stretch; }
.core .fe-chip { font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; padding: 8px 14px; border-radius: 22px; border: 2px solid var(--fe-chip-line); background: var(--fe-chipbg); color: inherit; cursor: pointer; text-align: left; line-height: 1.3; }
.fe-chips-stack .fe-chip { border-radius: 12px; }
.core .fe-chip.on { background: var(--fe-chip-on); border-color: var(--fe-accent); box-shadow: inset 0 0 0 1px var(--fe-accent); }
.core .fe-chip.on::before { content: "✓ "; }
.core .fe-chip:hover:not(:disabled) { border-color: var(--fe-accent); }
.fe-actions { display: flex; gap: 10px; margin-top: 8px; }
.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(--fe-chipbg); color: inherit; border: 2px solid var(--fe-chip-line); }
.core button:disabled, .core input:disabled { opacity: .6; cursor: default; }
.core .fe-chip.on:disabled { opacity: .85; }
.core-run:disabled { box-shadow: none; }
.core :focus-visible { outline: 3px solid #dd9823; outline-offset: 2px; }
.core-status { margin: 8px 0 4px; line-height: 1.4; font-weight: 600; }
.fe-precision { margin: 0 0 6px; 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; }
.fe-example { margin: 8px 0; }

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; }
  .core-scene svg { min-width: 760px; }
  .fe-example svg { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .core * { animation: none !important; transition: none !important; } }
