/* Rate Law Detective: the kinetics evidence desk. Scenes by art.js, colors from the --rl-* properties below (light and
   dark). Observed data are solid / filled; the student's model is a dashed outline or dashed line; the practice-only
   model reveal is green AND dotted, so colour is never the only cue. */
html {
  --rl-desk1: #8a5a36; --rl-desk2: #6a4126; --rl-grain: #a5734b; --rl-ink-on-desk: #fff4e3; --rl-lens: #cfe8f2;
  --rl-paper1: #fffdf6; --rl-paper2: #f6efdc; --rl-grid: rgba(36, 94, 118, .08); --rl-line: #4a5a63; --rl-pin: #c8402f;
  --rl-text: #1d2a31; --rl-muted: #50606a; --rl-chip: #fff8e6; --rl-stamp: #a23a2b; --rl-stamp-on: #1f6f3f;
  --rl-obs: #2a6f8a; --rl-obs-hi: #5aaecb; --rl-obs-line: #1c4c60; --rl-model: #b2541a; --rl-pair: #7a3f91; --rl-select: rgba(122, 63, 145, .1);
  --rl-plotbg: rgba(255, 255, 255, .7); --rl-axis: #26363f; --rl-gridline: rgba(36, 94, 118, .18); --rl-modelok: #1d7a3a;
  --rl-liquid: #3c8fae; --rl-liquid-hi: #8fd0e6; --rl-glass: #ffffff;
  --rl-panel1: #fffaf0; --rl-panel2: #f5ecd8; --rl-chipbg: #ffffff; --rl-chip-on: #e7dcf0; --rl-chip-line: #a69a86; --rl-accent: #245e76;
  --rl-build: #8a3f12; --rl-predict: #245e76;
}
html[data-theme="dark"] {
  --rl-desk1: #3a2a20; --rl-desk2: #241a14; --rl-grain: #4b382b; --rl-ink-on-desk: #f6e6cf; --rl-lens: #2d4b58;
  --rl-paper1: #1b252b; --rl-paper2: #141d22; --rl-grid: rgba(150, 210, 230, .06); --rl-line: #8fa3ad; --rl-pin: #e0705f;
  --rl-text: #e9eff2; --rl-muted: #aebdc5; --rl-chip: #26333a; --rl-stamp: #ff8f7c; --rl-stamp-on: #6fd68f;
  --rl-obs: #4fb3d4; --rl-obs-hi: #9ae0f4; --rl-obs-line: #9ad3e6; --rl-model: #ffa060; --rl-pair: #cf9ae6; --rl-select: rgba(207, 154, 230, .14);
  --rl-plotbg: rgba(10, 18, 22, .6); --rl-axis: #c3d2d9; --rl-gridline: rgba(150, 210, 230, .16); --rl-modelok: #6fd68f;
  --rl-liquid: #3a9cc0; --rl-liquid-hi: #8fdcf3; --rl-glass: #d9eef6;
  --rl-panel1: #172128; --rl-panel2: #1d2a32; --rl-chipbg: #1f2d35; --rl-chip-on: #4a2f5a; --rl-chip-line: #5d717b; --rl-accent: #7fc4dc;
  --rl-build: #ffad70; --rl-predict: #7fc4dc;
}

.core { height: 100%; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr); gap: 16px; padding: 16px; overflow: auto; color: var(--rl-text); 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(--rl-panel1), var(--rl-panel2)); border: 1px solid var(--rl-chip-line); box-shadow: 0 2px 10px rgba(40, 28, 10, .12); }

