:root {
  --bg: #1c2b26;
  --bg-elevated: #24362f;
  --panel: #24362f;
  --border: #3e564c;
  --text: #f4f1ea;
  --muted: #d2cbc0;
  --accent: #e4b15a;
  --accent-2: #8fd0b4;
  --good: #8fd0b4;
  --warn: #e4b15a;
  --bad: #f0b4b8;
  --radius: 10px;
  --shadow: none;
  --font: "Liberation Sans", "DejaVu Sans", "Nimbus Sans", sans-serif;
  --display: "Liberation Serif", "DejaVu Serif", "Nimbus Roman", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: none;
  line-height: 1.5;
}
h1, h2, h3, .brand strong {
  font-family: var(--display);
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.12em; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--bg);
  background-image: none;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand:hover .brand-text strong { color: var(--text); }
.brand-mark {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border);
  background: #fff;
  object-fit: cover;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}
.brand strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}
.brand-text > span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.25;
}
.nav { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.nav a {
  color: var(--text);
  padding: 0.55rem 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
}
.nav a:hover, .nav a.active {
  color: var(--text);
  background: #31483f;
  text-decoration: none;
}
@media (max-width: 640px) {
  .brand-text > span { display: none; }
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
  padding: 1.5rem 0 1rem;
}
.hero-rank {
  display: block;
  max-width: 42rem;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 1.15rem; }
}
.hero-copy { min-width: 0; }
.hero-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.85rem, 3.6vw, 2.55rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.hero-accent {
  color: inherit;
}
.hero p,
.hero-lead {
  margin: 0;
  color: var(--muted);
  max-width: 48ch;
  font-size: 1.02rem;
  line-height: 1.55;
}
.hero-actions { margin-top: 1.05rem; }

/* Tasteful hero / empty-state art — restrained so ranking UI stays primary */
.hero-figure {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: rgba(11, 18, 32, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  object-fit: cover;
}
.hero-figure-featured {
  position: relative;
  max-width: none;
  margin: 0;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(91, 157, 255, 0.12);
}
.hero-figure-featured::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(11, 18, 32, 0.28));
}
.hero-figure-campus img,
.hero-figure-featured img {
  aspect-ratio: 16 / 10;
  max-height: 280px;
  width: 100%;
  object-position: center 42%;
}
.hero-figure-side {
  margin: 0;
  border-radius: calc(var(--radius) - 4px);
  border: none;
  box-shadow: none;
  height: 100%;
}
.hero-figure-side img {
  aspect-ratio: 4 / 3;
  max-height: 200px;
  height: 100%;
  object-position: center 40%;
}
.hero-figure-reviews {
  max-width: min(34rem, 100%);
  margin-top: 1.1rem;
}
.hero-figure-reviews img {
  aspect-ratio: 16 / 9;
  max-height: 200px;
  object-position: center 55%;
}
.empty-state {
  text-align: center;
  padding: 0.75rem 0.5rem 0.25rem;
}
.empty-state-figure {
  margin: 0 auto 0.85rem;
  max-width: 14rem;
  border: none;
  background: transparent;
  box-shadow: none;
  opacity: 0.92;
}
.empty-state-figure img {
  aspect-ratio: 4 / 3;
  max-height: 140px;
  object-fit: contain;
  margin: 0 auto;
}

/* How-it-works band under home hero */
.hero-howto {
  display: block;
  margin: 0 0 1.15rem;
  padding: 1rem 1.1rem;
  background: var(--panel);
}
@media (max-width: 720px) {
  .hero-howto { grid-template-columns: 1fr; }
  .hero-howto-visual { max-width: 18rem; }
}
.hero-howto-visual .hero-figure {
  border: 1px solid rgba(42, 58, 85, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.hero-howto-body h2 {
  margin: 0 0 0.75rem;
  font-size: 1.12rem;
}
.rank-howto-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.rank-howto-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
}
.rank-howto-steps strong {
  display: block;
  margin-bottom: 0.1rem;
  letter-spacing: -0.01em;
}
.rank-howto-steps .muted {
  display: block;
  line-height: 1.4;
}
.howto-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent-2);
  background: rgba(61, 214, 198, 0.12);
  border: 1px solid rgba(61, 214, 198, 0.32);
  flex-shrink: 0;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 1rem; }
.pill {
  font-size: 0.78rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  background: var(--bg-elevated);
}
.pill-accent {
  color: var(--bg);
  border-color: var(--accent);
  background: var(--accent);
}
/* Multi-grade cost range in badges / rank table */
.pill.tuition-pill[data-cost-range] {
  white-space: nowrap;
}
td.tuition-cell [data-cost-range] {
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.pill.enrollment-pill {
  white-space: nowrap;
}
.pill.devices-pill[data-devices-policy="not_allowed"] {
  border-color: rgba(240, 113, 120, 0.45);
  color: #f0b4b8;
}
.pill.devices-pill[data-devices-policy="limited"] {
  border-color: rgba(240, 180, 41, 0.4);
}
.grades-cell .enrollment-meta {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* Notable public events on school profile / modal / homepage */
.school-events-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.school-event-item {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(11, 18, 32, 0.4);
}
.school-event-item[data-severity="high"] {
  border-color: rgba(240, 113, 120, 0.45);
}
.school-event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}
.school-event-severity.severity-high {
  border-color: rgba(240, 113, 120, 0.5);
  color: #f0b4b8;
}
.school-event-severity.severity-medium {
  border-color: rgba(240, 180, 41, 0.45);
}
.school-event-headline {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.school-event-summary {
  margin: 0 0 0.45rem;
  max-width: 62ch;
  line-height: 1.45;
}
.school-event-sources a {
  color: var(--accent);
}
.school-events--compact {
  margin-top: 0.85rem;
}
.school-events--compact .school-event-item {
  padding: 0.65rem 0.75rem;
}
.school-events--compact .school-event-headline {
  font-size: 0.98rem;
}

/* Homepage strip */
.home-events {
  margin: 0 0 1.25rem;
}
.home-events-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.home-event-item {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(11, 18, 32, 0.35);
}
.home-event-item[data-severity="high"] {
  border-color: rgba(240, 113, 120, 0.4);
}
.home-event-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}
.home-event-headline {
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 70ch;
}
.home-event-headline a {
  color: inherit;
  text-decoration: none;
}
.home-event-headline a:hover {
  color: var(--accent);
}



.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 1.1rem 1.15rem;
}
.card h2, .card h3 { margin-top: 0; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.controls {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.controls.controls-3 {
  grid-template-columns: 1.15fr 1.15fr 0.85fr;
}
@media (max-width: 1100px) {
  .controls.controls-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .controls,
  .controls.controls-3 { grid-template-columns: 1fr; }
}

.weight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
.weight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  align-items: center;
}
.weight-row label { font-size: 0.88rem; color: var(--muted); }
.weight-row output {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-2);
}
.weight-row output.priority-out {
  min-width: 4.5rem;
  text-align: right;
  font-weight: 600;
}
.weight-row input[type="range"] { grid-column: 1 / -1; width: 100%; }

.rank-howto {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
}
.rank-howto li { margin-bottom: 0.35rem; }

.school-param-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
@media (max-width: 720px) {
  .school-param-grid { grid-template-columns: 1fr; }
}
.filters-actions .pill { margin: 0.15rem 0.15rem 0 0; }

.filters {
  display: grid;
  gap: 0.65rem;
}
label.field { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #14211d;
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.75rem; align-items: center; }

/* —— Buttons (site-wide) —— */
.btn {
  --btn-bg0: var(--bg);
  --btn-bg1: var(--bg);
  --btn-fg: var(--text);
  --btn-border: var(--accent);
  --btn-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  min-height: 44px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  cursor: pointer;
  color: var(--btn-fg);
  background-color: var(--btn-bg0);
  background-image: linear-gradient(180deg, var(--btn-bg0) 0%, var(--btn-bg1) 100%);
  box-shadow: var(--btn-shadow);
  text-decoration: none !important;
  white-space: nowrap;
  user-select: none;
  vertical-align: middle;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    color 0.14s ease,
    box-shadow 0.14s ease,
    opacity 0.14s ease;
}
a.btn { color: var(--btn-fg); }
.btn:hover {
  --btn-bg0: var(--bg-elevated);
  --btn-bg1: var(--bg-elevated);
  filter: none;
  text-decoration: none !important;
  box-shadow: none;
}
.btn:active {
  box-shadow: none;
}
.btn:focus { outline: none; }
.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--accent),
    var(--btn-shadow);
}
.btn:disabled,
.btn[disabled],
.btn.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.15);
  pointer-events: none;
}
/* Alias used by filter chips / admin toggles */
.btn.primary {
  /* same as default .btn */
}

/* Outlined / quieter action */
.btn.secondary {
  --btn-bg0: var(--bg);
  --btn-bg1: var(--bg);
  --btn-fg: var(--text);
  --btn-border: var(--border);
  --btn-shadow: none;
  background-color: var(--btn-bg0);
  background-image: linear-gradient(180deg, var(--btn-bg0) 0%, var(--btn-bg1) 100%);
  color: var(--btn-fg);
}
.btn.secondary:hover {
  --btn-bg0: var(--bg-elevated);
  --btn-bg1: var(--bg-elevated);
  --btn-border: var(--accent);
  --btn-fg: var(--text);
  color: var(--btn-fg);
  box-shadow: none;
}
.btn.secondary:active {
  --btn-bg0: var(--bg);
  --btn-bg1: var(--bg);
}

/* Soft tint — tertiary / cancel / low emphasis */
.btn.ghost {
  --btn-bg0: transparent;
  --btn-bg1: transparent;
  --btn-fg: var(--accent);
  --btn-border: transparent;
  --btn-shadow: none;
  background-color: transparent;
  background-image: linear-gradient(180deg, var(--btn-bg0) 0%, var(--btn-bg1) 100%);
  color: var(--btn-fg);
}
.btn.ghost:hover {
  --btn-bg0: var(--bg-elevated);
  --btn-bg1: var(--bg-elevated);
  --btn-border: transparent;
  --btn-fg: var(--accent);
  color: var(--btn-fg);
  box-shadow: none;
}

