/* Photoelectric Effect: its colours, the graphs and drawings, the answers; the general look is in ui.css
   (shared by the apps). Photons yellow-orange, electrons blue, measurements dark. */
:root {
  --ph-photon: #e0a100; --ph-work: #8a8f98; --ph-kin: #1f5fc4; --ph-el: #bcd3f2; --ph-curve: #1f5fc4; --ph-old: #8a8f98; --ph-alt: #c0392b;
  --ph-x: #7b3fb5; --ph-glass: rgba(80, 140, 200, 0.08); --ph-fit: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root { --ph-photon: #f2c94c; --ph-work: #9aa0a6; --ph-kin: #79a8ff; --ph-el: #34507a; --ph-curve: #79a8ff; --ph-old: #9aa0a6; --ph-alt: #ff8a80; --ph-x: #c7a6ff; --ph-glass: rgba(120, 170, 230, 0.08); --ph-fit: #ff8a80; }
}

#prompt p { margin: 6px 0; }
.consts { color: var(--muted); font-size: 0.9rem; }
.law { text-align: center; font-family: var(--serif); font-size: 1.2rem; margin: 10px 0; }
table.data { border-collapse: collapse; margin: 8px 0; font-variant-numeric: tabular-nums; }
table.data th, table.data td { border: 1px solid var(--line); padding: 4px 10px; text-align: center; }
table.data th { font-weight: 600; background: var(--bg); text-align: left; white-space: nowrap; }
.figs .fig svg.ph { margin: 0 auto; }

