/* The subject schools (school/school.js). They wear ELECNora's layout (elec/elec.css) in their own colour. */
body[data-site="chem"] { --zone: #0f766e; --zone-2: #14b8a6; }
body[data-site="bio"]  { --zone: #2e7d32; --zone-2: #66bb6a; }
body[data-site="econ"] { --zone: #b45309; --zone-2: #f59e0b; }
body[data-site="soci"] { --zone: #7c3aed; --zone-2: #a78bfa; }
body[data-site] .elec-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--zone) 70%, #000), var(--zone) 55%, var(--zone-2)); }
body[data-site] .page-intro { padding: 22px 0 14px; }
body[data-site] .page-intro h1 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin-bottom: 4px; }
body[data-site] main.section, body[data-site] .section { padding-top: 14px; }
body[data-site] .card { padding: 16px; }
body[data-site] .elec-level-head b, body[data-site] .bench-stage-n { background: var(--zone); color: #fff; }
body[data-site] .elec-level-head.is-done b { background: #43a047; }
body[data-site] .st-tiles b, body[data-site] .cert-brand, body[data-site] .cert h2 { color: var(--zone); }
body[data-site] .cert { background: linear-gradient(135deg, var(--zone), #c9a227); }
#schMain .elec-article h2 { display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; }
#schMain .elec-how ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
#schMain #schSearch { margin-bottom: 14px; }
#schMain #schTerms .card h3 { margin: 0 0 6px; }
#schMain #schTerms .card p { margin: 0; }
@media print {
  body[data-site] > *:not(main), body[data-site] main > .container > *:not(.cert) { display: none !important; }
}

/* Sources under a lesson and on the dictionary page */
.sch-src { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 0.9rem; color: var(--muted); }
.sch-sources { margin: 0; padding-left: 20px; display: grid; gap: 10px; line-height: 1.5; }
.sch-sources small { display: block; color: var(--muted); }
/* Skins */
.sch-skin i { display: inline-block; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%; vertical-align: -3px; border: 1px solid rgba(0, 0, 0, 0.2); }
.sch-skin[disabled] { opacity: 0.55; cursor: not-allowed; }
/* Simulations (school/sims.js) */
.sim { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 18px; align-items: start; }
.sim-side { display: grid; gap: 14px; }
.sim-ctl { display: grid; gap: 4px; font-size: 0.9rem; }
.sim-ctl input { width: 100%; accent-color: var(--zone); }
.sim-ctl b { color: var(--zone); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .sim-ctl b, :root[data-theme="dark"] .sim-stat b { color: var(--zone-2); }
.sim-canvas { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.sim-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.sim-stat { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.sim-stat b { display: block; font-size: 1.25rem; color: var(--zone); font-variant-numeric: tabular-nums; }
.sim-stat span { font-size: 0.78rem; color: var(--muted); }
@media (max-width: 760px) { .sim { grid-template-columns: minmax(0, 1fr); } }

/* ---------- The lab on one screen: task and coach | bench | controls ---------- */
body.sch-onepage .page-intro { display: none; }
body.sch-onepage #schTasks { padding-top: 10px; }
body.sch-onepage #lab { padding-top: 6px; padding-bottom: 10px; width: min(1500px, 100% - 24px); max-width: none; }
.schlab { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 12px; height: calc(100vh - var(--schlab-top, 150px) - 12px); height: calc(100dvh - var(--schlab-top, 150px) - 12px); min-height: 520px; }
.schlab-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }
.schlab-side .card { margin: 0; }
.schlab-side .elec-steps { margin: 6px 0; font-size: 0.92rem; }
.schlab-main { display: flex; flex-direction: column; gap: 10px; min-height: 0; margin: 0; }
.schlab-tabs { align-items: center; }
#schSim { flex: 1; min-height: 0; }
.simx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 290px); gap: 14px; height: 100%; min-height: 0; }
.simx-stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.simx-stage .sim-canvas { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; max-height: 100%; object-fit: contain; }
.simx-stage .sim-stats { flex: 0 0 auto; margin: 8px 0 0; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 6px; }
.simx-stage .sim-stat { padding: 5px 8px; }
.simx-stage .sim-stat b { font-size: 1rem; overflow-wrap: anywhere; }
.simx-stage .sim-stat span { font-size: 0.72rem; line-height: 1.25; display: block; }
.simx-ctl { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.simx-ctl .lab-select { width: 100%; }
.sim-label { margin: 0 0 -6px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.simx-why { border-top: 1px dashed var(--border); padding-top: 8px; font-size: 0.88rem; line-height: 1.5; }
.simx-why summary { cursor: pointer; font-weight: 700; }
.simx-why p { margin: 6px 0 0; color: var(--muted); }
.schlab-tip { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; border-left: 4px solid var(--border); background: var(--surface-2); font-size: 0.92rem; line-height: 1.45; }
.schlab-tip.is-ok { border-left-color: #16a34a; }
.schlab-tip.is-warn { border-left-color: #d97706; }
.schlab-tip.is-info { border-left-color: var(--zone); }
.schlab-live { margin: 8px 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-weight: 700; font-size: 0.9rem; }
.schlab-live.is-ok, .schlab-live.is-done { background: color-mix(in srgb, #16a34a 16%, var(--surface)); color: #15803d; }
:root[data-theme="dark"] .schlab-live.is-ok, :root[data-theme="dark"] .schlab-live.is-done { color: #4ade80; }
@media (max-width: 1099px) {
  .schlab { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .schlab-side { display: contents; }
  #schTaskCard { order: 0; }
  .schlab-main { order: 1; }
  #schCoach { order: 2; }
  .simx { grid-template-columns: minmax(0, 1fr); height: auto; }
  .simx-ctl { overflow: visible; }
}
/* ---------- Dictionary, mind map ---------- */
.sch-term { border-left: 5px solid var(--cat, var(--zone)); }
.sch-cat { display: inline-block; margin-bottom: 4px; padding: 1px 10px; border-radius: 999px; background: color-mix(in srgb, var(--cat, var(--zone)) 16%, transparent); color: var(--cat, var(--zone)); font-size: 0.74rem; font-weight: 800; }
.sch-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; }
.sch-gap { flex: 0 0 12px; }
.sch-map { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin-bottom: 12px; }
.sch-map svg { display: block; width: 100%; min-width: 760px; height: auto; }
.sch-map text { font: 600 13px Inter, sans-serif; fill: var(--text); }
.sch-map .sch-node-cat { fill: #fff; font-weight: 800; }
.sch-node { cursor: pointer; }
.sch-node:hover text, .sch-node:focus text, .sch-node.is-on text { fill: var(--zone); text-decoration: underline; }
.sch-node.is-on circle { stroke: var(--text); stroke-width: 3; }
/* ---------- Games ---------- */
.sch-gamecard h3, .sch-gamecard p { margin: 6px 0; }
.sch-gameover { text-align: center; }
.sch-match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; }
.sch-match > div, .sch-answers { display: grid; gap: 8px; align-content: start; }
.sch-pair { padding: 10px 12px; border: 2px solid var(--border); border-left: 5px solid var(--cat, var(--border)); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; line-height: 1.4; }
.sch-pair--def { font-size: 0.9rem; }
.sch-pair:hover:not(:disabled), .sch-pair.is-on { border-color: var(--zone); background: var(--surface-2); }
.sch-pair.is-done { border-color: #16a34a; background: color-mix(in srgb, #16a34a 14%, var(--surface)); opacity: 0.85; }
.sch-pair.is-wrong { border-color: #dc2626; background: color-mix(in srgb, #dc2626 12%, var(--surface)); }
@media (max-width: 700px) { .sch-match { grid-template-columns: minmax(0, 1fr); } }
/* ---------- Backgrounds chosen under "Make it yours" ---------- */
body[data-schback="dots"] { background-image: radial-gradient(color-mix(in srgb, var(--zone) 22%, transparent) 1.2px, transparent 1.6px); background-size: 22px 22px; }
body[data-schback="grid"] { background-image: linear-gradient(color-mix(in srgb, var(--zone) 10%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--zone) 10%, transparent) 1px, transparent 1px); background-size: 26px 26px; }
body[data-schback="lines"] { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--zone) 8%, transparent) 0 2px, transparent 2px 18px); }
body[data-schback="glow"] { background-image: radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--zone) 20%, transparent), transparent 42%), radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--zone-2) 20%, transparent), transparent 40%); background-attachment: fixed; }
