/* DIBELS Running Log — Bauhaus edition
   Palette: coolors.co/0f6bb1-137c78-21bbb3-7dc576-f59778-faa434 · Type: Outfit */
:root {
  --blue: #0f6bb1;
  --blue-dark: #0b5590;
  --teal-dark: #137c78;
  --teal: #21bbb3;
  --green: #7dc576;
  --coral: #f59778;
  --orange: #faa434;

  --ink: #1a1f24;
  --ink-soft: #3f4a53;
  --muted: #6b747b;
  --paper: #f6f2ea;       /* warm Bauhaus paper */
  --paper-deep: #ece5d8;
  --line: #ddd5c6;
  --surface: #ffffff;
  --calc-bg: #e3f5f3;

  /* Benchmark levels (DIBELS blue / green / yellow / red, mapped to the palette) */
  --lvl-above-bg: var(--blue);      --lvl-above-fg: #fff;
  --lvl-at-bg: var(--green);        --lvl-at-fg: #173b14;
  --lvl-below-bg: var(--orange);    --lvl-below-fg: #4a2d00;
  --lvl-well-bg: var(--coral);      --lvl-well-fg: #5a1b07;

  --radius: 4px;
  --hard: 5px 5px 0 var(--ink);
  --stripe: linear-gradient(90deg,
    var(--blue) 0 22%, var(--teal) 22% 40%, var(--green) 40% 58%, var(--orange) 58% 80%, var(--coral) 80% 100%);
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 800; margin: 0; letter-spacing: -.02em; line-height: 1.05; }
h1 { font-size: 2.4rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .18em; font-size: .74rem; font-weight: 700; color: var(--teal-dark);
}
.eyebrow::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }

/* ---------- Buttons & inputs ---------- */
.btn {
  font: 700 .95rem var(--font);
  letter-spacing: .01em;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: .6rem 1.1rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s var(--ease-pop), box-shadow .12s, background .15s;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); }
