/* Universal Scope - teacher's sphere, student view and start page.
   Builds on style.css: same desk, paper, graphite ink and ballpoint blue. The teacher's inbox
   reads like a stack of papers on the desk; each open item is a sheet. */

:root { --ok: #1f6b3a; --no: #a3272e; --hold: #7a5a00; --btn: #1f4fa3; --btn-ink: #ffffff; }
html[data-look="dark"] { --ok: #7fd49a; --no: #ff9d9d; --hold: #f1cf6b; --btn: #a6c1ff; --btn-ink: #14181b; }
html[data-look="contrast"] { --ok: #7dff9e; --no: #ff8a8a; --hold: #ffe14d; --btn: #ffe14d; --btn-ink: #000000; }

.wrap { width: min(62rem, calc(100% - 1.5rem)); margin: 1.25rem auto 3rem; }
.who { align-self: center; font-size: 0.8rem; color: var(--soft-ink); }
.link-btn { background: transparent; border-color: transparent; text-decoration: underline; color: var(--ink); }

.primary {
  background: var(--btn); color: var(--btn-ink); border-color: var(--btn); font-weight: 700;
}
.primary[disabled] { opacity: 0.5; cursor: default; }

.panel {
  background: var(--paper); border-radius: 3px; padding: 1.25rem 1.4rem 1.4rem;
  box-shadow: 0 1px 0 var(--rule-strong), 0 12px 30px -20px rgba(0, 0, 0, 0.45);
  margin-bottom: 1.25rem;
}
.panel h2 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.panel .hint { margin: 0 0 0.9rem; color: var(--soft-ink); font-size: 0.9rem; }

.tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button[aria-selected="true"] { background: var(--paper); border-color: var(--ink); font-weight: 700; }

.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin-bottom: 0.8rem; }
.row .field { flex: 0 1 auto; }
input.text {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--control);
  border: 1px solid var(--rule-strong); border-radius: 6px; padding: 0.35rem 0.6rem; min-height: 2.25rem;
}

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.7rem 0.2rem; border-top: 1px solid var(--rule-strong);
}
.list > li:first-child { border-top: 0; }
.list .main { flex: 1 1 16rem; }
.list .title { font-weight: 700; }
.list .sub { font-size: 0.82rem; color: var(--soft-ink); }
.empty { color: var(--soft-ink); font-style: italic; margin: 0.4rem 0; }

.pill { font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pill.ok { color: var(--ok); } .pill.no { color: var(--no); } .pill.hold { color: var(--hold); } .pill.plain { color: var(--soft-ink); }

.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.3rem 1rem; margin: 0.3rem 0 0.9rem; }
.pages label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.92rem; }
.pages input { width: 1.1rem; height: 1.1rem; }

.msg { min-height: 1.3rem; margin: 0.4rem 0 0; font-size: 0.9rem; }
.msg.bad { color: var(--no); font-weight: 700; }
.msg.good { color: var(--ok); font-weight: 700; }

/* the one moment that matters to a student: work arrived */
.confirm {
  border: 2px solid var(--ok); border-radius: 4px; padding: 0.9rem 1rem; margin: 1rem 0 0;
  color: var(--ink); background: transparent;
}
.confirm strong { color: var(--ok); font-size: 1.1rem; display: block; }

/* graded work */
.problem .mark-badge { margin-left: 0.7rem; font-size: 0.8rem; font-weight: 700; vertical-align: middle; }
.mark-badge.right { color: var(--ok); } .mark-badge.wrong { color: var(--no); }
.problem.read-only .work, .problem.read-only .answer { cursor: default; }
.key-line { margin: 0.5rem 0 0; font-size: 0.88rem; color: var(--soft-ink); }

.grade-row { display: flex; gap: 0.4rem; margin-top: 0.6rem; align-items: center; flex-wrap: wrap; }
.grade-row button[aria-pressed="true"].g-right { background: var(--ok); color: var(--paper); border-color: var(--ok); }
.grade-row button[aria-pressed="true"].g-wrong { background: var(--no); color: var(--paper); border-color: var(--no); }
.grade-row .suggest { font-size: 0.82rem; color: var(--hold); }

