/* Schools Bell App - hand-rolled CSS, no build step, no framework. */

:root {
  --bg: #e3eef6;
  --card: #ffffff;
  --ink: #17181c;
  --muted: #56585e;
  --rule: #b9a8d9;          /* the lavender hairline under every heading */
  --hair: #e4e6ea;          /* neutral separators inside a card */
  --link: #12309b;
  --link-visited: #66339a;
  --field-border: #767676;
  --accent: #12309b;
  --passing: #6b3fa0;
  --lunch: #a34400;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", Times, serif;
  --ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Verdana, sans-serif;
  --mono: "DejaVu Sans Mono", "Cascadia Mono", Consolas, "Liberation Mono", "Courier New", monospace;

  --gap: 24px;              /* between cards, everywhere */
  --pad: 26px 32px;         /* inside a card, everywhere */
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 0 24px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
}

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

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

/* ---------- shell ---------- */

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--pad);
  margin: 0 0 var(--gap);
}

/* Every card heading carries the hairline. One rule, no per-page fiddling. */
.card > h1,
.card > h2 {
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.card > h1 + p,
.card > h2 + p { margin-top: 0; }

h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
}
h3 + p { margin-top: 0; }

.sub { color: var(--muted); margin-top: -6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.nowrap { white-space: nowrap; }

.site-header { padding: 24px 0 0; }
.site-header .card { padding: 13px 32px; text-align: center; }

.nav-links { font-size: 16px; }
.nav-links span { color: var(--rule); padding: 0 6px; }
.nav-links a { margin: 0 10px; }

.site-footer { margin-top: 0; }
.site-footer .card { color: var(--muted); font-size: 14px; }

/* ---------- two column card body ---------- */

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
  gap: 40px;
}
.cols-even { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px 40px; }
@media (max-width: 820px) {
  .cols, .cols-even { grid-template-columns: 1fr; gap: 24px; }
}

.stack > * + * { margin-top: 20px; }

/* ---------- form controls: native on purpose ---------- */

input[type="text"],
input[type="search"],
input[type="time"],
input[type="number"],
select,
textarea,
button,
.btn {
  font-family: var(--ui);
  font-size: 14px;
  color: var(--ink);
}