.core-scene { flex: 0 0 auto; overflow: auto; border-radius: 14px; border: 2px solid var(--rl-line); background: var(--rl-desk2); box-shadow: 0 4px 14px rgba(40, 28, 10, .25); }
.core-scene:focus-visible { outline: 3px solid #dd9823; outline-offset: 3px; }
.core-scene svg { display: block; width: 100%; min-width: 620px; height: auto; }
.rl-svg text { font-family: inherit; fill: var(--rl-text); font-size: 20px; }
.rl-svg .rl-head { font-size: 22px; font-weight: 800; fill: var(--rl-ink-on-desk); }
.rl-svg .rl-chiptext { font-size: 20px; font-weight: 700; }
.rl-svg .rl-stamptext { font-size: 20px; font-weight: 800; letter-spacing: .06em; }
.rl-svg .rl-colhead { font-weight: 800; fill: var(--rl-muted); }
.rl-svg .rl-rowlab { font-weight: 800; }
.rl-svg .rl-cell, .rl-svg .rl-tick { font-variant-numeric: tabular-nums; }
.rl-svg .rl-modeltext { fill: var(--rl-model); font-weight: 700; font-variant-numeric: tabular-nums; }
.rl-svg .rl-legend { font-weight: 600; }
.rl-svg .rl-muted { fill: var(--rl-muted); font-style: italic; }
.rl-svg .rl-axislab { font-weight: 700; fill: var(--rl-muted); }
.rl-svg .rl-pairtext { fill: #fff; font-weight: 800; }
.rl-svg .rl-ptlab { font-weight: 700; fill: var(--rl-muted); }
.rl-svg .rl-deltatext { font-weight: 800; fill: var(--rl-pair); }
.rl-svg .rl-axis { fill: none; stroke: var(--rl-axis); stroke-width: 2.4; }
.rl-svg .rl-gridline { fill: none; stroke: var(--rl-gridline); stroke-width: 1.4; stroke-dasharray: 4 5; }
.rl-svg .data-line { fill: none; stroke: var(--rl-obs); stroke-width: 2.4; opacity: .75; }
.rl-svg .rl-key-point { fill: var(--rl-obs); stroke: var(--rl-paper1); stroke-width: 3; }
.rl-svg .point { fill: var(--rl-obs); stroke: var(--rl-paper1); stroke-width: 3; cursor: pointer; }
.rl-svg .point.sel { fill: var(--rl-pair); stroke: var(--rl-text); stroke-width: 3; }
.rl-svg .point:hover { stroke: #dd9823; }
.core.locked .rl-svg .point { cursor: default; }
.rl-svg .rl-secant { fill: none; stroke: var(--rl-pair); stroke-width: 3; stroke-dasharray: 2 6; stroke-linecap: round; }
.rl-svg .rl-delta { fill: none; stroke: var(--rl-pair); stroke-width: 1.6; opacity: .7; }
.rl-svg .proposal-line, .rl-svg .rl-key-dash { fill: none; stroke: var(--rl-model); stroke-width: 4; stroke-dasharray: 12 7; stroke-linecap: round; }
.rl-svg .rl-model-line { fill: none; stroke: var(--rl-modelok); stroke-width: 4; stroke-dasharray: 3 6; stroke-linecap: round; opacity: .9; }
.rl-svg .rl-target { fill: none; stroke: var(--rl-muted); stroke-width: 2; stroke-dasharray: 6 6; }
.rl-svg .rl-predpt { fill: var(--rl-paper1); stroke: var(--rl-model); stroke-width: 4; }

.core-observation { margin: 0; min-height: 3em; padding: 10px 14px; line-height: 1.45; font-weight: 600; border-left: 5px solid var(--rl-accent); background: var(--rl-panel1); border-radius: 0 10px 10px 0; }

/* the tools row above the board: plot transforms */
.rl-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rl-tabs-k { margin: 0 4px 0 0; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 16px; color: var(--rl-build); }

/* evidence log (the data table with row buttons) */
.rl-log { padding: 10px 14px 12px; border-radius: 12px; background: var(--rl-panel1); border: 1px solid var(--rl-chip-line); }
.rl-log-k { margin: 0 0 6px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--rl-predict); }
.rl-table-scroll { overflow: auto; }
.rl-table { width: 100%; border-collapse: collapse; min-width: 320px; font-size: 16px; font-variant-numeric: tabular-nums; }
.rl-table th, .rl-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--rl-chip-line); }
.rl-table th { font-size: 16px; }
.rl-table tr.on td { background: var(--rl-select); }
.rl-note { margin: 8px 0 0; line-height: 1.45; }
.rl-pairs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rl-pair-note { margin: 8px 0 0; line-height: 1.45; font-weight: 600; }