/* the drawings */
svg.ph text { font-family: var(--serif); fill: var(--ink); }
svg.ph .tick { font-size: 12px; fill: var(--muted); font-family: system-ui, sans-serif; }
svg.ph .lbl { font-size: 15px; }
svg.ph .lbl.small { font-size: 13px; }
svg.ph .lbl.strong { font-weight: 700; }
svg.ph .grid { stroke: var(--line); stroke-width: 1; }
svg.ph .grid.minor { stroke-dasharray: 2 3; opacity: 0.7; }
svg.ph .ax { stroke: var(--ink); stroke-width: 1.3; }
svg.ph .axhead { fill: var(--ink); }
svg.ph .pt { fill: var(--ink); }
svg.ph .fit { stroke: var(--ph-fit); stroke-width: 2; }
svg.ph .fit.ext { stroke-dasharray: 6 4; }
svg.ph .tri { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 3; }
svg.ph .mark { fill: var(--ph-fit); }
svg.ph .iv { fill: none; stroke: var(--ph-curve); stroke-width: 2.4; stroke-linejoin: round; }
svg.ph .iv.old { stroke: var(--ph-old); stroke-width: 2; }
svg.ph .iv.alt { stroke: var(--ph-alt); }
svg.ph .uv { fill: color-mix(in srgb, var(--ph-x) 35%, var(--card)); }
svg.ph .ir { fill: color-mix(in srgb, #8b1a1a 30%, var(--card)); }
svg.ph .mark-arrow { fill: var(--ink); }
svg.ph .photon { fill: var(--ph-photon); }
svg.ph .work { fill: var(--ph-work); }
svg.ph .kin { fill: var(--ph-kin); }
svg.ph .missing { fill: none; stroke: var(--ph-work); stroke-dasharray: 4 3; }
svg.ph .guide { stroke: var(--muted); stroke-dasharray: 3 3; }
svg.ph .inside { fill: #fff; }
svg.ph .glass { fill: var(--ph-glass); stroke: var(--muted); stroke-width: 1.3; }
svg.ph .cathode { fill: none; stroke: var(--ink); stroke-width: 5; }
svg.ph .anode { stroke: var(--ink); stroke-width: 4; }
svg.ph .wire { fill: none; stroke: var(--ink); stroke-width: 1.4; }
svg.ph .meter { fill: var(--card); stroke: var(--ink); stroke-width: 1.4; }
svg.ph .batt { stroke: var(--ink); stroke-width: 1.6; }
svg.ph .batt.thick { stroke-width: 4; }
svg.ph .gap { fill: var(--card); }
svg.ph .ray { fill: none; stroke: var(--ray, var(--ph-photon)); stroke-width: 2; }
svg.ph .rayhead { fill: var(--ray, var(--ph-photon)); }
svg.ph .el { fill: var(--ph-el); stroke: var(--ink); stroke-width: 1.1; }
svg.ph .sign { font: 700 11px system-ui, sans-serif; fill: var(--ink); }
svg.ph .elpath { fill: none; stroke: var(--ph-kin); stroke-width: 1.4; stroke-dasharray: 4 3; }
svg.ph.graph.small .tick { font-size: 11px; }
.legend .k-old { color: var(--ph-old); font-weight: 700; }
.legend .k-new { color: var(--ph-curve); font-weight: 700; }
.legend .k-alt { color: var(--ph-alt); font-weight: 700; }

/* number fields: the question above, then symbol, field and unit in a row */
.fields { grid-template-columns: max-content minmax(0, 9em) max-content 1fr; }
.field .what { grid-column: 1 / -1; color: var(--ink); font-size: 0.95rem; margin: 6px 0 -4px; }
.field .sym { white-space: nowrap; }
.field .unit { white-space: nowrap; }
@media (max-width: 640px) {
  .fields { grid-template-columns: max-content minmax(0, 1fr) max-content; }
  .field .sym { grid-column: auto; text-align: right; margin-top: 0; }
}

/* choices: a row of options per question; drawings to choose from; statements to tick */
.ask { font-weight: 600; margin: 12px 0 6px; }
.qrow { display: grid; gap: 6px; margin-bottom: 14px; }
.qrow .what { font-weight: 600; }
.qrow .fb { font-size: 0.9rem; }
.qrow .fb:empty { display: none; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts label { position: relative; }
.opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opts span { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.opts label:hover span { border-color: var(--accent); }
.opts input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.qrow.ok input:checked + span { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.qrow.bad input:checked + span { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.qrow.ok .fb { color: var(--ok); }
.qrow.bad .fb { color: var(--bad); }
.qfb { color: var(--bad); margin: 0 0 12px; padding-left: 1.2em; }
.qfb:empty { display: none; }
.qfb li { margin: 3px 0; }
.cands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.cand { position: relative; display: block; border: 2px solid var(--line); border-radius: 10px; background: var(--card); padding: 4px; cursor: pointer; }
.cand svg { display: block; width: 100%; height: auto; }
.cand input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cand .letter { position: absolute; left: 10px; top: 6px; font-weight: 700; color: var(--accent); }
.cand:hover { border-color: var(--accent); }
.cand:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.cand:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.cand.ok { border-color: var(--ok); background: var(--ok-bg); }
.cand.bad { border-color: var(--bad); background: var(--bad-bg); }
@media (max-width: 560px) { .cands { grid-template-columns: minmax(0, 1fr); } }
.stmts { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 8px; }
.stmts li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--card); }
.stmts label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.stmts input { flex: none; transform: translateY(1px); }
.stmts li.ok { border-color: var(--ok); background: var(--ok-bg); }
.stmts li.bad { border-color: var(--bad); background: var(--bad-bg); }
.stmts .fb { display: block; font-size: 0.9rem; margin: 4px 0 0 26px; }
.stmts .fb:empty { display: none; }
.stmts-fb { color: var(--bad); font-size: 0.9rem; margin: 4px 0 0; }
.stmts-fb:empty { display: none; }

/* check: graphs as options; the options are sentences, so a little smaller */
#ck .ck-opt .val svg.ph { width: 100%; max-width: 260px; }
#ck .ck-opt { font-size: 1rem; }
svg.ph .mark-line { stroke: var(--ink); stroke-width: 1.4; }
svg.ph .mark-halo { stroke: var(--card); stroke-width: 4; }
svg.ph .mark-lead { stroke: var(--muted); stroke-width: 1; }

