/* Base layout and components. Source: docs/design.md §5–8. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.5;
}

h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.25; }
a { color: var(--blue-900); }

:focus-visible { outline: 2px solid var(--blue-900); outline-offset: 2px; }

.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); font-size: var(--text-secondary); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header (§6.1) */
.site-header {
  background: var(--blue-900);
  color: #FFFFFF;
  min-height: var(--header-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-8);
}
.site-header :focus-visible { outline-color: var(--gold-500); }
.wordmark {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-weight: 700; font-size: 20px; color: #FFFFFF; text-decoration: none;
}
.wordmark img { display: block; height: 24px; width: auto; }
.wordmark span { color: var(--gold-500); }
.menu-button {
  display: none; align-items: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control);
  background: var(--blue-700); color: #FFFFFF; font: inherit; font-weight: 600; cursor: pointer;
}

/* Sidebar (§6.1, §7.9) */
.shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--header-height)); }
.shell > .page { flex: 1 1 auto; min-width: 0; }
.has-sidebar .shell > .page { margin: 0; }
.sidebar {
  flex: 0 0 264px; background: var(--surface); border-right: 1px solid var(--border);
  padding: var(--space-4) var(--space-3); font-size: 14px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
  min-height: 36px; padding: var(--space-1) var(--space-3); border-radius: var(--radius-control);
  color: var(--text); text-decoration: none; font-weight: 500;
}
.sidebar a:hover { background: var(--blue-50); color: var(--blue-900); }
.sidebar a[aria-current="page"] { background: var(--blue-100); color: var(--blue-900); font-weight: 600; }
.sidebar-top { margin-bottom: var(--space-2); }
.sidebar-section { margin-top: var(--space-2); }
.sidebar-section summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
  min-height: 36px; padding: var(--space-1) var(--space-3); border-radius: var(--radius-control);
  cursor: pointer; list-style: none;
  font-size: var(--text-small); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
}
.sidebar-section summary::-webkit-details-marker { display: none; }
.sidebar-section summary::after { content: "▸"; margin-left: auto; font-size: 10px; }
.sidebar-section[open] summary::after { content: "▾"; }
.sidebar-section[open] summary .count--section { display: none; }
.count {
  display: inline-block; min-width: 1.5em; padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--gold-100); color: var(--gold-text);
  font-size: var(--text-small); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
  text-transform: none; letter-spacing: 0;
}
.menu-button .count { background: var(--gold-500); color: var(--ink); }
.count--urgent { background: var(--danger-100); color: var(--danger-text); }
.breadcrumb { font-size: var(--text-secondary); color: var(--text-muted); margin-bottom: var(--space-1); }

@media (max-width: 899px) {
  .has-sidebar .menu-button { display: inline-flex; margin-left: auto; }
  .has-sidebar .site-user { display: none; }
  .shell { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .js .sidebar:not(.is-open) { display: none; }
  .breadcrumb { display: none; }
}
.site-user { margin-left: auto; text-align: right; font-size: var(--text-secondary); }
.site-user .role { color: var(--text-on-blue); }
.site-user form { display: inline; }
.site-user button {
  background: none; border: 0; color: var(--text-on-blue); cursor: pointer;
  font: inherit; text-decoration: underline; min-height: 0; padding: 0;
}

/* Page (§6.1, §6.2) */
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--space-8); }
.page-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-6);
}
.page-title { font-size: var(--text-page-title); font-weight: 700; }
.page-context { color: var(--text-muted); font-size: var(--text-secondary); margin-top: var(--space-1); }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.section + .section { margin-top: var(--space-6); }

/* Tabs (§7.11): links to the pages of one unit, under the page header */
.page-header:has(+ .tabs) { margin-bottom: var(--space-4); }
.tabs {
  display: flex; gap: var(--space-5); margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--divider); overflow-x: auto; scrollbar-width: thin;
}
.tabs a {
  display: inline-flex; align-items: center; min-height: var(--tap-min); flex: 0 0 auto;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 15px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue-900); }
