/* Particulate Diagram Studio: the studio bench inside the practice shell's stage (about 1066 x 628 at 1366 x 768).
 * Layouts (set by activity.js from the stage size): pd--wide = key column + 2 x 2 grid of 380 x 236 boxes;
 * pd--mid = key strip on top + 2 x 2 grid of 320 x 262 boxes (scrolls); pd--narrow = one column.
 * Boxes are always drawn at 1:1 or larger so the 16 px particle labels stay 16 px. */
html { --pd-ink: #17212c; --pd-soft: #475668; --pd-card: #ffffff; --pd-card2: #f4f7fb; --pd-line: #c3cfdc; --pd-bench: #e6ecf2; --pd-bench2: #d5dfe9;
  --pd-accent: #0f5f73; --pd-accent-bg: #def1f5; --pd-sel: #1f5fbf; --pd-ok: #17683a; --pd-ok-bg: #e2f5e8; --pd-bad: #b42318; --pd-bad-bg: #fde8e5;
  --pd-air: #f4f7fa; --pd-water-a: #e3f2fc; --pd-water-b: #b9dcf3; --pd-surface: #6aa6d4; --pd-gas-a: #f6f4fb; --pd-gas-b: #e4e0ef; --pd-glass: #8fa3b8;
  --pd-solid-bg: #ddd5c3; --pd-solid-line: #cbc1aa; --pd-solid-edge: #8c7f62; }
html[data-theme="dark"] { --pd-ink: #eef2f7; --pd-soft: #c3cedb; --pd-card: #1b2430; --pd-card2: #151d27; --pd-line: #45556a; --pd-bench: #0f161e; --pd-bench2: #0b1117;
  --pd-accent: #7fd3e6; --pd-accent-bg: #123642; --pd-sel: #8ab8ff; --pd-ok: #86e0a6; --pd-ok-bg: #153a25; --pd-bad: #ffb4a8; --pd-bad-bg: #4a1e1a;
  --pd-air: #24303d; --pd-water-a: #1d3a52; --pd-water-b: #12283b; --pd-surface: #4f8fbf; --pd-gas-a: #2e3447; --pd-gas-b: #232838; --pd-glass: #6b7f95;
  --pd-solid-bg: #4a4436; --pd-solid-line: #5a5241; --pd-solid-edge: #b8a77e; }

/* vessel colours (the svg carries light defaults for print; these follow the theme) */
.pd-air { fill: var(--pd-air); } .pd-water-a { stop-color: var(--pd-water-a); } .pd-water-b { stop-color: var(--pd-water-b); }
.pd-gas-a { stop-color: var(--pd-gas-a); } .pd-gas-b { stop-color: var(--pd-gas-b); } .pd-surface { stroke: var(--pd-surface); }
.pd-glass { stroke: var(--pd-glass); } .pd-solid-bg { fill: var(--pd-solid-bg); } .pd-solid-line { stroke: var(--pd-solid-line); } .pd-solid-edge { stroke: var(--pd-solid-edge); }
html[data-theme="dark"] .pd-glint { fill-opacity: .18; }
.pd-at { font-family: var(--tlg-font-body, Inter, system-ui, sans-serif); font-size: 16px; font-weight: 700; text-anchor: middle; }
.pd-vessel { display: block; overflow: visible; }

.pd { position: absolute; inset: 0; overflow: auto; padding: 10px 12px; font-size: 17px; line-height: 1.3; color: var(--pd-ink);
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,.35), transparent 60%), linear-gradient(180deg, var(--pd-bench), var(--pd-bench2)); }
.pd *, .pd *::before, .pd *::after { box-sizing: border-box; }
.pd p { margin: 0; }
.pd-bench { display: grid; gap: 12px; min-height: 100%; }
.pd--wide .pd-bench { grid-template-columns: 220px minmax(0, 1fr); }
.pd--mid .pd-bench, .pd--narrow .pd-bench { grid-template-columns: minmax(0, 1fr); align-content: start; }

