/* Graph Linearizer: the Linearizer bench inside the practice shell's stage (about 1066 × 628 at 1366 × 768). */
.gl { position: absolute; inset: 0; overflow: auto; display: grid; grid-template-columns: 322px minmax(0, 1fr); gap: 10px; padding: 10px; font-size: 16px; line-height: 1.3;
  color: var(--gl-ink);
  --gl-ink: #18222e; --gl-soft: #4a5868; --gl-card: #ffffff; --gl-line: #c3ccd8; --gl-bench: #e9eef5; --gl-rule: #d5dde8;
  --gl-raw: #c2410c; --gl-lin: #1d4ed8; --gl-tri: #0f766e; --gl-plot-bg: #fbfcfe; --gl-grid: #d9e0ea; --gl-axis: #18222e; --gl-edge: #5b6676;
  --gl-ok: #17683a; --gl-ok-bg: #e2f5e8; --gl-bad: #b42318; --gl-bad-bg: #fde8e5; --gl-new-bg: #e8effd; --gl-accent: #1f4e8c;
  background: linear-gradient(var(--gl-rule) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, var(--gl-rule) 1px, transparent 1px) 0 0 / 24px 24px, var(--gl-bench); }
html[data-theme="dark"] .gl { --gl-ink: #eef2f7; --gl-soft: #c3cedb; --gl-card: #1c2531; --gl-line: #4a596c; --gl-bench: #121a24; --gl-rule: #1b2633;
  --gl-raw: #fdba74; --gl-lin: #93c5fd; --gl-tri: #5eead4; --gl-plot-bg: #141c27; --gl-grid: #2c3a4b; --gl-axis: #eef2f7; --gl-edge: #a9b6c6;
  --gl-ok: #86e0a6; --gl-ok-bg: #153a25; --gl-bad: #ffb4a8; --gl-bad-bg: #4a1e1a; --gl-new-bg: #1c2f52; --gl-accent: #9cc3f5; }
.gl *, .gl *::before, .gl *::after { box-sizing: border-box; }
.gl p { margin: 0; }
.gl-card { background: var(--gl-card); border: 1px solid var(--gl-line); border-radius: 12px; padding: 8px 10px; box-shadow: 0 1px 3px rgba(15, 23, 42, .1); min-width: 0; }
.gl-k { font-weight: 700; font-size: 16px; color: var(--gl-ink); }
.gl-sub { color: var(--gl-soft); font-size: 16px; }

/* left: experiment + data */
.gl-exp { display: flex; flex-direction: column; gap: 6px; align-self: start; }
.gl-scene { width: 300px; max-width: 100%; height: 190px; border-radius: 8px; overflow: hidden; align-self: center; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .25); flex: none; }
.gl-scene-svg { display: block; width: 300px; height: 190px; }
.gl-caption { color: var(--gl-soft); font-size: 16px; line-height: 1.25; }
.gl-eq { display: flex; align-items: baseline; gap: 10px; padding: 5px 10px; border-radius: 8px; background: var(--gl-new-bg); border: 1px solid var(--gl-line); }
.gl-eq-k { font-size: 16px; font-weight: 700; color: var(--gl-soft); }
.gl-eq-v { font-size: 19px; font-weight: 700; white-space: nowrap; }
.gl-table-wrap { overflow-x: auto; }
.gl-table { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; }
.gl-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gl-table th, .gl-table td { padding: 2px 6px; text-align: right; border-bottom: 1px solid var(--gl-line); white-space: nowrap; }
.gl-table th { font-weight: 700; border-bottom: 2px solid var(--gl-ink); }
.gl-table .gl-col-new { background: var(--gl-new-bg); color: var(--gl-lin); font-weight: 700; }
.gl-table-note { color: var(--gl-soft); font-size: 16px; }