/* Wide screens: a long row wraps instead of hiding tabs off the edge. Phones scroll it. */
@media (min-width: 900px) { .tabs { flex-wrap: wrap; column-gap: var(--space-5); row-gap: 0; overflow-x: visible; } }
.section-title { font-size: var(--text-section); font-weight: 600; margin-bottom: var(--space-3); }
.with-panel { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.with-panel > .main { flex: 999 1 640px; min-width: 0; }
.with-panel > .panel { flex: 1 1 340px; }

.page--phone { max-width: 560px; padding: var(--space-4); }
.page--phone .page-title { font-size: var(--text-page-title-phone); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }

/* Buttons (§7.1) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap-min); padding: 0 var(--space-4);
  border-radius: var(--radius-control); border: 1.5px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--blue-900); color: #FFFFFF; }
.btn--secondary { background: var(--surface); color: var(--blue-900); border-color: var(--blue-900); }
.btn--neutral { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--border); color: var(--text-muted); border-color: var(--border); cursor: not-allowed;
}
.btn--dense { min-height: 40px; }
.btn--block { width: 100%; }

/* Cards (§7.2, §7.3) */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: var(--space-4);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.card-title { font-size: var(--text-card-title); font-weight: 600; }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
@media (min-width: 768px) { .page:not(.page--phone) .card { padding: var(--space-5); } }

.stats { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-6); }
.stat { flex: 1 1 160px; }
.stat-label { color: var(--text-muted); font-size: var(--text-secondary); }
.stat-number { color: var(--ink); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat--overdue { border-color: var(--danger-border); }
.stat--overdue .stat-number, .stat--overdue .stat-label { color: var(--danger-text); }

/* Badges (§3.1) */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: var(--text-secondary); font-weight: 600; white-space: nowrap;
  background: var(--divider); color: var(--text);
}
.badge--not-scheduled, .badge--expected { background: var(--divider); color: var(--text); }
.badge--pending-review, .badge--needs-score { background: var(--gold-100); color: var(--gold-text); }
.badge--reserved { background: var(--blue-100); color: var(--blue-900); }
.badge--booked { background: var(--blue-900); color: #FFFFFF; }
.badge--testing, .badge--checked-in, .badge--remote { background: var(--teal-100); color: var(--teal-text); }
.badge--passed { background: var(--green-100); color: var(--green-text); }
.badge--failed { background: var(--danger-100); color: var(--danger-text); }
.badge--no-show { background: #FFFFFF; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--text); }
.badge--accommodation { background: var(--purple-100); color: var(--purple-text); }

/* Tables (§7.4) */
.table-scroll { overflow-x: auto; position: relative; }
.table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; color: var(--text-muted); font-size: var(--text-secondary); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--divider);
}
.table td { padding: var(--space-3); border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr[aria-selected="true"] td { background: var(--blue-50); }
.table tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--blue-900); }
.person-name { color: var(--ink); font-weight: 600; }
.person-email { color: var(--text-muted); font-size: var(--text-secondary); }

/* Banners (§7.5) */
.banner { border-radius: var(--radius-banner); padding: var(--space-3) 14px; }
.banner-title { font-weight: 700; }
.banner--info { background: var(--blue-100); }
.banner--info .banner-title { color: var(--blue-900); }
.banner--attention { background: var(--gold-100); color: var(--gold-text); }

/* Forms (§7.7) */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field label { font-size: var(--text-secondary); font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  min-height: var(--tap-min); border: 1.5px solid var(--border); border-radius: var(--radius-control);
  padding: 0 var(--space-3); font: inherit; color: var(--text); background: var(--surface);
}
.choice {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap-min);
  border: 1px solid var(--border); border-radius: var(--radius-control); padding: 0 var(--space-3);
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--blue-900); }

/* Voucher code (§7.8) */
.voucher {
  display: inline-flex; align-items: center; gap: var(--space-3); background: var(--ground);
  border-radius: var(--radius-control); padding: var(--space-2) var(--space-3);
  font-family: var(--font-mono); font-weight: 500;
}

/* Detail lists */
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: var(--space-4) 0 0; }
.detail-list dt { color: var(--text-muted); font-size: var(--text-secondary); }
.detail-list dd { margin: 0; }

@media (max-width: 640px) {
  .page { padding: var(--space-4); }
  .site-header { padding: var(--space-2) var(--space-4); }
}

