/* Interference Pool: the wave-pattern design desk. Scenes by art.js; colors from the --ip-* properties below (light and
   dark). S₂ phase fronts and r₂ are dashed as well as a second colour, so colour is never the only cue. Laser colours
   are always named in text. */
html {
  --ip-desk1: #eef4f6; --ip-desk2: #dde8ec; --ip-ink: #142833; --ip-muted: #4a5f6b; --ip-line: #3b5260;
  --ip-water1: #8fd0e6; --ip-water2: #4f9fbf; --ip-rim1: #b98b5a; --ip-rim2: #7d5a36;
  --ip-front1: rgba(255, 255, 255, .85); --ip-front2: #fff1a8; --ip-path1: #0d4f6b; --ip-path2: #8a3f12;
  --ip-metal1: #f1f4f6; --ip-metal2: #c9d3d9; --ip-metal3: #9aa9b2; --ip-glass1: #e3f1f6; --ip-glass2: #f9fdff; --ip-cap: #5a4632;
  --ip-wave: #1f7a8c; --ip-wave-ok: #138a52; --ip-wave-off: #8a96a0; --ip-panel: #ffffff; --ip-panel-line: #9fb4be;
  --ip-meterbg: #e3ebef; --ip-meter: #1f8fb0; --ip-model: #1d7a3a; --ip-active: #dd9823;
  --ip-chipbg: #ffffff; --ip-chip-on: #d7ecf2; --ip-chip-line: #8eaab5; --ip-accent: #245e76;
  --ip-p1: #f7fbfc; --ip-p2: #e9f2f4; --ip-design: #9a4a12; --ip-predict: #245e76; --ip-explain: #6e3f8f; --ip-warn: #a2461a;
}
html[data-theme="dark"] {
  --ip-desk1: #15232b; --ip-desk2: #0f1b22; --ip-ink: #e8f0f3; --ip-muted: #a9bcc6; --ip-line: #8fa9b6;
  --ip-water1: #1d5a73; --ip-water2: #0f3a4d; --ip-rim1: #6b4f32; --ip-rim2: #3e2c1b;
  --ip-front1: rgba(210, 240, 255, .75); --ip-front2: #ffe27a; --ip-path1: #9fe3ff; --ip-path2: #ffb37a;
  --ip-metal1: #6f7d86; --ip-metal2: #4b5860; --ip-metal3: #2f3a40; --ip-glass1: #1b2f39; --ip-glass2: #24414f; --ip-cap: #c9a77e;
  --ip-wave: #5fd3e6; --ip-wave-ok: #5fe39a; --ip-wave-off: #74828c; --ip-panel: #1a2a33; --ip-panel-line: #4f7383;
  --ip-meterbg: #23353f; --ip-meter: #5fd3e6; --ip-model: #6fd68f; --ip-active: #ffc04d;
  --ip-chipbg: #1f333f; --ip-chip-on: #24566a; --ip-chip-line: #4f7383; --ip-accent: #7fc4dc;
  --ip-p1: #16242c; --ip-p2: #1d2f3a; --ip-design: #ffad70; --ip-predict: #7fc4dc; --ip-explain: #d3a6f5; --ip-warn: #ffad70;
}