.btn.danger {
  --btn-bg0: #9f1d26;
  --btn-bg1: #871924;
  --btn-fg: #fff;
  --btn-border: transparent;
  --btn-shadow: none;
  background-color: var(--btn-bg0);
  background-image: linear-gradient(180deg, var(--btn-bg0) 0%, var(--btn-bg1) 100%);
  color: var(--btn-fg);
}
.btn.danger:hover {
  --btn-bg0: #871924;
  --btn-bg1: #74151f;
}
.btn.good {
  --btn-bg0: #146c3a;
  --btn-bg1: #115e32;
  --btn-fg: #fff;
  --btn-border: transparent;
  --btn-shadow: none;
  background-color: var(--btn-bg0);
  background-image: linear-gradient(180deg, var(--btn-bg0) 0%, var(--btn-bg1) 100%);
  color: var(--btn-fg);
}
.btn.good:hover {
  --btn-bg0: #115e32;
  --btn-bg1: #0e4e29;
}

/* Compact size (filters, rank row actions, chips) */
.btn.small {
  padding: 0.4rem 0.75rem;
  min-height: 44px;
  font-size: 0.88rem;
  border-radius: 8px;
  font-weight: 600;
}
.btn.block {
  display: flex;
  width: 100%;
}

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin: 0.75rem 0 1rem; }
table.data-table,
table.cost-bands-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  background: rgba(13, 21, 36, 0.55);
}
table.data-table th,
table.data-table td,
table.cost-bands-table th,
table.cost-bands-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(42, 58, 85, 0.75);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}
table.data-table th,
table.cost-bands-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(18, 26, 43, 0.95);
}
table.cost-bands-table tr.cost-band-specialty td {
  opacity: 0.92;
}
table.cost-bands-table td .meta {
  display: block;
  margin-top: 0.15rem;
}
#cost-breakdown .profile-subhead {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}
table.rank {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: rgba(13, 21, 36, 0.6);
}
table.rank th, table.rank td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(42, 58, 85, 0.75);
  text-align: left;
  vertical-align: middle;
  font-size: 0.92rem;
}
table.rank th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(18, 26, 43, 0.95);
  position: sticky;
  top: 0;
}
table.rank tr:hover td { background: rgba(91, 157, 255, 0.05); }
table.rank td.rank-actions {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  padding-right: 0.85rem;
}
.rank-action-btns {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 5.75rem;
}
.rank-action-btn {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0.38rem 0.55rem !important;
  min-height: 44px !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
  border-radius: 9px !important;
}
a.rank-action-btn {
  text-decoration: none !important;
}
.rank-num {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-2);
}
.score {
  font-family: var(--mono);
  font-weight: 700;
}
.school-link { font-weight: 650; color: var(--text); }
.school-link:hover { color: var(--accent); }
.school-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 200px;
}
.school-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}
.school-logo-lg { width: 56px; height: 56px; border-radius: 12px; }
/*
 * Logo plates adapt to ink color:
 *  - on-dark: white/light logos sit on transparent/dark (site chrome)
 *  - on-light: dark wordmarks sit on a soft light plate
 */
img.school-logo {
  padding: 4px;
  border: 1px solid transparent;
  background: transparent;
}
img.school-logo.school-logo--on-dark {
  background: transparent;
  border-color: rgba(42, 58, 85, 0.55);
  box-shadow: none;
}
img.school-logo.school-logo--on-light {
  background: linear-gradient(180deg, #f8fafc 0%, #e8eef6 100%);
  border-color: rgba(232, 238, 246, 0.85);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  padding: 5px;
}
img.school-logo-lg.school-logo--on-light { padding: 6px; }
.school-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px rgba(42, 58, 85, 0.55);
  border: 1px solid var(--border);
}
.school-logo-icon {
  display: block;
  opacity: 0.72;
}
.grades-pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}
.grades-cell { white-space: nowrap; }
.profile-modal-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.profile-modal-title-row h1 { margin: 0 0 0.35rem; }
.social-link-row { margin-top: 0.35rem; flex-wrap: wrap; gap: 0.45rem; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.social-link .social-icon,
.social-inline .social-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  vertical-align: -0.15em;
}
.social-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.social-link--twitter .social-icon { /* X mark reads well at small size */ }
.school-bio p { color: var(--text); }
.meta { color: var(--muted); font-size: 0.82rem; }
.school-loc { margin-top: 0.1rem; }
.fact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.4rem;
  max-width: 28rem;
}
.fact-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(91, 157, 255, 0.22);
  background: rgba(91, 157, 255, 0.08);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 550;
  line-height: 1.35;
  white-space: nowrap;
}
.fact-chip[data-fact="faith"] {
  border-color: rgba(196, 160, 255, 0.28);
  background: rgba(196, 160, 255, 0.1);
}
.fact-chip[data-fact="care"],
.fact-chip[data-fact="immersion"] {
  border-color: rgba(61, 214, 198, 0.28);
  background: rgba(61, 214, 198, 0.08);
}
.fact-chip[data-fact="asd"],
.fact-chip[data-fact="iep"] {
  border-color: rgba(255, 184, 77, 0.3);
  background: rgba(255, 184, 77, 0.08);
}
.fact-chip[data-fact="credentialed"] {
  border-color: rgba(62, 207, 142, 0.32);
  background: rgba(62, 207, 142, 0.1);
}
.fit-score .fit-value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
}
.fit-score .fit-hint,
.fit-score .fit-empty {
  font-size: 0.72rem;
  font-weight: 500;
}
.snapshot-cell { min-width: 11rem; }
.snapshot-empty { font-size: 0.8rem; }
.bars { display: grid; gap: 0.25rem; min-width: 140px; }
.bars.priority-bars { min-width: 150px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 28px; gap: 0.35rem; align-items: center; font-size: 0.72rem; color: var(--muted); }
.priority-bars .bar-row { grid-template-columns: 72px 1fr 28px; }
.bar {
  height: 6px;
  border-radius: 999px;
  background: #24314a;
  overflow: hidden;
}
.bar.bar-empty {
  opacity: 0.55;
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.factor-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.55rem; }
.factor-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 21, 36, 0.55);
}
.fact-list .val {
  font-family: var(--mono);
  color: var(--accent-2);
  text-align: right;
  white-space: nowrap;
  margin-left: 0.5rem;
}

/* Admin collection schedule stats (label / value never run together) */
.collect-stats {
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.5rem;
}
.collect-stat {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 21, 36, 0.55);
}
.collect-stat dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.collect-stat dd {
  margin: 0;
  font-family: var(--mono);
  color: var(--accent-2);
  font-weight: 600;
  text-align: right;
}
.collect-stat-wide {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.collect-stat-wide dd {
  text-align: left;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
}

.delta-pos { color: var(--good); }
.delta-neg { color: var(--bad); }
.delta-zero { color: var(--muted); }

.banner {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
}
.banner.ok { background: rgba(62, 207, 142, 0.1); border-color: rgba(62, 207, 142, 0.35); }
.banner.err { background: rgba(240, 113, 120, 0.1); border-color: rgba(240, 113, 120, 0.35); }
.banner.info { background: rgba(91, 157, 255, 0.1); border-color: rgba(91, 157, 255, 0.3); }

.ai-box {
  border-left: 3px solid var(--accent-2);
  background: rgba(61, 214, 198, 0.06);
  padding: 0.9rem 1rem;
  border-radius: 0 12px 12px 0;
  white-space: pre-wrap;
  color: #d7e7ff;
}
/* Markdown-rendered summaries (compare / guide) — real HTML, not pre-wrapped source */
.ai-box.ai-md,
.ai-box.chat-md {
  white-space: normal;
  line-height: 1.55;
}
.ai-box.ai-md > :first-child { margin-top: 0; }
.ai-box.ai-md > :last-child { margin-bottom: 0; }
.ai-box.ai-md h1,
.ai-box.ai-md h2,
.ai-box.ai-md h3,
.ai-box.ai-md h4 {
  margin: 0.85rem 0 0.4rem;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  color: var(--text);
}
.ai-box.ai-md p { margin: 0.45rem 0; }
.ai-box.ai-md ul,
.ai-box.ai-md ol {
  margin: 0.4rem 0 0.55rem;
  padding-left: 1.25rem;
}
.ai-box.ai-md li { margin: 0.2rem 0; }
.ai-box.ai-md strong { color: #f0f6ff; }
.ai-box.ai-md code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(11, 18, 32, 0.45);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Compare page: loading + row-wise table */
.compare-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(91, 157, 255, 0.35);
  background: rgba(91, 157, 255, 0.1);
  color: var(--text);
  font-size: 0.95rem;
}
.compare-loading[hidden] { display: none !important; }
.compare-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid rgba(91, 157, 255, 0.25);
  border-top-color: var(--accent);
  animation: compare-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes compare-spin {
  to { transform: rotate(360deg); }
}
.compare-header-cards .score { margin-bottom: 0; }
.compare-desc {
  margin: 0.55rem 0 0;
  max-width: 48ch;
  line-height: 1.45;
}
.compare-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 36rem;
}
.compare-table th,
.compare-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(42, 58, 85, 0.75);
}
.compare-table thead th {
  background: rgba(11, 18, 32, 0.65);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.compare-table tbody th[scope="row"] {
  font-weight: 500;
  color: var(--text);
  min-width: 9.5rem;
}
.compare-section-row th {
  background: rgba(91, 157, 255, 0.08);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom-color: rgba(91, 157, 255, 0.2);
  padding-top: 0.7rem;
  padding-bottom: 0.45rem;
}
.compare-row-rating td:nth-child(2),
.compare-row-rating td:nth-child(3) {
  font-family: var(--mono);
  font-size: 0.88rem;
}
.compare-table tbody tr:hover td,
.compare-table tbody tr:hover th[scope="row"] {
  background: rgba(91, 157, 255, 0.04);
}
.compare-hl-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}
.compare-highlights {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.45;
}
.compare-highlights li { margin: 0.3rem 0; }