/* Form layout and errors (§7.7) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); }
.form-grid .field:has(textarea), .form-grid .field--wide { grid-column: 1 / -1; }
.field textarea { min-height: 160px; padding: var(--space-3); font-family: var(--font-mono); }
.field select[multiple] { min-height: 120px; padding: var(--space-2); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger-text); }
.field-error { color: var(--danger-text); font-size: var(--text-secondary); }
.messages { margin-bottom: var(--space-4); }
.inline-form { display: inline; }
.empty { color: var(--text-muted); padding: var(--space-4) 0; }
.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.link-list a.card { text-decoration: none; color: inherit; }
.link-list a.card:hover { border-color: var(--blue-900); }

/* Calendar builder */
/* Seven columns that shrink to fit beside the side panel; the grid only scrolls below 560px. */
.month-grid { min-width: 560px; table-layout: fixed; }
.month-grid th { padding-left: var(--space-2); padding-right: var(--space-2); }
.month-grid td { vertical-align: top; height: 112px; padding: var(--space-2); border-right: 1px solid var(--divider); }
.month-grid .month-cell-head { flex-wrap: wrap; }
.month-grid .month-cell-head > span, .month-grid .tag { white-space: nowrap; }
.month-grid .shift, .month-grid .shift a { flex-wrap: wrap; }
.month-cell--out { background: var(--ground); color: var(--text-muted); }
.month-cell-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-1); font-weight: 600; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-pill); }
.tag--blackout { background: var(--blue-100); color: var(--blue-900); }
.shift { display: flex; justify-content: space-between; gap: var(--space-1); font-size: 12px; padding: 2px 6px; margin-top: 2px; border-radius: 6px; background: var(--blue-900); color: #FFFFFF; }
.shift a { color: inherit; text-decoration: none; display: flex; justify-content: space-between; gap: var(--space-1); width: 100%; }
.shift--draft { background: var(--surface); color: var(--blue-900); box-shadow: inset 0 0 0 1.5px var(--blue-900); }
.shift--open { background: var(--gold-100); color: var(--gold-text); box-shadow: inset 0 0 0 1.5px var(--gold-700); }
.plain-list { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: grid; gap: var(--space-1); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }

/* Django radio and checkbox lists as full-width option rows (§7.7) */
.field div[id] > div > label {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap-min);
  border: 1px solid var(--border); border-radius: var(--radius-control); padding: 0 var(--space-3);
  font-size: 15px; font-weight: 400; color: var(--text);
}
.field div[id] { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2); }

/* Shift chips: compact time and initials on one line; they wrap only if the cell is tiny */
.shift, .shift a { flex-wrap: wrap; column-gap: var(--space-1); line-height: 1.3; white-space: nowrap; }
.shift { padding: 3px 6px; }