.core { height: 100%; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; padding: 16px; overflow: auto; color: var(--ip-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(--ip-p1), var(--ip-p2)); border: 1px solid var(--ip-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(--ip-line); background: var(--ip-desk2); 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%; min-width: 460px; height: auto; color: var(--ip-ink); }
.ip-plot { touch-action: pan-x pan-y; cursor: ew-resize; }

/* scene text: every class ≥ 22 viewBox units (≥ 16 px at the 460 px minimum width) */
.core-scene svg text { font-family: inherit; fill: var(--ip-ink); font-size: 22px; pointer-events: none; paint-order: stroke; }
.core-scene svg .ip-head { font-size: 24px; font-weight: 800; }
.core-scene svg .ip-small, .core-scene svg .ip-tick { font-size: 22px; fill: var(--ip-muted); font-variant-numeric: tabular-nums; }
.core-scene svg .ip-ptext { font-size: 22px; font-weight: 600; }
.core-scene svg .ip-strong { font-weight: 800; }
.core-scene svg .ip-warn { fill: var(--ip-warn); font-weight: 800; }
.core-scene svg .ip-srclab, .core-scene svg .ip-pathlab { font-size: 22px; font-weight: 800; stroke: var(--ip-water1); stroke-width: 4px; }
.core-scene svg .ip-chiptext { font-size: 22px; font-weight: 700; }
.core-scene svg .ip-modeltext { font-size: 22px; font-weight: 800; fill: var(--ip-model); stroke: var(--ip-desk1); stroke-width: 4px; }
.core-scene svg .ip-axis { fill: none; stroke: var(--ip-line); stroke-width: 2.2; }
.core-scene svg .ip-dim { fill: none; stroke: var(--ip-muted); stroke-width: 1.6; stroke-dasharray: 2 4; }
.core-scene svg .ip-rail { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1 10; }
.core-scene svg .ip-front1 { fill: none; stroke: var(--ip-front1); stroke-width: 2.4; }
.core-scene svg .ip-front2 { fill: none; stroke: var(--ip-front2); stroke-width: 2.4; stroke-dasharray: 9 6; }
.core-scene svg .ip-path1 { fill: none; stroke: var(--ip-path1); stroke-width: 3.4; }
.core-scene svg .ip-path2 { fill: none; stroke: var(--ip-path2); stroke-width: 3.4; stroke-dasharray: 10 6; }
.core-scene svg .ip-active { fill: none; stroke: var(--ip-active); stroke-width: 4; stroke-dasharray: 5 4; }
.core-scene svg .ip-panel { fill: var(--ip-panel); stroke: var(--ip-panel-line); stroke-width: 2; }
.core-scene svg .ip-meterbg { fill: var(--ip-meterbg); stroke: var(--ip-panel-line); stroke-width: 2; }
.core-scene svg .ip-meterfill { fill: var(--ip-meter); }
.core-scene svg .ip-marker { fill: none; stroke: var(--ip-active); stroke-width: 3; stroke-dasharray: 7 5; }
.core-scene svg .ip-handle, .core-scene svg .ip-handlebox { fill: var(--ip-active); stroke: var(--ip-ink); stroke-width: 2; }
.core-scene svg .ip-ghost { fill: none; stroke: var(--ip-model); stroke-width: 3.4; stroke-dasharray: 6 4; }
.core-scene svg .ip-ghostline { fill: none; stroke: var(--ip-model); stroke-width: 3.4; stroke-dasharray: 6 4; }
.core-scene svg .ip-centre { fill: none; stroke: var(--ip-muted); stroke-width: 1.4; stroke-dasharray: 3 5; }
.core-scene svg .ip-envelope { fill: none; stroke: var(--ip-wave); stroke-width: 2; stroke-dasharray: 6 5; opacity: .65; }
.core-scene svg .ip-wave { fill: none; stroke: var(--ip-wave); stroke-width: 4; stroke-linecap: round; }
.core-scene svg .ip-wave.is-resonant { stroke: var(--ip-wave-ok); stroke-width: 5; }
.core-scene svg .ip-wave.is-off { stroke: var(--ip-wave-off); stroke-dasharray: 2 6; }
.core-scene svg .ip-chip rect { fill: var(--ip-chipbg); stroke: var(--ip-chip-line); stroke-width: 2; }
.core-scene svg .ip-chip-ok rect { stroke: var(--ip-wave-ok); stroke-width: 3; }
.core-scene svg .ip-chip-warn rect { stroke: var(--ip-warn); stroke-width: 3; stroke-dasharray: 6 4; }

.ip-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.ip-segbtn { flex: 1; min-width: 140px; font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; border-radius: 10px; border: 2px solid var(--ip-chip-line); background: var(--ip-chipbg); color: inherit; cursor: pointer; }
.ip-segbtn[aria-pressed="true"] { background: var(--ip-chip-on); border-color: var(--ip-active); box-shadow: inset 0 0 0 2px var(--ip-active); }
.ip-legend { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ip-muted); font-style: italic; }
.core-observation { margin: 0; min-height: 3em; line-height: 1.5; font-weight: 600; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--ip-chip-line); background: var(--ip-p1); }
.core-observation.is-tested { border-style: solid; border-left: 6px solid var(--ip-predict); }
.ip-motion { align-self: flex-start; font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 2px solid var(--ip-chip-line); background: var(--ip-chipbg); color: inherit; cursor: pointer; }
.ip-motion[hidden] { display: none; }
.ip-motion:disabled { opacity: .55; cursor: not-allowed; }
.core-about summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; font-size: 16px; }
.core-about p { font-size: 16px; line-height: 1.5; margin: 0 0 8px; }