/* Site-admin school logs & stats */
.ops-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
@media (max-width: 800px) {
  .ops-stat-grid { grid-template-columns: 1fr 1fr; }
}
.ops-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(11, 18, 32, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ops-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ops-stat-value {
  font-size: 1.45rem;
  font-family: var(--mono);
  color: var(--accent-2);
  letter-spacing: -0.02em;
}
.ops-log-table .ops-log-detail {
  max-width: 28rem;
  white-space: normal;
  line-height: 1.4;
}
.ops-report-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.ops-report-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: rgba(13, 21, 36, 0.5);
}
.ops-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.pill-warn {
  border-color: rgba(240, 180, 41, 0.45);
  color: #f0d78a;
}
.pill-danger {
  border-color: rgba(232, 93, 117, 0.55);
  color: #ffb3bf;
  background: rgba(232, 93, 117, 0.12);
}
.data-issue-banner {
  margin: 0.65rem 0 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
}
.row-data-issue td {
  background: rgba(232, 93, 117, 0.06);
}
.profile-admin-audit {
  border-color: rgba(91, 157, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(91, 157, 255, 0.08), transparent 45%),
    linear-gradient(180deg, rgba(22, 32, 51, 0.97), rgba(18, 26, 43, 0.96));
}
.profile-admin-audit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.35rem;
}
.profile-admin-audit .profile-subhead {
  margin-top: 1.15rem;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.quote {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(13, 21, 36, 0.5);
  margin: 0 0 0.75rem;
}
.quote footer { margin-top: 0.5rem; color: var(--muted); font-size: 0.85rem; }

.site-footer {
  margin-top: 2.5rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid rgba(42, 58, 85, 0.7);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
}

.stack { display: grid; gap: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }

/* Nav button (Guide offcanvas trigger) */
.nav-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.nav-btn:hover, .nav-btn.active {
  color: var(--text);
  background: rgba(91, 157, 255, 0.12);
}
.nav-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(91, 157, 255, 0.55);
}
button.linkish {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

/* Home / map layout */
.schools-map {
  height: min(52vh, 480px);
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  z-index: 1;
  background: #0d1524;
}
.home-map-section { margin-bottom: 0.25rem; }
.home-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.map-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1rem;
}
@media (max-width: 860px) {
  .map-layout { grid-template-columns: 1fr; }
}
.map-list {
  max-height: min(52vh, 480px);
  overflow: auto;
  display: grid;
  gap: 0.25rem;
  align-content: start;
}
.map-list a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
}
.map-list a:hover, .map-list a.active {
  background: rgba(91, 157, 255, 0.12);
  border-color: var(--border);
  text-decoration: none;
}
.school-mini-map {
  height: 220px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Contact */
.contact-block h2, .contact-block h3 { margin-bottom: 0.35rem; }
.contact-actions { margin: 0.5rem 0 0.75rem; }
.contact-form-status { margin-top: 0.5rem; }
.contact-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 520px) {
  .contact-identity-grid { grid-template-columns: 1fr; }
}
.contact-message-form .field input[type="text"],
.contact-message-form .field input[type="email"],
.contact-message-form .field input[type="tel"],
.contact-message-form .field textarea {
  width: 100%;
}
.contact-message-panel {
  max-width: min(32rem, 100%);
}
.contact-lead { line-height: 1.45; }
.contact-turnstile-pass {
  margin: 0.15rem 0 0.35rem;
  opacity: 0.9;
}
.contact-form-actions { margin-top: 0.25rem; }
.contact-message-form-wrap { padding-bottom: 0.25rem; }
.contact-account-prompt {
  margin: 0.65rem 0 1rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
}
.contact-account-prompt-title {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
.contact-account-prompt-actions {
  margin-top: 0.75rem;
}

/* Floating chat / guide FAB */
.chat-fab {
  position: fixed;
  right: max(1.15rem, env(safe-area-inset-right, 0px));
  bottom: max(1.15rem, env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.1rem 0.8rem 0.95rem;
  border: 1px solid rgba(91, 157, 255, 0.5);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  animation: chat-fab-in 0.35s ease-out both;
}
@keyframes chat-fab-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}
.chat-fab:active {
  transform: translateY(0) scale(0.98);
}
.chat-fab:focus-visible {
  outline: 2px solid var(--accent-2, #3dd6c6);
  outline-offset: 3px;
}
.chat-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
}
.chat-fab-label { padding-right: 0.15rem; }
body.offcanvas-open .chat-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  animation: none;
}
/* Lift FAB above cookie banner when present */
body:has(.cookie-banner:not([hidden])) .chat-fab {
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 5.25rem));
}
@media (max-width: 520px) {
  .chat-fab {
    right: max(0.85rem, env(safe-area-inset-right, 0px));
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
    padding: 0.9rem;
    border-radius: 999px;
  }
  body:has(.cookie-banner:not([hidden])) .chat-fab {
    bottom: max(5.75rem, calc(env(safe-area-inset-bottom, 0px) + 5.5rem));
  }
  .chat-fab-label { display: none; }
}

/* Offcanvas chat — wider on desktop for readable multi-turn guide */
.offcanvas-backdrop, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 16, 0.62);
  z-index: 40;
  backdrop-filter: none;
}
.offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  height: 100dvh;
  z-index: 50;
  background: var(--panel);
  border-left: 1px solid rgba(91, 157, 255, 0.22);
  box-shadow: -18px 0 52px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  animation: offcanvas-slide-in 0.22s ease-out;
}
@keyframes offcanvas-slide-in {
  from { transform: translateX(12px); opacity: 0.85; }
  to { transform: translateX(0); opacity: 1; }
}
@media (min-width: 900px) {
  .offcanvas { width: min(560px, 48vw); }
}
@media (min-width: 1200px) {
  .offcanvas { width: min(640px, 40vw); }
}
@media (min-width: 1600px) {
  .offcanvas { width: min(720px, 36vw); }
}
.offcanvas[hidden], .offcanvas-backdrop[hidden],
.modal[hidden], .modal-backdrop[hidden] {
  display: none !important;
}
.offcanvas-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(91, 157, 255, 0.18);
  background: var(--panel);
}
.offcanvas-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2, #3dd6c6);
}
.offcanvas-header h2 { margin: 0 0 0.3rem; font-size: 1.25rem; letter-spacing: -0.02em; }
.offcanvas-header-text { min-width: 0; flex: 1; }
.offcanvas-header-text .small { line-height: 1.4; max-width: 36rem; }
.offcanvas-close {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
}
.offcanvas-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.25rem 1.15rem;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 0.8rem;
}
.chat-log {
  min-height: 0;
  max-height: none;
  overflow: auto;
  display: grid;
  gap: 0.75rem;
  align-content: start;
  padding: 0.15rem 0.35rem 0.4rem 0.1rem;
  scroll-behavior: smooth;
}
.chat-empty-card {
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px dashed rgba(91, 157, 255, 0.32);
  background: rgba(13, 21, 36, 0.55);
}
.chat-empty { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.chat-msg .meta {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  opacity: 0.85;
}
.chat-msg-user.quote,
.chat-log .quote {
  margin: 0;
  margin-left: min(2rem, 12%);
  padding: 0.75rem 0.95rem;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid rgba(91, 157, 255, 0.28);
  background: rgba(91, 157, 255, 0.12);
}
.chat-msg-guide.ai-box,
.chat-log .ai-box {
  margin: 0;
  margin-right: min(1.5rem, 8%);
  padding: 0.8rem 1rem;
  border-radius: 14px 14px 14px 4px;
  border: 1px solid rgba(61, 214, 198, 0.18);
  background: rgba(13, 21, 36, 0.72);
}
.chat-composer {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 0.1rem 0.2rem;
  border-top: 1px solid rgba(91, 157, 255, 0.14);
}
.chat-composer-field { margin: 0; }
.chat-composer textarea {
  resize: vertical;
  min-height: 3rem;
  max-height: 9rem;
  border-radius: 12px;
  border: 1px solid rgba(91, 157, 255, 0.28);
  background: rgba(11, 18, 32, 0.9);
  line-height: 1.45;
}
.chat-composer textarea:focus {
  outline: none;
  border-color: rgba(91, 157, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.15);
}
.chat-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.chat-composer-actions .btn {
  min-width: 4.5rem;
}
/* Guide markdown bubbles (marked / python-markdown output) */
.chat-md {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.chat-md p {
  margin: 0 0 0.65rem;
}
.chat-md p:last-child { margin-bottom: 0; }
.chat-md h1, .chat-md h2, .chat-md h3, .chat-md h4,
.chat-md .chat-md-h2,
.chat-md .chat-md-h3 {
  margin: 0.55rem 0 0.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  font-size: 1rem;
}
.chat-md h1, .chat-md h2 { font-size: 1.05rem; }
.chat-md ul,
.chat-md ol,
.chat-md .chat-md-list {
  margin: 0.35rem 0 0.65rem;
  padding-left: 1.25rem;
  color: var(--text);
}
.chat-md li { margin: 0.25rem 0; }
.chat-md code,
.chat-md .chat-md-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  background: rgba(13, 21, 36, 0.75);
  border: 1px solid var(--border);
}
.chat-md pre,
.chat-md .chat-md-pre {
  margin: 0.4rem 0 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  overflow: auto;
  background: rgba(13, 21, 36, 0.85);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}
.chat-md pre code {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: inherit;
}
.chat-md a { color: var(--accent); }
.chat-md strong { color: var(--text); font-weight: 700; }
.chat-md blockquote {
  margin: 0.4rem 0 0.65rem;
  padding: 0.35rem 0.75rem;
  border-left: 3px solid rgba(91, 157, 255, 0.45);
  color: var(--muted);
}

/* Typing indicator — classic bouncing chat bubbles */
.chat-typing {
  opacity: 0.95;
}
.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.15rem 0.15rem;
  min-height: 1.25rem;
}
.chat-typing-dots span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--accent, #5b9dff);
  opacity: 0.45;
  animation: chat-bounce 1.2s ease-in-out infinite;
}
.chat-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
  background: var(--accent-2, #3dd6c6);
}
.chat-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes chat-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-0.35rem);
    opacity: 1;
  }
}
body.offcanvas-open, body.modal-open {
  overflow: hidden;
}