/* Student slot picker (§7.6) */
.exam-when { font-weight: 600; color: var(--ink); margin: var(--space-3) 0 0; }
.exam-card p { margin: var(--space-2) 0 0; }
.day-chips { display: flex; gap: var(--space-2); overflow-x: auto; padding: var(--space-2) 0; margin-top: var(--space-3); }
.day-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 72px; min-height: var(--tap-min);
  padding: var(--space-2); border: 1.5px solid var(--blue-900); border-radius: var(--radius-banner);
  background: var(--surface); color: var(--ink); text-decoration: none; line-height: 1.25;
}
.day-chip--public { border-style: dashed; border-color: var(--gold-700); }
.day-chip--selected { background: var(--blue-900); border-color: var(--blue-900); color: #FFFFFF; }
.day-chip-weekday { font-size: var(--text-secondary); font-weight: 600; }
.day-chip-date { font-weight: 700; }
.day-chip-tag { font-size: 11px; }
.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.slot {
  display: flex; flex-direction: column; justify-content: center; min-height: 56px; padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--border); border-radius: var(--radius-banner); background: var(--surface);
  color: var(--ink); text-decoration: none;
}
.slot-time { font-weight: 600; }
.slot-seats { font-size: var(--text-secondary); color: var(--text-muted); }
.slot--selected { background: var(--blue-900); border-color: var(--blue-900); color: #FFFFFF; }
.slot--selected .slot-seats { color: var(--text-on-blue); }
.slot--full { background: var(--divider); color: var(--text-muted); cursor: not-allowed; }
.picker { padding-bottom: 140px; }
.picker-footer {
  position: fixed; left: 0; right: 0; bottom: 0; padding: var(--space-3) var(--space-4);
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(27, 38, 51, 0.08);
}
.picker-footer form, .picker-footer > * { max-width: 528px; margin-left: auto; margin-right: auto; }
.picker-footer p { margin: 0 0 var(--space-2); }

/* Daily schedule timeline (§14) */
.timeline { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-1) var(--space-2); min-width: 760px; }
.timeline-label { font-size: var(--text-secondary); color: var(--text-muted); align-self: center; }
.timeline-track { display: grid; grid-template-columns: repeat(var(--cols), minmax(14px, 1fr)); position: relative; min-height: 44px; background: var(--ground); border-radius: 6px; }
.timeline-hours { background: none; min-height: 20px; }
.timeline-hour { font-size: var(--text-secondary); color: var(--text-muted); grid-row: 1; }
.timeline-staffed { grid-row: 1; background: var(--surface); border: 1px dashed var(--border); border-radius: 6px; }
.timeline-bar {
  grid-row: 1; z-index: 1; margin: 3px 1px; padding: 2px 6px; border-radius: 6px; font-size: 12px; line-height: 1.3;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none;
  background: var(--blue-100); color: var(--blue-900);
}
.timeline-bar span { display: block; overflow: hidden; text-overflow: ellipsis; }
.timeline-bar--booked { background: var(--blue-900); color: #FFFFFF; }
.timeline-bar--awaiting_override { background: var(--gold-100); color: var(--gold-text); }
.timeline-bar--block { background: var(--divider); color: var(--text); }
.timeline-bar--over { box-shadow: inset 0 0 0 2px var(--danger-text); }
.date-input { min-height: var(--tap-min); border: 1.5px solid var(--border); border-radius: var(--radius-control); padding: 0 var(--space-2); font: inherit; }
.slot-grid--wide { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
fieldset.field { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }

.stat--list .plain-list { margin-top: var(--space-1); font-size: var(--text-secondary); }
.code-low { color: var(--danger-text); font-weight: 600; }

/* Class roster filter pills and inline link buttons */
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.pill {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-4);
  border: 1.5px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 14px;
}
.pill--selected { background: var(--blue-900); border-color: var(--blue-900); color: #FFFFFF; }
.link-button { background: none; border: 0; padding: 0; margin-top: var(--space-1); color: var(--blue-900); font: inherit; font-size: var(--text-secondary); text-decoration: underline; cursor: pointer; }
.page-context .tag { margin-right: var(--space-2); }
.tag--neutral { background: var(--divider); color: var(--text); }
.preview { white-space: pre-wrap; font-family: var(--font-sans); font-size: 14px; margin: 0; }
.section-gap { margin-bottom: var(--space-4); }
.stack-tight { display: grid; gap: var(--space-1); }
.form-grid .field:has([data-wide]) { grid-column: 1 / -1; }
.mono-input { font-family: var(--font-mono); }

/* Tech+ (§11) */
.capacity-input { width: 5rem; }
.score-input { width: 5.5rem; }
.check { display: flex; gap: var(--space-2); align-items: center; }
.checkout-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: end; }
.checkout-form label { display: grid; gap: var(--space-1); font-size: var(--text-secondary); }
.checkout-form .wide { min-width: 12rem; flex: 1; }
.mono { font-family: var(--font-mono); }
.print-sheet { max-width: 48rem; margin: 0 auto; }
@media print {
  .site-header, .sidebar, .no-print { display: none !important; }
  .print-logo { display: block !important; }
  body { background: #fff; }
  .print-table td, .print-table th { padding: 0.5rem; }
}
.checkin-form { justify-items: start; }

/* Special cases (§10) */
.code-box { display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; padding: var(--space-2) var(--space-3); border-radius: 8px; background: var(--blue-50); border: 1px solid var(--border); }
.code-value { font-size: var(--text-card-title); font-weight: 600; letter-spacing: 0.02em; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.details { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.details dt { color: var(--text-muted); }
.details dd { margin: 0; }
.field-label { font-weight: 600; font-size: var(--text-secondary); margin-bottom: var(--space-1); }
.tag--attention { background: var(--gold-100); color: var(--gold-text); }

/* Home: Needs attention (§9) */
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  min-height: 52px; padding: var(--space-2) 0; border-top: 1px solid var(--divider);
  color: var(--ink); text-decoration: none;
}
.attention-row:hover .attention-label { text-decoration: underline; }
.attention-label { font-weight: 600; display: block; }
.attention-detail { display: block; font-size: var(--text-secondary); color: var(--text-muted); }
.all-clear { margin-top: var(--space-3); }
.print-logo { display: none; height: 28px; width: auto; margin-bottom: var(--space-4); }

/* Popup (§7.10) */
.popup {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface); color: var(--text); box-shadow: 0 12px 32px rgba(27, 38, 51, 0.24);
}
.popup::backdrop { background: rgba(27, 38, 51, 0.4); }
.popup .form-grid { grid-template-columns: 1fr; }
.popup-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.popup-title { font-size: var(--text-section); font-weight: 600; color: var(--ink); }
.popup-close {
  min-width: var(--tap-min); min-height: var(--tap-min); border: 0; border-radius: var(--radius-control);
  background: none; color: var(--text-muted); font-size: 24px; cursor: pointer;
}
.popup-close:hover { background: var(--ground); }
.popup-footer { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.popup-page { max-width: 480px; }
@media (max-width: 640px) {
  .popup { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--radius-card) var(--radius-card) 0 0; }
}

/* Click a day to add (§6.1, §7.10) */
.day-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px; margin-left: auto;
  color: var(--blue-900); text-decoration: none; font-weight: 700; font-size: 16px;
  opacity: 0.35;
}
.month-cell:hover .day-add, .week-day:hover .day-add, .day-add:focus-visible { opacity: 1; background: var(--blue-100); }
@media (hover: none) { .day-add { opacity: 1; } }
.month-cell-head { gap: var(--space-1); }
.shift--mine.shift--draft { box-shadow: inset 0 0 0 2px var(--gold-700); }

/* Weekly availability grid (§6.1) */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.week-day { min-height: 160px; padding: var(--space-2); border: 1px solid var(--divider); border-radius: var(--radius-control); background: var(--ground); }
.week-day-head { display: flex; align-items: center; font-weight: 600; margin-bottom: var(--space-2); }
.hours-block {
  display: block; margin-top: var(--space-1); padding: 6px 8px; border-radius: 6px;
  background: var(--blue-900); color: #FFFFFF; text-decoration: none; font-size: 12px; line-height: 1.35;
}
.hours-block:hover { background: var(--blue-700); color: #FFFFFF; }
.hours-range { display: block; color: var(--text-on-blue); }
@media (max-width: 899px) {
  .week-grid { grid-template-columns: 1fr; }
  .week-day { min-height: 0; }
}

.panel .tag { white-space: nowrap; }

/* Find a student (spec §14) */
.search-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: var(--space-1); }
.search-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.search-row input { flex: 1 1 280px; min-height: var(--tap-min); padding: 0 var(--space-3); border: 1.5px solid var(--border); border-radius: var(--radius-control); font: inherit; }

/* Search above a long setup list (design §7.10) */
.list-search { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.list-search input[type="search"], .list-search input[type="email"] { flex: 1 1 240px; min-height: var(--tap-min); padding: 0 var(--space-3); border: 1.5px solid var(--border); border-radius: var(--radius-control); font: inherit; }

/* On/off switch: a real button that posts (design §8). */
.switch { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-min); padding: 0; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.switch-track { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--border); transition: background 0.15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; transition: left 0.15s; }
.switch[aria-checked="true"] .switch-track { background: var(--blue-900); }
.switch[aria-checked="true"] .switch-thumb { left: 19px; }
.switch:focus-visible { outline: 2px solid var(--blue-900); outline-offset: 2px; border-radius: 6px; }
.switch-label { font-size: 14px; font-weight: 600; min-width: 2em; text-align: left; }
.email-controls .list-search { margin: var(--space-3) 0 0; }
.email-off { margin-bottom: var(--space-4); }
