/* BEHIND THE QPS — the same editorial, report-like look as Behind the LAB (teacher and admin): serif headings, plain
   sans body, colour used for meaning only — sounds and short words (amber), vowel patterns (plum), big words (blue),
   the reading path (green). */
:root {
  --ink: #1d2330;
  --muted: #5b6474;
  --paper: #f7f5f0;
  --card: #ffffff;
  --line: #e3dfd6;
  --accent: #0f6b5c;
  --sounds: #b4580e;  --sounds-bg: #fdf1e6;
  --vowels: #7b3f8c;  --vowels-bg: #f5ecf8;
  --big: #1f5fa8;     --big-bg: #e9f1fb;
  --reading: #1c7a4a; --reading-bg: #e8f5ee;
  --ok: #1c7a4a; --next: #b07800; --tried: #a8431f; --wait: #8a8f99;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 32, .06), 0 6px 18px rgba(20, 24, 32, .06);
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.55; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 2.1rem; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: .4rem 0 .7rem; }
b { font-weight: 650; }
.muted { color: var(--muted); }

/* header + tabs */
.top { background: linear-gradient(180deg, #fff 0%, #fbfaf6 100%); border-bottom: 1px solid var(--line); padding: 26px 0 0; position: sticky; top: 0; z-index: 5; }
.sub { color: var(--muted); margin: 0 0 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { font: inherit; font-size: .95rem; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
.tab:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #f0b429; outline-offset: 2px; }
main { padding: 26px 20px 40px; }
.lead { font-size: 1.05rem; max-width: 820px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid3 { margin-top: 18px; }
.more { font: inherit; font-size: .9rem; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; cursor: pointer; color: var(--accent); }
.more:hover { background: #f1f7f5; border-color: var(--accent); }
.stat-row { font-size: .95rem; }
.stat-row .n { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin-right: 4px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.count-chip { border-radius: 999px; padding: 3px 11px; font-size: .85rem; background: #f2f1ec; }

/* the five parts of a stop */
.steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; counter-reset: s; }
.steps li { position: relative; }
.steps li + li::before { content: '→'; position: absolute; left: -11px; top: 38%; color: var(--muted); }
.steps button { width: 100%; font: inherit; text-align: center; background: #fbfaf6; border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; align-items: center; min-height: 130px; transition: transform .15s, box-shadow .15s; }
.steps button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.steps .si { font-size: 1.8rem; }
.steps small { color: var(--muted); font-size: .8rem; }

/* the map */
.legend { display: flex; gap: 10px; margin: 6px 0 16px; flex-wrap: wrap; }
.legend span { border-radius: 999px; padding: 3px 12px; font-size: .85rem; }
.area-sounds { background: var(--sounds-bg); color: var(--sounds); }
.area-vowels { background: var(--vowels-bg); color: var(--vowels); }
.area-big { background: var(--big-bg); color: var(--big); }
.area-reading { background: var(--reading-bg); color: var(--reading); }
.lane { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.lane-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lane-head h3 { margin: 0; }
.lane-head button { font: inherit; }
.gate { font-size: .82rem; color: var(--muted); background: #f2f1ec; border-radius: 999px; padding: 2px 10px; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tile { font: inherit; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 11px; cursor: pointer; min-width: 150px; max-width: 210px; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .code { font-size: .8rem; color: var(--c); font-weight: 700; letter-spacing: .04em; display: block; }
.tile .t { font-size: .9rem; font-weight: 600; display: block; line-height: 1.25; }
.arrow { color: var(--muted); font-size: .9rem; }
.sounds { --c: var(--sounds); --bg: var(--sounds-bg); }
.vowels { --c: var(--vowels); --bg: var(--vowels-bg); }
.big { --c: var(--big); --bg: var(--big-bg); }
.reading { --c: var(--reading); --bg: var(--reading-bg); }

/* who gets what */
.who-card { border-left: 6px solid var(--c); }
.who-card dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 8px 0 0; }
.who-card dt { color: var(--muted); font-size: .88rem; }
.who-card dd { margin: 0; }

/* the drawer */
.drawer { position: fixed; inset: 0; background: rgba(20, 24, 32, .35); z-index: 20; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-panel { width: min(640px, 100%); height: 100%; overflow-y: auto; background: var(--card); padding: 26px 26px 40px; box-shadow: -8px 0 30px rgba(0, 0, 0, .15); position: relative; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer-panel { animation: none; } .tile, .steps button { transition: none; } }
.drawer-close { position: absolute; top: 14px; right: 14px; font-size: 1.1rem; background: #f2f1ec; border: 0; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; }
.kid-view { background: #fbfaf6; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0 14px; }
.kid-view .lbl { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.facts-list { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 10px 0 16px; }
.facts-list dt { color: var(--muted); font-size: .88rem; }
.facts-list dd { margin: 0; }
.sample { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0 14px; }
.sample ul { margin: 6px 0; padding-left: 20px; }
.sample li.right { color: var(--ok); font-weight: 650; }
.sample li.right::after { content: '  ✓ right answer'; font-weight: 500; font-size: .85rem; }
.sample details { margin-top: 6px; color: var(--muted); }
.sample details p { color: var(--ink); font-size: .92rem; }
.drawer h4 { font-family: var(--serif); font-size: 1.05rem; margin: 18px 0 4px; }

/* my students */
.pin-box { max-width: 560px; }
#pin-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#pin-input { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; width: 140px; }
.btn { font: inherit; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 9px 18px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.pin-msg { color: var(--tried); }
.students-bar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.switch { cursor: pointer; user-select: none; }
.roster { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.roster th, .roster td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.roster th { font-size: .82rem; color: var(--muted); font-weight: 600; background: #fbfaf6; }
.roster tr.kid { cursor: pointer; }
.roster tr.kid:hover td { background: #fbfaf6; }
.kid-name { font-weight: 650; border: 0; background: none; font: inherit; cursor: pointer; padding: 0; text-align: left; color: var(--ink); }
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .82rem; margin: 2px 4px 2px 0; background: var(--bg); color: var(--c); }
.no-plan { color: var(--muted); font-style: italic; }
.route-strand { border-left: 5px solid var(--c); padding: 6px 0 6px 12px; margin: 12px 0; }
.route-strand h4 { margin: 0 0 6px; }
.nodes { display: flex; flex-wrap: wrap; gap: 6px; }
.node { font: inherit; font-size: .85rem; border-radius: 9px; padding: 5px 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.node.passed, .node.done { background: #e8f5ee; border-color: #b9dfc9; }
.node.now { background: #fff5d9; border-color: var(--next); font-weight: 650; }
.node.screener { background: #f6f5f1; color: var(--muted); }
.node.ahead { color: var(--wait); }
.node small { font-size: .8rem; color: var(--muted); }
.order { padding-left: 22px; margin: 6px 0 12px; columns: 2; column-gap: 26px; }
.order li { break-inside: avoid; font-size: .92rem; }
.why-box { background: #fbfaf6; border-radius: 10px; padding: 8px 12px; font-size: .92rem; margin: 6px 0; }
.evidence-note { font-size: .88rem; color: var(--muted); }
.foot { color: var(--muted); font-size: .85rem; padding-bottom: 30px; }

@media (max-width: 900px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li + li::before { content: none; }
  .order { columns: 1; }
}
@media (max-width: 560px) {
  html { font-size: 17px; }
  h1 { font-size: 1.7rem; }
  .steps { grid-template-columns: 1fr; }
  .steps button { min-height: 0; flex-direction: row; justify-content: flex-start; gap: 10px; text-align: left; }
  .facts-list, .who-card dl { grid-template-columns: 1fr; }
  .tile { min-width: 0; max-width: none; flex: 1 1 140px; }
}

/* QPS additions */
.reading-card { border-left: 6px solid var(--reading); }
.path-steps { list-style: none; padding: 0; margin: 12px 0 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.path-steps li { position: relative; }
.path-steps li + li::before { content: '→'; position: absolute; left: -11px; top: 38%; color: var(--muted); }
.path-steps button { width: 100%; font: inherit; text-align: center; background: var(--reading-bg); border: 1px solid #b9dfc9; border-radius: 12px; padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; align-items: center; transition: transform .15s, box-shadow .15s; }
.path-steps button:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.path-steps .si { font-size: 1.6rem; }
.path-steps small { color: var(--muted); font-size: .8rem; }
.tile .ex { display: block; font-size: .82rem; color: var(--muted); font-family: var(--serif); font-style: italic; }
.tile .cnt { display: inline-block; margin-top: 4px; font-size: .74rem; color: var(--c); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.more.inline { padding: 1px 10px; font-size: .88rem; }
.step-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.step-chip { display: inline-block; border-radius: 8px; padding: 2px 8px; font-size: .85rem; background: #f2f1ec; }
.step-chip small { color: var(--muted); }
.step-chip.check { background: #e8f5ee; color: var(--ok); font-weight: 650; }
.step-row .arrow { font-size: .8rem; }
.snd { white-space: nowrap; background: #fff5d9; border-radius: 6px; padding: 0 5px; font-weight: 600; }
.levels, .start-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 6px 0 12px; }
.levels th, .levels td, .start-table th, .start-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.levels th, .start-table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.sample .box { white-space: nowrap; background: #f2f1ec; border-radius: 6px; padding: 0 5px; font-size: .9rem; }
.sample .box .right { color: var(--ok); }
.decided { margin: 6px 0 0; padding-left: 18px; }
.decided li { margin-bottom: 6px; }
.live { color: var(--accent); font-weight: 600; }
.fast { display: inline-block; background: #fbe9e2; color: var(--tried); border-radius: 999px; padding: 0 8px; font-size: .8rem; font-weight: 650; }
.checks { padding-left: 18px; margin: 6px 0 12px; }
.checks li { margin-bottom: 6px; font-size: .92rem; }
.nowrap { white-space: nowrap; }
.drawer .back { margin-bottom: 10px; }
@media (max-width: 900px) { .path-steps { grid-template-columns: 1fr; } .path-steps li + li::before { content: none; } }
@media (max-width: 560px) {
  .roster th:nth-child(5), .roster td:nth-child(5), .roster th:nth-child(6), .roster td:nth-child(6) { display: none; }
  .levels th:nth-child(4), .levels td:nth-child(4) { display: none; }
}
.test-card { border-left: 6px solid var(--accent); }
.test-points { margin: 6px 0 12px; padding-left: 20px; }
.test-points li { margin-bottom: 6px; }
#roster { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