/* right: coach, graphs, steps */
.gl-work { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 8px; min-width: 0; min-height: 0; }
.gl-coachbar { display: flex; align-items: center; gap: 10px; padding: 5px 12px; border-radius: 10px; background: var(--gl-card); border: 2px solid var(--gl-accent); min-height: 38px; }
.gl-coach-k { flex: none; font-weight: 700; font-size: 16px; color: #fff; background: #1f4e8c; border-radius: 999px; padding: 1px 12px; }
.gl-coach { font-weight: 700; font-size: 16px; line-height: 1.25; }
.gl-graphs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 0; }
.gl-graph { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.gl-graph-head { min-height: 76px; display: flex; flex-direction: column; gap: 4px; flex: none; }
html .gl-graph--lin .gl-chip { padding: 4px 9px; }
.gl-graph--lin .gl-chips { gap: 5px; }
.gl-plot-host { flex: 1 1 auto; min-height: 180px; min-width: 0; overflow: hidden; }
.gl-lin-title { font-weight: 700; color: var(--gl-soft); font-size: 16px; min-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-lin-title.is-answer { color: var(--gl-ok); }
.gl-graph--raw .gl-graph-head { min-height: 101px; }
.gl-legend { display: flex; flex-wrap: wrap; gap: 2px 14px; min-height: 21px; color: var(--gl-soft); font-size: 16px; }
.gl-leg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.gl-leg-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gl-raw); }
.gl-leg-dia { width: 11px; height: 11px; transform: rotate(45deg); background: var(--gl-lin); }
.gl-leg-line { width: 24px; height: 0; border-top: 3px solid var(--gl-raw); }
.gl-leg-line--lin, .gl-leg-line--fit { border-top-color: var(--gl-lin); }
.gl-leg-line--fit { border-top-width: 4px; }
.gl-leg-line--edge { border-top: 2px dashed var(--gl-edge); }
.gl-leg-line--tri { border-top: 2px dashed var(--gl-tri); }