.ip-case { margin-bottom: 8px; }
.ip-case-kicker { margin: 0; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; font-size: 16px; color: var(--ip-accent); }
.ip-case-title { margin: 4px 0 10px; font-size: 21px; line-height: 1.25; }
.ip-table { width: 100%; border-collapse: collapse; font-size: 16px; margin-bottom: 8px; }
.ip-table th, .ip-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--ip-chip-line); vertical-align: top; line-height: 1.35; }
.ip-table th { font-weight: 700; width: 44%; }
.ip-rule { margin: 6px 0; font-size: 16px; line-height: 1.45; color: var(--ip-muted); }
.ip-step { margin: 14px 0 6px; font-weight: 800; font-size: 16px; text-transform: uppercase; letter-spacing: .08em; padding-bottom: 4px; border-bottom: 3px solid currentColor; }
.ip-step-design { color: var(--ip-design); }
.ip-step-predict { color: var(--ip-predict); }
.ip-step-explain { color: var(--ip-explain); }
.core-field { display: grid; gap: 6px; margin: 0 0 12px; }
.ip-label { font-weight: 700; font-size: 16px; line-height: 1.35; }
.ip-num { display: flex; align-items: center; gap: 8px; }
.ip-num input { flex: 1; min-width: 0; font: inherit; font-size: 16px; min-height: 44px; border-radius: 8px; border: 1px solid var(--ip-chip-line); padding: 8px 10px; background: var(--ip-chipbg); color: inherit; font-variant-numeric: tabular-nums; }
.ip-unit { font-weight: 700; min-width: 3em; }
.ip-range { font-size: 16px; width: 100%; min-height: 44px; accent-color: var(--ip-accent); margin: 0; }
.ip-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ip-chip { font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; min-width: 64px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--ip-chip-line); background: var(--ip-chipbg); color: inherit; cursor: pointer; text-align: center; }
.ip-chips-wide { flex-direction: column; }
.ip-chips-wide .ip-chip { text-align: left; font-weight: 600; line-height: 1.35; }
.ip-chip.is-on { background: var(--ip-chip-on); border-color: var(--ip-accent); box-shadow: inset 0 0 0 2px var(--ip-accent); }
.ip-chip.is-on::before { content: '✓ '; font-weight: 800; }
.ip-chip:disabled { cursor: default; opacity: .6; }
.ip-chip.is-on:disabled { opacity: .85; }
.ip-actions { display: flex; gap: 8px; margin-top: 12px; }
.ip-actions button { flex: 1; font: inherit; font-size: 16px; font-weight: 800; min-height: 48px; border-radius: 10px; cursor: pointer; }
.core-run { background: #245e76; color: #fff; border: 2px solid #1a4558; }
.core-revise { background: var(--ip-chipbg); color: inherit; border: 2px solid var(--ip-chip-line); }
.ip-actions button:disabled { opacity: .5; cursor: not-allowed; }
.core-status { margin: 8px 0 0; font-size: 16px; line-height: 1.4; }
.ip-precision { margin: 8px 0 0; font-size: 16px; line-height: 1.4; color: var(--ip-muted); }
.core :focus-visible { outline: 3px solid #dd9823; outline-offset: 3px; }
.ip-example svg { min-width: 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-scene { overflow-x: auto; }
  .core-panel { padding-bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) { .core * { animation: none !important; transition: none !important; } }