.score { font-size: 1.5rem; font-weight: 700; margin: 0.2rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }

/* start page */
.door { width: min(30rem, calc(100% - 1.5rem)); margin: 12vh auto 3rem; }
.door h1 { font-size: 2rem; margin: 0 0 0.3rem; }
.door .roles { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }
.door .roles button { flex: 1 1 10rem; min-height: 3rem; font-size: 1.05rem; }
.door .foot { margin-top: 1.4rem; font-size: 0.85rem; color: var(--soft-ink); }
.door .foot a { color: var(--ink); }

.page-head h3 { margin: 0.6rem 0 0.2rem; font-size: 1.2rem; }
.page-head + .problem { border-top: 0; }
.page-head .directions { margin: 0 0 0.8rem; }

/* coaching: the correct part of an answer, highlighted */
.read-line { margin: 0.5rem 0 0; font-size: 0.95rem; }
.read-line .hl-right { background: transparent; color: var(--ok); font-weight: 700; border-bottom: 3px solid var(--ok); padding: 0 0.1em; }
.read-line .read-note { font-size: 0.85rem; color: var(--hold); }

/* anomaly for the teacher's review */
.read-line .hl-anomaly { background: var(--hold); color: var(--paper); font-weight: 700; padding: 0 0.15em; border-radius: 2px; }
.problem.needs-review { box-shadow: inset 5px 0 0 var(--hold); padding-left: 1rem;
  background: color-mix(in srgb, var(--hold) 7%, transparent); }

.earlier { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--soft-ink); white-space: pre-wrap; }
/* keep the problem number in its usual place, left of the amber bar */
.problem.needs-review .prompt::before { left: -3.55rem; }

/* student coaching: what they wrote (red) and what it should be (green) */
.coach { margin: 0.6rem 0 0; padding: 0.6rem 0.8rem; border-radius: 4px;
  background: color-mix(in srgb, var(--no) 6%, transparent); letter-spacing: 0.06em; }
.coach-line { margin: 0.15rem 0; font-size: 1.05rem; }
.coach-label { font-weight: 700; }
.coach-wrong .coach-value { color: var(--no); font-weight: 700; }
.coach-right .coach-value { color: var(--ok); font-weight: 700; }

/* labels match their colors, a little softer than the answers */
.coach-wrong .coach-label { color: var(--no); opacity: 0.8; }
.coach-right .coach-label { color: var(--ok); opacity: 0.8; }

.smh-row { width: 100%; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; font-size: 0.9rem; padding-top: 0.3rem; }

/* "Show me how" */
.smh { margin-top: 0.7rem; }
.smh-open { font-weight: 700; }
.smh-panel { margin-top: 0.6rem; padding: 0.8rem 1rem; border-radius: 4px; border: 1px solid var(--rule-strong); }
.smh-head { margin: 0 0 0.5rem; font-weight: 700; letter-spacing: 0.04em; }
.smh-steps { margin: 0 0 0.6rem; padding-left: 1.4rem; }
.smh-steps li { margin: 0.35rem 0; }
.smh-nav { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.smh-nav button[disabled] { opacity: 0.45; cursor: default; }
.smh-text { display: block; }
.smh-math { display: block; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.06em; margin-top: 0.1rem; }
.smh-practice { margin-top: 0.8rem; padding-top: 0.6rem; border-top: 1px dashed var(--rule-strong); }
.smh-count { margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--soft-ink); }
.smh-problem { margin: 0 0 0.4rem; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.04em; }
.smh-practice .answer-row { gap: 0.6rem; }
.smh-right, .smh-done { color: var(--ok); font-weight: 700; margin: 0.4rem 0 0; }
.smh-done { font-size: 1.1rem; }

