/* Eye-PIRLS shared stylesheet (landing, teacher, dashboard).

   The palette maps onto the MD3 token layer (md3.css, loaded first on
   every page): the warm scheme the owner picked for the learner page
   now themes the whole system. Semantic colors (green/red/amber) and
   the AOI/chart category colors keep their own values — they encode
   data, not brand. Fallbacks = the previous cool theme. */

:root {
  --bg: var(--md-surface-dim, #f5f6f8);
  --surface: var(--md-surface, #ffffff);
  --border: var(--md-outline-variant, #e2e6eb);
  --border-strong: var(--md-outline-strong, #cbd2da);
  --text: var(--md-on-surface, #1a2332);
  --muted: var(--md-on-surface-variant, #66707d);
  --accent: var(--md-primary, #2563eb);
  --accent-dark: var(--md-primary-dark, #1d4ed8);
  --accent-soft: var(--md-primary-container, #eaf0fe);
  --green: #16a34a;
  --green-soft: #e8f7ee;
  --red: #dc2626;
  --red-soft: #fdecec;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --aoi-question: #3b82f6;
  --aoi-a: #8b5cf6;
  --aoi-b: #0e9aa7;
  --aoi-c: #d97706;
  --aoi-d: #db2777;
  --aoi-off: #cbd5e1;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 10px; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 14.5px; }

code, pre { font-family: var(--mono); font-size: 12.5px; }

/* ------------------------------------------------------------ layout */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .eye { color: var(--accent); }

.topbar nav { display: flex; gap: 14px; margin-left: auto; }
.topbar nav a { color: var(--muted); font-weight: 500; }
.topbar nav a:hover { color: var(--accent); text-decoration: none; }

.topbar .section-info {
  color: var(--muted);
  font-size: 13px;
}
.topbar .section-info b { color: var(--text); font-family: var(--mono); }

main.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 22px 48px;
  flex: 1;
}

footer.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  padding: 12px 22px;
  background: var(--surface);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.card > h2:first-child, .card > h3:first-child { margin-top: 2px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-items: start;
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* --------------------------------------------------------- landing */

.hero { text-align: center; padding: 46px 16px 26px; }
.hero h1 { font-size: 40px; margin-bottom: 8px; }
.hero .tagline { font-size: 17px; color: var(--muted); margin: 0 0 8px; }
.hero .privacy {
  display: inline-block;
  font-size: 13px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #bfe8cd;
  border-radius: 999px;
  padding: 5px 14px;
  margin-top: 6px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 940px;
  margin: 26px auto 0;
}

.choice-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px 22px;
  text-align: center;
  color: var(--text);
  transition: border-color 0.12s, transform 0.12s;
}
.choice-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.choice-card .glyph { font-size: 34px; display: block; margin-bottom: 10px; }
.choice-card .glyph-img {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
}
.choice-card b { font-size: 16px; display: block; margin-bottom: 6px; }
.choice-card span.desc { color: var(--muted); font-size: 13px; }

/* -------------------------------------------------------- forms/buttons */

label.field { display: block; margin-bottom: 12px; font-weight: 500; }
label.field span { display: block; margin-bottom: 4px; font-size: 13px; }

input[type="text"], input[type="password"], select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 200px;
}
input[type="text"]:focus, input[type="password"]:focus, select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
input[type="file"] { font: inherit; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
}
.btn:hover { background: #1d4fc4; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secondary {
  color: var(--accent);
  background: var(--surface);
}
.btn.secondary:hover { background: var(--accent-soft); }

/* ---------------------------------------------------------- messages */

.error-box {
  background: var(--red-soft);
  border: 1px solid #f3b9b9;
  color: #8f1d1d;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px 0;
  white-space: pre-wrap;
}

.notice-box {
  background: var(--amber-soft);
  border: 1px solid #eed3a4;
  color: #7a4a08;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px 0;
}

.hidden { display: none !important; }

/* ------------------------------------------------------ big group code */

.big-code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(56px, 12vw, 120px);
  letter-spacing: 0.06em;
  text-align: center;
  color: #ffffff;
  background: #101828;
  border-radius: 12px;
  padding: 30px 16px;
  margin: 12px 0 16px;
  user-select: all;
}

/* -------------------------------------------------------------- tables */

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  background: #fafbfc;
  white-space: nowrap;
}
.tbl tbody tr:hover { background: #f7f9fc; }
.tbl.clickable tbody tr { cursor: pointer; }
.tbl tr.selected { background: var(--accent-soft); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--accent); }

.table-scroll { overflow-x: auto; }

/* -------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tabs button {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 14px;
  margin-bottom: -1px;
  cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------------------------------------------------- stat cards */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.stat .v { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 2px;
}

.chart-box { position: relative; height: 280px; }

/* ------------------------------------------------- distribution mini bars */

.dist { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; }
.dist-bar {
  display: inline-block;
  width: 8px;
  background: #b6bec8;
  border-radius: 1px 1px 0 0;
  min-height: 2px;
}
.dist-bar.ok { background: var(--green); }

/* ------------------------------------------------------------- badges */

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
}
.badge.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid #eed3a4; }
.badge.ok { background: var(--green-soft); color: var(--green); }

.check { color: var(--green); font-weight: 700; }

/* ------------------------------------------------------ student detail */

.qrow { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.qrow .qlabel { width: 42px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.qrow .bar-track { flex: 1; background: #eef1f5; border-radius: 4px; height: 18px; position: relative; overflow: hidden; }
.qrow .bar-fill { display: block; height: 100%; border-radius: 4px 0 0 4px; }
.qrow .bar-fill.ok { background: var(--green); }
.qrow .bar-fill.bad { background: var(--red); }
.qrow .bar-fill.none { background: #b6bec8; }
.qrow .qval { width: 66px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; flex: none; }
.qrow .replay-link { flex: none; font-size: 12.5px; }

.stack-track { flex: 1; display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: #eef1f5; }
.stack-seg { height: 100%; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.legend .key { display: inline-flex; align-items: center; gap: 5px; }
.legend .swatch { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }

/* ------------------------------------------------------------- replay */

.replay-layout { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.replay-canvas-wrap { flex: 1 1 640px; min-width: 320px; }

#replay-canvas {
  width: 100%;
  max-width: 960px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  display: block;
}

.replay-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.replay-controls input[type="range"] { flex: 1; min-width: 140px; }
.replay-controls .toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }

.metrics-panel { flex: 0 0 260px; min-width: 240px; }
.metric-bar-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 12.5px; }
.metric-bar-row .mlabel { width: 62px; flex: none; color: var(--muted); }
.metric-bar-row .mtrack { flex: 1; background: #eef1f5; height: 12px; border-radius: 3px; overflow: hidden; }
.metric-bar-row .mfill { display: block; height: 100%; border-radius: 3px 0 0 3px; }
.metric-bar-row .mval { width: 44px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }

.kv { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.kv td { padding: 4px 2px; border-bottom: 1px dashed var(--border); }
.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ------------------------------------------------------------ AI tab */

.llm-status { font-size: 13px; margin-bottom: 12px; }
.llm-status .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.up { background: var(--green); }
.dot.down { background: var(--red); }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.report-summary { font-size: 14.5px; background: #fafbfc; border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 6px 6px 0; }

.clusters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.cluster { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; border-top-width: 3px; }
.cluster.understood { border-top-color: var(--green); }
.cluster.partial { border-top-color: var(--amber); }
.cluster.not { border-top-color: var(--red); }
.cluster h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; }
.cluster.understood h4 { color: var(--green); }
.cluster.partial h4 { color: var(--amber); }
.cluster.not h4 { color: var(--red); }

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  background: #eef1f5;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  margin: 2px 3px 2px 0;
}
.cluster .evidence { font-size: 12px; color: var(--muted); margin-top: 8px; }

.rec-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.rec-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #fafbfc; }
.rec-card .topic { font-weight: 700; margin-bottom: 4px; }
.rec-card .action { margin-bottom: 6px; }
.rec-card .reason { font-size: 12.5px; color: var(--muted); }

details.report-item { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; background: var(--surface); }
details.report-item > summary { cursor: pointer; padding: 9px 14px; font-weight: 600; font-size: 13px; }
details.report-item > .report-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }

/* -------------------------------------------------------------- help */

details.help { border: 1px solid var(--border); border-radius: 6px; background: #fafbfc; margin: 12px 0; }
details.help > summary { cursor: pointer; padding: 9px 14px; font-weight: 600; }
details.help > div { padding: 0 14px 12px; }
details.help pre {
  background: #101828;
  color: #e6edf6;
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
}

ul.plain { padding-left: 20px; margin: 8px 0; }
ul.plain li { margin: 3px 0; }

/* ------------------------------------------------------- login & account */

.login-card { max-width: 380px; margin: 9vh auto 0; }
.login-card input[type="text"],
.login-card input[type="password"] { width: 100%; min-width: 0; }

.topbar .user-box {
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 14px;
  white-space: nowrap;
}
.topbar .user-box #user-name { color: var(--text); font-weight: 600; }
.topbar .user-box a { color: var(--muted); }
.topbar .user-box a:hover { color: var(--accent); }

/* ------------------------------------------------- user management (admin) */

.user-create { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.user-create input { min-width: 180px; }
.pw-input { font-family: var(--mono); }

.mini-btn {
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-btn:hover { background: var(--accent-soft); }

.ok-box {
  background: var(--green-soft);
  border: 1px solid #bfe8cd;
  color: #14532d;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 12px 0;
}

.gen-pw {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  background: #101828;
  color: #ffffff;
  border-radius: 4px;
  padding: 2px 9px;
  user-select: all;
}

/* -------------------------------------------- student set-up (client info) */

.setup-line {
  font-size: 12.5px;
  color: var(--muted);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  margin: 6px 0 12px;
}
.setup-line .setup-label {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text);
  margin-right: 8px;
}
.setup-bad { color: var(--red); font-weight: 700; }

/* remove-student button + no-data cluster box */
.remove-btn {
  border: 1px solid #fca5a5; background: #fff; color: #b91c1c;
  border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer;
}
.remove-btn:hover { background: #fef2f2; }
.cluster.nodata { border-top: 3px solid #94a3b8; margin-top: 12px; }
.cluster.nodata h4 { color: #64748b; text-transform: uppercase; }

/* ================================================= Eye-PIRLS 2.0 (v2) */

/* ------------------------------------------ type & process badges */

.tbadge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.tbadge.t-mcq { background: var(--accent-soft); color: var(--accent); }
.tbadge.t-yesno { background: var(--green-soft); color: var(--green); }
.tbadge.t-cloze { background: var(--amber-soft); color: var(--amber); }
.tbadge.t-open { background: #f3e8ff; color: #7c3aed; }

.pbadge {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* pending-open stat card */
.stat.warn { border-color: #eed3a4; background: var(--amber-soft); }
.stat.warn .v { color: var(--amber); }

/* yes/no distribution cell */
.yn { display: inline-flex; gap: 4px; font-size: 12px; white-space: nowrap; }
.yn-side { background: #eef1f5; border-radius: 4px; padding: 1px 7px; color: var(--muted); }
.yn-side.ok { background: var(--green-soft); color: var(--green); font-weight: 700; }

/* ---------------------------------------------- reading profiles */

.profile-chip {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.profile-chip.prof-on_track { background: var(--green-soft); color: var(--green); }
.profile-chip.prof-pending { background: #eef1f5; color: #6b7280; font-style: italic; }
.profile-chip.prof-fluency_support { background: var(--accent-soft); color: var(--accent); }
.profile-chip.prof-comprehension_support { background: var(--amber-soft); color: var(--amber); }
.profile-chip.prof-intensive_support { background: var(--red-soft); color: var(--red); }
.profile-chip.prof-no_gaze_ok,
.profile-chip.prof-no_gaze_low,
.profile-chip.prof-no_gaze { background: #eef1f5; color: #64748b; }

.profile-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
}
.profile-card.prof-on_track { border-top-color: var(--green); }
.profile-card.prof-fluency_support { border-top-color: var(--accent); }
.profile-card.prof-comprehension_support { border-top-color: var(--amber); }
.profile-card.prof-intensive_support { border-top-color: var(--red); }
.profile-card.prof-no_gaze_ok,
.profile-card.prof-no_gaze_low,
.profile-card.prof-no_gaze { border-top-color: #94a3b8; }
.profile-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.profile-card.prof-on_track h4 { color: var(--green); }
.profile-card.prof-fluency_support h4 { color: var(--accent); }
.profile-card.prof-comprehension_support h4 { color: var(--amber); }
.profile-card.prof-intensive_support h4 { color: var(--red); }
.profile-card.prof-no_gaze_ok h4,
.profile-card.prof-no_gaze_low h4,
.profile-card.prof-no_gaze h4 { color: #64748b; }
.profile-card .pc-n { color: var(--muted); font-weight: 600; }
.profile-card .tip { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.profile-card .evidence { font-size: 12px; color: var(--muted); margin-top: 8px; }
.profile-card .actions {
  font-size: 12.5px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
  margin-top: 8px;
}

/* ------------------------------------- fluency x comprehension quadrant */

.quadrant-layout { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.quadrant-layout .quadrant-box { flex: 1 1 480px; min-width: 320px; height: 340px; }
#quadrant-side { flex: 0 0 230px; min-width: 200px; }
#quadrant-side .legend { flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 0; }
.nogaze-group { margin-top: 12px; }
.nogaze-group h4 {
  margin: 0 0 4px;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.disc-warn { color: var(--amber); font-weight: 700; }

/* --------------------------------------------------- answers tab */

.answers-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--amber-soft);
  border-color: #eed3a4;
}
.answers-banner .pending-text { font-weight: 600; color: #7a4a08; }

.answers-tbl .ans-text {
  max-width: 340px;
  white-space: pre-wrap;
  word-break: break-word;
}
.answers-tbl .rationale { max-width: 280px; }
.answers-tbl .override { white-space: nowrap; }
.answers-tbl .override input {
  min-width: 0;
  width: 64px;
  padding: 4px 6px;
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  margin-right: 5px;
}
.answers-tbl .override input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.src-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.src-badge.src-auto { background: #eef1f5; color: #64748b; }
.src-badge.src-llm { background: var(--accent-soft); color: var(--accent); }
.src-badge.src-teacher { background: var(--green-soft); color: var(--green); }
.src-badge.src-pending { background: var(--amber-soft); color: var(--amber); }

/* --------------------------------------------------- AI guidance */

.guidance-block { margin: 0 0 12px; }
.guidance-block label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
#ai-guidance {
  display: block;
  width: 100%;
  max-width: 640px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
}
#ai-guidance:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.guidance-used {
  font-size: 12.5px;
  background: #fafbfc;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  padding: 7px 10px;
  margin: 10px 0;
}

/* --------------------------------------------- "how it works" guide
   Numbered steps strip for non-technical users, shown at the top of
   each teacher-facing page. Shared component (teacher/review/dash). */
.guide-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text);
}
.guide-steps .gstep { display: inline-flex; align-items: center; gap: 7px; }
.guide-steps .gnum {
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* one-line plain-language explanation under a card heading */
.card-sub {
  margin: -6px 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* AI tab: model picker + per-report delete */
#ai-model-field { margin: 8px 0 4px; max-width: 520px; }
#ai-model { width: 100%; }
.report-item summary .report-del { float: right; }

/* -------------------------------- students tab: class at a glance */
#class-glance h4 { margin: 14px 0 8px; font-size: 13.5px; }
#glance-heatmap .hm {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#glance-heatmap .hm-good { background: var(--green-soft); color: var(--green); }
#glance-heatmap .hm-mid { background: var(--amber-soft); color: var(--amber); }
#glance-heatmap .hm-low { background: var(--red-soft); color: var(--red); }
#glance-heatmap .hm-none { color: var(--muted); }
#glance-heatmap .hm-class-row td {
  font-weight: 700;
  border-top: 2px solid var(--border-strong);
}
.guidance-response {
  background: #fafbfc;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 14px 0 4px;
  white-space: pre-line; /* the model may answer with a line list */
}
.guidance-response h3 { margin: 0 0 6px; }
.insight-action {
  display: block;
  font-size: 12.5px;
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 5px 9px;
  margin-top: 3px;
}

/* --------------------------------------- student detail additions */

.read-row { display: flex; align-items: center; gap: 12px; margin: 5px 0; flex-wrap: wrap; }
.read-row .rtitle { font-weight: 600; flex: 1 1 160px; min-width: 120px; }
.read-row .rstat {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.read-row .rstat b { color: var(--text); }
.read-row .replay-link { flex: none; font-size: 12.5px; }

.qrow .bar-fill.pend { background: var(--amber); }
.qrow .qscore {
  width: 92px;
  flex: none;
  text-align: right;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* authoritative process percentage shown inside AI-report insights */
.proc-pct { font-weight: 700; color: var(--accent); }

/* survey tab: children's own words */
.sv-quotes { list-style: none; margin: 0; padding: 0; }
.sv-quotes li {
  padding: 8px 12px;
  margin-bottom: 6px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.chip.mut { background: var(--accent-soft); color: var(--accent-dark);
  font-size: 11px; padding: 1px 7px; border-radius: 999px; }

/* Survey tab: individual responses (lessons §13b) */
.sv-ind-row { padding: 3px 0; }
.sv-ind-detail td { background: #fafbfd; }