/* Profile modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem 2rem;
  overflow: auto;
  pointer-events: none;
}
.modal:not([hidden]) { pointer-events: auto; }
.modal-panel {
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.98), rgba(14, 22, 36, 0.98));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 170, 220, 0.45) rgba(8, 14, 26, 0.35);
}

/* Site-wide thin, themed scrollbars (modals, offcanvas, message log, etc.) */
.modal,
.modal-panel,
.modal-body,
.profile-modal-body,
.profile-modal-scroll,
.offcanvas,
.offcanvas-body,
.message-log,
.messages-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 170, 220, 0.45) rgba(8, 14, 26, 0.35);
}
.modal::-webkit-scrollbar,
.modal-panel::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.profile-modal-body::-webkit-scrollbar,
.profile-modal-scroll::-webkit-scrollbar,
.offcanvas::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar,
.message-log::-webkit-scrollbar,
.messages-list::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
.modal::-webkit-scrollbar-track,
.modal-panel::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.profile-modal-body::-webkit-scrollbar-track,
.profile-modal-scroll::-webkit-scrollbar-track,
.offcanvas::-webkit-scrollbar-track,
.offcanvas-body::-webkit-scrollbar-track,
.message-log::-webkit-scrollbar-track,
.messages-list::-webkit-scrollbar-track {
  background: rgba(8, 14, 26, 0.4);
  border-radius: 999px;
  margin: 4px 0;
}
.modal::-webkit-scrollbar-thumb,
.modal-panel::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.profile-modal-body::-webkit-scrollbar-thumb,
.profile-modal-scroll::-webkit-scrollbar-thumb,
.offcanvas::-webkit-scrollbar-thumb,
.offcanvas-body::-webkit-scrollbar-thumb,
.message-log::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(130, 165, 230, 0.55),
    rgba(90, 130, 200, 0.4)
  );
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  min-height: 2rem;
}
.modal::-webkit-scrollbar-thumb:hover,
.modal-panel::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.profile-modal-body::-webkit-scrollbar-thumb:hover,
.profile-modal-scroll::-webkit-scrollbar-thumb:hover,
.offcanvas::-webkit-scrollbar-thumb:hover,
.offcanvas-body::-webkit-scrollbar-thumb:hover,
.message-log::-webkit-scrollbar-thumb:hover,
.messages-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(150, 185, 245, 0.75),
    rgba(110, 155, 225, 0.55)
  );
  background-clip: padding-box;
}
.modal::-webkit-scrollbar-corner,
.modal-panel::-webkit-scrollbar-corner,
.modal-body::-webkit-scrollbar-corner {
  background: transparent;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(18, 26, 43, 0.96);
  z-index: 1;
}
.modal-header h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 1rem 1.15rem 1.35rem; }