input[type="text"],
input[type="search"],
input[type="time"],
input[type="number"],
textarea {
  background: #fff;
  border: 1px solid var(--field-border);
  border-radius: 2px;
  padding: 4px 7px;
  width: 220px;
  max-width: 100%;
}
textarea { width: 100%; line-height: 1.5; font-family: var(--mono); font-size: 13px; }
select { padding: 3px 4px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .btn {
  display: inline-block;
  background: linear-gradient(#fcfcfc, #e9e9e9);
  border: 1px solid #8a8a8a;
  border-radius: 3px;
  padding: 5px 14px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.5;
}
button:hover, .btn:hover { background: linear-gradient(#ffffff, #e0e0e0); text-decoration: none; color: var(--ink); }
button:active, .btn:active { background: #e0e0e0; }
.btn:visited { color: var(--ink); }
button[aria-pressed="true"] { background: #dfe6f5; border-color: #7a8bbd; }

.btn-row { margin-top: 18px; }
.btn-row > * { margin: 0 8px 8px 0; }

/* A single labelled control on its own line. */
.field label {
  display: block;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
}
.field .tiny { display: block; margin-top: 5px; }

/* Label / control rows, aligned like a classic form. */
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 12px 20px; align-items: center; }
.fields > label { margin: 0; font-size: 16px; }
@media (max-width: 520px) {
  .fields { grid-template-columns: 1fr; gap: 6px; }
  .fields > label { margin-top: 8px; }
}

/* ---------- search ---------- */

.state-list > .btn { margin: 0 6px 6px 0; }

/* The districts of one state: a plain list, largest district first, with
   the school count on the right. */
.district-list { list-style: none; margin: 0; padding: 0; }
.district-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--hair);
}
.district-list li:first-child { border-top: 0; }
.district-list li[hidden] { display: none; }
.district-list li a { font-weight: 600; }
.district-list .count { color: var(--muted); font-size: 13px; white-space: nowrap; }
/* A district we have not reached yet: listed so the gap is visible, but dimmed. */
.district-list li.district-empty a { font-weight: 400; color: var(--muted); }
.district-list li.district-empty .count { font-style: italic; }
.state-list .count { color: var(--muted); font-size: 12px; margin-left: 4px; }
.btn[aria-current="page"] { background: #dfe6f5; border-color: #7a8bbd; font-weight: 700; }
.btn[aria-current="page"] .count { color: #45527a; }

/* The district finder: a search box, a Find button and an optional Clear,
   sitting on one line until the viewport is too narrow for it. */
.district-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.district-tools input[type="search"] {
  flex: 1 1 240px; min-width: 0; font-size: 15px; padding: 6px 9px;
}

/* The current sort, marked without turning the link into a button. */
.district-tools ~ p a[aria-current="true"] { font-weight: 700; text-decoration: none; }

/* A button that has to read as a link, for the JavaScript-only reset. */
.linkish {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--link, #2b4a9b); text-decoration: underline; cursor: pointer;
}

.searchbox { position: relative; max-width: 460px; }
.searchbox input { width: 100%; font-size: 15px; padding: 6px 9px; }

.suggestions {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 2px);
  background: #fff;
  border: 1px solid #999;
  z-index: 30;
  text-align: left;
}
.suggestions a {
  display: block;
  padding: 7px 10px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
}
.suggestions a:last-child { border-bottom: 0; }
.suggestions a:hover, .suggestions a.is-active { background: #eef2fb; }
.suggestions .sub { color: var(--muted); font-size: 13px; margin: 0; }

.school-list { list-style: none; padding: 0; margin: 0; }
.school-list li { border-bottom: 1px solid var(--hair); }
.school-list li:last-child { border-bottom: 0; }
.school-list a { display: block; padding: 10px 0; text-decoration: none; }
.school-list a:hover .name { text-decoration: underline; }
.school-list .name { color: var(--link); font-weight: 700; }
.school-list .where { color: var(--muted); font-size: 14px; }
/* The initials a school answers to, shown beside its name so a search for
   "BNHS" visibly explains why each row is in the list. */
.school-list .abbr {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid var(--hair);
    border-radius: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    vertical-align: 2px;
}

.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { padding: 7px 0; border-bottom: 1px solid var(--hair); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list .meta { color: var(--muted); font-size: 13px; }

/* ---------- recently updated: one card per school ---------- */

/* Every tile is cropped to the same shape from the top, so the school name
   and first periods always show and the row lines up whatever the schedule. */
.recent-grid {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.recent-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.recent-card a:hover,
.recent-card a:focus-visible {
  border-color: var(--rule);
  box-shadow: 0 6px 18px rgba(23, 24, 28, .10);
  transform: translateY(-2px);
}
.recent-card a:hover .name { text-decoration: underline; }
.recent-thumb {
  display: block;
  aspect-ratio: 15 / 8;
  background: #f4f6f9;
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
}
.recent-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.recent-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px 14px;
  flex: 1;
}
.recent-body .name { color: var(--link); font-weight: 700; line-height: 1.3; }
.recent-body .where { color: var(--muted); font-size: 13px; line-height: 1.4; }
.recent-now {
  margin-top: 6px;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.recent-now .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: #9ea4b0;
}
.recent-now.is-in .dot { background: #1a7f4b; }
.recent-now.is-passing .dot { background: var(--passing); }
.recent-now.is-lunch .dot { background: var(--lunch); }
.recent-now.is-off { color: var(--muted); }
.recent-updated {
  margin-top: auto;
  padding-top: 6px;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 12px;
}

/* ---------- homepage: live counter, prompt, special list ---------- */

.live-count {
  margin: 12px 0 0;
  font-family: var(--ui);
  font-size: 14px;
}
.live-count .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #1a7f4b;
  margin-right: 6px;
  vertical-align: 1px;
  animation: msb-pulse 2.4s ease-in-out infinite;
}
@keyframes msb-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-count .dot { animation: none; } }

.pick-prompt {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--rule);
  background: #f6f3fb;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
}

.my-school-card { border-top: 4px solid var(--accent); }

.special-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 24px;
}
.special-list li { border-bottom: 1px solid var(--hair); padding: 8px 0; }
.special-list a { text-decoration: none; display: block; }
.special-list a:hover .name { text-decoration: underline; }
.special-list .name { color: var(--link); font-weight: 700; display: block; line-height: 1.3; }
.special-list .meta { color: var(--muted); font-size: 13px; font-family: var(--ui); }
.special-list .tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--passing);
}
.special-list .tag.early { background: var(--lunch); }
.special-list .tag.late { background: var(--accent); }

/* ---------- homepage: states, abbreviations, districts ---------- */

.state-grid {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.state-grid a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 14px;
  transition: border-color .15s ease, background .15s ease;
}
.state-grid a:hover { border-color: var(--rule); background: #f6f3fb; }
.state-grid .state-abbr {
  flex: none;
  width: 30px;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}
.state-grid .state-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-grid .state-count { color: var(--muted); font-size: 12px; }

.home-pair { gap: 0 var(--gap); }
.home-pair > .card { margin-bottom: var(--gap); }

.chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  display: inline-block;
  padding: 4px 11px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
}
.chips a:hover { border-color: var(--rule); background: #f6f3fb; }
.chips .count { color: var(--muted); font-weight: 400; margin-left: 2px; }

.faq details { border-bottom: 1px solid var(--hair); padding: 10px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.faq summary:hover { color: var(--link); }
.faq details p { margin: 8px 0 0; }

/* ---------- the live dashboard ---------- */

.dash { margin: 0; }

.dash-status {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.dash-status .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #1a7f4b;
  margin-right: 7px;
  vertical-align: 1px;
}

.dash-now {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin: 6px 0 0;
}
.dash-room {
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 10px;
  white-space: nowrap;
}

.countdown {
  font-family: var(--mono);
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin: 10px 0 0;
}
.countdown small {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 12px;
}

.timebar {
  height: 10px;
  background: #f0f1f4;
  border: 1px solid #d6d8dd;
  border-radius: 2px;
  overflow: hidden;
  margin: 16px 0 8px;
}
.timebar > i { display: block; height: 100%; background: var(--accent); transition: width .5s linear; }

.dash-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--hair);
  margin-top: 18px;
}
.dash-facts .fact { padding: 14px 20px; border-left: 1px solid var(--hair); }
.dash-facts .fact:first-child { padding-left: 0; border-left: 0; }
.fact .k {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact .v { font-size: 17px; font-weight: 700; margin-top: 3px; }
.fact .s { font-size: 14px; color: var(--muted); }
@media (max-width: 620px) {
  .dash-facts { grid-template-columns: 1fr; }
  .dash-facts .fact { padding: 12px 0; border-left: 0; border-top: 1px solid var(--hair); }
  .dash-facts .fact:first-child { border-top: 0; }
}

.is-passing .countdown { color: var(--passing); }
.is-passing .timebar > i { background: var(--passing); }
.is-lunch .countdown { color: var(--lunch); }
.is-lunch .timebar > i { background: var(--lunch); }
.is-off .countdown { color: var(--muted); }

/* ---------- schedule tabs + table ---------- */

/* The schedule tabs and lunch picker sit with the table they control, not
   at the top of the page away from it. */
.selectors {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: #f7f8fb;
  border: 1px solid var(--hair);
  border-radius: 8px;
}
.selectors .tabs { margin: 0; }
.selectors .tabs + .lunch-pick { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hair); }
.selectors .lunch-pick { margin: 0; }

.tabs { margin: 0 0 18px; }
.tabs > * { margin: 0 6px 6px 0; }
.tab {
  font-family: var(--ui);
  font-size: 13px;
  padding: 4px 11px;
}
.tab[aria-selected="true"] {
  background: #dfe6f5;
  border-color: #7a8bbd;
  font-weight: 700;
}

.lunch-pick { font-family: var(--ui); font-size: 13px; color: var(--muted); }
.lunch-pick label { display: inline; margin: 0 6px 0 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.lunch-pick select { margin-right: 10px; }
.tabs .lunch-pick { display: inline-block; margin-left: 6px; }

.table-scroll { overflow-x: auto; }
table.sched { width: 100%; border-collapse: collapse; font-size: 15px; }
table.sched th, table.sched td { padding: 8px 14px 8px 0; text-align: left; }
table.sched th:last-child, table.sched td:last-child { padding-right: 0; }
table.sched th {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 7px;
}
table.sched td { border-bottom: 1px solid var(--hair); }
table.sched td.time,
table.sched td.until { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.sched td.until { text-align: right; color: var(--muted); padding-right: 0; }

/* Each row is tinted with its own period colour, set inline as --pc. The wash
   is faint enough to read black text over, the rule on the left is not. */
table.sched tbody tr { background: color-mix(in srgb, var(--pc, #ffffff) 7%, #ffffff); }
table.sched th:first-child { padding-left: 16px; }
table.sched td.period {
  border-left: 4px solid var(--pc, transparent);
  padding-left: 12px;
  font-weight: 600;
}

table.sched tr.now { background: color-mix(in srgb, var(--pc, #ffffff) 22%, #ffffff); }
table.sched tr.now td { font-weight: 700; }
table.sched tr.done { opacity: .5; }

/* Length as a bar, so the shape of the day is readable at a glance. */
table.sched td.len { white-space: nowrap; }
table.sched td.len .bar {
  display: inline-block;
  width: 68px;
  height: 8px;
  background: #eceef2;
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 9px;
}
table.sched td.len .bar > i { display: block; height: 100%; background: var(--pc, #9aa0aa); border-radius: 2px; }
table.sched td.len .len-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.badge {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  white-space: nowrap;
}

/* ---------- school header ---------- */

.school-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.school-head h1 {
  font-size: 23px;
  line-height: 1.25;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
}
.school-abbr {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 5px;
}
.school-abbr strong {
  font-weight: 600;
  letter-spacing: .02em;
}
.school-logo {
  flex: none;
  width: 68px;
  height: 68px;
  object-fit: contain;
  object-position: center;
}
@media (max-width: 520px) {
  .school-logo { width: 52px; height: 52px; }
  .school-head { gap: 14px; }
}

/* ---------- downloadable schedule card ---------- */

.dl-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
}
.dl-group { width: 210px; }
.dl-group-wide { width: 250px; }
.dl-desc { margin: 7px 0 0; line-height: 1.45; }

/* A source document we cannot preview - a PDF, with no rasteriser to hand. */
.dl-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 130px;
  background: var(--surface-2, #f0f2f5);
  color: #9aa0aa;
  font: 700 22px/1 var(--ui);
  letter-spacing: .1em;
}
.dl-alt { margin: 6px 0 0; text-align: center; }
.dl-alt a { margin: 0 5px; }
.dl-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-tile {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid var(--hair);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}
.dl-tile:visited { color: var(--ink); }
.dl-tile:hover { border-color: var(--accent); text-decoration: none; }
.dl-tile img { display: block; width: 100%; height: auto; }

.dl-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 11px;
  border-top: 1px solid var(--hair);
  font-family: var(--ui);
  font-size: 13px;
}
.dl-tile:hover .dl-meta strong { color: var(--accent); }

/* The folded red corner that marks the PDF. */
.dl-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 44px solid #c1121f;
  border-right: 44px solid transparent;
  z-index: 1;
}
.dl-corner span {
  position: absolute;
  top: -38px;
  left: 2px;
  width: 34px;
  color: #fff;
  font: 700 10px/1 var(--ui);
  letter-spacing: .04em;
  text-align: center;
  transform: rotate(-45deg);
}

@media (max-width: 520px) {
  .dl-group, .dl-group-wide, .dl-tile { width: 100%; }
}

/* ---------- card preview ----------
   Opened by public/js/card-preview.js when a download tile is tapped, so you
   see the card before a file lands in your downloads folder. */

.cardview-open, .cardview-open body { overflow: hidden; }

.cardview {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cardview[hidden] { display: none; }

.cardview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 24, .62);
}

.cardview-box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: 100%;
  background: #fff;
  border: 1px solid var(--hair);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}

.cardview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hair);
}
.cardview-head h3 { margin: 0; font-family: var(--ui); font-size: 15px; }

.cardview-x {
  flex: none;
  background: none;
  border: 0;
  padding: 0 4px;
  font-size: 24px;
  line-height: 1;
  color: #7a7f88;
}
.cardview-x:hover { background: none; color: var(--ink); }

.cardview-body {
  overflow: auto;
  padding: 14px;
  background: var(--surface-2, #f0f2f5);
  text-align: center;
}
.cardview-body img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--hair);
  background: #fff;
}

.cardview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 11px 14px;
  border-top: 1px solid var(--hair);
}
.cardview-alt a { margin-right: 8px; }

@media (max-width: 520px) {
  .cardview { padding: 0; }
  .cardview-box { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; }
}

/* ---------- customize panel ---------- */

.custom-grid { display: grid; grid-template-columns: 190px 1fr 130px; gap: 10px 16px; align-items: center; }
.custom-grid > .h {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.custom-grid input { width: 100%; }
@media (max-width: 620px) {
  .custom-grid { grid-template-columns: 1fr; gap: 5px; }
  .custom-grid > .h { display: none; }
  .custom-grid .lbl { margin-top: 12px; font-weight: 700; }
}

/* ---------- visualizer timeline ---------- */

.timeline { padding-left: 78px; }
.tl-item { position: relative; padding-bottom: 5px; }
.tl-time {
  position: absolute; left: -78px; width: 68px;
  text-align: right;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  padding-top: 9px;
}
.tl-block {
  border-radius: 3px;
  padding: 8px 12px;
  color: #fff;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.tl-gap {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0 4px 12px;
  margin-left: 12px;
  border-left: 2px dotted #c3c6cc;
}

/* ---------- full screen classroom display ---------- */

body.live { background: #0b0d12; color: #f2f4f8; padding: 0; }
body.live main.wrap { max-width: none; padding: 0; }
body.live .live-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 40px; }
body.live .card { background: transparent; padding: 0; margin: 0; }
body.live a { color: #9fc0ff; }
body.live a:visited { color: #9fc0ff; }
body.live .live-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 24px; }
body.live .live-head .name { font-size: 26px; font-weight: 700; margin: 0; line-height: 1.2; }
body.live .dash-now { font-size: clamp(30px, 6vw, 58px); }
body.live .countdown { font-size: clamp(80px, 21vw, 210px); }
body.live .countdown small { color: #9ea4b0; font-size: clamp(16px, 2vw, 26px); }
body.live .timebar { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); height: 12px; }
body.live .timebar > i { background: #6f9dff; }
body.live .dash-facts { border-color: rgba(255, 255, 255, .16); }
body.live .dash-facts .fact { border-color: rgba(255, 255, 255, .16); }
body.live .fact .k, body.live .fact .s, body.live .dash-status { color: #9ea4b0; }

/* ---------- print ---------- */

/* A group page stands for a set of schools; the set is the point of the page,
   so it reads as a list of links rather than a sentence naming seventy of them.
   Columns so a long set stays scannable, and each name keeps its town beside
   it because several districts repeat a name across towns. */
.group-members {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  columns: 2;
  column-gap: 28px;
}
.group-members li {
  break-inside: avoid;
  padding: 5px 0;
  border-bottom: 1px solid rgba(128, 128, 128, .18);
}
.group-members a { font-weight: 600; }
.group-members .tiny { display: block; }
@media (max-width: 640px) {
  .group-members { columns: 1; }
}

.group-heading {
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(128, 128, 128, .22);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.group-heading:first-of-type { border-top: 0; padding-top: 0; }

/* "At a glance" facts: label left, value right, wrapping to one column on phones. */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 15px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
@media (max-width: 520px) { dl.facts { grid-template-columns: 1fr; gap: 2px; } dl.facts dd { margin-bottom: 8px; } }

@media print {
  body { background: #fff; padding: 0; }
  table.sched { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dl-tiles { display: none; }
  .cardview { display: none !important; }
  .site-header, .site-footer, .no-print { display: none !important; }
  .card { margin: 0 0 18px; padding: 0; }
  .card > h1, .card > h2 { border-color: #999; }
  a { color: #000; text-decoration: none; }
}