/* no step numbers inside "Show me how" - they could be confused with the math */
.smh-steps { list-style: none; padding-left: 0; }
.smh-steps li { padding-left: 0.8rem; border-left: 3px solid var(--rule-strong); }
.smh-count { letter-spacing: 0.2em; }

/* balance scale (Show me how, equations) */
.scale { width: 100%; max-width: 34rem; display: block; margin: 0.4rem 0 0.8rem; }
.scale-post, .scale-bar { fill: var(--soft-ink); }
.scale-pivot { fill: var(--ink); }
.scale-string { stroke: var(--soft-ink); stroke-width: 2; }
.scale-pan { fill: color-mix(in srgb, var(--ok) 18%, transparent); stroke: var(--ok); stroke-width: 2; }
.scale-text { fill: var(--ink); font-size: 30px; font-weight: 700; letter-spacing: 1px; }
.scale-eq { fill: var(--ok); font-size: 34px; font-weight: 700; }
.scale-beam { transform-origin: 300px 58px; }
.scale-beam.wobble { animation: wobble 0.9s ease-out; }
@keyframes wobble { 0% { transform: rotate(-4deg); } 35% { transform: rotate(3deg); } 70% { transform: rotate(-1deg); } 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .scale-beam.wobble { animation: none; } }
.smh-read { font-size: 0.85rem; margin-bottom: 0.5rem; }

