/* Palette roles: light first, dark redefined below. Status colours are fixed in both modes. */
:root {
  color-scheme: light;
  --plane: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --ink: #0f1720;
  --ink-2: #4b5563;
  --muted: #8a919c;
  --line: #e6e9ef;
  --border: rgba(15, 23, 32, .08);
  --accent: #2563eb;
  --accent-soft: #dbe7fd;
  --brand-1: #0b2f5b;   /* deep university blue */
  --brand-2: #0f766e;   /* teal */
  --brand-3: #7c3aed;   /* violet highlight */
  --violet: #7c3aed;
  --good: #0ca30c;
  --warning: #f59e0b;
  --serious: #ea7a4b;
  --critical: #dc3b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 32, .04), 0 4px 16px rgba(15, 23, 32, .06);
  --shadow-lift: 0 2px 4px rgba(15, 23, 32, .06), 0 12px 28px rgba(15, 23, 32, .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --plane: #0b0f16; --surface: #141a23; --surface-2: #1a212c; --ink: #f3f5f8; --ink-2: #b7bfcb; --muted: #7d8694;
    --line: #242c38; --border: rgba(255,255,255,.08); --accent: #5b8def; --accent-soft: #1e3a6e;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.5), 0 14px 30px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--plane); color: var(--ink);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; letter-spacing: -.005em; }
h2 .icon { color: var(--accent); }
h3 { font-size: 15px; margin: 0 0 8px; }
.icon { flex: none; vertical-align: -3px; }

/* Header: brand gradient bar */
header.top {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 10px 24px; color: #fff;
  background: linear-gradient(100deg, var(--brand-1) 0%, #12457e 55%, var(--brand-2) 100%);
  box-shadow: 0 2px 12px rgba(11, 47, 91, .25);
  position: sticky; top: 0; z-index: 1100; /* above Leaflet controls (1000) */
}
header.top .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
header.top .brand img { display: block; background: #fff; border-radius: 50%; padding: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-org { font-size: 11px; letter-spacing: .14em; opacity: .75; }
.brand-text strong { font-size: 17px; letter-spacing: .01em; }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
header.top nav a {
  display: inline-flex; align-items: center; gap: 7px; color: rgba(255,255,255,.78); text-decoration: none;
  padding: 7px 12px; border-radius: 999px; font-size: 14px; transition: background .15s, color .15s;
}
header.top nav a:hover { color: #fff; background: rgba(255,255,255,.12); }
header.top nav a.active { color: var(--brand-1); background: #fff; font-weight: 600; }
header.top .spacer { margin-left: auto; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.9); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f59e0b, #ec4899); color: #fff; font-weight: 700; font-size: 13px;
}
header.top .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }
header.top .btn.ghost:hover { background: rgba(255,255,255,.12); }

main { padding: 24px; max-width: 1320px; margin: 0 auto; animation: rise .35s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .spacer { margin-left: auto; }
.sub { color: var(--ink-2); font-size: 13px; }

/* Hero band on the overview */
.hero {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: #fff;
  padding: 24px 28px; margin-bottom: 20px; border-radius: calc(var(--radius) + 4px); position: relative; overflow: hidden;
  background:
    radial-gradient(600px 220px at 85% -20%, rgba(124, 58, 237, .45), transparent 60%),
    radial-gradient(500px 240px at 10% 130%, rgba(15, 118, 110, .55), transparent 60%),
    linear-gradient(120deg, var(--brand-1), #173f73);
  box-shadow: var(--shadow-lift);
}
.hero h1 { font-size: 28px; color: #fff; }
.hero-kicker { margin: 0 0 2px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.hero-sub { margin: 0; opacity: .85; font-size: 14px; }
.hero .spacer { margin-left: auto; }
.btn.hero-btn { background: #fff; color: var(--brand-1); border: 0; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.btn.hero-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head .more { margin-left: auto; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; text-decoration: none; }
.more:hover .icon { transform: translateX(2px); }
.more .icon { transition: transform .15s; }
.grid { display: grid; gap: 18px; }
.two-col { grid-template-columns: 1fr 1fr; }
/* Several cards stacked in one column of a two-col grid, packed at the top. */
.col-stack { align-content: start; }
.overview-split { grid-template-columns: minmax(280px, 2fr) 3fr; }
@media (max-width: 900px) { .two-col, .overview-split { grid-template-columns: 1fr; } }

/* Stat tiles */
.tiles { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 20px; }
.tile {
  --tone: var(--accent); display: flex; flex-direction: column; margin: 0; color: inherit; text-decoration: none;
  position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
}
.tile::after {
  content: ""; position: absolute; inset: auto -30px -40px auto; width: 120px; height: 120px; border-radius: 50%;
  background: var(--tone); opacity: .08;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.tile.tone-critical { --tone: var(--critical); }
.tile.tone-serious { --tone: var(--serious); }
.tile.tone-accent { --tone: var(--accent); }
.tile.tone-violet { --tone: var(--violet); }
.tile-icon {
  width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, transparent); margin-bottom: 12px;
}
.tile .label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.tile .value { font-size: 36px; font-weight: 750; line-height: 1.1; margin: 2px 0; letter-spacing: -.02em;
               font-variant-numeric: tabular-nums; }
.tile .note { color: var(--muted); font-size: 12px; }

/* Severity donut */
/* Donut with its legend centred underneath. */
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.donut {
  --a: calc(var(--critical-pct) * 1%); --b: calc((var(--critical-pct) + var(--serious-pct)) * 1%);
  width: 210px; height: 210px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--critical) 0 var(--a), var(--serious) var(--a) var(--b), var(--warning) var(--b) 100%);
}
.donut-hole {
  width: 136px; height: 136px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px var(--border);
}
.donut-hole strong { font-size: 38px; line-height: 1; }
.donut-hole span { font-size: 13px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; justify-items: center; width: 100%; }
.legend li { display: flex; align-items: center; justify-content: center; gap: 8px; }
.legend li strong { font-variant-numeric: tabular-nums; }
.legend .sub { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
     text-transform: uppercase; letter-spacing: .06em; padding: 8px 12px; border-bottom: 1px solid var(--line);
     background: var(--surface-2); }
th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Severity and status pills */
.sev {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; font-weight: 600;
  padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--surface-2);
}
.sev .dot { font-size: 12px; line-height: 1; }
/* Critical is solid, not a tint: on a long list it has to be findable at a glance. */
.sev-critical { color: #fff; background: var(--critical); }
.sev-serious { color: #c2410c; background: color-mix(in srgb, var(--serious) 16%, transparent); }
.sev-warning { color: #a16207; background: color-mix(in srgb, var(--warning) 18%, transparent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sev-serious { color: var(--serious); }
  :root:not([data-theme="light"]) .sev-warning { color: var(--warning); }
}
/* A severity stripe down the left of each findings row, so the shape of a list is readable
   before any text is. Colour is never the only cue: the pill carries an icon and a word too. */
tr.flag-row td:first-child { border-left: 4px solid transparent; }
tr.flag-row.sev-row-critical td:first-child { border-left-color: var(--critical); }
tr.flag-row.sev-row-serious td:first-child { border-left-color: var(--serious); }
tr.flag-row.sev-row-warning td:first-child { border-left-color: var(--warning); }
tr.flag-row.sev-row-critical { background: color-mix(in srgb, var(--critical) 5%, transparent); }
tr.flag-row.sev-row-critical:hover { background: color-mix(in srgb, var(--critical) 10%, transparent); }
tr.flag-row.sev-row-critical td:nth-child(2) a { font-weight: 650; }

/* Kind icon: what the problem is, in the severity's colour. */
.flag-title { display: flex; gap: 10px; align-items: flex-start; }
.kind-ic { flex: none; display: inline-flex; padding-top: 1px; color: var(--muted); }
.sev-row-critical .kind-ic { color: var(--critical); }
.sev-row-serious .kind-ic { color: var(--serious); }
.sev-row-warning .kind-ic { color: var(--warning); }
.kind-inline { vertical-align: -3px; margin-right: 4px; }
.bar-label .icon { vertical-align: -3px; margin-right: 6px; color: var(--muted); }

/* One card per kind of finding: big icon, count, and how many of them are critical.
   Clicking a card filters the list to that kind; clicking it again clears. */
.kind-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kind-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto;
  column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--ink-2); text-decoration: none; transition: box-shadow .12s, border-color .12s;
}
.kind-card:hover { box-shadow: var(--shadow-lift); }
.kind-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.kc-ic { grid-row: 1 / 3; display: inline-flex; color: var(--muted); }
.kind-card.has-critical .kc-ic { color: var(--critical); }
.kc-n { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.kc-label { font-size: 12px; font-weight: 600; line-height: 1.3; }
.kc-crit { grid-column: 2; font-size: 11px; font-weight: 700; color: var(--critical); margin-top: 4px; }

/* Kind headings inside the findings table. */
tr.group-head th {
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; text-transform: none;
  letter-spacing: 0; padding: 8px 12px; border-radius: 0;
}
tr.group-head .icon { vertical-align: -4px; margin-right: 8px; color: var(--muted); }
tr.group-head .sub { margin-left: 8px; font-weight: 600; }

/* Severity totals above the findings table; each one filters the list. */
.sev-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.sev-summary a {
  display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--ink-2); font-size: 12px; font-weight: 600; text-decoration: none;
  border-left: 4px solid var(--tone, var(--line));
}
.sev-summary a:hover { box-shadow: var(--shadow-lift); }
.sev-summary a.is-on { border-color: var(--tone); border-left-color: var(--tone); }
.sev-summary .n { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.sev-summary .critical { --tone: var(--critical); }
.sev-summary .serious { --tone: var(--serious); }
.sev-summary .warning { --tone: var(--warning); }
.sev-summary .critical .n { color: var(--critical); }

.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border);
}
.chip.open { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip.confirmed { color: #fff; background: var(--critical); border-color: transparent; }
.chip.dismissed { color: var(--muted); }

/* Bars (findings by type) */
.bars { display: grid; gap: 8px; }
.bar { display: block; color: inherit; text-decoration: none; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; }
.bar:hover { background: var(--surface-2); }
.bar-label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.bar-row { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; }
.bar-track { display: block; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
             box-shadow: inset 0 0 0 1px var(--border); }
.bar-fill {
  display: block; height: 100%; width: var(--w); border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--accent) 60%, var(--brand-3));
  animation: grow .8s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes grow { from { width: 0; } }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Recent inspections feed */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: inherit;
  text-decoration: none; border: 1px solid var(--border); transition: background .12s, transform .12s;
}
.feed a:hover { background: var(--surface-2); transform: translateX(2px); }
.feed a > .icon { color: var(--muted); margin-left: auto; }
.feed-badge {
  flex: none; min-width: 48px; text-align: center; padding: 6px 8px; border-radius: 10px; font-weight: 700;
  font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--accent));
}
.feed-main { display: flex; flex-direction: column; min-width: 0; }
.feed-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Forms and buttons */
form.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
form.filters label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 3px; }
/* One height for every control in a filter row. Safari draws search boxes and menus its own way and
   ignores their padding, so both are drawn here instead, the menu with its own arrow. */
form.filters input, form.filters select, form.filters .btn { height: 38px; box-sizing: border-box; margin: 0; }
input[type=search], form.filters select { -webkit-appearance: none; appearance: none; }
form.filters select {
  padding-right: 32px; background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%237d8694' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input, select, textarea, button { font: inherit; }
input[type=text], input[type=number], input[type=password], select, textarea {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
  cursor: pointer; font-weight: 500; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #4f46e5); border-color: transparent; color: #fff;
               box-shadow: 0 4px 14px rgba(37, 99, 235, .3); }
.btn.primary:hover { box-shadow: 0 8px 20px rgba(37, 99, 235, .38); }
.btn.small { padding: 5px 11px; font-size: 13px; }
th.sortable a, th.sortable a:hover { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th.sortable a:hover { color: var(--ink-2); }
/* A data table: headers read as headings, larger than the rows under them. */
table.data th { font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink-2); padding: 10px 12px; }
table.data td { font-size: 13px; padding: 9px 12px; }
table.data th a, table.data th a:hover { text-decoration: none !important; }
table.data td a { text-decoration: none; }
table.data td a:hover { text-decoration: underline; }
/* Long college names wrap to two lines at most; the full name is in the tooltip. */
table.data td.name-cell { max-width: 360px; }
td.name-cell > a { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
                   overflow: hidden; }

.suggestion { border: 1px dashed var(--accent); border-radius: 12px; padding: 4px 14px 12px; margin-bottom: 12px;
              background: var(--accent-soft); }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Colleges by stream: total first, then each stream; a card filters the list to its stream. */
.stream-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stream-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px;
               border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none;
               transition: box-shadow .12s, border-color .12s; }
.stream-stat:hover { box-shadow: var(--shadow); }
.stream-stat.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.stream-stat.total { background: var(--accent-soft); border-color: transparent; }
.ss-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ss-value { font-size: 22px; font-weight: 750; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ss-note { font-size: 12px; color: var(--muted); }
.ss-bar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 4px; overflow: hidden; }
.ss-bar span { display: block; height: 100%; background: var(--good); }

/* Groups: suggested groups as cards, each with its map colour (groups_map.js uses the same hue). */
.groups-map { height: 420px; margin-top: 10px; }
/* Suggested groups: one group at a time on the left, the map beside it. */
.suggest-layout { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; margin-top: 12px; align-items: start; }
.suggest-panel { display: flex; flex-direction: column; gap: 10px; max-height: 600px; }
.suggest-panel .cluster { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow-y: auto; }
.suggest-panel .cluster[hidden] { display: none; }
.suggest-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.suggest-nav .btn:disabled { opacity: .4; cursor: default; }
.suggest-layout .groups-map { height: 600px; margin-top: 0; }
@media (max-width: 900px) {
  .suggest-layout { grid-template-columns: 1fr; }
  .suggest-panel { max-height: none; }
  .suggest-layout .groups-map { height: 380px; }
}
/* Groups maps: the home map's stream markers (.cm-marker) in the group's colour; "nearby" ones hollow. */
.gm-nearby { background: #fff; color: #7d8694; border: 2px dashed #7d8694; box-shadow: none; }
.cluster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cluster { display: flex; flex-direction: column; margin: 0; scroll-margin-top: 80px; }
.cluster:target { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.cluster .card-head { gap: 8px; }
.cluster-swatch { width: 14px; height: 14px; border-radius: 50%; flex: none;
                  background: hsl(calc(var(--i) * 137.5deg) 70% 45%); }
.cluster-name, .group-title { font: inherit; font-weight: 650; border: 1px solid transparent; border-radius: 8px;
                              padding: 4px 6px; background: transparent; color: var(--ink); width: 100%; }
.cluster-name:hover, .cluster-name:focus, .group-title:hover, .group-title:focus { border-color: var(--line); background: var(--surface); }
.group-title { font-size: 22px; max-width: 520px; }
.rename { display: flex; align-items: center; gap: 8px; }
.cluster-colleges { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 6px; flex: 1; }
.cluster-colleges li label, .cluster-colleges li form { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.cluster-colleges .sub { display: block; }
.cluster-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pop-up (native <dialog>), e.g. assigning a suggested group. */
dialog.modal { width: min(520px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
               background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
dialog.modal h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 6px 0 10px; }
/* Wide pop-up: form and college list on the left, map of the colleges on the right. */
dialog.modal.wide { width: min(1040px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; }
.assign-layout { display: grid; grid-template-columns: minmax(320px, 1fr) 1.2fr; height: min(640px, calc(100vh - 34px)); }
.assign-side { padding: 20px 22px; overflow-y: auto; }
.assign-map-wrap { position: relative; min-height: 300px; border-left: 1px solid var(--line); }
.assign-map { position: absolute; inset: 0; }
/* Over a map: why it shows nothing for this group (its colleges have no location). */
.map-note { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; margin: 0;
            width: min(360px, calc(100% - 24px)); padding: 10px 14px; border-radius: 10px; font-size: 13px;
            background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.suggest-map { position: relative; }
.assign-colleges-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.assign-colleges { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: 10px;
                   max-height: 240px; overflow-y: auto; }
.assign-colleges li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px;
                      border-bottom: 1px solid var(--line); font-size: 13px; }
.assign-colleges li:last-child { border-bottom: 0; }
.assign-inspector { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 0; margin: 0 0 12px; }
.assign-inspector legend { font-weight: 600; padding: 0 4px; }
.assign-inspector .form-field { margin-bottom: 10px; }
input[type=tel], input[type=date] { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); }
.assign-colleges li > span { display: flex; flex-direction: column; min-width: 0; }
.assign-colleges li strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .assign-layout { grid-template-columns: 1fr; grid-template-rows: auto 280px; height: auto; max-height: calc(100vh - 34px); overflow-y: auto; }
  .assign-map-wrap { border-left: 0; border-top: 1px solid var(--line); }
}
.add-inspector summary { cursor: pointer; }
.add-inspector .form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px;
                            margin-top: 12px; align-items: start; }
.add-inspector .form-grid > p { grid-column: 1 / -1; margin: 0; }
form.filters .grow { flex: 1; min-width: 240px; }
form.filters .grow input { width: 100%; }

/* Edit forms: label above field, help and error under it. */
.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form-field label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.form-field input:not([type=checkbox]), .form-field select, .form-field textarea { width: 100%; box-sizing: border-box; }
.form-field .field-error { color: var(--critical); font-size: 13px; }
.form-field.has-error input, .form-field.has-error select { border-color: var(--critical); }
input[type=email], input[type=search] { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); }
.sort-arrow { font-size: 9px; opacity: .45; }
th[aria-sort] .sort-arrow { opacity: 1; color: var(--accent); }
.pager {display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding-top: 14px; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages li { padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
               box-shadow: var(--shadow); }
.messages li.success { border-left: 4px solid var(--good); }
.messages li.error { border-left: 4px solid var(--critical); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.photo { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2);
         transition: transform .15s, box-shadow .15s; }
.photo:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.photo img { width: 100%; height: 150px; object-fit: cover; display: block; }
.photo video { width: 100%; height: 150px; display: block; background: #000; }
.photo .meta { padding: 8px 10px; font-size: 12px; color: var(--ink-2); }
.photo .flag { color: var(--critical); }
.step-note { margin: 10px 0 0; padding: 9px 13px; border-left: 3px solid var(--accent); background: var(--surface-2);
             border-radius: 0 10px 10px 0; font-size: 14px; }
.map { height: 380px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.key { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; }

/* Sign-in page: full-bleed brand background */
body.login-page {
  background:
    radial-gradient(700px 400px at 90% 0%, rgba(124, 58, 237, .35), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(15, 118, 110, .45), transparent 60%),
    linear-gradient(135deg, var(--brand-1), #173f73);
}
body.login-page .login-wrap .card { box-shadow: 0 20px 50px rgba(0,0,0,.3); border: 0; }
.login-wrap { max-width: 400px; margin: 0 auto; min-height: calc(100vh - 48px); display: flex; flex-direction: column; justify-content: center; }
.login-wrap .card { text-align: center; padding: 28px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-brand img { flex: none; }
.login-brand h1 { font-size: 26px; margin: 0; background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
                  -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-brand h1 { background: none; color: var(--ink); }
}
.diff-up { color: var(--critical); font-weight: 600; }
.diff-ok { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 700px) {
  main { padding: 16px; }
  header.top { padding: 10px 16px; gap: 10px; }
  .user-chip { display: none; }
  .hero { padding: 20px; }
}

/* Photo map pins (photo_map.js): colour and icon by what was photographed */
:root { --pm-college: #0ca30c; --pm-lab: #7b4fd0; --pm-hospital: #0f8fa6; --pm-mixed: #52514e; }
.pm-college { --pm: var(--pm-college); } .pm-lab { --pm: var(--pm-lab); }
.pm-hospital { --pm: var(--pm-hospital); } .pm-mixed { --pm: var(--pm-mixed); }
.pm-pin-wrap { position: relative; width: 34px; height: 44px; }
.pm-pin { position: absolute; left: 2px; top: 0; width: 30px; height: 30px; border-radius: 50% 50% 50% 0;
          transform: rotate(-45deg); transform-origin: 50% 50%; margin-top: 4px; background: var(--pm);
          border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pm-pin svg { width: 17px; height: 17px; color: #fff; transform: rotate(45deg); position: absolute; left: 4.5px; top: 4.5px; }
.pm-count, .pm-alert { position: absolute; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
                       font: 700 11px/18px system-ui, sans-serif; text-align: center; color: #fff;
                       border: 1.5px solid #fff; box-sizing: border-box; }
.pm-count { right: -8px; top: -6px; background: #1d1d1b; }
.pm-alert { left: -8px; top: -6px; background: var(--critical); }
.pm-place { width: 28px; height: 28px; box-sizing: border-box; border-radius: 6px; background: #fff;
            border: 2.5px solid var(--pm); color: var(--pm); display: flex; align-items: center; justify-content: center;
            box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.pm-place.pm-college { --pm: var(--accent); }
.pm-place svg { width: 17px; height: 17px; }
.pm-kind { display: inline-flex; vertical-align: -1px; margin-right: 3px; color: var(--pm); }
.pm-kind svg { width: 11px; height: 11px; }
.pm-sub { color: #666; font-size: 11px; }
.pm-swatch { display: inline-flex; vertical-align: -3px; color: var(--pm); }
.pm-swatch svg { width: 12px; height: 12px; }
.pm-popup .leaflet-popup-content-wrapper, .pm-popup .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.pm-popup .leaflet-popup-content { margin: 10px; }
.pm-head { font-weight: 600; margin-bottom: 8px; }
.pm-list { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; }
.pm-item { display: flex; gap: 10px; color: inherit; text-decoration: none; align-items: flex-start; }
.pm-item:hover .pm-meta strong { text-decoration: underline; }
.pm-item img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; background: var(--plane); }
.pm-meta { font-size: 12px; line-height: 1.4; color: var(--ink-2); }
.pm-meta strong { color: var(--ink); font-size: 13px; }
.pm-flag { color: var(--critical); }
.pm-key-place { display: inline-flex; width: 15px; height: 15px; border-width: 1.5px; border-radius: 4px; vertical-align: -3px; box-shadow: none; }
.pm-key-place svg { width: 10px; height: 10px; }
.key > span { display: inline-flex; align-items: center; gap: 4px; }
.pm-key-badge { position: static; display: inline-block; min-width: 14px; height: 14px; line-height: 12px;
                font-size: 9px; padding: 0 3px; border-width: 1px; }
.pm-item img { cursor: zoom-in; }
.pm-list { max-height: 300px; }

/* Full-size photo viewer (photo_map.js) */
.pm-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.88); display: flex;
             align-items: center; justify-content: center; padding: 48px 64px; }
.pm-viewer[hidden] { display: none; }
.pm-viewer figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pm-viewer img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; border-radius: 6px; background: #111; }
.pm-viewer figcaption { color: #ddd; font-size: 13px; line-height: 1.5; text-align: center; max-width: 720px; }
.pm-viewer figcaption strong { color: #fff; }
.pm-viewer figcaption a { color: #9cc6ff; }
.pm-v-count { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 8px; background: #333; color: #fff; }
.pm-v-close, .pm-v-nav { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
                         border-radius: 50%; width: 44px; height: 44px; font-size: 28px; line-height: 44px; padding: 0; }
.pm-v-close:hover, .pm-v-nav:hover { background: rgba(255,255,255,.25); }
.pm-v-close { top: 12px; right: 12px; }
.pm-v-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.pm-v-next { right: 12px; top: 50%; transform: translateY(-50%); }
.pm-v-nav[hidden] { display: none; }
.login-brand .sub { margin: 4px 0 0; }
.login-form { text-align: left; margin-top: 16px; }
.login-form p { margin: 0 0 14px; }
.login-form label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 14px; }
.login-form input { width: 100%; box-sizing: border-box; }
.login-form .btn { width: 100%; justify-content: center; padding-block: 10px; }

/* Floor-plan scans (inspection page) */
.floor-plan { display: grid; grid-template-columns: minmax(220px, 420px) 1fr; gap: 16px; align-items: start; margin: 10px 0 18px; }
.floor-plan svg { width: 100%; height: auto; max-height: 420px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.floor-plan .meta { font-size: 13px; color: var(--ink-2); }
.floor-plan .flag { color: var(--critical); }
.fp-room { fill: rgba(11, 47, 91, .08); stroke: var(--brand-1); stroke-linejoin: round; }
.fp-door { stroke: #d97706; stroke-linecap: round; }
.fp-window { stroke: #0ea5e9; stroke-linecap: round; }
.fp-label { fill: var(--ink); }
.fp-rooms { margin: 8px 0; border-collapse: collapse; }
.fp-rooms td { padding: 2px 10px 2px 0; }
@media (max-width: 700px) { .floor-plan { grid-template-columns: 1fr; } }

/* Home map (college_map.js): icon = stream, colour = status, tick = inspected */
.cm-marker { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); box-sizing: border-box; }
.cm-tick { position: absolute; right: -6px; top: -6px; width: 15px; height: 15px; border-radius: 50%; background: #fff;
  color: #15803d; font: 800 11px/15px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 1.5px #15803d; }
.cm-bad { background: #dc2626; }
.cm-warn { background: #d97706; }
.cm-progress { background: #2563eb; }
.cm-ok { background: #16a34a; }
.cm-none { background: #8b95a3; }
.cm-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.cm-tick-key { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 5px; text-align: center;
  font: 800 10px/14px system-ui, sans-serif; color: #15803d; box-shadow: 0 0 0 1.5px #15803d; }
.cm-stream { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.map-card { margin-bottom: 18px; }
.map-card .map { height: 460px; }
.map-layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
.college-list { display: flex; flex-direction: column; height: 460px; min-width: 0; }
.college-list input { padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  color: var(--ink); font: inherit; }
.college-list .sub { margin: 6px 2px; }
.cl-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
#college-sort { grid-column: 1 / -1; }
/* Inspector photos (face enrollment photo, or the latest matched face check) */
.face { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; flex: none; }
.face-sm { width: 36px; height: 36px; font-size: 15px; vertical-align: middle; margin-right: 10px; }
.face-lg { width: 88px; height: 88px; font-size: 34px; margin-right: 18px; border: 3px solid var(--surface); box-shadow: var(--shadow); }
td.person a { display: inline-flex; align-items: center; color: inherit; }
/* Facilities checklist (college page) */
.facility-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facility-list li { display: flex; gap: 10px; align-items: flex-start; }
.facility-list .sub { display: block; }
.tick { display: inline-flex; align-items: center; justify-content: center; width: 22px; flex: none;
  font-weight: 800; font-size: 18px; line-height: 1.2; }
.tick.yes { color: #16a34a; }
.tick.no { color: var(--critical); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.score-big { margin-left: 10px; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-big .sub { font-size: 14px; font-weight: 500; }
.score-parts { width: 100%; border-collapse: collapse; font-size: 14px; }
.score-parts th, .score-parts td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.score-parts .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.score-parts tr.muted td { color: var(--muted); }
.cl-score { margin-left: auto; flex: none; align-self: center; min-width: 34px; padding: 3px 6px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); text-align: center; font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums; }
.cl-filters select { min-width: 0; padding: 7px 8px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; }
.college-list ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; border: 1px solid var(--border); border-radius: 10px; }
.college-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; cursor: pointer; border-bottom: 1px solid var(--border); }
.college-list li:last-child { border-bottom: 0; }
/* The rule above sets display:flex, which would override the hidden attribute used by the filters. */
.college-list li[hidden] { display: none; }
.college-list li:hover, .college-list li:focus-visible { background: var(--surface-2); outline: none; }
.college-list li.selected { background: var(--accent-soft, #e8effd); }
.cl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.cl-main strong { overflow-wrap: anywhere; }
.cl-state { font-size: 12px; font-weight: 600; }
.cl-bad { color: #dc2626; } .cl-warn { color: #b45309; } .cl-progress { color: #2563eb; } .cl-ok { color: #15803d; } .cl-none { color: var(--muted, #8b95a3); }
.cm-marker.cm-small { flex: none; width: 24px; height: 24px; border-width: 1.5px; box-shadow: none; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } .college-list { height: 320px; } }

/* College page photo gallery (gallery.js); the full-size viewer is the .pm-viewer from photo_map.js */
.gallery-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.gv-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.gv-chip { cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; }
.gv-chip[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: transparent; }
.gv-n { opacity: .7; font-weight: 500; margin-left: 2px; }
.gv-select { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-left: auto; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gv-item { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
           background: var(--surface-2); border: 1px solid var(--border); cursor: zoom-in; }
.gv-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.gv-item:hover img { transform: scale(1.05); }
.gv-caption { position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; color: #fff; font-size: 12px; line-height: 1.3;
              display: flex; flex-direction: column; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.gv-caption strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-caption span { opacity: .85; }
.gv-flag { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid;
           place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--critical);
           border: 2px solid #fff; }
/* Gallery videos and floor plans (gallery.js), and the viewer showing them (photo_map.js) */
.gv-item video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; pointer-events: none; }
.gv-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); width: 44px; height: 44px;
           border-radius: 50%; display: grid; place-items: center; padding-left: 3px; font-size: 16px; color: #fff;
           background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.85); }
.gv-badge { position: absolute; top: 8px; right: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px;
            font-weight: 700; color: #fff; background: rgba(0,0,0,.6); }
.gv-floorplan { background: var(--surface); }
.gv-plan { width: 100%; height: 100%; padding: 8px 8px 34px; box-sizing: border-box; }
.pm-v-media { position: relative; display: flex; justify-content: center; align-items: center; max-width: 100%; }
.pm-viewer video { max-width: 100%; max-height: calc(100vh - 170px); border-radius: 6px; background: #000; }
.pm-v-plan { width: min(90vw, 900px); max-height: calc(100vh - 170px); background: #fff; border-radius: 8px; padding: 12px; }
.pm-v-plan .fp-label { fill: #0f1720; }  /* the plan sits on white in the viewer, in both themes */
/* Gallery note tiles: a photo category with no photo, and the inspector's note on it (gallery.js) */
.gv-note { display: flex; flex-direction: column; justify-content: space-between; cursor: default; padding: 12px;
           background: color-mix(in srgb, var(--warning) 10%, var(--surface)); border: 1px dashed color-mix(in srgb, var(--warning) 55%, transparent); }
.gv-note.gv-note-none { background: color-mix(in srgb, var(--critical) 8%, var(--surface));
                        border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.gv-note-body { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow: hidden; }
.gv-note-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #a16207; }
.gv-note-none .gv-note-kind { color: var(--critical); }
.gv-note strong { font-size: 13px; }
.gv-note q { font-size: 13px; color: var(--ink-2); font-style: italic; display: -webkit-box; -webkit-line-clamp: 4;
             -webkit-box-orient: vertical; overflow: hidden; }
.gv-note-labs { font-size: 12px; color: var(--critical); display: -webkit-box; -webkit-line-clamp: 3;
                -webkit-box-orient: vertical; overflow: hidden; }
.gv-note-foot { font-size: 11px; color: var(--muted); }
/* College page: Principal section (photo + record vs latest inspection) */
.principal-layout { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: flex-start; }
.principal-layout > :last-child { flex: 1 1 260px; min-width: 0; }  /* the table wraps under the photos when the column is narrow */
.principal-photos { display: flex; gap: 12px; flex-wrap: wrap; }
.principal-photo { display: flex; flex-direction: column; gap: 6px; width: 180px; color: inherit; text-decoration: none; }
.principal-photo img { width: 180px; height: 220px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border);
                       background: var(--surface-2); cursor: zoom-in; transition: transform .15s, box-shadow .15s; }
.principal-photo:hover img { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.principal-photo-none { height: 220px; justify-content: center; align-items: center; text-align: center; padding: 12px;
                        border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
/* Principal profile page (principal.html) */
.pp-alert { border-left: 4px solid var(--critical); background: color-mix(in srgb, var(--critical) 7%, var(--surface)); }
.pp-colleges { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pp-college { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--border);
              border-radius: 12px; background: var(--surface); }
.pp-college.pp-current { border-left: 4px solid var(--accent); }
.pp-thumb { flex: none; width: 72px; height: 88px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
            background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.pp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pp-facts a.chip { text-decoration: none; }
.pc-links { margin-left: auto; display: inline-flex; gap: 12px; }
.pc-links .more { margin-left: 0; }
/* Inspection status chips (random inspections page) */
.chip.assigned { color: var(--ink-2); }
.chip.in_progress { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip.submitted { color: #15803d; background: color-mix(in srgb, var(--good) 14%, transparent); border-color: transparent; }
.chip.cancelled { color: var(--muted); text-decoration: line-through; }

/* Public landing page (dashboard/landing.html) */
body.landing { background: var(--plane); }
/* Header aligned with the page content below it; the button sits at the right edge. */
.lp-top { display: flex; align-items: center; gap: 14px; background: var(--surface);
  padding: 14px max(20px, calc((100% - 1060px) / 2)); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; }
.lp-top .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.lp-top .brand-org { color: var(--brand-2); opacity: 1; }
.lp-top .spacer { margin-left: auto; }
.landing main { max-width: 1060px; margin: 0 auto; padding: 0 20px 40px; }
.lp-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; padding: 56px 0 40px; }
.lp-hero h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; margin: 8px 0 14px; color: var(--brand-1); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .lp-hero h1 { background: linear-gradient(100deg, var(--brand-1), var(--brand-2) 70%);
    -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.lp-lead { font-size: 17px; color: var(--ink-2); max-width: 54ch; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn.primary { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }
.lp-stats { list-style: none; margin: 0; padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.lp-stats li { display: flex; flex-direction: column; }
.lp-stats strong { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--brand-1); }
.lp-stats span { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.lp-grid article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.lp-grid h2 { font-size: 17px; margin: 0 0 8px; }
.lp-grid p { margin: 0; color: var(--ink-2); font-size: 14px; }
.lp-steps { margin-top: 34px; }
.lp-steps ol { list-style: none; counter-reset: step; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.lp-steps li { counter-increment: step; display: grid; grid-template-columns: 34px 180px 1fr; gap: 12px; align-items: baseline;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.lp-steps li::before { content: counter(step); display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent-soft); color: var(--brand-1); font-weight: 700; font-size: 13px; }
.lp-steps span { color: var(--ink-2); font-size: 14px; }
.lp-foot { max-width: 1060px; margin: 0 auto; padding: 22px 20px 40px; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border); }
@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 34px; }
  .lp-steps li { grid-template-columns: 26px 1fr; }
  .lp-steps li span { grid-column: 2; }
}

/* Landing page flourishes: gradient sheen, icons, hover lift, and a gentle reveal. */
body.landing { background:
  radial-gradient(900px 420px at 12% -8%, rgba(37, 99, 235, .16), transparent 60%),
  radial-gradient(760px 380px at 92% 4%, rgba(15, 118, 110, .16), transparent 62%), var(--plane); }
.lp-top { background: var(--surface); background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lp-hero { grid-template-columns: 1.15fr .85fr; gap: 28px; }
.lp-hero > div:first-child { grid-row: 1; }
.lp-visual { grid-column: 2; grid-row: 1; align-self: center; }
/* The counts run the full width under both columns, so their labels never wrap. */
.lp-stats { grid-column: 1 / -1; }
.lp-visual svg { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-lift, 0 18px 40px rgba(6, 22, 47, .14)); }
.lp-pins > g { animation: lp-drop .7s cubic-bezier(.2, .9, .3, 1.3) backwards; }
.lp-pins > g:nth-child(1) { animation-delay: .25s; } .lp-pins > g:nth-child(2) { animation-delay: .45s; }
.lp-pins > g:nth-child(3) { animation-delay: .65s; } .lp-pins > g:nth-child(4) { animation-delay: .85s; }
@keyframes lp-drop { from { opacity: 0; transform: translateY(-14px) scale(.85); } }
.hero-kicker { letter-spacing: .12em; text-transform: uppercase; font-size: 12px; font-weight: 700; color: var(--brand-2); }
.lp-stats { grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 16px; }
.lp-stats li { align-items: center; text-align: center; }
.lp-stats strong { color: var(--brand-1); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .lp-stats strong { background: linear-gradient(120deg, var(--brand-1), var(--brand-3));
    -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.lp-grid article { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.lp-grid article::after { content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3)); opacity: .85; }
.lp-grid article:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift, 0 16px 32px rgba(6, 22, 47, .12)); }
.lp-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px;
  background: var(--accent-soft);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--brand-2) 18%, transparent));
  color: var(--brand-1); }
.lp-steps h2 { font-size: 20px; }
.lp-steps li { transition: border-color .18s ease, transform .18s ease; }
.lp-steps li:hover { border-color: var(--accent); transform: translateX(2px); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.landing main > section { animation: lp-rise .5s ease backwards; }
.landing main > section:nth-child(2) { animation-delay: .08s; }
.landing main > section:nth-child(3) { animation-delay: .16s; }
@keyframes lp-rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .landing main > section, .lp-pins > g { animation: none; }
  .lp-grid article:hover, .lp-steps li:hover { transform: none; }
}
@media (max-width: 860px) { .lp-visual { grid-row: auto; } .lp-stats { grid-template-columns: 1fr 1fr; } }

/* Zoom sequence in the photo viewer: flip between the zoomed-in, normal and zoomed-out frames. */
.pm-v-frames { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 6px;
  padding: 6px; border-radius: 999px; background: rgba(12, 18, 28, .72); backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); }
.pm-v-frames button { border: 0; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px;
  color: #fff; background: transparent; cursor: pointer; }
.pm-v-frames button:hover { background: rgba(255, 255, 255, .16); }
.pm-v-frames button.on { background: #fff; color: #10151d; font-weight: 600; }
.pm-v-frames .sub { opacity: .7; }
.pm-zoom { color: var(--ink-2); }

/* Privacy policy: a readable column of text. */
.policy { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.6; }
.policy h1 { margin-bottom: 4px; }
.policy h2 { margin-top: 32px; font-size: 20px; }
.policy h3 { margin-top: 18px; font-size: 16px; }
.policy li { margin-bottom: 6px; }