/* side: work order, level, key, about */
.pd-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pd--mid .pd-side, .pd--narrow .pd-side { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
.pd-plaque { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; border-radius: 10px; background: linear-gradient(180deg, #24414d, #172b33); color: #f2fbff; border: 2px solid #5cc3d8; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.pd-plaque-k { font-size: 16px; text-transform: uppercase; letter-spacing: .08em; color: #8ee3f3; }
.pd-plaque-t { font-size: 18px; font-weight: 800; }
.pd-level { align-self: flex-start; font-size: 16px; font-weight: 700; padding: 2px 12px; border-radius: 999px; background: var(--pd-accent-bg); color: var(--pd-accent); border: 1px solid var(--pd-accent); }
.pd-key { padding: 8px 10px; border-radius: 12px; background: var(--pd-card); border: 2px solid var(--pd-line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pd--mid .pd-key, .pd--narrow .pd-key { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; column-gap: 14px; }
.pd-key-h { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--pd-soft); }
.pd--mid .pd-key-h, .pd--narrow .pd-key-h { flex: 1 1 100%; }
.pd-key-i { display: flex; align-items: center; gap: 8px; font-size: 16px; min-width: 0; }
.pd-key-i .pd-icon { flex: none; width: 36px; height: 36px; }
.pd-key-f { font-weight: 800; }
.pd-key-n { color: var(--pd-soft); }
.pd-key-note { font-size: 16px; color: var(--pd-soft); }
.pd-about { position: relative; }
.pd-about summary { cursor: pointer; font-size: 16px; font-weight: 700; min-height: 44px; display: flex; align-items: center; padding: 0 8px; border-radius: 8px; list-style: none; color: var(--pd-ink); }
.pd-about summary::-webkit-details-marker { display: none; }
.pd-about summary::before { content: 'ⓘ'; margin-right: 6px; }
.pd-about summary:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.pd-about p { padding: 8px 10px; background: var(--pd-card); border: 1px solid var(--pd-line); border-radius: 10px; font-size: 16px; }
.pd--mid .pd-about[open], .pd--narrow .pd-about[open] { flex: 1 1 100%; }
/* wide: the open About panel floats over the bottom of the side column, not the boxes */
.pd--wide .pd-about { margin-top: auto; }

/* main grid of cells */
.pd-main { display: grid; gap: 12px; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; align-content: start; }
.pd--narrow .pd-main { grid-template-columns: minmax(0, 1fr); }
.pd-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 4px 6px 6px; border-radius: 14px; font: inherit; color: var(--pd-ink); text-align: left;
  background: linear-gradient(180deg, var(--pd-card), var(--pd-card2)); border: 2px solid var(--pd-line); box-shadow: 0 4px 10px rgba(20, 40, 60, .14); }
html[data-theme="dark"] .pd-cell { box-shadow: 0 4px 10px rgba(0,0,0,.45); }
.pd-cell-h { align-self: stretch; display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 16px; font-weight: 800; }
.pd-letter { display: inline-grid; place-items: center; min-width: 28px; height: 26px; padding: 0 6px; border-radius: 7px; background: #34495e; color: #fff; font-size: 16px; }
.pd-cell-cap { margin-left: auto; font-size: 16px; font-weight: 700; color: var(--pd-soft); white-space: nowrap; }
.pd-cell--info { justify-content: flex-start; align-items: stretch; padding: 8px 12px; gap: 6px; }
.pd-cell--before .pd-letter { background: #6b7c8f; }
button.pd-cell { cursor: pointer; }
button.pd-cell:hover:not(:disabled) { border-color: var(--pd-accent); }
button.pd-cell:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
button.pd-cell:disabled { cursor: default; opacity: 1; }
.pd-cell.is-on { border: 3px solid var(--pd-sel); padding: 3px 5px 5px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pd-sel) 25%, transparent), 0 4px 10px rgba(20,40,60,.14); }
.pd-cell.is-on .pd-cell-cap { color: var(--pd-sel); }
.pd-cell.is-right { border: 3px solid var(--pd-ok); padding: 3px 5px 5px; }
.pd-cell.is-right .pd-cell-cap { color: var(--pd-ok); }
.pd-cell.is-wrong { border: 3px solid var(--pd-bad); padding: 3px 5px 5px; }
.pd-cell.is-wrong .pd-cell-cap, .pd-cell.is-other .pd-cell-cap { color: var(--pd-bad); }
.pd-cell.is-other { opacity: 1; }
.pd-cell.is-right .pd-letter { background: var(--pd-ok); } html[data-theme="dark"] .pd-cell.is-right .pd-letter { background: #1f7a45; }
.pd-cell.is-wrong .pd-letter { background: #b42318; }

/* info card text */
.pd-info-k { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--pd-soft); }
.pd-info-big { font-size: 22px; font-weight: 800; line-height: 1.25; }
.pd-info-row { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.pd-info-row .pd-icon { width: 56px; height: 56px; flex: none; }
.pd-info-note { font-size: 16px; color: var(--pd-soft); }
.pd-eqn { font-size: 20px; font-weight: 700; }
.pd-kval { font-size: 26px; font-weight: 800; color: var(--pd-accent); }
.pd-qlist { display: flex; flex-direction: column; gap: 2px; font-size: 16px; padding-top: 4px; border-top: 1px dashed var(--pd-line); }
.pd-qlist .is-ok { color: var(--pd-ok); font-weight: 800; }

/* build: steppers */
.pd-steps { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-radius: 14px; background: var(--pd-card); border: 2px solid var(--pd-line); }
.pd-steps-h { font-size: 17px; font-weight: 800; }
.pd-steps-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.pd-step { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 2px 0; }
.pd-step .pd-icon { width: 40px; height: 40px; flex: none; }
.pd-step-name { flex: 1 1 auto; min-width: 0; font-size: 16px; }
.pd-step-name b { font-size: 17px; }
html .pd-pm { width: 46px; height: 46px; flex: none; border-radius: 10px; border: 2px solid var(--pd-line); background: var(--pd-card2); color: var(--pd-ink); font: inherit; font-size: 24px; font-weight: 800; line-height: 1; cursor: pointer; }
.pd-pm:hover:not(:disabled) { border-color: var(--pd-accent); }
.pd-pm:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.pd-pm:disabled { opacity: .45; cursor: default; }
.pd-num { width: 34px; text-align: center; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pd-step.is-right .pd-num { color: var(--pd-ok); } .pd-step.is-wrong .pd-num { color: var(--pd-bad); text-decoration: line-through; }
.pd-want { min-width: 64px; font-size: 16px; font-weight: 800; color: var(--pd-ok); white-space: nowrap; }

/* shift: choice chips */
.pd-chips { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-radius: 14px; background: var(--pd-card); border: 2px solid var(--pd-line); }
.pd-chips-h { font-size: 17px; font-weight: 800; }
.pd-chips-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pd--narrow .pd-chips-row { grid-template-columns: 1fr; }
html .pd-chip { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px; border-radius: 10px; border: 2px solid var(--pd-line); background: var(--pd-card2); color: var(--pd-ink); font: inherit; font-size: 17px; text-align: left; cursor: pointer; }
.pd-chip:hover:not(:disabled) { border-color: var(--pd-accent); }
.pd-chip:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.pd-chip:disabled { cursor: default; }
.pd-chip-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pd-soft); }
.pd-chip.is-on { border-color: var(--pd-sel); font-weight: 700; background: color-mix(in srgb, var(--pd-sel) 12%, var(--pd-card)); }
.pd-chip.is-on .pd-chip-dot { border-color: var(--pd-sel); background: radial-gradient(circle, var(--pd-sel) 0 45%, transparent 50%); }
.pd-chip.is-right { border-color: var(--pd-ok); background: var(--pd-ok-bg); }
.pd-chip.is-wrong { border-color: var(--pd-bad); background: var(--pd-bad-bg); text-decoration: line-through; }
.pd-chip.is-right .pd-chip-dot, .pd-chip.is-wrong .pd-chip-dot { border: none; background: none; width: auto; height: auto; font-weight: 800; }
.pd-chip.is-right .pd-chip-dot { color: var(--pd-ok); } .pd-chip.is-right .pd-chip-dot::before { content: '✓'; }
.pd-chip.is-wrong .pd-chip-dot { color: var(--pd-bad); } .pd-chip.is-wrong .pd-chip-dot::before { content: '✗'; }
.pd-qline { font-size: 17px; font-weight: 700; }

.pd-start { display: block; width: 100%; height: auto; }
.pd-example { display: flex; justify-content: center; }
.pd-example .pd-vessel { flex: none; }

@media (prefers-reduced-motion: no-preference) {
  button.pd-cell, .pd-chip, .pd-pm { transition: border-color .12s, background .12s; }
}
@media (max-width: 900px) {
  .pd { position: static; overflow: visible; }
}
/* at about 1024 px the shell's two-line "Hint used" meter badge hangs about 14 px below the top bar: start the
   scrolling bench below it so nothing scrolls underneath (shell request filed) */
@media (min-width: 901px) { .pd--mid { top: 16px; } }

/* ── Intro college track (freezing point, college-activity.js) ── */
.pdc-ask { gap: 8px; }
.pdc-eq { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 4px 10px; border-radius: 8px; background: var(--pd-accent-bg); border: 1px solid var(--pd-line); font-weight: 700; font-size: 18px; }
.pdc-eq-k { font-size: 16px; color: var(--pd-soft); }
.pdc-coach { font-weight: 700; color: var(--pd-accent); font-size: 16px; }
.pdc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pdc-l { font-weight: 700; font-size: 16px; }
.pdc-input { width: 118px; min-height: 44px; padding: 4px 10px; font: inherit; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--pd-ink); background: var(--pd-card2); border: 2px solid var(--pd-soft); border-radius: 8px; }
.pdc-input::placeholder { color: var(--pd-soft); opacity: .7; font-weight: 400; }
.pdc-input:focus-visible, .pdc-sign:focus-visible, .pdc-reset:focus-visible, .pdc-step:focus-visible { outline: 3px solid var(--tlg-focus, #b84c00); outline-offset: 2px; }
.pdc-sign { width: 44px; min-height: 44px; font: inherit; font-size: 20px; font-weight: 700; color: var(--pd-ink); background: var(--pd-card); border: 2px solid var(--pd-soft); border-radius: 8px; cursor: pointer; }
.pdc-unit { font-weight: 700; }
.pdc-mark { font-weight: 700; } .pdc-mark.is-right { color: var(--pd-ok); } .pdc-mark.is-wrong { color: var(--pd-bad); }
.pdc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
html .pdc-chip { min-height: 44px; min-width: 64px; justify-content: center; font-weight: 700; }
.pdc-chip.is-right { border-color: var(--pd-ok); background: var(--pd-ok-bg); color: var(--pd-ok); }
.pdc-chip.is-wrong { border-color: var(--pd-bad); background: var(--pd-bad-bg); color: var(--pd-bad); border-style: dashed; }
.pdc-reset { align-self: flex-start; min-height: 44px; padding: 4px 14px; font: inherit; font-size: 16px; font-weight: 700; border-radius: 10px; border: 2px solid var(--pd-line); background: var(--pd-card2); color: var(--pd-ink); cursor: pointer; }
.pdc-reset:disabled { opacity: .55; cursor: default; }
.pdc-cap { font-weight: 700; }
.pdc-figure { align-items: center; }
.pdc-zoom { background: #0f5f73; }
.pdc-app-host, .pdc-app { max-width: 100%; }
.pdc-app { display: block; height: auto; }
.pdc-work { align-items: stretch; padding: 6px 10px 10px; }
.pdc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pdc-step { width: 100%; display: flex; align-items: flex-start; gap: 8px; text-align: left; min-height: 44px; padding: 5px 10px; font: inherit; font-size: 16px; line-height: 1.3; color: var(--pd-ink); background: var(--pd-card2); border: 2px solid var(--pd-line); border-radius: 10px; cursor: pointer; }
.pdc-step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--pd-accent-bg); color: var(--pd-accent); font-weight: 800; }
.pdc-step-t { flex: 1 1 auto; } .pdc-step-m { font-weight: 800; }
.pdc-step.is-on { border-color: var(--pd-sel); background: color-mix(in srgb, var(--pd-sel) 12%, var(--pd-card)); }
.pdc-step.is-right { border-color: var(--pd-ok); background: var(--pd-ok-bg); } .pdc-step.is-right .pdc-step-m { color: var(--pd-ok); }
.pdc-step.is-wrong { border-color: var(--pd-bad); background: var(--pd-bad-bg); border-style: dashed; } .pdc-step.is-wrong .pdc-step-m { color: var(--pd-bad); }
.pdc-step:disabled { cursor: default; }
.pdc-example { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pdc-example figure { margin: 0; text-align: center; } .pdc-example figcaption { font-size: 16px; margin-bottom: 4px; }
.pdc-example svg { max-width: 100%; height: auto; }
.pd-track-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-track-note { margin: 4px 0 0; }
.pd-track-locked { margin: 0; font-size: 17px; }