/* Profile modal shell — panel scrolls as a unit; sticky header + sticky footer CTAs */
.profile-modal .profile-modal-panel {
  width: min(760px, 100%);
  max-height: min(90vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: var(--panel);
  border: 1px solid rgba(120, 150, 200, 0.22);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.profile-modal .profile-modal-shell-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0.9rem 1.2rem;
  background: var(--panel);
  backdrop-filter: none;
  border-bottom: 1px solid rgba(120, 150, 200, 0.18);
}
.profile-modal .profile-modal-shell-header h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text, #e8eef8);
  max-width: calc(100% - 3rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-modal .modal-close-btn {
  min-width: 2.25rem;
  min-height: 2.25rem;
  border-radius: 999px;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.9;
}
.profile-modal .profile-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.profile-modal-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.profile-modal-hero {
  flex: 0 0 auto;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(120, 150, 200, 0.12);
  background: linear-gradient(180deg, rgba(91, 157, 255, 0.06), transparent 80%);
}
.profile-modal-title-text { min-width: 0; }
.profile-modal-meta { line-height: 1.4; }
.profile-modal-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 1.25rem 1rem;
  display: grid;
  gap: 0.15rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.profile-modal-location .school-mini-map-wrap {
  margin-top: 0.4rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}
.profile-modal-location .school-mini-map {
  height: 168px;
  border: 0;
  border-radius: 0;
}
.profile-modal-content .contact-block {
  margin-top: 0.65rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.profile-modal-footer {
  flex: 0 0 auto;
  z-index: 2;
  padding: 0.75rem 1.15rem 0.95rem;
  border-top: 1px solid rgba(120, 150, 200, 0.16);
  background: linear-gradient(180deg, rgba(14, 20, 34, 0.96), rgba(12, 18, 30, 0.99));
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
}
.profile-modal-footer .profile-modal-actions {
  margin: 0;
  gap: 0.45rem;
}
.profile-modal-footer .profile-modal-report {
  margin-top: 0.45rem;
  opacity: 0.92;
}
.profile-modal-footer .profile-modal-report .btn {
  font-size: 0.82rem;
  padding: 0.3rem 0.55rem;
}
.school-address {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}
.school-address-icon {
  flex: 0 0 auto;
  font-size: 0.85em;
  line-height: 1.4;
  opacity: 0.85;
}
.school-location--compact .school-mini-map {
  height: 168px;
}
.school-mini-map-wrap.card {
  padding: 0.45rem;
}
/* Contact + report + site feedback modals stack above profile modal */
#contact-message-backdrop,
#report-problem-backdrop,
#site-feedback-backdrop {
  z-index: 60;
}
#contact-message-modal.contact-message-modal,
.contact-message-modal,
#report-problem-modal.report-problem-modal,
.report-problem-modal,
#site-feedback-modal.site-feedback-modal,
.site-feedback-modal {
  z-index: 65;
}
.contact-message-modal .contact-message-panel,
.report-problem-modal .report-problem-panel,
.site-feedback-modal .site-feedback-panel {
  max-width: 28rem;
  width: min(28rem, 100%);
  /* Avoid full-bleed mobile panel looking nested inside profile */
  max-height: min(92vh, 720px);
  min-height: 0;
}
.contact-message-modal .modal-body,
.report-problem-modal .modal-body,
.site-feedback-modal .modal-body { padding-top: 0.5rem; }
.contact-message-form .cf-turnstile,
.report-problem-form .cf-turnstile,
.site-feedback-form .cf-turnstile,
.turnstile-slot { margin: 0.35rem 0 0.5rem; }

/* Site feedback form — name/email stacked (avoids crowded side-by-side fields) */
.site-feedback-optional-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
.site-feedback-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.site-feedback-form .field input[type="text"],
.site-feedback-form .field input[type="email"],
.site-feedback-form .field select,
.site-feedback-form .field textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.site-feedback-modal .site-feedback-panel {
  max-width: min(30rem, 100%);
}
.site-feedback-modal .modal-body {
  padding: 0.85rem 1.2rem 1.25rem;
}
.footer-feedback-btn.linkish,
button.linkish.footer-feedback-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  opacity: 0.92;
}
.footer-feedback-btn.linkish:hover {
  opacity: 1;
  color: var(--accent, #7dd3fc);
}

/* Admin feedback dashboard */
.feedback-count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.feedback-count-num {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.feedback-status-pill {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}
.feedback-status-pill.status-open {
  color: #fde68a;
  border-color: rgba(253, 230, 138, 0.35);
}
.feedback-status-pill.status-reviewed {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.35);
}
.feedback-status-pill.status-closed {
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.35);
}
.feedback-admin-message {
  margin: 0.55rem 0 0.35rem;
  white-space: pre-wrap;
  line-height: 1.45;
}
.feedback-admin-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.field-inline select {
  min-width: 8rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.profile-modal-report {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

/* Messages inbox / badge — visible to all visitors */
.nav-messages {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-messages-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  opacity: 0.92;
}
.nav-messages-label { white-space: nowrap; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f97316;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.nav-badge[hidden] { display: none !important; }
.message-thread-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.message-thread-card:hover {
  border-color: rgba(91, 157, 255, 0.45);
}
.message-thread-card.has-unread {
  border-color: rgba(249, 115, 22, 0.45);
}
.message-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.message-preview {
  margin-top: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-thread-page { max-width: 42rem; margin: 0 auto; }
.message-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
}
.message-thread-header-main { min-width: 0; }
.message-thread-header h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  letter-spacing: -0.02em;
}
.message-compose-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.message-log {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(58vh, 540px);
  overflow: auto;
  padding: 0.85rem 1rem;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
.message-log-empty { margin: 0.5rem 0; text-align: center; }
.message-bubble {
  max-width: min(92%, 34rem);
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.message-bubble--parent {
  align-self: flex-end;
  border-color: rgba(91, 157, 255, 0.4);
  background: linear-gradient(160deg, rgba(40, 70, 120, 0.45), rgba(15, 23, 42, 0.65));
  border-bottom-right-radius: 5px;
}
.message-bubble--school {
  align-self: flex-start;
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(160deg, rgba(20, 55, 45, 0.5), rgba(12, 28, 24, 0.7));
  border-bottom-left-radius: 5px;
}
.message-bubble--site {
  align-self: flex-start;
  border-color: rgba(167, 139, 250, 0.45);
  background: linear-gradient(160deg, rgba(55, 40, 90, 0.55), rgba(22, 16, 40, 0.75));
  border-bottom-left-radius: 5px;
}
.site-message-page {
  width: min(40rem, 100%);
  max-width: 40rem;
  margin: 0 auto 2rem;
  padding: 0 0.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}
.site-message-crumb {
  margin: 0 0 1rem;
  text-align: left;
}
.site-message-header {
  margin: 0 0 1.25rem;
  text-align: center;
}
.site-message-header h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.site-message-lead {
  margin: 0 auto;
  max-width: 34rem;
  line-height: 1.5;
  text-align: center;
}
.site-message-start {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1.65rem;
  text-align: left;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: var(--panel);
  box-sizing: border-box;
}
.site-message-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}
.site-message-form textarea {
  width: 100%;
  min-height: 12rem;
  box-sizing: border-box;
  resize: vertical;
}
.site-message-actions {
  justify-content: center;
  margin-top: 0.35rem;
}
.site-message-turnstile,
.site-message-pass-note {
  display: flex;
  justify-content: center;
}
.site-message-pass-note {
  text-align: center;
  width: 100%;
}
.site-message-form [data-site-message-status] {
  text-align: center;
}
.chat-gate-banner {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.chat-gate-banner a,
.chat-gate-banner .linkish {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.chat-gate-banner .linkish {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.chat-composer[data-chat-locked="1"] {
  opacity: 0.72;
}
.messages-inbox-hero {
  max-width: 42rem;
  margin: 0 auto 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
}
.messages-inbox-intro { min-width: min(100%, 18rem); flex: 1 1 16rem; }
.messages-help {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.45;
}
.messages-help li { margin: 0.3rem 0; }
.messages-help .linkish,
.messages-help a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.messages-help .linkish {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.messages-inbox-actions { margin: 0; flex-wrap: wrap; }
.messages-empty {
  max-width: 42rem;
  margin: 0 auto;
}
.site-thread-pill {
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.4);
  color: #ddd6fe;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.message-thread-card.is-site-thread {
  border-color: rgba(167, 139, 250, 0.28);
}
.messages-list {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}
.messages-list-heading {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.footer-message-site {
  color: var(--muted);
  margin-right: 0.75rem;
  text-decoration: none;
}
.footer-message-site:hover {
  color: var(--text, #e8eef8);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.message-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  margin: 0;
}
.message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}
.message-compose {
  padding: 0.95rem 1.05rem 1.1rem;
}
.message-compose textarea {
  min-height: 5.5rem;
  resize: vertical;
}
.profile-modal-content h2, .profile-modal-content h3 { letter-spacing: -0.02em; }
.profile-modal-name {
  margin: 0 0 0.35rem;
  font-size: clamp(1.2rem, 2.6vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

@media (max-width: 520px) {
  .offcanvas {
    width: 100vw;
    border-left: 0;
  }
  .offcanvas-header { padding: 0.95rem 1rem 0.85rem; }
  .offcanvas-body { padding: 0.85rem 0.9rem 1rem; }
  .chat-msg-user.quote,
  .chat-log .quote { margin-left: 0.75rem; }
  .chat-msg-guide.ai-box,
  .chat-log .ai-box { margin-right: 0.5rem; }
  .modal { padding: 0; }
  .modal-panel {
    max-height: 100vh;
    border-radius: 0;
    min-height: 100vh;
  }
  .profile-modal .profile-modal-panel {
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    width: 100%;
  }
  .profile-modal-hero,
  .profile-modal-scroll {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .profile-modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .profile-modal-location .school-mini-map {
    height: 150px;
  }
  /* Contact / report forms stay compact dialogs on small screens */
  .contact-message-modal .contact-message-panel,
  .report-problem-modal .report-problem-panel {
    min-height: 0;
    max-height: min(92vh, 720px);
    border-radius: 16px;
    margin: 4vh auto;
  }
  .contact-message-modal,
  .report-problem-modal {
    padding: 4vh 1rem 2rem;
    align-items: flex-start;
  }
}


/* Legal / footer / cookie banner */
.footer-links a,
.footer-links .footer-feedback-btn {
  color: var(--muted);
  margin-right: 0.75rem;
  text-decoration: none;
}
.footer-links a:hover,
.footer-links .footer-feedback-btn:hover { color: var(--accent); }
.legal-prose h2 { margin-top: 1.25rem; font-size: 1.05rem; }
.legal-prose ul { padding-left: 1.2rem; color: var(--muted); }
.legal-prose p { color: var(--text); max-width: 48rem; }
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  background: rgba(18, 26, 43, 0.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.35);
  padding: 0.85rem 0;
}
.cookie-banner-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.cookie-banner p { margin: 0; max-width: 42rem; font-size: 0.9rem; color: var(--muted); }
.cookie-banner a { color: var(--accent); }

/* Parent ratings */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem 1rem;
}
.rating-field select { width: 100%; }
.rating-summary .val strong { color: var(--accent-2); margin-right: 0.35rem; }
.bar-empty { opacity: 0.35; }

/* Rate form: one dimension per row with scoring guide */
.rating-dim-list {
  display: grid;
  gap: 0.85rem;
}
.rating-dim {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(13, 21, 36, 0.55);
}
.rating-dim .rating-field {
  display: grid;
  grid-template-columns: 1fr minmax(7.5rem, 9rem);
  gap: 0.55rem 0.85rem;
  align-items: center;
  margin: 0;
}
.rating-dim-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
.rating-dim-guide {
  margin: 0.55rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(91, 157, 255, 0.12);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
@media (max-width: 560px) {
  .rating-dim .rating-field {
    grid-template-columns: 1fr;
  }
}

/* —— School profile (decluttered layout) —— */
.profile-hero {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 1.15rem;
  padding: 1.35rem 0 0.75rem;
  align-items: start;
}
@media (max-width: 900px) {
  .profile-hero { grid-template-columns: 1fr; }
}
.profile-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.profile-hero-main .crumb { margin-bottom: 0.65rem; }
.profile-cta-row { margin-top: 0.85rem; }
.profile-hero-map {
  min-height: 200px;
  align-self: stretch;
}
.profile-hero-map .school-location {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.profile-hero-map .school-mini-map-wrap {
  flex: 1 1 auto;
  min-height: 200px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow);
}
.profile-hero-map .school-mini-map {
  height: 240px;
  border: 0;
  border-radius: 0;
  margin: 0;
}
.profile-hero-map .school-address {
  margin: 0 0.15rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr;
  gap: 1rem;
  padding: 0.5rem 0 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}
.profile-main.stack,
.profile-side.stack,
.stack {
  display: grid;
  gap: 1rem;
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.section-head h2 { margin: 0; }
.profile-about { margin: 0; color: var(--text); max-width: 62ch; }
.profile-highlights {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
}
.profile-subhead {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.95rem;
  color: var(--text);
}
.rating-status-line {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(91, 157, 255, 0.08);
  color: var(--text);
}
.rating-status-line.is-live {
  border-color: rgba(62, 207, 142, 0.4);
  background: rgba(62, 207, 142, 0.1);
}
.rating-status-line.is-pending {
  border-color: rgba(240, 180, 41, 0.35);
  background: rgba(240, 180, 41, 0.08);
}
.facts-accordion { display: grid; gap: 0.45rem; }
.facts-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 21, 36, 0.55);
  padding: 0.15rem 0.75rem 0.35rem;
}
.facts-group summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.15rem;
  font-weight: 600;
  color: var(--text);
}
.facts-group summary::-webkit-details-marker { display: none; }
.facts-group summary::before {
  content: "▸ ";
  color: var(--muted);
  font-weight: 400;
}
.facts-group[open] summary::before { content: "▾ "; }
.facts-group .fact-list { padding-bottom: 0.45rem; }
.contact-form-details {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.contact-form-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}
.contact-list .val { word-break: break-word; text-align: right; max-width: 60%; }
.staff-list li { align-items: baseline; }
.peer-row { margin-top: 0.35rem; }
.peer-row .btn {
  font-size: 0.85rem;
  padding: 0.42rem 0.78rem;
  min-height: 2.1rem;
}

/* Dedicated rate / share page — centered column on large screens */
.rate-page {
  max-width: 46rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 1.25rem 0 2.5rem;
}
.reviews-feed { display: grid; gap: 1rem; }
.rate-section-head { margin-bottom: 0.75rem; }
.rate-section-head h2 { margin: 0 0 0.25rem; }

/* Fancy multi-file dropzone */
.file-drop {
  position: relative;
  margin-top: 0.35rem;
}
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  width: 100%;
  height: 100%;
}
.file-drop-ui {
  border: 1.5px dashed rgba(91, 157, 255, 0.45);
  border-radius: 14px;
  background: var(--panel);
  padding: 1.35rem 1rem;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.file-drop.is-dragover .file-drop-ui {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.18);
  background: var(--bg-elevated);
}
.file-drop.has-files .file-drop-ui { padding: 0.85rem 1rem; }
.file-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  background: rgba(91, 157, 255, 0.15);
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
}
.file-drop-icon svg { display: block; }
.file-drop-title { margin: 0; font-weight: 600; color: var(--text); }
.file-drop-hint { margin: 0.25rem 0 0; }
.file-chip-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.35rem 0.55rem 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(22, 32, 51, 0.95);
  font-size: 0.82rem;
  color: var(--text);
}
.file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
}
.file-chip-size { color: var(--muted); font-variant-numeric: tabular-nums; }
.file-chip-remove {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.file-chip-remove:hover { color: var(--bad); }
.file-drop-error { margin-top: 0.55rem; }
.rate-page-header { margin: 0.75rem 0 1rem; }
.rate-page-header h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
  letter-spacing: -0.02em;
}
.share-steps {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
}
.share-steps li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.share-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(91, 157, 255, 0.16);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}
.rate-form {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(91, 157, 255, 0.18);
}
.rate-section {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.rate-section:last-of-type { border-bottom: none; }
.rate-section h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.rate-actions {
  padding: 1rem 1.25rem 1.2rem;
  margin: 0;
  border-top: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.45);
}
/* High-contrast agreement block (matches dark theme) */
.rate-agreement {
  background: linear-gradient(180deg, rgba(91, 157, 255, 0.1), rgba(18, 26, 43, 0.65));
}
.rate-agreement-body {
  margin: 0.65rem 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(91, 157, 255, 0.35);
  background: #0d1524;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}
.rate-agreement-body p { margin: 0 0 0.75rem; color: #e8eef9; }
.rate-agreement-body p:last-child { margin-bottom: 0; }
.rate-agreement-challenge {
  color: #c5d4ef !important;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.75rem !important;
}
.rate-attestation { margin-top: 0.5rem; }
.rate-incentive-fieldset {
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: 10px;
  padding: 0.85rem 1rem 1rem;
  margin: 0 0 1rem;
}
.rate-incentive-q {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0 0.25rem;
  margin-bottom: 0.5rem;
}
.rate-incentive-choices {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.rate-radio {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.35;
}
.rate-radio input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}
.rate-incentive-details { margin-top: 0.35rem; }
.rate-incentive-details[hidden] { display: none !important; }
.rate-truth-check {
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.rate-agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}
.rate-agreement-check input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}
input.input-readonly,
input.input-readonly:disabled {
  opacity: 1;
  color: var(--text);
  background: rgba(13, 21, 36, 0.85);
  border-color: var(--border);
  cursor: default;
}
.school-response {
  margin-top: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(61, 214, 198, 0.35);
  background: rgba(61, 214, 198, 0.08);
}
.school-response strong {
  display: block;
  font-size: 0.82rem;
  color: var(--accent-2);
  margin-bottom: 0.25rem;
}
.school-response p { margin: 0; color: var(--text); font-size: 0.92rem; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 0.65rem !important; }

/* —— Teacher job board & climate —— */
.jobs-hero .lead { max-width: 48ch; }
.jobs-marketing {
  border: 1px solid rgba(61, 214, 198, 0.28);
  background: var(--panel);
}
.jobs-marketing-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--accent-2, #3dd6c6);
}
.jobs-marketing-blurb {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}
.jobs-marketing-list {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.jobs-marketing-list.compact { margin-bottom: 0.5rem; }
.jobs-marketing-list li { margin-bottom: 0.3rem; }
.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.job-card { display: grid; gap: 0.55rem; align-content: start; }
.job-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.job-card-title { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.job-card-title a { color: var(--text); text-decoration: none; }
.job-card-title a:hover { color: var(--accent); }
.job-card-school a { font-weight: 600; }
.job-card-excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}
.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.job-prose {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.55;
  max-width: 62ch;
}
.job-school-cta {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}
.job-profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.job-profile-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.job-profile-list li:last-child { border-bottom: none; }
.job-admin-card {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(13, 21, 36, 0.55);
}

/* —— Thank-you parents page (single-column, centered) —— */
.thank-page {
  max-width: 42rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 0 2.75rem;
  display: grid;
  gap: 1rem;
}
.thank-page-header {
  padding: 0.35rem 0 0.25rem;
}
.thank-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2, #3dd6c6);
}
.thank-page-header h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 22ch;
}
.thank-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 52ch;
}
.thank-callout {
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(91, 157, 255, 0.35);
  background:
    linear-gradient(135deg, rgba(91, 157, 255, 0.14), rgba(61, 214, 198, 0.06));
  color: var(--text);
  line-height: 1.55;
  font-size: 0.95rem;
}
.thank-section {
  padding: 1.2rem 1.25rem 1.3rem;
}
.thank-section h2 {
  margin: 0 0 0.65rem;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}
.thank-section > p {
  margin: 0 0 0.85rem;
  color: var(--text);
  line-height: 1.55;
  max-width: none;
}
.thank-section > p:last-child { margin-bottom: 0; }
.thank-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.thank-checklist li {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.55rem;
  align-items: start;
  color: var(--text);
  line-height: 1.45;
  font-size: 0.95rem;
}
.thank-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(61, 214, 198, 0.16);
  color: var(--accent-2, #3dd6c6);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.05rem;
}
.thank-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
@media (min-width: 640px) {
  .thank-benefits { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
}
.thank-benefit {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(13, 21, 36, 0.65);
}
.thank-benefit h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--text);
}
.thank-drawing {
  border-color: rgba(61, 214, 198, 0.32);
  background: var(--panel);
}
.thank-rules-list {
  margin: 0.25rem 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.thank-rules-list > div {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(11, 18, 32, 0.55);
}
.thank-rules-list dt {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2, #3dd6c6);
}
.thank-rules-list dd {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}
.thank-rules-note {
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}
.thank-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.thank-steps li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.6rem;
  align-items: start;
  color: var(--text);
  line-height: 1.45;
  font-size: 0.95rem;
}
.thank-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(91, 157, 255, 0.16);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}
.thank-footer-cta {
  padding: 1.25rem 1.25rem 1.35rem;
  text-align: left;
  border: 1px solid rgba(91, 157, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(91, 157, 255, 0.1), rgba(13, 21, 36, 0.75));
}
.thank-footer-cta h2 {
  margin: 0 0 0.4rem;
  font-size: 1.12rem;
}
.thank-footer-cta .btn-row { margin-top: 0.85rem; flex-wrap: wrap; }