/* panel: case card, steps, chips, numbers */
.rl-case { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--rl-chipbg); border: 1px dashed var(--rl-chip-line); }
.rl-case p { margin: 6px 0; line-height: 1.45; }
.rl-case .rl-case-k { margin-top: 0; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; color: var(--rl-predict); }
.rl-step { margin: 14px 0 8px; padding-top: 10px; border-top: 1px solid var(--rl-chip-line); font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.rl-step-build { color: var(--rl-build); }
.rl-step-predict { color: var(--rl-predict); }
.rl-field { display: grid; gap: 6px; margin: 0 0 12px; }
.rl-label { font-weight: 700; line-height: 1.35; }
.rl-num { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rl-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(--rl-chip-line); background: var(--rl-chipbg); color: inherit; font-variant-numeric: tabular-nums; }
.rl-unit { flex: 0 1 auto; font-weight: 600; max-width: 50%; }
.rl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.core .rl-chip { font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; padding: 8px 14px; border-radius: 22px; border: 2px solid var(--rl-chip-line); background: var(--rl-chipbg); color: inherit; cursor: pointer; text-align: left; line-height: 1.3; }
.core .rl-chip.wide { flex: 1 1 100%; border-radius: 12px; font-weight: 600; }
.core .rl-chip.on { background: var(--rl-chip-on); border-color: var(--rl-pair); box-shadow: inset 0 0 0 1px var(--rl-pair); }
.core .rl-chip.on::before { content: "✓ "; }
.core .rl-tool { font: inherit; font-size: 16px; font-weight: 700; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 2px solid var(--rl-chip-line); background: var(--rl-chipbg); color: inherit; cursor: pointer; }
.core .rl-tool[aria-pressed="true"], .core .rl-tool[aria-checked="true"] { background: var(--rl-chip-on); border-color: var(--rl-pair); box-shadow: inset 0 0 0 1px var(--rl-pair); }
.core .rl-row { min-width: 96px; padding: 6px 10px; margin: 0; }
.rl-half { display: flex; align-items: center; gap: 8px; }
.rl-half input { flex: 0 0 84px !important; text-align: center; }
.core .rl-half .rl-tool { width: 52px; font-size: 20px; padding: 6px; }

.rl-proposals { display: grid; gap: 8px; }
.core .rl-proposal { display: grid; gap: 4px; text-align: left; font: inherit; font-size: 16px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--rl-chip-line); background: var(--rl-chipbg); color: inherit; cursor: pointer; min-height: 44px; }
.core .rl-proposal strong { font-size: 17px; }
.core .rl-proposal span { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; }
.core .rl-proposal em { flex: 0 0 auto; font-style: normal; font-weight: 700; color: var(--rl-build); }
.core .rl-proposal.on { background: var(--rl-chip-on); border-color: var(--rl-pair); box-shadow: inset 0 0 0 1px var(--rl-pair); }
.core .rl-proposal.on strong::before { content: "✓ "; }

.rl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.rl-actions button { flex: 1 1 140px; font: inherit; font-size: 16px; font-weight: 800; min-height: 48px; border-radius: 12px; border: 2px solid var(--rl-accent); cursor: pointer; }
.core .core-run { background: #245e76; color: #fff; }
.core .core-revise { background: var(--rl-chipbg); color: inherit; }
.core button:disabled { opacity: .55; cursor: default; }
.core :focus-visible { outline: 3px solid #dd9823; outline-offset: 3px; }
.core-status { line-height: 1.4; }
.rl-precision { color: var(--rl-muted); line-height: 1.4; }
.core-about { margin-top: 6px; }
.core-about summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.core-about p { line-height: 1.5; }
.rl-example { border-radius: 12px; overflow: hidden; border: 2px solid var(--rl-line); }
.rl-example svg { display: block; width: 100%; height: auto; }

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; } }