.btn-block { width: 100%; }
.btn-assess { background: var(--orange); color: var(--ink); padding: .45rem 1rem; font-size: .88rem; }
.btn-assess:hover:not(:disabled) { background: #ffb24d; }

input, select {
  font: 500 1rem var(--font);
  color: inherit;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: .65rem .8rem;
  background: var(--surface);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:hover { border-color: #c7bda9; }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 4px 4px 0 var(--teal); }
button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.form-error { color: #b13a17; font-size: .9rem; font-weight: 500; min-height: 1.3em; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--orange) 26%, transparent) 0 90px, transparent 91px),
    radial-gradient(circle at 6% 94%, color-mix(in srgb, var(--teal) 22%, transparent) 0 140px, transparent 141px),
    var(--paper);
}
.login-card {
  width: min(900px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  animation: card-in .6s var(--ease-pop) both;
}
.login-body { padding: 40px 40px 36px; display: grid; gap: .7rem; align-content: center; }
.login-logo { display: block; width: min(250px, 80%); height: auto; margin: 0 0 22px; }
.login-card h1 { font-size: 2.6rem; }
.login-card form { display: grid; gap: 1rem; margin-top: 1rem; }

/* Bauhaus poster: a 3×4 grid of tiles, each holding one geometric shape */
.login-art {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  border-right: 2px solid var(--ink);
  min-height: 460px;
  background: var(--ink);
  gap: 2px;
}
.t { position: relative; overflow: hidden; background: var(--bg, var(--paper)); }
.t::before { content: ''; position: absolute; background: var(--fg, var(--blue)); transition: transform 1s var(--ease-pop); animation: shape-in .7s var(--ease-pop) both; animation-delay: calc(var(--d, 0) * 70ms + 150ms); }
.t.circle::before  { inset: 16%; border-radius: 50%; }
.t.pip::before     { inset: 34%; border-radius: 50%; }
.t.half::before    { left: 8%; right: 8%; top: 50%; bottom: -42%; border-radius: 50% 50% 0 0; }
.t.half-l::before  { top: 8%; bottom: 8%; left: 50%; right: -42%; border-radius: 50% 0 0 50%; transform-origin: left; }
.t.quarter::before { inset: 0 0 -100% -100%; border-radius: 50%; }
.t.quarter-tl::before { inset: -100% -100% 0 0; border-radius: 50%; }
.t.tri::before     { inset: 14%; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.t.square::before  { inset: 18%; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.t.lines::before   { inset: 0; background: repeating-linear-gradient(90deg, var(--fg) 0 6px, transparent 6px 16px); }
.login-art:hover .t.quarter::before, .login-art:hover .t.quarter-tl::before { transform: rotate(90deg); }
.login-art:hover .t.circle::before { transform: scale(.8); }
.login-art:hover .t.tri::before { transform: rotate(180deg); }

@keyframes shape-in { from { opacity: 0; scale: .3; rotate: -30deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px) 18px;
  background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--stripe); }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { height: 40px; width: auto; flex: none; }
.brand-text { min-width: 0; padding-left: 14px; border-left: 2px solid var(--ink); }
.brand-title { font-weight: 800; font-size: 1.15rem; line-height: 1.1; letter-spacing: -.01em; }
.brand-sub { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.teacher-name { font-weight: 600; color: var(--ink-soft); }

/* ---------- Page ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 40px) 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); display: flex; align-items: center; gap: 14px; }
.shapes { display: inline-flex; align-items: flex-end; gap: 4px; }
.shapes i { display: block; width: 18px; height: 18px; }
.shapes i:nth-child(1) { background: var(--blue); border-radius: 50%; }
.shapes i:nth-child(2) { background: var(--orange); }
.shapes i:nth-child(3) { background: var(--teal); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.page-head #roster-summary { margin-top: 6px; font-weight: 500; }
.page-tools { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.page-tools input[type=search] { width: 240px; }

.legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 24px 0 14px; }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  border-radius: 2px; padding: .2rem .6rem; white-space: nowrap;
  background: var(--paper-deep); color: var(--ink-soft);
}
.lvl-ABOVE { background: var(--lvl-above-bg); color: var(--lvl-above-fg); }
.lvl-AT { background: var(--lvl-at-bg); color: var(--lvl-at-fg); }
.lvl-BELOW { background: var(--lvl-below-bg); color: var(--lvl-below-fg); }
.lvl-WELL_BELOW { background: var(--lvl-well-bg); color: var(--lvl-well-fg); }

/* ---------- Roster ---------- */
.roster { display: grid; gap: 12px; }
.student {
  --accent: var(--blue); --accent-ink: #fff;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: transform .15s var(--ease-pop), box-shadow .15s;
}
.student:hover, .student:focus-within { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.roster.intro .student { animation: rise .45s var(--ease-pop) both; animation-delay: calc(min(var(--i, 0), 14) * 35ms); }
@keyframes rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

.c0 { --accent: var(--blue); --accent-ink: #fff; }
.c1 { --accent: var(--teal-dark); --accent-ink: #fff; }
.c2 { --accent: var(--teal); --accent-ink: var(--ink); }
.c3 { --accent: var(--green); --accent-ink: var(--ink); }
.c4 { --accent: var(--coral); --accent-ink: var(--ink); }
.c5 { --accent: var(--orange); --accent-ink: var(--ink); }

.avatar {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1rem; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent);
  transition: border-radius .35s var(--ease-pop), transform .35s var(--ease-pop);
}
.s0 { border-radius: 50%; }
.s1 { border-radius: 2px; }
.s2 { border-radius: 24px 24px 2px 2px; }
.s3 { border-radius: 24px 2px 24px 2px; }
.s4 { border-radius: 2px 48px 2px 2px; }
.student:hover .avatar { transform: rotate(-8deg) scale(1.06); }

.student-name { font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.student-meta { color: var(--muted); font-size: .85rem; }
.season-dots { display: flex; gap: 5px; }
.dot {
  width: 38px; height: 26px; border-radius: 2px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; display: grid; place-items: center;
  background: var(--paper); color: #a59c8c; border: 1.5px dashed var(--line);
}
.dot[class*=lvl-] { border: 0; }
.latest { text-align: right; min-width: 118px; }
.latest-score { font-weight: 800; font-size: 1.6rem; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.latest-label { font-size: .75rem; color: var(--muted); font-weight: 500; }
.student .btn-assess { opacity: 0; transform: translateX(6px); transition: opacity .15s, transform .2s var(--ease-pop), box-shadow .12s, background .15s; }
.student:hover .btn-assess, .student:focus-within .btn-assess { opacity: 1; transform: none; }
.student:hover .btn-assess:hover:not(:disabled) { transform: translate(-1px, -1px); }
.student:hover .btn-assess:active:not(:disabled) { transform: translate(3px, 3px); }
@media (hover: none) { .student .btn-assess { opacity: 1; transform: none; } }
.student .btn-assess:disabled, .student:hover .btn-assess:disabled { opacity: .35; }
.empty { text-align: center; color: var(--muted); padding: 56px 16px; font-weight: 500; }

@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Trials table ---------- */
.trials { width: 100%; border-collapse: collapse; font-size: .9rem; }
.trials th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--ink);
}
.trials td { white-space: nowrap; padding: 8px; border-bottom: 1px solid var(--paper-deep); vertical-align: middle; }
.trials tr:last-child td { border-bottom: 0; }
.trials .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.trials .cell { display: flex; align-items: center; gap: 6px; }
.dot.lvl-ABOVE { background: var(--lvl-above-bg); color: var(--lvl-above-fg); }
.dot.lvl-AT { background: var(--lvl-at-bg); color: var(--lvl-at-fg); }
.dot.lvl-BELOW { background: var(--lvl-below-bg); color: var(--lvl-below-fg); }
.dot.lvl-WELL_BELOW { background: var(--lvl-well-bg); color: var(--lvl-well-fg); }
.lvl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line); }
.lvl-dot.lvl-ABOVE { background: var(--lvl-above-bg); }
.lvl-dot.lvl-AT { background: var(--lvl-at-bg); }
.lvl-dot.lvl-BELOW { background: var(--lvl-below-bg); }
.lvl-dot.lvl-WELL_BELOW { background: var(--lvl-well-bg); }
.no-trials { color: var(--muted); font-size: .9rem; padding: 12px 0; }

/* ---------- Assess dialog ---------- */
.assess {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 2px solid var(--ink); border-radius: 0; padding: 0;
  box-shadow: 12px 12px 0 var(--ink);
  color: var(--ink);
  background: var(--surface);
}
.assess[open] { animation: dialog-in .35s var(--ease-pop) both; }
.assess::before { content: ''; display: block; height: 10px; background: var(--stripe); }
.assess::backdrop { background: rgba(26, 31, 36, .5); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.assess form { padding: 26px clamp(18px, 3vw, 36px) 26px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.assess form > * { min-width: 0; }
.assess-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.assess-head h2 { font-size: 2.3rem; }
.assess-meta { color: var(--muted); font-weight: 500; margin-top: 6px; }
.icon-btn {
  border: 2px solid var(--ink); background: var(--surface); width: 42px; height: 42px; border-radius: 50%;
  font: 500 1.5rem/1 var(--font); cursor: pointer; color: var(--ink); flex: none;
  transition: transform .25s var(--ease-pop), background .15s;
}
.icon-btn:hover { background: var(--coral); transform: rotate(90deg); }

.windows { border: 0; padding: 0; margin: 0; }
.windows legend { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft); margin-bottom: .55rem; padding: 0; }
.segmented { display: inline-flex; max-width: 100%; gap: 8px; flex-wrap: wrap; }
.segmented label { display: block; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: .55rem 1rem; cursor: pointer;
  font-weight: 600; color: var(--ink-soft); font-size: .95rem;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: transform .15s var(--ease-pop), box-shadow .15s, background .15s, border-color .15s;
}
.segmented span:hover { border-color: var(--ink); }
.segmented input:checked + span { background: var(--blue); color: #fff; border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.segmented input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.segmented .open-now { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; background: var(--green); color: var(--ink); border-radius: 2px; }

.score-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.score-field { display: grid; gap: 8px; align-content: start; }
.score-field label { font-size: .85rem; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.score-field input, .calc-value {
  height: 76px;
  font: 700 2rem var(--font);
  letter-spacing: -.02em;
  text-align: center;
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}
.score-field input { border: 2px solid var(--ink); }
.score-field input:focus { box-shadow: 5px 5px 0 var(--teal); }
.calc-value {
  display: grid; place-items: center;
  background: var(--calc-bg);
  border: 2px dashed var(--teal-dark);
  color: var(--teal-dark);
  transition: background .2s;
}
.calc-value.bump { animation: bump .35s var(--ease-pop); }
@keyframes bump { 40% { transform: scale(1.06); background: #c9eee9; } }
.auto {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: #fff; background: var(--teal-dark); padding: 1px 6px; border-radius: 2px;
}
.chip {
  justify-self: center; font-size: .74rem; font-weight: 700; border-radius: 2px;
  padding: .2rem .6rem; min-height: 1.55rem; text-align: center;
  animation: pop-in .25s var(--ease-pop);
}
.chip:empty, .chip-empty { visibility: hidden; }

.assess-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.assess-actions .form-error { flex: 1; min-height: 0; }
.assess-actions .btn { padding: .8rem 2.2rem; font-size: 1.05rem; }

.history { border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; background: var(--paper); }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.history-head h3 { font-size: 1.3rem; font-weight: 700; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  font: 600 .82rem var(--font); border: 2px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: .3rem .75rem; cursor: pointer; color: var(--ink-soft);
}
.tabs button:hover { border-color: var(--ink); }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.history-scroll { overflow-x: auto; }


/* ---------- View switch ---------- */
.view-switch { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface); box-shadow: 3px 3px 0 var(--ink); margin-bottom: 22px; }
.view-switch button {
  font: 700 .9rem var(--font); border: 0; background: transparent; color: var(--ink-soft);
  padding: .5rem 1.1rem; cursor: pointer; transition: background .15s, color .15s;
}
.view-switch button + button { border-left: 2px solid var(--ink); }
.view-switch button:hover { background: var(--paper); }
.view-switch button[aria-selected=true] { background: var(--ink); color: #fff; }

/* ---------- Class overview ---------- */
.ov-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 18px; }
.tabs .open-now { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 1px 5px; margin-left: 6px; background: var(--green); color: var(--ink); border-radius: 2px; vertical-align: 1px; }
.ov-tabs button { font-size: .9rem; padding: .45rem .9rem; }
.btn-sm { padding: .4rem .85rem; font-size: .85rem; box-shadow: 2px 2px 0 var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.stat-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value .of { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.stat-sub { font-size: .82rem; color: var(--ink-soft); }
.meter { height: 6px; background: var(--paper-deep); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: var(--teal-dark); border-radius: 3px; }

.dists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.dist { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.dist-main { grid-column: 1 / -1; }
.dist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dist-head h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.dist-main .dist-head h3 { font-size: 1.3rem; }

/* 100% stacked bar: the whole class, 2px gaps between segments */
.stack { display: flex; gap: 2px; height: 30px; }
.dist-main .stack { height: 44px; }
.seg {
  min-width: 22px; display: grid; place-items: center; border: 0; padding: 0; border-radius: 2px;
  font: 700 .8rem var(--font); font-variant-numeric: tabular-nums;
  transition: transform .15s var(--ease-pop), box-shadow .15s, opacity .15s;
}
.seg:first-child { border-radius: 4px 2px 2px 4px; }
.seg:last-child { border-radius: 2px 4px 4px 2px; }
.seg:only-child { border-radius: 4px; }
button.seg { cursor: pointer; }
button.seg:hover { transform: translateY(-2px); box-shadow: 0 3px 0 var(--ink); }
.seg.active { box-shadow: inset 0 0 0 3px var(--ink); }
.stack:has(.seg.active) .seg:not(.active):not(.seg-missing) { opacity: .45; }
.seg-missing { background: repeating-linear-gradient(135deg, var(--paper) 0 5px, var(--paper-deep) 5px 10px); color: var(--muted); outline: 1.5px dashed var(--line); outline-offset: -1.5px; }
.empty-stack { background: var(--paper); border-radius: 4px; }

.dist-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .82rem; color: var(--ink-soft); }
.dist-legend li { display: inline-flex; align-items: center; gap: 6px; }
.dist-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sw { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.sw-missing { background: repeating-linear-gradient(135deg, var(--paper) 0 3px, var(--paper-deep) 3px 6px); outline: 1px dashed #b9ae9b; }

.dist-year { margin-bottom: 14px; }
.year-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 14px; }
.year-label { display: grid; line-height: 1.2; }

.ov-table-wrap { background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; }
.ov-table-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ov-table-head h3 { font-size: 1.3rem; font-weight: 700; }
.ov-table th button {
  font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; gap: 4px; align-items: center;
}
.ov-table th button:hover { color: var(--ink); }
.ov-table th[aria-sort=ascending], .ov-table th[aria-sort=descending] { color: var(--ink); }
.ov-table .arrow { font-size: .6rem; }
.ov-table tbody tr { cursor: pointer; transition: background .12s; }
.ov-table tbody tr:hover, .ov-table tbody tr:focus-visible { background: var(--paper); outline: none; }
.ov-table tbody tr:focus-visible { box-shadow: inset 3px 0 0 var(--teal); }
.ov-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.mini-avatar { width: 26px; height: 26px; display: grid; place-items: center; font-size: .66rem; font-weight: 800; background: var(--accent); color: var(--accent-ink); flex: none; }
.mini-avatar.s2 { border-radius: 13px 13px 2px 2px; }
.mini-avatar.s3 { border-radius: 13px 2px 13px 2px; }
.mini-avatar.s4 { border-radius: 2px 26px 2px 2px; }
.score {
  display: inline-block; min-width: 52px; text-align: center; padding: .22rem .5rem; border-radius: 2px;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.score-none { background: transparent; color: #b3a995; }
.not-assessed { color: var(--muted); font-style: italic; }
.count { margin-left: 6px; font-size: .72rem; font-weight: 700; color: var(--teal-dark); background: var(--calc-bg); padding: 1px 5px; border-radius: 2px; }
.change { font-weight: 700; }
.change.up { color: var(--teal-dark); }
.change.down { color: #b13a17; }
.filter-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; font-weight: 500; padding: 8px 10px; background: var(--paper); border-radius: var(--radius); margin: 4px 0 8px; }
.link-btn { font: 700 .85rem var(--font); background: none; border: 0; color: var(--blue); cursor: pointer; text-decoration: underline; padding: 0; margin-left: auto; }

.tip {
  position: fixed; z-index: 70; pointer-events: none; max-width: 260px;
  background: var(--ink); color: #fff; font-size: .8rem; font-weight: 500; padding: .35rem .6rem; border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--teal);
}

/* ---------- Toast + celebration ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; padding: .8rem 1.2rem .8rem 1rem; border-radius: var(--radius);
  font-weight: 600; box-shadow: 5px 5px 0 var(--orange);
  animation: toast-in .4s var(--ease-pop) both;
}
.toast::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--green); flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
.confetti { position: fixed; z-index: 60; pointer-events: none; width: 14px; height: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dists { grid-template-columns: minmax(0, 1fr); }
  .year-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .score-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-field.calc:last-child { grid-column: 1 / -1; }
  .student { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .season-dots { display: none; }
  .latest { display: none; }
}
@media (max-width: 720px) {
  .login-card { grid-template-columns: minmax(0, 1fr); box-shadow: 6px 6px 0 var(--ink); }
  .login-art { grid-template-columns: repeat(6, 1fr); grid-template-rows: 64px; min-height: 0; border-right: 0; border-bottom: 2px solid var(--ink); }
  .login-art .t:nth-child(n+7) { display: none; }
  .login-body { padding: 28px 22px 26px; }
  .login-card h1 { font-size: 2.1rem; }
}
@media (max-width: 560px) {
  .brand-logo { height: 32px; }
  .brand-text { display: none; }
  .teacher-name { display: none; }
  .page-tools, .page-tools input[type=search] { width: 100%; }
  .assess-head h2 { font-size: 1.7rem; }
  .assess-actions { flex-direction: column; align-items: stretch; }
  .assess { box-shadow: 6px 6px 0 var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