/* —— Home rank workspace (must-haves + considered priorities) —— */
.hero-rank { padding-bottom: 0.35rem; }
.rank-workspace { margin: 0.35rem 0 1rem; }

/* —— Home interactive comparison tool —— */
.hero-compare .hero-lead { max-width: 40rem; }
.compare-workspace { margin-top: 0.5rem; }
.compare-primary-panel {
  margin-bottom: 1rem;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid rgba(91, 157, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(91, 157, 255, 0.08), transparent 55%),
    rgba(13, 21, 36, 0.55);
}
.compare-primary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.75rem;
  align-items: start;
}
@media (max-width: 800px) {
  .compare-primary-grid { grid-template-columns: 1fr; }
}
.compare-control-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.compare-control-block .muted { margin-bottom: 0.65rem; }
.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.28rem;
  border-radius: 14px;
  border: 1px solid rgba(42, 58, 85, 0.95);
  background: rgba(11, 18, 32, 0.65);
}
.segmented-option {
  position: relative;
  flex: 1 1 5.5rem;
  min-width: 4.5rem;
  margin: 0;
  cursor: pointer;
}
.segmented-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: 11px;
  font-weight: 650;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.segmented-option:hover span {
  color: var(--text);
  background: rgba(91, 157, 255, 0.08);
}
.segmented-option input:checked + span {
  color: #fff;
  background: linear-gradient(180deg, rgba(91, 157, 255, 0.38), rgba(61, 214, 198, 0.18));
  border-color: rgba(91, 157, 255, 0.55);
  box-shadow: 0 6px 18px rgba(91, 157, 255, 0.18);
}
.segmented-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.compare-location-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 560px) {
  .compare-location-row { grid-template-columns: 1fr; }
}
.compare-location-row .field-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare-location-row select {
  min-height: 2.75rem;
  font-size: 0.98rem;
}
/* Comparison dimension chips — single horizontal row, no grid wrap glitches */
.dim-chip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.dim-chip .priority-handle {
  flex: 0 0 auto;
}
.dim-chip .priority-rank {
  flex: 0 0 auto;
}
.dim-chip-main {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  overflow: hidden;
}
.dim-chip .priority-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.dim-chip .priority-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  gap: 0.15rem;
}
.dim-kind-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border: 1px solid rgba(42, 58, 85, 0.9);
  border-radius: 999px;
  padding: 0.1rem 0.42rem;
  white-space: nowrap;
  line-height: 1.2;
}
.dim-kind-tag-sm {
  font-size: 0.6rem;
  padding: 0.08rem 0.35rem;
  opacity: 0.92;
}
.dim-chip-rating .dim-kind-tag,
.priority-pool-btn[data-dim-kind="rating"] .dim-kind-tag {
  color: var(--accent-2);
  border-color: rgba(61, 214, 198, 0.35);
  background: rgba(61, 214, 198, 0.08);
}
.dim-chip-bool .dim-kind-tag,
.priority-pool-btn[data-dim-kind="bool"] .dim-kind-tag {
  color: var(--accent);
  border-color: rgba(91, 157, 255, 0.35);
  background: rgba(91, 157, 255, 0.08);
}
.compare-dim-builder .priority-list {
  gap: 0.35rem;
}
.compare-dim-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  max-height: none;
}
.compare-dim-pool > li {
  margin: 0;
  padding: 0;
}
.compare-dim-pool .priority-pool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}
.compare-dim-pool .dim-pool-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
/* Selected dim name is the hover target for the custom popover */
.priority-label.dim-help-trigger {
  cursor: help;
  color: var(--text);
  border-bottom: 1px dotted rgba(147, 164, 195, 0.45);
  transition: color 0.12s ease, border-color 0.12s ease;
}
.priority-label.dim-help-trigger:hover,
.priority-label.dim-help-trigger:focus-visible,
.priority-label.dim-help-trigger[aria-expanded="true"] {
  color: #fff;
  border-bottom-color: rgba(91, 157, 255, 0.85);
  outline: none;
}
/* Shared dimension help popover — fixed to viewport, portaled to body in JS */
.dim-help-popover {
  position: fixed;
  z-index: 400;
  width: min(22.5rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 28rem);
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(91, 157, 255, 0.45);
  background:
    linear-gradient(180deg, rgba(28, 40, 64, 0.99) 0%, rgba(14, 22, 38, 0.99) 100%);
  box-shadow:
    0 0 0 1px rgba(11, 18, 32, 0.65),
    0 22px 56px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(91, 157, 255, 0.12);
  color: var(--text);
  pointer-events: auto;
}
.dim-help-popover[hidden],
.dim-help-popover:not(.is-open) {
  display: none !important;
}
.dim-help-popover.is-open {
  display: block !important;
}
.dim-help-popover-inner {
  padding: 0.9rem 1rem 1.05rem;
  display: grid;
  gap: 0.72rem;
}
.dim-help-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dim-help-kicker {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  border: 1px solid rgba(61, 214, 198, 0.35);
  background: rgba(61, 214, 198, 0.1);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  line-height: 1.2;
}
.dim-help-kicker.is-bool {
  color: var(--accent);
  border-color: rgba(91, 157, 255, 0.4);
  background: rgba(91, 157, 255, 0.1);
}
.dim-help-close {
  flex: 0 0 auto;
}
.dim-help-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: #fff;
}
.dim-help-block {
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(42, 58, 85, 0.9);
}
.dim-help-label {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.dim-help-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(232, 238, 249, 0.94);
}
.dim-help-note {
  color: var(--accent-2);
}
.compare-grade-legend {
  margin-top: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(42, 58, 85, 0.85);
}
.compare-grade-legend summary {
  cursor: pointer;
  list-style: none;
}
.compare-grade-legend summary::-webkit-details-marker {
  display: none;
}
.grade-legend-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}
.grade-legend-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