/* graph SVG */
.gl-plot { display: block; max-width: 100%; }
.gl-plot text { font-family: inherit; }
.gl-p-bg { fill: var(--gl-plot-bg); }
.gl-p-grid { stroke: var(--gl-grid); stroke-width: 1; fill: none; }
.gl-p-frame { stroke: var(--gl-edge); stroke-width: 1.2; fill: none; }
.gl-p-zero { stroke: var(--gl-axis); stroke-width: 2; fill: none; stroke-linecap: square; }
.gl-p-tick { font-size: 16px; fill: var(--gl-ink); font-variant-numeric: tabular-nums; }
.gl-p-title { font-size: 16px; font-weight: 700; fill: var(--gl-ink); }
.gl-p-note { font-size: 17px; font-weight: 700; fill: var(--gl-soft); }
.gl-p-trend { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.gl-plot--raw .gl-p-trend { stroke: var(--gl-raw); }
.gl-plot--lin .gl-p-trend { stroke: var(--gl-lin); }
.gl-p-edge { fill: none; stroke: var(--gl-edge); stroke-width: 2; stroke-dasharray: 7 6; }
.gl-p-fit { fill: none; stroke: var(--gl-lin); stroke-width: 3.4; stroke-linecap: round; }
.gl-p-tri { fill: none; stroke: var(--gl-tri); stroke-width: 2.2; stroke-dasharray: 6 5; }
.gl-p-trilabel { font-size: 16px; font-weight: 700; fill: var(--gl-tri); stroke: var(--gl-plot-bg); stroke-width: 5px; paint-order: stroke; stroke-linejoin: round; }
.gl-p-pts { stroke: var(--gl-card); stroke-width: 2; }
.gl-plot--raw .gl-p-pts { fill: var(--gl-raw); }
.gl-plot--lin .gl-p-pts { fill: var(--gl-lin); }
@media (prefers-reduced-motion: no-preference) {
  .gl-plot-host.is-reveal .gl-p-fit { stroke-dasharray: 900; stroke-dashoffset: 900; animation: gl-draw .9s ease-out forwards; }
  .gl-plot-host.is-reveal .gl-p-tri, .gl-plot-host.is-reveal .gl-p-trilabel { opacity: 0; animation: gl-fade .5s ease-out .8s forwards; }
}
@keyframes gl-draw { to { stroke-dashoffset: 0; } }
@keyframes gl-fade { to { opacity: 1; } }

/* steps */
.gl-step-k { display: flex; align-items: center; gap: 8px; }
.gl-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: #1f4e8c; color: #fff; font-weight: 700; font-size: 16px; }
.gl-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gl-step { display: flex; flex-direction: column; gap: 6px; }
.gl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
html .gl-chip { min-height: 44px; min-width: 48px; justify-content: center; padding: 4px 12px; font-size: 17px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--gl-ink); background: var(--gl-card); border: 2px solid var(--gl-edge); border-radius: 999px; cursor: pointer; font-family: inherit; }
html .gl-chip[aria-checked="true"] { background: #1f4e8c; border-color: #1f4e8c; color: #fff; }
html[data-theme="dark"] .gl-chip[aria-checked="true"] { background: #2f66b0; border-color: #9cc3f5; }
html .gl-chip:disabled { cursor: default; opacity: 1; }
html .gl-chip:disabled:not([aria-checked="true"]):not(.is-right) { opacity: .6; }
html .gl-chip.is-right, html[data-theme="dark"] .gl-chip.is-right[aria-checked] { background: var(--gl-ok-bg); border-color: var(--gl-ok); color: var(--gl-ok); }
html .gl-chip.is-wrong, html[data-theme="dark"] .gl-chip.is-wrong[aria-checked] { background: var(--gl-bad-bg); border-color: var(--gl-bad); color: var(--gl-bad); border-style: dashed; }
.gl-chip:focus-visible, .gl-input:focus-visible, .gl-sign:focus-visible { outline: 3px solid #b84c00; outline-offset: 2px; }
html[data-theme="dark"] .gl-chip:focus-visible, html[data-theme="dark"] .gl-input:focus-visible, html[data-theme="dark"] .gl-sign:focus-visible { outline-color: #ffd166; }
.gl-chip-mark:empty { display: none; }
.gl-slope-row, .gl-unit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-slope-l, .gl-unit-l { font-weight: 700; font-size: 16px; }
.gl-input { width: 124px; min-height: 44px; padding: 4px 10px; font: inherit; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gl-ink); background: var(--gl-plot-bg); border: 2px solid var(--gl-edge); border-radius: 8px; }
.gl-input::placeholder { color: var(--gl-soft); opacity: .7; font-weight: 400; }
.gl-sign { width: 44px; min-height: 44px; font: inherit; font-size: 20px; font-weight: 700; color: var(--gl-ink); background: var(--gl-card); border: 2px solid var(--gl-edge); border-radius: 8px; cursor: pointer; }
.gl-input:disabled, .gl-sign:disabled { opacity: .75; cursor: default; }
.gl-slope-mark { font-weight: 700; font-size: 16px; }
.gl-slope-mark.is-right { color: var(--gl-ok); }
.gl-slope-mark.is-wrong { color: var(--gl-bad); }
.gl-msg { font-weight: 700; color: var(--gl-bad); }

/* Briefing example */
.gl-example { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; --gl-ink: #18222e; --gl-soft: #4a5868; --gl-card: #ffffff; --gl-raw: #c2410c; --gl-lin: #1d4ed8; --gl-tri: #0f766e; --gl-plot-bg: #fbfcfe; --gl-grid: #d9e0ea; --gl-axis: #18222e; --gl-edge: #5b6676;
  background: #fff; color: #18222e; border-radius: 12px; padding: 10px; }
.gl-example figure { margin: 0; }
.gl-example figcaption { font-size: 16px; text-align: center; margin-bottom: 2px; }
.gl-example .gl-plot { height: auto; max-height: none; }
.gl-ex-arrow { font-size: 30px; font-weight: 700; color: #1f4e8c; }
.gl-example--narrow { flex-direction: column; }

/* a stage narrower than the two-graph bench (1024-wide laptops): experiment and table side by side on top, the stage scrolls */
@media (max-width: 1240px) {
  .gl { display: flex; flex-direction: column; }
  .gl > * { flex: none; }
  .gl-work { display: flex; flex-direction: column; }
  .gl-work > *, .gl-graph > * { flex: none; }
  .gl-exp { display: grid; grid-template-columns: 300px minmax(0, 1fr); column-gap: 12px; align-self: stretch; }
  .gl-exp > .gl-k { grid-column: 1 / -1; }
  .gl-exp > .gl-scene { grid-column: 1; grid-row: 2 / span 4; align-self: start; }
  .gl-exp > :not(.gl-k):not(.gl-scene) { grid-column: 2; }
  .gl-plot-host { height: 270px; flex: none; }
}
/* the shell stacks at 900 px: everything in one column, the page scrolls */
@media (max-width: 900px) {
  .gl { position: static; overflow: visible; }
}
@media (max-width: 700px) {
  .gl-exp { display: flex; }
  .gl-graphs, .gl-steps { grid-template-columns: minmax(0, 1fr); }
  .gl-graph-head { min-height: 0; }
  .gl-eq-v { white-space: normal; }
}

/* ── Intro college track (Arrhenius, college-activity.js / college-art.js) ── */
.gl { --glc-1: #1d4ed8; --glc-2: #c2410c; --glc-3: #0f766e; --glc-mark: #7c2d12; }
html[data-theme="dark"] .gl { --glc-1: #93c5fd; --glc-2: #fdba74; --glc-3: #5eead4; --glc-mark: #fde68a; }
.gl-example { --glc-1: #1d4ed8; --glc-2: #c2410c; --glc-3: #0f766e; --glc-mark: #7c2d12; }
.glc-line { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.glc-curve { stroke-width: 2.6; }
.glc-line.glc-s1 { stroke: var(--glc-1); }
.glc-line.glc-s2 { stroke: var(--glc-2); stroke-dasharray: 10 6; }
.glc-line.glc-s3 { stroke: var(--glc-3); stroke-dasharray: 3 5; stroke-width: 3.6; }
.glc-curve.glc-s2 { stroke-dasharray: none; }
.glc-pt { stroke: var(--gl-card, #fff); stroke-width: 2; }
.gl-example .glc-pt { stroke: #fff; }
.glc-pt.glc-s1 { fill: var(--glc-1); } .glc-pt.glc-s2 { fill: var(--glc-2); } .glc-pt.glc-s3 { fill: var(--glc-3); }
.glc-name { font-size: 16px; font-weight: 700; paint-order: stroke; stroke: var(--gl-plot-bg, #fbfcfe); stroke-width: 5px; stroke-linejoin: round; }
.glc-name.glc-s1 { fill: var(--glc-1); } .glc-name.glc-s2 { fill: var(--glc-2); } .glc-name.glc-s3 { fill: var(--glc-3); }
.glc-mark { fill: none; stroke: var(--glc-mark); stroke-width: 3; }
.glc-mark-t { font-size: 16px; font-weight: 700; fill: var(--glc-mark); paint-order: stroke; stroke: var(--gl-plot-bg, #fbfcfe); stroke-width: 5px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }
.gl-graphs.glc-one { grid-template-columns: minmax(0, 1fr); }
.gl--college .glc-head { min-height: 0; }
.gl--college .gl-graph--lin .glc-head { min-height: 76px; }
.gl-step.glc-wide { grid-column: 1 / -1; }
.glc-unit { font-weight: 700; font-size: 17px; }
.glc-input { width: 132px; }
.glc-src { font-size: 16px; }
.glc-table th, .glc-table td { padding: 2px 5px; }
.glc-work { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
.glc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.glc-step { width: 100%; display: flex; align-items: flex-start; gap: 8px; text-align: left; min-height: 44px; padding: 6px 10px; font: inherit; font-size: 16px; line-height: 1.3;
  color: var(--gl-ink); background: var(--gl-card); border: 2px solid var(--gl-line); border-radius: 10px; cursor: pointer; }
.glc-step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--gl-new-bg); color: var(--gl-ink); font-weight: 700; }
.glc-step-t { flex: 1 1 auto; }
.glc-step[aria-checked="true"] { border-color: #1f4e8c; box-shadow: inset 0 0 0 1px #1f4e8c; background: var(--gl-new-bg); }
html[data-theme="dark"] .glc-step[aria-checked="true"] { border-color: #9cc3f5; box-shadow: inset 0 0 0 1px #9cc3f5; }
.glc-step.is-right { border-color: var(--gl-ok); background: var(--gl-ok-bg); }
.glc-step.is-wrong { border-color: var(--gl-bad); background: var(--gl-bad-bg); border-style: dashed; }
.glc-step:disabled { cursor: default; }
.glc-step:focus-visible { outline: 3px solid #b84c00; outline-offset: 2px; }
html[data-theme="dark"] .glc-step:focus-visible { outline-color: #ffd166; }
.glc-step .gl-chip-mark { font-weight: 700; }
.glc-step.is-right .gl-chip-mark { color: var(--gl-ok); } .glc-step.is-wrong .gl-chip-mark { color: var(--gl-bad); }
.gl-track-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gl-track-note { margin: 4px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .gl-plot-host.is-reveal .glc-line { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: gl-draw .9s ease-out forwards; }
  .gl-plot-host.is-reveal .glc-line.glc-s2, .gl-plot-host.is-reveal .glc-line.glc-s3 { animation: none; stroke-dashoffset: 0; }
  .gl-plot-host.is-reveal .gl-p-tri { opacity: 0; animation: gl-fade .5s ease-out .8s forwards; }
}
@media (max-width: 1240px) { .glc-work { overflow: visible; } }
.gl--college .gl-eq { flex-wrap: wrap; }
.gl--college .gl-eq-v { white-space: normal; font-size: 18px; }
.glc-legend svg { flex: none; }
.glc-legend .glc-line { stroke-width: 3; }
.gl-track-locked { margin: 0; font-size: 17px; }