/* the written problem in "Show me how", with the part being read highlighted (Chris 2026-09-25) */
.smh-bigprob { font-size: 1.6rem; font-weight: 700; letter-spacing: 0.08em; margin: 0.2rem 0 0.6rem; white-space: pre; }
.smh-hl { background: #ffe680; color: #111; border-radius: 4px; padding: 0 0.15em; outline: 2px solid #b58900; transition: background 0.3s; }

/* one step at a time (Chris 2026-09-25) */
.smh-now { min-height: 6.5rem; margin: 0 0 0.6rem; padding: 0.6rem 0.9rem; border-left: 4px solid var(--rule-strong); }
.smh-now .smh-count { margin: 0 0 0.3rem; font-size: 0.85rem; opacity: 0.75; }
.smh-now .smh-text { margin: 0; font-size: 1.15rem; line-height: 1.5; }
.smh-now .smh-math { margin: 0.4rem 0 0; font-size: 1.3rem; font-weight: 700; letter-spacing: 0.06em; }

/* the step's words scroll inside a fixed box, so Go back / Repeat / Next step never move
   and never leave the screen (Chris 2026-09-25) */
.smh-now { height: 9.5rem; overflow-y: auto; overscroll-behavior: contain; }
.smh-nav { position: sticky; bottom: 0; z-index: 2; background: var(--paper); padding: 0.5rem 0; }

/* BRIGHT CONTRAST READING - when Read aloud is off (for Deaf students, or anyone who'd rather read).
   White and bright yellow on black: about 19:1 contrast, the same in every Look. (Chris 2026-09-25) */
.smh-reading .smh-now { background: #000; color: #fff; border-left: 6px solid #ffd400; border-radius: 6px; }
.smh-reading .smh-now .smh-count { color: #ffd400; opacity: 1; font-weight: 700; }
.smh-reading .smh-now .smh-text { font-size: 1.4rem; font-weight: 600; line-height: 1.55; }
.smh-reading .smh-now .smh-math { color: #ffd400; font-size: 1.6rem; }

/* ---------- THE VISUAL COMPANION (Chris 2026-09-27: "walkthroughs include the visual companion! everytime ...
   everywhere"). Every kind of problem gets a picture that moves with the steps - see site/visuals.js. */
.vz { width: 100%; max-width: 36rem; display: block; margin: 0.4rem 0 0.8rem; overflow: visible; }
.vz text { font-family: inherit; }
.vz-t { fill: var(--ink); }
.vz-small { font-size: 14px; fill: var(--soft-ink); }
.vz-num { font-size: 18px; font-weight: 700; fill: var(--ink); }
.vz-num-a { fill: var(--pen); }
.vz-num-b { fill: var(--hold); }
.vz-num-big { font-size: 34px; font-weight: 700; fill: var(--ink); }
.vz-ans-big { font-size: 30px; font-weight: 700; fill: var(--ok); }
.vz-ans-mid { font-size: 22px; font-weight: 700; fill: var(--ok); }
.vz-q-t { font-size: 24px; font-weight: 700; fill: var(--hold); }
.vz-take { font-size: 15px; font-weight: 700; fill: var(--no); }
.vz-count { font-size: 13px; font-weight: 700; fill: var(--soft-ink); }
.vz-dot-t { font-size: 22px; font-weight: 700; fill: var(--ink); }

.vz-axis { stroke: var(--ink); stroke-width: 2.5; }
.vz-tick { stroke: var(--ink); stroke-width: 1.5; }
.vz-grid { stroke: var(--rule-strong); stroke-width: 1; }
.vz-edge { stroke: var(--ink); stroke-width: 3.5; fill: none; stroke-linecap: round; }
.vz-shape { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linejoin: round; }
.vz-fill, .vz-shape.vz-fill { fill: color-mix(in srgb, var(--pen) 16%, transparent); }
.vz-cell { stroke: color-mix(in srgb, var(--pen) 45%, transparent); stroke-width: 1; }
.vz-ghost { fill: none; stroke: var(--soft-ink); stroke-width: 2; stroke-dasharray: 7 6; }
.vz-dash { stroke: var(--hold); stroke-width: 3; stroke-dasharray: 7 6; }
.vz-soft { stroke: var(--soft-ink); stroke-width: 2; fill: none; }
.vz-radius { stroke: var(--hold); stroke-width: 3.5; stroke-linecap: round; }
.vz-center { fill: var(--ink); }
.vz-trace { fill: none; stroke: var(--pen); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; }
.vz-edge.vz-hyp { stroke: var(--ok); }
.vz-ray { stroke: var(--pen); stroke-width: 3.5; stroke-linecap: round; }

.vz-dot-a { fill: var(--pen); }
.vz-dot-b { fill: var(--hold); }
.vz-gone { opacity: 0.28; }
.vz-cross { stroke: var(--no); stroke-width: 3; stroke-linecap: round; }
.vz-start { fill: var(--pen); }
.vz-hop { fill: none; stroke: var(--hold); stroke-width: 2.5; }
.vz-land { fill: var(--hold); }
.vz-ans { fill: none; stroke: var(--ok); stroke-width: 4; }
.vz-ans-num { fill: var(--ok); font-weight: 700; }

.vz-tile { fill: color-mix(in srgb, var(--pen) 22%, var(--paper)); stroke: var(--pen); stroke-width: 2; }
.vz-tile-b { fill: color-mix(in srgb, var(--hold) 22%, var(--paper)); stroke: var(--hold); stroke-width: 2; }
.vz-tile-neg { fill: color-mix(in srgb, var(--no) 18%, var(--paper)); stroke: var(--no); stroke-width: 2; }
.vz-tile-t { font-size: 20px; font-weight: 700; fill: var(--ink); }
.vz-zero { opacity: 0.3; }
.vz-chip { fill: color-mix(in srgb, var(--ok) 16%, var(--paper)); stroke: var(--ok); stroke-width: 2; }
.vz-chip-neg { fill: color-mix(in srgb, var(--no) 16%, var(--paper)); stroke: var(--no); stroke-width: 2; }
.vz-chip-t { font-size: 17px; font-weight: 700; fill: var(--ink); }
.vz-group { fill: none; stroke: var(--soft-ink); stroke-width: 2; stroke-dasharray: 6 5; }
.vz-brace { fill: none; stroke: var(--soft-ink); stroke-width: 2; }

.vz-guide-a { stroke: var(--pen); stroke-width: 3; stroke-dasharray: 8 5; }
.vz-guide-b { stroke: var(--hold); stroke-width: 3; stroke-dasharray: 8 5; }
.vz-slope { stroke: var(--ok); stroke-width: 3.5; stroke-linecap: round; }
.vz-pt { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }

.vz-term { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 2; }
.vz-term-t { font-size: 20px; font-weight: 700; fill: var(--ink); }
.vz-factor { fill: var(--paper); stroke: var(--pen); stroke-width: 2.5; }
.vz-card { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1.5; }
.vz-card-ok { fill: color-mix(in srgb, var(--ok) 14%, var(--paper)); stroke: var(--ok); stroke-width: 2.5; }
.vz-card-t { font-size: 16px; font-weight: 700; fill: var(--ink); }
.vz-card-ok-t { font-size: 15px; font-weight: 700; fill: var(--ok); }

.vz-sq-q { fill: color-mix(in srgb, var(--pen) 10%, transparent); stroke: var(--pen); stroke-width: 2.5; stroke-dasharray: 8 6; }
.vz-sq-try { fill: color-mix(in srgb, var(--hold) 35%, var(--paper)); stroke: var(--hold); stroke-width: 1; }
.vz-sq-ok { fill: color-mix(in srgb, var(--ok) 35%, var(--paper)); stroke: var(--ok); stroke-width: 1; }
.vz-sq-a { fill: color-mix(in srgb, var(--pen) 14%, transparent); stroke: var(--pen); stroke-width: 2; }
.vz-sq-b { fill: color-mix(in srgb, var(--hold) 16%, transparent); stroke: var(--hold); stroke-width: 2; }
.vz-sq-c { fill: color-mix(in srgb, var(--ok) 14%, transparent); stroke: var(--ok); stroke-width: 2; }
.vz-wedge-a { fill: color-mix(in srgb, var(--pen) 22%, transparent); stroke: var(--pen); stroke-width: 2; }
.vz-wedge-b { fill: color-mix(in srgb, var(--hold) 24%, transparent); stroke: var(--hold); stroke-width: 2; }

.vz-badge { fill: var(--paper); stroke: var(--ok); stroke-width: 3; }
.vz-badge-t { font-size: 22px; font-weight: 700; fill: var(--ok); }

/* the part being read right now: the same yellow as the written problem */
.vz-halo { fill: none !important; stroke: #8ab4f8; stroke-width: 6; stroke-opacity: 0.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: none; }
.vz-halo-box { fill: #ffe680; stroke: #b58900; stroke-width: 2; }
.vz-lit { fill: #111 !important; }
.scale-eq.vz-lit-eq { fill: #b58900; }

.vz-pop { animation: vzpop 0.5s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes vzpop { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
.vz-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: vzdraw 1.4s ease-in-out both; }
@keyframes vzdraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .vz-pop, .vz-draw { animation: none; stroke-dashoffset: 0; } }
/* the big written problem wraps instead of running off a phone screen (Chris 2026-09-27) */
.smh-bigprob { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) { .smh-bigprob { font-size: 1.3rem; letter-spacing: 0.03em; } }
/* the part being read, lit right on the scale's pan */
.scale-text .scale-hl { fill: var(--hold); text-decoration: underline; text-decoration-thickness: 3px; }
.scale-plate { fill: var(--scale-bg, var(--paper)); }
/* the work, written under the picture as it's said (Chris 2026-09-27) */
.vz-work { fill: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes vzfade { from { opacity: 0; } to { opacity: 1; } }
.vz-work-new { animation: vzfade 0.35s ease-out both; }
@media (prefers-reduced-motion: reduce) { .vz-work-new { animation: none; } }

/* the multiply dot shown as a tiny x (Chris 2026-09-28) */
.tiny-x { font-size: 0.6em; vertical-align: 0.15em; }

/* a name under the lit part of the math line, e.g. "coefficient" (Chris 2026-09-29) */
.smh-label { margin: 0.1rem 0 0; font-size: 1rem; font-weight: 700; color: #ffd400; letter-spacing: 0.02em; }