/* Comparison results: page scroll, frozen header, slightly wider than .wrap */
.compare-results-wide {
  /* ~1280px — wider than main wrap (1120) but not full-bleed */
  width: min(1280px, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  margin-left: calc(50% - min(640px, 50vw - 0.75rem));
  margin-right: auto;
  box-sizing: border-box;
}
.compare-results-wide .rank-search-bar {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
/* overflow must stay visible — overflow-x:auto computes overflow-y:auto and kills sticky */
.compare-table-scroll.table-wrap,
.compare-table-scroll {
  max-height: none;
  overflow: visible;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
}
.compare-table-scroll table.rank,
table.compare-match {
  width: 100%;
  min-width: 0;
  margin: 0;
  /* collapse breaks position:sticky on th in Chromium/WebKit */
  border-collapse: separate;
  border-spacing: 0;
}
/* Frozen header while the page scrolls; offset below sticky site-header */
table.compare-match thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 3.75rem;
  z-index: 5;
  background: var(--bg-elevated);
  box-shadow: none;
  backdrop-filter: none;
}
table.compare-match thead {
  position: relative;
  z-index: 5;
}
table.compare-match th.col-match,
table.compare-match td.match-score {
  min-width: 4.5rem;
  text-align: center;
}
table.compare-match th.col-dim {
  text-align: center;
  min-width: 3.6rem;
  max-width: 6.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.compare-match td.compare-cell {
  text-align: center;
  vertical-align: middle;
}
.letter-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  padding: 0.18rem 0.4rem;
  border-radius: 8px;
  font-weight: 750;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  font-family: var(--mono);
  background: rgba(91, 157, 255, 0.12);
  border: 1px solid rgba(91, 157, 255, 0.28);
  color: var(--text);
}
.letter-grade.grade-Aplus,
.letter-grade.grade-A,
.letter-grade.grade-Aminus {
  background: rgba(62, 207, 142, 0.14);
  border-color: rgba(62, 207, 142, 0.4);
  color: #8ef0c0;
}
.letter-grade.grade-Bplus,
.letter-grade.grade-B,
.letter-grade.grade-Bminus {
  background: rgba(91, 157, 255, 0.14);
  border-color: rgba(91, 157, 255, 0.4);
  color: #a8c9ff;
}
.letter-grade.grade-Cplus,
.letter-grade.grade-C,
.letter-grade.grade-Cminus {
  background: rgba(240, 180, 41, 0.12);
  border-color: rgba(240, 180, 41, 0.38);
  color: #f0d48a;
}
.letter-grade.grade-Dplus,
.letter-grade.grade-D,
.letter-grade.grade-Dminus,
.letter-grade.grade-F {
  background: rgba(240, 113, 120, 0.12);
  border-color: rgba(240, 113, 120, 0.38);
  color: #f5a0a5;
}
.match-grade {
  font-size: 1.15rem;
  min-width: 2.2rem;
  padding: 0.28rem 0.5rem;
}
.bool-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}
.bool-check.bool-yes {
  color: #8ef0c0;
  background: rgba(62, 207, 142, 0.16);
  border: 1px solid rgba(62, 207, 142, 0.4);
}
.bool-check.bool-no {
  color: #f5a0a5;
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
}
.bool-check.bool-unknown {
  opacity: 0.7;
}
.rank-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}
/* Dimensions card always full container width; filters sit below */
.compare-dims-panel {
  width: 100%;
  min-width: 0;
}
.rank-panel h2 { margin-bottom: 0.35rem; }
.rank-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
  margin-top: 0.75rem;
}
@media (min-width: 900px) {
  .rank-filter-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 560px) {
  .rank-filter-grid { grid-template-columns: 1fr; }
}
.priority-builder {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.65rem;
  align-items: start;
}
/* Wide screens: Selected (left) and Add options (right) side by side */
@media (min-width: 720px) {
  .priority-builder {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem 1.35rem;
  }
  .priority-builder .priority-available {
    padding-left: 1.15rem;
    border-left: 1px solid rgba(42, 58, 85, 0.85);
  }
}
.priority-subhead {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.priority-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  min-height: 2.5rem;
}
.priority-chip {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.45rem 0.55rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(91, 157, 255, 0.28);
  background: rgba(13, 21, 36, 0.75);
  cursor: grab;
  user-select: none;
  will-change: transform;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.15s ease,
    opacity 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}
.priority-chip.is-dragging {
  opacity: 0.55;
  border-color: var(--accent);
  z-index: 2;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.priority-chip.is-drag-over {
  box-shadow: 0 0 0 2px rgba(91, 157, 255, 0.35);
}
/* FLIP play phase — chip sliding into new rank slot */
.priority-chip.is-reordering {
  z-index: 1;
  pointer-events: none;
}
.priority-chip.is-entering {
  animation: priority-chip-enter 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes priority-chip-enter {
  from {
    opacity: 0.35;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.priority-handle {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: -0.08em;
  cursor: grab;
}
.priority-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: rgba(91, 157, 255, 0.18);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}
.priority-label { font-size: 0.92rem; font-weight: 500; color: var(--text); }
.priority-actions { display: inline-flex; gap: 0.15rem; }
.btn-icon {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(22, 32, 51, 0.9);
  color: var(--muted);
  border-radius: 9px;
  width: 1.75rem;
  height: 1.75rem;
  line-height: 1;
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.btn-icon:hover {
  color: var(--text);
  border-color: rgba(91, 157, 255, 0.45);
  background: rgba(91, 157, 255, 0.1);
}
.btn-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(91, 157, 255, 0.55);
}
.btn-icon:disabled,
.btn-icon[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.priority-empty {
  padding: 0.75rem 0.5rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  font-size: 0.9rem;
}
.priority-pool {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.priority-pool-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: rgba(13, 21, 36, 0.65);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.priority-pool-btn:hover {
  color: var(--text);
  border-color: rgba(91, 157, 255, 0.5);
  background: rgba(91, 157, 255, 0.12);
}
.priority-pool-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(91, 157, 255, 0.5);
}
/* —— Rate form dimension groups —— */
.rate-dim-group {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(42, 58, 85, 0.65);
}
.rate-dim-group:first-of-type {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: 0;
}
.rate-dim-group-title {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.rating-summary-groups {
  display: grid;
  gap: 1rem;
  margin-top: 0.65rem;
}
.rating-summary-group .fact-list {
  margin-top: 0.35rem;
}

/* —— Signature strengths (profile differentiators) —— */
.signature-strengths-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-top: 0.75rem;
}
@media (max-width: 640px) {
  .signature-strengths-grid { grid-template-columns: 1fr; }
}
.signature-subhead {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.signature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.signature-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(91, 157, 255, 0.2);
  background: rgba(13, 21, 36, 0.55);
}
.signature-program-list li {
  align-items: center;
}
.percent-positive {
  color: var(--accent-2);
  font-size: 0.85em;
  white-space: nowrap;
}
.school-param-cat {
  grid-column: 1 / -1;
  margin: 0.55rem 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--accent);
  letter-spacing: 0.01em;
}

/* —— Rank results search bar (compact, above school table) —— */
.rank-search-bar {
  margin: 0.75rem 0 0;
  padding: 0;
  max-width: 28rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.rank-search-field {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  /* override any label.field grid stacking */
  gap: 0;
  font-size: inherit;
  color: inherit;
}
.rank-search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
  transition: color 0.12s ease;
}
.rank-search-field:focus-within .rank-search-icon {
  color: var(--accent);
}
.rank-search-field input[type="search"] {
  display: block;
  width: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1524;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  /* left pad clears the absolute icon */
  padding: 0.48rem 0.7rem 0.48rem 2.15rem;
  box-shadow: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.rank-search-field input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 0.9;
}
.rank-search-field input[type="search"]:hover {
  border-color: rgba(91, 157, 255, 0.4);
}
.rank-search-field input[type="search"]:focus {
  outline: none;
  border-color: rgba(91, 157, 255, 0.65);
  background: #0f1830;
  box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.16);
}
.rank-search-field input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}
.rank-search-field input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
  filter: invert(0.75);
}

.rank-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(91, 157, 255, 0.28);
  background: linear-gradient(180deg, rgba(91, 157, 255, 0.1), rgba(13, 21, 36, 0.85));
  position: sticky;
  bottom: 0.5rem;
  z-index: 5;
}
.rank-toolbar-left { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.45rem; }
.rank-match-count { font-size: 1.15rem; color: var(--accent); }
.rank-toolbar-hint { font-size: 0.82rem; }
.rank-toolbar-actions { margin: 0; }
.rank-auto-status {
  min-height: 1em;
  color: var(--accent);
  font-size: 0.82rem;
}
.rank-workspace.is-updating {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Profile boost paywall (school admin) */
.paywall-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.paywall-benefits { margin: 0.5rem 0 0; padding-left: 1.15rem; }
.paywall-benefits li { margin: 0.25rem 0; }
.pill-ok {
  background: #145c49;
  color: var(--text);
  border: 1px solid var(--accent-2);
}
.is-paywalled { opacity: 0.92; }
.is-paywalled fieldset:disabled { opacity: 0.65; }
.school-promotion {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.promo-tagline { font-size: 1.05rem; font-weight: 500; }
.promo-event-callout {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  margin: 0.5rem 0;
}
.inline-form { display: inline; margin: 0; }

/* Primary nav: single site-admin control-panel entry */
.nav a.nav-admin-hub {
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.nav a.nav-admin-hub:hover,
.nav a.nav-admin-hub.active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Site-admin hub + critical error inbox */
.admin-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}
a.admin-hub-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.admin-hub-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 12%, transparent);
}
.admin-hub-card h3 { margin-bottom: 0.35rem; }
.admin-hub-card-alert {
  border-color: color-mix(in srgb, #b45309 45%, var(--border));
}
.admin-hub-stats {
  margin: 0.5rem 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.admin-hub-stats li { margin: 0.15rem 0; }
.row-missing-file { opacity: 0.72; }
.row-missing-file .delta-neg { color: #b45309; }

/* Collected files accordion (site admin) */
details.collected-files-acc {
  padding: 0;
  overflow: hidden;
}
.collected-files-acc-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.85rem;
  padding: 0.75rem 1rem;
  user-select: none;
}
.collected-files-acc-summary::-webkit-details-marker { display: none; }
.collected-files-acc-summary::before {
  content: "▸";
  color: var(--muted, #8b9bb4);
  font-size: 0.85em;
  width: 0.9rem;
  flex: 0 0 auto;
}
details.collected-files-acc[open] > .collected-files-acc-summary::before {
  content: "▾";
}
.collected-files-acc-title {
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.collected-files-acc-meta { margin-left: auto; }
.collected-files-acc-body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.collected-files-table { font-size: 0.9rem; }
.collected-files-table th,
.collected-files-table td {
  padding: 0.35rem 0.45rem;
  vertical-align: top;
}
.collected-files-name {
  max-width: 22rem;
}
.collected-files-title {
  display: block;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collected-files-fname {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collected-files-actions a { white-space: nowrap; }
.collected-files-table .nowrap { white-space: nowrap; }

.critical-error-card pre.code-block,
.code-block {
  background: #14211d;
  color: #e8eef7;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  max-height: 22rem;
  overflow-y: auto;
}

/* Teacher profile + two-sided job board */
.teacher-encourage {
  border-left: 3px solid var(--accent, #3b82f6);
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem 1rem;
}
.checkbox-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.checkbox-field input[type="checkbox"] {
  width: auto;
  align-self: flex-start;
}
.progress-bar {
  height: 0.45rem;
  background: color-mix(in srgb, var(--border, #334) 80%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent, #3b82f6);
  border-radius: 999px;
}
.checklist {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.checklist li { margin: 0.15rem 0; }
.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.doc-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #334) 70%, transparent);
}
.doc-list-item:last-child { border-bottom: 0; }
.inline-form { display: inline; margin: 0; }
.teacher-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border, #334) 80%, transparent);
  background: #0f172a;
}
.teacher-avatar-lg {
  width: 96px;
  height: 96px;
}
.teacher-public-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}
.teacher-photo-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}
.fact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.fact-list li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.5rem;
  padding: 0.25rem 0;
}
.preserve-lines { white-space: pre-wrap; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.school-context-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.school-context-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #334) 60%, transparent);
}
.candidate-card .job-card-title { font-size: 1.05rem; }

/* ---------- School photo carousel ---------- */
/* Full-width strip: aspect-ratio + max-height alone can shrink width and
   left-align the viewport on wide layouts — keep min-width 100% and center crop. */
.school-photo-carousel {
  margin: 1rem 0 1.25rem;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface, #1a2332) 92%, #000);
  border: 1px solid color-mix(in srgb, var(--border, #334) 70%, transparent);
}
.school-photo-carousel-viewport {
  position: relative;
  width: 100%;
  min-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 22rem;
  background: var(--bg);
  overflow: hidden;
}
.school-photo-slide {
  margin: 0;
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
.school-photo-slide.is-active {
  display: flex;
}
.school-photo-img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  display: block;
}
.school-photo-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.4rem 0.65rem;
  border-top: 1px solid color-mix(in srgb, var(--border, #334) 60%, transparent);
}
.school-photo-nav {
  min-width: 2.25rem;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.15rem 0.5rem;
  flex: 0 0 auto;
}
.school-photo-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  flex: 1 1 auto;
}
.school-photo-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: color-mix(in srgb, var(--muted, #94a3b8) 55%, transparent);
}
.school-photo-dot.is-active {
  background: var(--accent, #38bdf8);
  transform: scale(1.15);
}
.school-photo-counter {
  text-align: center;
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
}
.profile-modal-scroll .school-photo-carousel {
  margin-top: 0.35rem;
  width: 100%;
}
.profile-modal-scroll .school-photo-carousel-viewport {
  max-height: 14rem;
  min-width: 100%;
  width: 100%;
}

/* School admin photo management */
.school-admin-photo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.school-admin-photo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #334) 55%, transparent);
}
.school-admin-photo-thumb img {
  width: 7.5rem;
  height: 5rem;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--bg);
}
.school-admin-photo-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
@media (max-width: 640px) {
  .school-admin-photo-item {
    grid-template-columns: auto 1fr;
  }
  .school-admin-photo-remove {
    grid-column: 1 / -1;
  }
}

/* Pine surfaces. These beat earlier glass paints and the rejected cream/navy hexes. */

body {
  background-color: var(--bg);
  background-image: none;
  color: var(--text);
  font-family: var(--font);
}
.site-header {
  background-color: var(--bg);
  background-image: none;
  backdrop-filter: none;
}
h1, h2, h3, .hero h1, .brand strong {
  font-family: var(--display);
  color: var(--text);
  background-image: none;
}

.rank-search-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
  color: var(--text);
}
.rank-search-field input[type="search"],
.rank-search-field input[type="search"]:focus {
  background: #14211d;
  color: var(--text);
  border-color: var(--border);
  min-height: 44px;
}
.rank-search-field input[type="search"]::-webkit-search-cancel-button {
  filter: none;
}

table.rank {
  background: var(--panel);
}
table.rank th,
table.data-table th,
table.cost-bands-table th,
table.compare-match thead th {
  background: var(--bg-elevated);
  color: var(--muted);
  box-shadow: none;
  backdrop-filter: none;
}
table.rank th, table.rank td,
table.cost-bands-table th,
table.cost-bands-table td {
  border-bottom-color: var(--border);
}

.ai-box,
.ai-box.ai-md strong {
  color: var(--text);
  background: var(--panel);
}
.quote {
  background: var(--panel);
}
.pill-warn { color: #7a5200; background: #fbf3df; }
.pill-danger,
.pill.devices-pill[data-devices-policy="not_allowed"] {
  color: #8d1e24;
  background: #fdecea;
  border-color: #e7c4c6;
}
.ops-report-item { background: var(--panel); }

.letter-grade.grade-Aplus,
.letter-grade.grade-A,
.letter-grade.grade-Aminus {
  background: #e5f6ec;
  border-color: #b7dfc6;
  color: #146c3a;
}
.letter-grade.grade-Bplus,
.letter-grade.grade-B,
.letter-grade.grade-Bminus {
  background: #e5f3ec;
  border-color: #b7dfc6;
  color: #145c49;
}
.letter-grade.grade-Cplus,
.letter-grade.grade-C,
.letter-grade.grade-Cminus {
  background: #fbf3df;
  border-color: #ead7a4;
  color: #7a4e00;
}
.letter-grade.grade-Dplus,
.letter-grade.grade-D,
.letter-grade.grade-Dminus,
.letter-grade.grade-F {
  background: #fdecea;
  border-color: #e7c4c6;
  color: #8d1e24;
}

.chat-fab {
  background-color: var(--bg);
  background-image: none;
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 8px;
  box-shadow: none;
  animation: none;
  min-height: 44px;
}
.chat-fab:hover { transform: none; box-shadow: none; }
.offcanvas-backdrop, .modal-backdrop {
  background: rgba(12, 18, 16, 0.62);
  backdrop-filter: none;
}
.offcanvas,
.offcanvas-header,
.modal-panel,
.profile-modal .profile-modal-panel,
.profile-modal .profile-modal-shell-header,
.profile-modal-hero,
.profile-modal-footer {
  background: var(--panel);
  color: var(--text);
  box-shadow: none;
  backdrop-filter: none;
}
.cookie-banner {
  background: var(--panel);
  box-shadow: none;
  border-top: 1px solid var(--border);
}
.dim-help-popover {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.dim-help-title,
.priority-label.dim-help-trigger:hover,
.priority-label.dim-help-trigger:focus-visible,
.priority-label.dim-help-trigger[aria-expanded="true"] {
  color: var(--text);
}
.priority-label.dim-help-trigger { cursor: pointer; }
.segmented-control {
  background: var(--bg-elevated);
  border-color: var(--border);
}
.segmented-option input:checked + span {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
.message-log { background: var(--bg); }
.message-bubble { background: var(--panel); color: var(--text); }
.message-bubble--parent { background: #1e3f3a; color: var(--text); }
.message-bubble--school { background: #1a3328; color: var(--text); }
.message-bubble--site { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.site-message-start,
.contact-account-prompt,
.jobs-marketing,
.thank-callout,
.thank-drawing,
.thank-footer-cta,
.compare-primary-panel,
.rank-toolbar,
.rate-agreement,
.rate-agreement-body,
.file-drop-ui,
.profile-admin-audit {
  background: var(--panel);
  background-image: none;
  color: var(--text);
}
.rate-agreement-body { background: var(--panel); }
.rate-agreement-body p,
.rate-agreement-body li,
.rate-agreement-challenge { color: var(--text) !important; }
.bool-check.bool-yes { color: #146c3a; background: #e5f6ec; border-color: #b7dfc6; }
.bool-check.bool-no { color: #8d1e24; background: #fdecea; border-color: #e7c4c6; }
.critical-error-card pre.code-block,
.code-block {
  background: #14211d;
  color: var(--text);
}
.btn-icon {
  width: 44px;
  height: 44px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.school-logo-placeholder {
  background: var(--bg-elevated);
  color: var(--muted);
}
.feedback-status-pill.status-open { color: var(--warn); }
.feedback-status-pill.status-reviewed { color: var(--good); }
.feedback-status-pill.status-closed { color: var(--muted); }
.nav-badge { background: var(--accent); color: var(--bg); }

@media (max-width: 800px) {
  .compare-table-scroll,
  .compare-table-scroll.table-wrap,
  .table-wrap {
    overflow-x: auto;
    max-width: 100%;
  }
  table.compare-match thead th {
    position: static;
  }
}
