/* ============================================================
   Careermash Partners - presentation layer
   Design system: CEC3 (Stripe/Linear-grade - light, spacious,
   confident type, teal-tinted hairlines, no default browser UI).
   Ported from /cec3-design/assets/cec3.css as a reference system;
   this file is Careermash Partners' own copy, restyled for a
   data-forward operational workspace (dashboard, finder, reports,
   campaigns) rather than a marketing surface.
   ============================================================ */

/* ============================================================
   BRAND OVERRIDE BLOCK
   Every colour, radius, shadow and easing curve the rest of this
   file uses is read from a custom property here. Re-skin the whole
   app by editing this block only - nothing below should ever hold
   a literal brand hex value outside of it. Values below are CEC3's
   own palette, copied verbatim as Careermash Partners' starting point.
   ============================================================ */
:root {
  /* --- brand --- */
  --teal-deep: #055252;
  --teal: #00797b;
  --teal-light: #0a9698;
  --pale: #ebf0f1;
  --sage: #aecbc6;
  --blue: #006a94;
  --indigo: #525e93;
  --coral: #fe6454;
  --gold: #e8b462;
  /* Cool neutral for chart "reference" marks only (dumbbell benchmark dot,
     ranked-bar benchmark tick) - deliberately distinct from --grey (which
     is warm and used for body/caption text) so a benchmark mark never
     reads as body copy that wandered into a chart. Not part of the CEC3
     brand palette above; scoped to this one job. */
  --slate: #64748b;
  --grey: #585856;
  --ink: #0f2323;
  --white: #ffffff;

  /* teal-tinted hairlines & surfaces */
  --line: rgba(5, 82, 82, 0.10);
  --line-strong: rgba(5, 82, 82, 0.16);
  --surface-tint: rgba(5, 82, 82, 0.035);
  --teal-08: rgba(0, 121, 123, 0.08);
  --teal-14: rgba(0, 121, 123, 0.14);
  --teal-20: rgba(0, 121, 123, 0.20);

  /* need / deprivation ramp (IMD-derived signals only - never reused for
     outreach-priority tiers, campaign status or anything else, so a reader
     can never mistake "this school sits in a deprived area" for "this is a
     hot prospect" or "this campaign needs approval") */
  --need-low: #ebf0f1;
  --need-low-ink: #3c4a49;
  --need-medium: #aecbc6;
  --need-medium-ink: #0f3634;
  --need-high: #e8b462;
  --need-high-ink: #5a3c0a;
  --need-very-high: #fe6454;
  --need-very-high-ink: #ffffff;

  /* outreach-priority tier ramp (tierPill / distribution bars) - its own
     teal-forward scale, deliberately distinct from the need ramp above:
     Tier 1 here means "best prospect, contact first", a positive signal,
     never a distress/urgency one, so it reads as confident teal rather
     than alarm coral. */
  --tier1-bg: var(--teal-deep);
  --tier1-ink: #ffffff;
  --tier2-bg: var(--teal-08);
  --tier2-ink: var(--teal-deep);
  --tier3-bg: var(--pale);
  --tier3-ink: var(--grey);

  /* quiet positive / negative accents (approve/reject, grant/revoke,
     open-rate vs gap) - reuses the same small tint pairing as the rest
     of the CEC3 system's up/down deltas, never a saturated alert colour */
  --positive-bg: #e2f1ee;
  --positive-ink: #0d6a52;
  --negative-bg: #fdece8;
  --negative-ink: #9c3b28;

  /* elevation - two-layer: ambient + key, teal-tinted */
  --shadow-xs: 0 1px 2px rgba(5, 82, 82, 0.06);
  --shadow-sm: 0 1px 1px rgba(5, 82, 82, 0.04), 0 4px 12px rgba(5, 82, 82, 0.07);
  --shadow-md: 0 2px 4px rgba(5, 82, 82, 0.05), 0 12px 28px rgba(5, 82, 82, 0.11);
  --shadow-lg: 0 6px 16px rgba(5, 82, 82, 0.10), 0 24px 56px rgba(5, 82, 82, 0.16);
  --shadow-key: 0 2px 6px rgba(5, 82, 82, 0.08);

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 200ms;

  --font: "Lato", "Calibri", Arial, sans-serif;

  /* grid + spacing tokens - see "TILE GRID SYSTEM" below for --cell */
  --wrap-max: 1220px;
  --wrap-pad: 1.75rem;
  --grid-gap: 1.1rem;
  --cell: calc((min(100vw, var(--wrap-max)) - 2 * var(--wrap-pad) - 8 * var(--grid-gap)) / 9);

  --space-1: 0.4rem;
  --space-2: 0.75rem;
  --space-3: 1.1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
}

/* ---------------- Reset & base ---------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0; padding: 0;
  background: #fbfcfc;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1, "lnum" 1;
  /* .hero-band bleeds to 100vw on purpose (see below) - this is the
     standard safety net against the 100vw-vs-scrollbar rounding gap that
     technique can introduce, so the page itself never gains a horizontal
     scrollbar because of it. */
  overflow-x: hidden;
}
::selection { background: var(--teal-20); color: var(--teal-deep); }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--teal-deep); }
code { overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--teal-20), 0 0 0 1px var(--teal);
  border-radius: var(--radius-xs);
}

h1, h2, h3, h4 { font-family: var(--font); color: var(--teal-deep); margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.008em; }
h3 { font-size: 1.03rem; font-weight: 800; }
p { margin: 0 0 0.75rem; color: var(--grey); font-size: 0.9375rem; }
strong, b { color: var(--ink); }
.tnum { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: 0 var(--wrap-pad); }
main.wrap { padding-top: 2.25rem; padding-bottom: 3.5rem; }
.wrap-narrow { max-width: 640px; margin: 0 auto; padding: 0 var(--wrap-pad); }

/* .h1 - the app's page-title div (kept as a div, not a real <h1>, in the
   existing templates - styled to the same weight/size the CEC3 system
   gives its own page-head h1) */
/* Matches cec3.css's own h1 + .page-head h1 exactly (size/weight/line-height/
   letter-spacing copied, not invented): weight 300, clamp(1.9rem,3.4vw,2.6rem). */
.h1 { font-family: var(--font); font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 300; color: var(--teal-deep); letter-spacing: -0.01em; line-height: 1.1; margin: 0 0 0.5rem; max-width: 46ch; }
.lede { font-size: 1.02rem; color: var(--ink); font-weight: 400; max-width: 74ch; margin: 0 0 1.35rem; }
.muted { color: var(--grey); font-size: 0.87rem; }

/* ---------------- Chrome ---------------- */
.chrome-top {
  background: linear-gradient(180deg, var(--teal-deep) 0%, #063f3f 100%);
  color: var(--white);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 8px 24px rgba(5,82,82,0.18);
}
.chrome-bar {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 0.85rem var(--wrap-pad);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  transition: opacity var(--dur) var(--ease);
}
.wordmark:hover { opacity: 0.85; color: var(--white); }
.wordmark .wm-sub { font-weight: 400; opacity: 0.72; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }

.chrome-signin {
  margin-left: auto;
  color: var(--white);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chrome-signin:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.45); color: var(--white); }

/* ---------------- Account menu ---------------- */
.acct-cluster { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.acct-menu-wrap { position: relative; }
.acct-menu-btn {
  display: flex; align-items: center; gap: 0.55rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  color: var(--white); border-radius: 999px; padding: 0.32rem 0.95rem 0.32rem 0.32rem;
  cursor: pointer; font-family: var(--font); font-weight: 700; font-size: 0.84rem;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.acct-menu-btn:hover { background: rgba(255,255,255,0.16); }
.acct-menu-btn[aria-expanded="true"] { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.32); }
.acct-menu-icon {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center; flex: none;
  font-weight: 900; font-size: 0.72rem; color: var(--white);
}
.acct-menu-label { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.acct-menu-caret { flex: none; opacity: 0.7; transition: transform var(--dur) var(--ease); }
.acct-menu-btn[aria-expanded="true"] .acct-menu-caret { transform: rotate(180deg); }

.acct-menu-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  min-width: 260px; max-width: calc(100vw - 1.5rem);
  background: var(--white); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.6rem;
  display: flex; flex-direction: column; gap: 0.1rem;
  box-sizing: border-box;
}
.acct-menu-panel[hidden] { display: none; }
.acct-identity { padding: 0.55rem 0.7rem 0.65rem; }
.acct-identity .acct-name { display: block; font-weight: 900; color: var(--teal-deep); font-size: 0.92rem; overflow-wrap: anywhere; }
.acct-identity .acct-meta { display: block; font-size: 0.78rem; color: var(--grey); margin-top: 0.15rem; }
.acct-menu-divider { height: 1px; background: var(--line); margin: 0.35rem 0.3rem; }
.acct-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.55rem 0.7rem; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.86rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.acct-menu-item:hover { background: var(--surface-tint); color: var(--teal-deep); }
@media (max-width: 480px) { .acct-menu-panel { right: -0.75rem; min-width: 230px; } .acct-menu-label { max-width: 110px; } }

/* ---------------- App tab row ---------------- */
.app-tabs { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 58px; z-index: 30; }
/* In-page anchor targets (the institution head's Contactable tile jumps to
   #contacts) must clear both sticky bars above, or the target lands
   half-hidden underneath them. */
#contacts { scroll-margin-top: 6.5rem; }
.app-tabs .wrap { display: flex; gap: 0.3rem; flex-wrap: wrap; padding-top: 0.65rem; padding-bottom: 0.65rem; }
.app-tabs a { color: var(--grey); text-decoration: none; font-size: 0.82rem; font-weight: 700; padding: 0.42rem 0.9rem; border-radius: 999px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.app-tabs a:hover { background: var(--surface-tint); color: var(--teal-deep); }
.app-tabs a.on { background: var(--teal-08); color: var(--teal-deep); }

/* ---------------- Footer ---------------- */
.foot {
  color: var(--grey); font-size: 0.78rem; text-align: center;
  padding: 1.5rem var(--wrap-pad) 2.25rem; margin: 0;
  border-top: 1px solid var(--line);
}
.foot .wrap { padding-top: 0; padding-bottom: 0; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin: 0 0 1.35rem;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card h2 { margin-top: 0; }
.card h2 + p, .card h2 + .muted { margin-top: -0.3rem; }
a.card { display: block; text-decoration: none; }
a.card:hover, .card.hoverable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
/* grid gap already spaces cards inside a .grid; a card's own bottom margin
   would double it up - same fix cec3.css applies to .hub-grid .card */
.grid .card, .tile-grid .card { margin-bottom: 0; }

.card.accent-teal { background: var(--teal-08); border-color: var(--teal-20); }
.card.accent-teal .note { color: var(--teal-deep); }
/* Same quiet accent for the Lists index's pinned "My shortlist" .icard - a
   second selector rather than widening .card.accent-teal itself, since
   .icard and .card intentionally carry different base rules elsewhere. */
.icard.accent-teal { background: var(--teal-08); border-color: var(--teal-20); }
.card.note-demo { border-left: 3px solid var(--coral); background: rgba(254,100,84,0.045); }

/* ---------------- Grid utilities ---------------- */
.grid { display: grid; gap: var(--grid-gap); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 300px 1fr; gap: var(--grid-gap); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.split-main { display: grid; grid-template-columns: 2fr 1fr; gap: var(--grid-gap); align-items: start; }
@media (max-width: 900px) { .split-main { grid-template-columns: 1fr; } }
/* Right column of a split-main row that stacks more than one block (e.g. the
   dashboard's top-target side panel + Regional coverage card) - a plain flex
   column at the same width as the single-child case, so the row balances
   against a taller map instead of leaving dead space under a short panel. */
.side-col { display: flex; flex-direction: column; gap: var(--grid-gap); }
.side-col .card { margin-bottom: 0; }

/* ============================================================
   TILE GRID SYSTEM (ported from CEC3's hub.html grid)
   ============================================================
   A 9-column, tile-unit grid. Each direct child declares its size
   in whole cells via a `.t-{cols}x{rows}` utility class rather than
   a bespoke pixel width - two sections sharing a cell count are
   pixel-identical by construction. --cell is derived above from the
   wrap width, padding and gap so a "1x1" tile measures roughly square.
   grid-auto-rows is minmax(var(--cell), auto): a row is at least one
   cell tall but grows to fit real content, so a tile with more to
   say never gets clipped by the square-tile assumption.
   ============================================================ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-auto-rows: minmax(var(--cell), auto);
  gap: var(--grid-gap);
  margin-bottom: 1.35rem;
}
.tile-grid > * { min-width: 0; }
.tile-grid .card { height: 100%; }
/* a tile whose real content is much shorter than a taller neighbour
   sharing its row-span (e.g. a 4-row-tall stat card beside a 4-row-tall
   table) hugs its own content instead of stretching into a mostly-empty
   box - the leftover grid space is just page background, not a voidy card.
   Plain .grid rows (e.g. the institution page's .grid.g2 pairs) stretch
   their cards to match a row's tallest sibling by the same native CSS Grid
   default (align-items: stretch) - .hug needs the identical override there
   too, not just inside .tile-grid, so it's one shared utility either way. */
.tile-grid .card.hug, .grid .card.hug { height: auto; align-self: start; }
.t-1x1 { grid-column: span 1; grid-row: span 1; }
.t-2x1 { grid-column: span 2; grid-row: span 1; }
.t-3x1 { grid-column: span 3; grid-row: span 1; }
.t-4x2 { grid-column: span 4; grid-row: span 2; }
.t-5x2 { grid-column: span 5; grid-row: span 2; }
.t-6x2 { grid-column: span 6; grid-row: span 2; }
.t-9x1 { grid-column: span 9; grid-row: span 1; }
.t-9x2 { grid-column: span 9; grid-row: span 2; }
.t-3x4 { grid-column: span 3; grid-row: span 4; }
.t-6x4 { grid-column: span 6; grid-row: span 4; }
@media (max-width: 980px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; }
  .t-1x1 { grid-column: span 1; }
  .t-2x1, .t-3x1, .t-4x2, .t-5x2, .t-6x2, .t-6x4, .t-9x1, .t-9x2, .t-3x4 { grid-column: span 3; }
}
@media (max-width: 620px) {
  .tile-grid { grid-template-columns: 1fr; }
  .t-1x1, .t-2x1, .t-3x1, .t-4x2, .t-5x2, .t-6x2, .t-6x4, .t-9x1, .t-9x2, .t-3x4 { grid-column: span 1; grid-row: auto; }
}

/* ---------------- KPI tiles / metrics ---------------- */
/* .metric is this app's existing class name for a KPI value+label block
   (kept verbatim so template edits stay minimal) - restyled here to the
   same visual grade as a CEC3 kpi-tile. .kpi-row lays a row of them out -
   the operational KPI band's own 4-equal-column grid, matching cec3.css's
   #hub-kpis. */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--grid-gap); margin-bottom: 1.35rem; }
@media (max-width: 980px) { .kpi-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kpi-row { grid-template-columns: 1fr; } }

.metric {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem 1.05rem;
  box-shadow: var(--shadow-sm);
  display: block;
  text-decoration: none;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
  position: relative;
}
a.metric:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--line-strong); }
/* Numeral weight matches CEC3's own kpi-tile exactly - light (300), not
   bold. An earlier pass here invented 900; copying the source rather than
   inventing means these read as the same "big light numeral" idiom as the
   hub's own KPI tiles, not a heavier home-grown look. */
.metric .v {
  font-family: var(--font); font-weight: 300; font-size: 1.95rem; letter-spacing: -0.02em;
  color: var(--teal-deep); line-height: 1.05; font-variant-numeric: tabular-nums;
  display: block;
}
.metric .l { font-size: 0.78rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; margin-top: 0.4rem; }

/* the 9-col tile-grid's own kpi-tile variant, for tiles that sit directly
   in .tile-grid rather than a flat .kpi-row */
.kpi-tile {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem 1.05rem; box-shadow: var(--shadow-sm); height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
.kpi-tile .kpi-label { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; font-weight: 900; color: var(--teal); }
.kpi-tile .kpi-numrow { display: flex; align-items: flex-end; gap: 0.5rem; margin-top: 0.4rem; }
.kpi-tile .kpi-num { font-family: var(--font); font-weight: 300; font-size: clamp(1.9rem, 2.6vw, 2.35rem); letter-spacing: -0.02em; color: var(--teal-deep); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-tile .kpi-sub { font-size: 0.78rem; color: var(--grey); margin-top: 0.4rem; }

/* Operational-KPI-band action tile: the whole tile is a real link (no JS
   click-delegation needed server-side), with a quiet "Open X ->" hint
   appended to its caption line - CEC3's kpi-clickable/kpi-view-hint
   pattern. No sparkline: we have no time series, so the tile stays
   narrower/cleaner rather than faking one. */
a.kpi-tile.kpi-clickable { text-decoration: none; cursor: pointer; transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
a.kpi-tile.kpi-clickable:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
a.kpi-tile.kpi-clickable:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--teal-20), 0 0 0 1px var(--teal); }
.kpi-view-hint { color: var(--teal); font-weight: 800; white-space: nowrap; }

/* ---------------- Hub head row: hero LEFT, context stats RIGHT ----------------
   Copied slot-for-slot from hub.html's own #head (.page-head, ~58%) beside
   #hub-head-stats (a 3x2 grid of portrait kpi-tiles, ~42%) - see cec3.css's
   HUB GRID SYSTEM comment for the source geometry. Ours is a simple two-
   column grid rather than porting the full 9-column --cell tile system,
   since nothing here needs the tile customiser that system exists for. */
.hub-head-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--grid-gap); align-items: start; padding: 1.75rem 0 0.5rem; }
@media (max-width: 900px) { .hub-head-row { grid-template-columns: 1fr; } }
.hub-head-main .h1 { margin-top: 0; }
.hub-head-status { display: flex; align-items: center; gap: 0.55rem; font-size: 0.98rem; color: var(--ink); margin: 0.7rem 0 1.1rem; flex-wrap: wrap; }
.hub-head-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr;
  gap: 0.65rem;
}
@media (max-width: 900px) { .hub-head-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .hub-head-stats { grid-template-columns: repeat(2, 1fr); } }
/* Column count adapts to how many tiles the page actually has (set server-
   side - see headRow()'s colsCls): 6 tiles keep the default 3x2, 4 tiles
   become a real 2x2 (never 3-then-1-orphaned), 1-2 tiles sit in one row.
   Higher specificity than the two breakpoints above on purpose, so a 2x2
   page stays 2x2 rather than being squeezed by the 6-tile-oriented mobile
   overrides. */
.hub-head-stats.cols-1 { grid-template-columns: 1fr; }
.hub-head-stats.cols-2 { grid-template-columns: repeat(2, 1fr); }
/* portrait context tile: centred, smaller numeral than the operational
   band's tiles - matches .kpi-tile[data-kpi-group="hub-head-stats"] in
   cec3.css exactly (tiny uppercase label on top, big light numeral under).
   The label reserves a fixed two-line height and is NOT vertically centred
   with the numeral below it - a short one-line label ("Contactable") and a
   long two-line one ("Institutions in scope") must still leave every
   numeral starting at the same y, which only holds if the label's own box
   is a constant height regardless of how much of it the text actually
   fills. */
.kpi-tile.head-stat { padding: 0.85rem 0.7rem; text-align: center; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.kpi-tile.head-stat .kpi-label { text-align: center; line-height: 1.3; min-height: 1.78rem; }
.kpi-tile.head-stat .kpi-numrow { justify-content: center; margin-top: 0.3rem; }
.kpi-tile.head-stat .kpi-num { font-size: 1.7rem; }
/* Click-through hint on a clickable head-stat tile (Jason: "numbers in
   tiles that show detail when you click through them") - centred and
   compact to match this tile's own small-portrait proportions, unlike the
   left-aligned .kpi-view-hint-row on the wider operational-band tiles. */
.kpi-tile.head-stat .kpi-view-hint-row { display: block; margin-top: 0.35rem; font-size: 0.68rem; }
.kpi-tile.head-stat .kpi-view-hint { font-weight: 800; }
/* Audit fix: bridges a located/filtered subset tile back to its site-wide
   total (e.g. "of 7,059 in scope") so the two never read as a silent
   contradiction. */
.kpi-tile.head-stat .kpi-sub-caption { margin-top: 0.25rem; font-size: 0.66rem; color: var(--grey); line-height: 1.3; }

/* ---------------- Focus-week row: full-width card, bordered inner minis ---------------- */
.focus-week-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 0.85rem; }
@media (max-width: 980px) { .focus-week-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .focus-week-grid { grid-template-columns: 1fr; } }
.focus-week-item { display: flex; flex-direction: column; gap: 0.3rem; border: 1px solid var(--line); border-top-width: 3px; border-radius: var(--radius-sm); padding: 0.9rem 1rem; background: var(--white); }
/* Quiet category identity, accent line only - text stays ink (Jason,
   colour pass, item 2). One colour per Focus-your-week card so the four
   are visually distinct at a glance without any of them shouting. */
.focus-week-item.accent-blue { border-top-color: var(--blue); }
.focus-week-item.accent-gold { border-top-color: var(--gold); }
.focus-week-item.accent-indigo { border-top-color: var(--indigo); }
.focus-week-item.accent-sage { border-top-color: var(--sage); }
.focus-week-item .fw-label { margin: 0; font-weight: 800; font-size: 0.9rem; color: var(--ink); }
.focus-week-item .fw-count { font-size: 1.6rem; font-weight: 300; color: var(--teal-deep); line-height: 1.1; font-variant-numeric: tabular-nums; }
.focus-week-item .fw-sub { margin: 0; font-size: 0.78rem; color: var(--grey); flex: 1; }
.focus-week-item .fw-action { font-size: 0.8rem; font-weight: 700; color: var(--teal); margin-top: 0.2rem; text-decoration: none; }
.focus-week-item .fw-action:hover { color: var(--teal-deep); }

/* ---------------- Side-panel mini stat tiles (map + dashboard top-target panel) ---------------- */
.stat { background: var(--pale); border-radius: var(--radius); padding: 0.85rem 0.95rem; border: 1px solid transparent; }
.stat .num { font-size: 1.5rem; font-weight: 300; color: var(--teal-deep); display: block; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 0.76rem; color: var(--grey); line-height: 1.35; display: block; margin-top: 0.15rem; }
.side-panel .stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.9rem 0; }
/* row layout (label left, value right) for the panel's LA/Ofsted facts,
   reusing the same .stat component rather than a second one */
.sp-hstack { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 0.9rem; }
.sp-hstack .stat { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 0.75rem; width: 100%; background: transparent; border: none; border-top: 1px solid var(--line); border-radius: 0; padding: 0.5rem 0; }
.sp-hstack .stat .num { font-size: 0.92rem; font-weight: 800; color: var(--ink); }
.sp-hstack .stat .label { margin-top: 0; text-align: left; }

/* ---------------- Table-card pager (Row 5 "cold-spot list" pattern) ---------------- */
.table-head-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.table-pager { display: flex; align-items: center; gap: 0.5rem; }
.table-pager-note { font-size: 0.78rem; white-space: nowrap; }
.pager-circle-btn {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--teal); background: var(--white); color: var(--teal-deep);
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.pager-circle-btn:hover { background: var(--teal-08); }
.pager-circle-btn.is-disabled { opacity: 0.32; pointer-events: none; }

/* compact chip strip inside a card (the dashboard's own map card) */
.chips.compact { margin: 0.6rem 0 0.9rem; gap: 0.3rem; }
.chips.compact .chip { padding: 0.32rem 0.7rem; font-size: 0.74rem; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font-family: var(--font); font-weight: 800; font-size: 0.88rem;
  padding: 0.68rem 1.3rem; border-radius: 999px;
  border: 1.5px solid var(--teal);
  background: var(--teal); color: var(--white);
  text-decoration: none; cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--white); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-key); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--white); color: var(--teal-deep); border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-tint); border-color: var(--teal); color: var(--teal-deep); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-sm {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1.5px solid var(--line-strong); color: var(--teal-deep); background: var(--white);
  padding: 0.4rem 0.85rem; border-radius: 999px; font-weight: 700; font-size: 0.78rem;
  text-decoration: none; cursor: pointer; font-family: var(--font);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-sm:hover { border-color: var(--teal); background: var(--surface-tint); text-decoration: none; }
.btn-sm.positive { border-color: rgba(13,106,82,0.35); color: var(--positive-ink); }
.btn-sm.positive:hover { background: var(--positive-bg); border-color: var(--positive-ink); }
.btn-sm.negative { border-color: rgba(156,59,40,0.32); color: var(--negative-ink); }
.btn-sm.negative:hover { background: var(--negative-bg); border-color: var(--negative-ink); }

.actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 0.4rem 0 1.4rem; }
.btn-row { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: center; }

/* ---------------- Chips & segmented controls ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.3rem 0 1rem; }
.chip {
  padding: 0.45rem 0.95rem; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; background: var(--white); color: var(--grey);
  text-decoration: none; display: inline-flex; align-items: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--teal); color: var(--teal-deep); text-decoration: none; }
.chip.on { background: var(--teal-deep); color: var(--white); border-color: var(--teal-deep); }
.chip.on:hover { color: var(--white); }

/* link-based two-way "segmented" (view toggles that must stay plain GET
   navigation, not JS) - visually matches the radio seg-group below */
.seg-view { display: inline-flex; background: var(--pale); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-view a { padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.82rem; font-weight: 800; color: var(--grey); text-decoration: none; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.seg-view a:hover { color: var(--teal-deep); text-decoration: none; }
.seg-view a.on { background: var(--white); color: var(--teal-deep); box-shadow: var(--shadow-sm); }

/* form-native "segmented control" built from radio + label, so a filter
   form keeps submitting via plain GET with no JS required.
   FIX (render-verify pass): this used to collide with `.filter label`
   below - both selectors have identical specificity (one class + one
   element), `.filter label` happened to sit later in the file, so it won
   on every seg-group nested inside a .filter form and blockified/
   uppercased/margin'd the pills into the "overlapping blob" bug. Every
   rule here now carries `.filter` too so it can never lose that fight
   again regardless of source order, on top of giving the group its own
   real specificity floor. */
.seg-group {
  position: relative;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  background: var(--white);
  margin: 0.2rem 0 0;
}
.seg-group input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0; padding: 0; border: 0;
  pointer-events: none;
}
.seg-group label,
.filter .seg-group label {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.42rem 0.4rem;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  color: var(--grey);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg-group input[type=radio]:checked + label,
.filter .seg-group input[type=radio]:checked + label {
  background: var(--teal-deep);
  color: var(--white);
}
.seg-group input[type=radio]:focus-visible + label,
.filter .seg-group input[type=radio]:focus-visible + label {
  outline: none;
  box-shadow: 0 0 0 3px var(--teal-20), 0 0 0 1px var(--teal);
}

/* ---------------- Tags / pills ---------------- */
.pill {
  display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.01em; margin: 1px 4px 1px 0;
  background: var(--pale); color: var(--teal-deep); border: 1px solid transparent;
  white-space: nowrap;
}
.pill.t1 { background: var(--tier1-bg); color: var(--tier1-ink); }
.pill.t2 { background: var(--tier2-bg); color: var(--tier2-ink); }
.pill.t3 { background: var(--tier3-bg); color: var(--tier3-ink); border-color: var(--line-strong); }
.pill.g { background: var(--teal-08); color: var(--teal-deep); }
.pill.v { background: rgba(0,106,148,0.10); color: var(--blue); }
.pill.on { background: var(--positive-bg); color: var(--positive-ink); }
.pill.off { background: var(--pale); color: var(--grey); border-color: var(--line-strong); }
.pill.tag { background: var(--pale); color: var(--grey); }
/* Contact address-status "not resolving" tier - a quiet warning, never the
   coral/negative treatment: a stale address is not a critical error, just
   worth a second look. Same dark-gold ink already used against a solid
   --gold fill elsewhere (.auto-note), here at pill-tint strength. */
.pill.warn { background: rgba(232,180,98,0.24); color: #6b4a0a; }

/* Contacts page "What do these statuses mean?" disclosure - quiet by
   default, never a permanent block of prose competing with the table. */
.status-legend { margin: 0.6rem 0 0; }
.status-legend summary { cursor: pointer; font-size: 0.82rem; font-weight: 700; color: var(--teal-deep); }
.status-legend summary:hover { color: var(--teal); }
.status-legend ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.status-legend li { margin-bottom: 0.3rem; font-size: 0.82rem; }

/* outreach-priority tier tag used as a small text chip anywhere a tier
   accent colour also appears, so colour is never the only signal */
.tier-chip { display: inline-flex; align-items: center; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.03em; text-transform: uppercase; padding: 0.18rem 0.55rem; border-radius: 999px; }
.tier-chip.t1 { background: var(--tier1-bg); color: var(--tier1-ink); }
.tier-chip.t2 { background: var(--tier2-bg); color: var(--tier2-ink); }
.tier-chip.t3 { background: var(--tier3-bg); color: var(--tier3-ink); border: 1px solid var(--line-strong); }

/* Attribute chips (Priority Finder cards, institution detail) - quiet
   sentence-case tags in tinted families, never shouting uppercase grey.
   teal = a descriptive fact about the school (High vocational, FE/college,
   etc); sage = a positive operational status (Contactable, Existing
   priority); neutral = context with no honest grading of its own; gold/
   coral = Ofsted grade tints (Jason, colour pass: "grade-tinting is
   semantically truthful" - Requires improvement/Inadequate are genuinely
   worse outcomes, so a quiet gold/coral tint on that one chip is reporting
   a fact, not decorating one - text stays dark, tint stays quiet, and the
   word itself is still there so colour is never the only signal). */
.attr-chip {
  display: inline-flex; align-items: center;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em;
  padding: 0.2rem 0.65rem; border-radius: 999px; margin: 1px 4px 1px 0;
  background: var(--pale); color: var(--grey); white-space: nowrap;
}
.attr-chip.teal { background: var(--teal-08); color: var(--teal-deep); }
.attr-chip.sage { background: rgba(174,203,198,0.4); color: var(--teal-deep); }
.attr-chip.neutral { background: var(--pale); color: var(--grey); }
.attr-chip.gold { background: rgba(232,180,98,0.22); color: #5a3c0a; }
.attr-chip.coral { background: rgba(254,100,84,0.14); color: #9c3b28; }

/* Outreach-priority tier left-edge accent (Priority Finder cards + table
   rows). Teal family only, by design - Tier 1 is the best prospect, never
   an alarm, so it never borrows the coral used estate-wide for negatives.
   Tier 3 carries no accent at all rather than a token "least important"
   colour. */
.tier-accent { border-left: 3px solid transparent; }
.tier-accent.t1 { border-left-color: var(--teal-deep); }
.tier-accent.t2 { border-left-color: var(--sage); }
.tier-accent.t3 { border-left-color: transparent; }
/* .icard's own `border: 1px solid ...` shorthand is defined later in this
   file at the same one-class specificity, which would otherwise win the
   border-left-WIDTH tie-break by source order alone and silently shrink
   this back to a 1px hairline (the colour still wins independently, since
   .tier-accent.t1 above is two classes - only the width was at risk).
   Naming the real .icard combo explicitly, at higher specificity, keeps
   the accent's width correct regardless of file order. */
.icard.tier-accent { border-left-width: 3px; border-left-style: solid; }

/* ---------------- Forms ---------------- */
label { display: block; font-weight: 900; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--teal-deep); margin: 1rem 0 0.4rem; }
label:first-of-type { margin-top: 0.2rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 0.72rem 0.9rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.94rem; color: var(--ink); background: var(--white);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input::placeholder, textarea::placeholder { color: #9aa8a7; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-20); outline: none; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23585856' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.2rem;
}
textarea { min-height: 96px; resize: vertical; font-size: 0.94rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--teal-deep); width: 16px; height: 16px; vertical-align: -3px; }
fieldset { border: none; padding: 0; margin: 0; }
.field-hint, .note { font-size: 0.78rem; color: var(--grey); margin-top: 0.4rem; }

.filter label { display: block; font-weight: 900; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--teal); margin: 1.15rem 0 0.4rem; }
.filter label:first-of-type { margin-top: 0.2rem; }
/* a checkbox's own inline label reads as a normal sentence, not a shouty
   field caption - scoped so every other .filter label keeps the caption
   treatment above */
.filter label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 0.55rem; text-transform: none; font-weight: 600; font-size: 0.86rem; color: var(--ink); letter-spacing: normal; margin: 1rem 0; }
.filter button[type=submit] { width: 100%; margin-top: 1.1rem; }
.filter .btn.ghost { display: block; text-align: center; margin-top: 0.6rem; }

/* Priority Finder auto-filter (progressive enhancement - partners.js's
   initAutoFilter): no-JS default is the Apply button visible, hint hidden.
   Once JS confirms the form auto-submits on change, it adds .js-auto-filter
   to the form itself, which swaps the two - the hint sits in the exact spot
   the button occupied, at the same width/centring, so nothing reflows. */
#pf-auto-hint { display: none; text-align: center; width: 100%; margin-top: 1.1rem; }
.filter.js-auto-filter #pf-apply-btn { display: none; }
.filter.js-auto-filter #pf-auto-hint { display: block; }

/* labels used as inline field captions outside a stacked form (contacts
   filter row, admin's inline add-university/add-sender forms) - block
   spacing isn't wanted there, and each field wants a sensible min-width
   so it doesn't collapse to its label's width in a flex row */
.inline-field { min-width: 160px; }
.inline-field label { margin: 0 0 0.3rem; }
/* Inline filter row (Top targets table) - CEC3's cold-spot filter-row
   pattern: compact controls side by side on one baseline, each ~200-280px,
   wrapping only at narrow widths. This was missing its own display:flex
   entirely, which is why the .inline-field wrappers were stacking as full-
   width rows instead of sitting inline. */
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filter-row .inline-field { flex: 0 1 220px; min-width: 180px; }
.filter-row button[type=submit] { flex: none; }

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
caption { caption-side: top; text-align: left; font-size: 0.78rem; color: var(--grey); padding: 0 0 0.6rem; font-weight: 400; }
th, td { text-align: left; padding: 0.7rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--teal); font-weight: 900; background: var(--white); }
tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover td { background: var(--surface-tint); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.tier-accent td:first-child { padding-left: 0.6rem; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); scrollbar-width: thin; scrollbar-color: var(--teal) var(--pale); }
.table-scroll table { min-width: 640px; }
/* A short, single-word column (e.g. Contacts' Role: "Headteacher") can still
   get squeezed narrow by auto table layout even inside a min-width:640px
   scroll container, and the global overflow-wrap:anywhere above then breaks
   it mid-word. nowrap here keeps it intact - the table already scrolls
   horizontally at any width that can't fit every column. */
.col-role { white-space: nowrap; }

/* ---------------- Icard (compact list card) ---------------- */
.icard { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 0.85rem; background: var(--white); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.icard:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.icard h3 { margin: 0 0 0.15rem; font-size: 1.02rem; }
.icard .sub { color: var(--grey); font-size: 0.82rem; margin-bottom: 0.5rem; }
.why { font-size: 0.86rem; margin: 0.5rem 0; color: var(--ink); }
.kv { display: flex; flex-wrap: wrap; gap: 0 1.1rem; font-size: 0.82rem; color: var(--grey); margin: 0.5rem 0; }
.kv b, .kv strong { color: var(--teal-deep); font-weight: 900; font-variant-numeric: tabular-nums; }

.kpi { display: flex; flex-wrap: wrap; gap: 1.5rem; }

.row { display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
a.row { text-decoration: none; color: inherit; border-radius: var(--radius-sm); transition: background var(--dur) var(--ease); }
a.row:hover { background: var(--surface-tint); }
a.row:hover .grow b { color: var(--teal-deep); }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- Meters ---------------- */
/* single-value progress meter (campaign funnel rows, regional mini bars) */
.bar { height: 9px; border-radius: 999px; background: var(--pale); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--teal-light)); font-style: normal; }

/* stacked distribution meter (tier / coverage / match-rate breakdowns) */
.bar.stacked { display: flex; }
.bar.stacked .seg { height: 100%; flex: none; }
.bar.stacked .seg.t1 { background: var(--tier1-bg); }
.bar.stacked .seg.t2 { background: var(--sage); }
.bar.stacked .seg.t3 { background: var(--pale); border-right: 1px solid var(--line-strong); }
.bar.stacked .seg.ok { background: var(--teal); }
.bar.stacked .seg.gap { background: var(--sage); }
/* Qualification mix's two-segment band (GCSE vs Level 2 vocational, real
   entry counts - see qualMixCard()) - teal/blue, matching the same card's
   own existing .pill.g/.pill.v tint pair so the colour identity is
   consistent within that one card rather than inventing a third scheme. */
.bar.stacked .seg.qg { background: var(--teal); }
.bar.stacked .seg.qv { background: var(--blue); }
.dist-bar { margin: 0.6rem 0 0.5rem; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: 0.55rem; font-size: 0.8rem; color: var(--grey); }
.dist-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.dist-legend-item::before { content: ""; width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dist-legend-item.t1::before { background: var(--tier1-bg); }
.dist-legend-item.t2::before { background: var(--sage); }
.dist-legend-item.t3::before { background: var(--pale); border: 1px solid var(--line-strong); }
.dist-legend-item.ok::before { background: var(--teal); }
.dist-legend-item.gap::before { background: var(--sage); }
.dist-legend-item.qg::before { background: var(--teal); }
.dist-legend-item.qv::before { background: var(--blue); }
/* MDX quartile-band segments (Attainment 8 / EBacc APS / HE-tariff
   progression distributions, Middlesex report R-MDX-3) - a light-to-dark
   teal ramp, same "higher = deeper teal" direction as the outreach-priority
   tier ramp above. Bands are computed live from the real in-scope
   distribution (see bandDistBar in server.js), never a fixed external
   threshold - these classes are just the band's ordinal position. */
.bar.stacked .seg.qz1 { background: var(--pale); border-right: 1px solid var(--line-strong); }
.bar.stacked .seg.qz2 { background: var(--sage); }
.bar.stacked .seg.qz3 { background: var(--teal-light); }
.bar.stacked .seg.qz4 { background: var(--teal-deep); }
.dist-legend-item.qz1::before { background: var(--pale); border: 1px solid var(--line-strong); }
.dist-legend-item.qz2::before { background: var(--sage); }
.dist-legend-item.qz3::before { background: var(--teal-light); }
.dist-legend-item.qz4::before { background: var(--teal-deep); }
/* MDX contact-role segments (Middlesex report R-MDX-4, role breakdown) -
   five honest buckets, distinct hues from the tier/need ramps above so a
   role mix is never mistaken for a priority tier or a deprivation signal. */
.bar.stacked .seg.hp { background: var(--teal-deep); }
.bar.stacked .seg.of { background: var(--teal); }
.bar.stacked .seg.ch { background: var(--indigo); }
.bar.stacked .seg.se { background: var(--gold); }
.bar.stacked .seg.st { background: var(--pale); border-right: 1px solid var(--line-strong); }
.dist-legend-item.hp::before { background: var(--teal-deep); }
.dist-legend-item.of::before { background: var(--teal); }
.dist-legend-item.ch::before { background: var(--indigo); }
.dist-legend-item.se::before { background: var(--gold); }
.dist-legend-item.st::before { background: var(--pale); border: 1px solid var(--line-strong); }
.dist-legend-item b { color: var(--ink); font-variant-numeric: tabular-nums; }


/* single-value gauge with a marker dot (match-score band on a card) */
/* Match meter (Priority Finder cards + institution detail header) - a
   single-hue teal fill, never a multicolour ramp. matchScore is a
   goodness scale (higher = better prospect); the old low->sage->gold->coral
   gradient made a 94/100 match land visually in the coral "danger" zone,
   the same colour this system uses for negatives everywhere else. One
   colour, filled proportionally, is the only honest encoding for a
   goodness scale - the number alongside is already the real label. */
.match-meter { height: 6px; border-radius: 999px; background: var(--pale); overflow: hidden; margin: 0.5rem 0 0.15rem; }
.match-meter > i { display: block; height: 100%; border-radius: 999px; background: var(--teal); }

/* ---------------- Status notes ---------------- */
.ok, .err {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  font-size: 0.88rem; border-left: 3px solid transparent;
}
.ok { background: var(--teal-08); color: var(--teal-deep); border-left-color: var(--teal); }
.err { background: rgba(254,100,84,0.08); color: #9c3b28; border-left-color: var(--coral); }

/* ---------------- Stepper ---------------- */
/* the uploads page's existing .step / .step > b pair, restyled to the
   CEC3 stepper idiom (teal circle badges joined by a quiet connector)
   with no markup change */
.step { display: flex; gap: 0.75rem; position: relative; padding-bottom: 1.1rem; }
.step:last-child { padding-bottom: 0; }
.step::after { content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 1.5px; background: var(--line-strong); }
.step:last-child::after { display: none; }
.step > b {
  background: var(--teal); color: var(--white); width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.76rem; font-weight: 900;
  flex: none; position: relative; z-index: 1; font-style: normal;
}
.step > div { padding-top: 0.3rem; font-size: 0.9rem; color: var(--ink); font-weight: 600; }

/* modern CEC3 step-chip (available for any future numbered flow) */
.stepper { display: flex; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; row-gap: 0.5rem; }
.step-chip { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 700; color: var(--grey); }
.step-chip .n { width: 26px; height: 26px; border-radius: 50%; background: var(--white); border: 2px solid var(--line-strong); color: var(--grey); display: flex; align-items: center; justify-content: center; font-size: 0.76rem; font-weight: 900; }
.step-chip.active .n { background: var(--teal); color: var(--white); border-color: var(--teal); box-shadow: 0 0 0 5px var(--teal-14); }
.step-chip.active { color: var(--teal-deep); }
.step-chip.done .n { background: var(--teal-deep); color: var(--white); border-color: var(--teal-deep); }
.step-connector { flex: 1; height: 2px; background: var(--line-strong); margin: 0 0.4rem; min-width: 20px; }
.step-connector.done { background: var(--teal); }

/* ---------------- Empty states ---------------- */
.empty-state {
  text-align: center; color: var(--grey); padding: 2.25rem 1.5rem;
  background: var(--pale); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.empty-state p { margin: 0; color: var(--grey); }

/* ---------------- Side panel (map "top area" auto-pick) ---------------- */
.side-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; background: var(--white); box-shadow: var(--shadow-sm); }
.card.auto-pick { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,180,98,0.25), var(--shadow-sm); }
.auto-note { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.68rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; color: #5a3c0a; background: var(--gold); padding: 0.2rem 0.6rem; border-radius: 999px; margin-bottom: 0.6rem; }

/* ---------------- Map canvas chrome ---------------- */
.map-canvas { position: relative; background: #04302f; border-radius: var(--radius); overflow: hidden; }

/* ---------------- Auth split screen ---------------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 940px) { .auth-shell { grid-template-columns: 1fr; min-height: auto; } }
.auth-brand {
  background: radial-gradient(ellipse 120% 80% at 20% 0%, #0a5c5c 0%, var(--teal-deep) 45%, #033838 100%);
  color: var(--white); padding: 3.5rem 3.25rem;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; min-height: 100vh;
}
@media (max-width: 940px) { .auth-brand { min-height: 260px; padding: 2.5rem 1.75rem; } }
.auth-brand::before {
  content: "";
  position: absolute; inset: -10% -10% -10% 20%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='138' viewBox='0 0 120 138'%3E%3Cpath d='M60 0L120 34V104L60 138L0 104V34Z' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 120px 138px;
  animation: hexdrift 60s linear infinite;
}
@keyframes hexdrift { from { transform: translate(0,0); } to { transform: translate(-120px,-138px); } }
.auth-brand .ab-top, .auth-brand .ab-mid, .auth-brand .ab-bottom { position: relative; z-index: 1; }
.auth-brand .ab-bottom { font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-top: 1.5rem; }
.auth-brand .wordmark { font-size: 1.1rem; }
.auth-brand h1 { color: var(--white); font-size: clamp(1.9rem, 3.2vw, 2.5rem); font-weight: 300; max-width: 15ch; margin-bottom: 0.75rem; }
.auth-brand .lede { color: rgba(255,255,255,0.84); max-width: 38ch; font-size: 1.02rem; margin-bottom: 0; }

.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 3rem 2.5rem; background: #fbfcfc; min-width: 0; }
@media (max-width: 940px) { .auth-form-side { padding: 2.5rem 1.5rem; } }
.auth-card { width: 100%; max-width: 420px; min-width: 0; }
.auth-card .card { box-shadow: var(--shadow-lg); }
.auth-card .h1 { margin-top: 0; }
.auth-foot-link { margin-top: 1.1rem; font-size: 0.85rem; color: var(--grey); text-align: center; }

/* ---------------- Hero (marketing landing) ---------------- */
/* Full-bleed regardless of the main.wrap ancestor it sits in - standard
   100vw/left:50%/-50vw bleed technique, paired with the overflow-x:hidden
   safety net on html/body above. */
.hero-band {
  background: linear-gradient(160deg, var(--teal-deep) 0%, #0a4d4d 55%, var(--teal) 130%);
  color: var(--white); padding: 4.5rem 0 4.75rem;
  width: 100vw; position: relative; left: 50%; right: 50%; margin: 0 -50vw 2rem;
  overflow: hidden;
}
/* Same hex-texture treatment as the auth split-screen's brand panel
   (.auth-brand::before), reused here so the signed-out landing page reads
   as the same front door, not a different, thinner design (Jason: "the
   landing page looks the same as before" - the fix is real composition,
   not just a texture, but the texture is part of matching the craft bar). */
.hero-band::before {
  content: "";
  position: absolute; inset: -20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='138' viewBox='0 0 120 138'%3E%3Cpath d='M60 0L120 34V104L60 138L0 104V34Z' fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 120px 138px;
  animation: hexdrift 60s linear infinite;
}
.hero-band .wrap { max-width: 900px; position: relative; z-index: 1; }
.hero-band .eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: rgba(255,255,255,0.75); font-weight: 900; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.hero-band .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.hero-band .h1 { color: var(--white); font-weight: 300; font-size: clamp(2rem, 4.4vw, 3rem); max-width: 18ch; margin-bottom: 0.75rem; }
.hero-band .lede { color: rgba(255,255,255,0.88); font-size: 1.12rem; max-width: 62ch; }
.hero-band .btn-row { margin-top: 1.6rem; }
/* Primary CTA needs its own override here: the base .btn is teal-on-teal,
   which reads as almost invisible against this dark band - a real solid
   white-on-teal button, not the app's usual teal-on-white one. */
.hero-band .btn:not(.ghost) { background: var(--white); color: var(--teal-deep); border-color: var(--white); }
.hero-band .btn:not(.ghost):hover { background: rgba(255,255,255,0.9); transform: translateY(-1px); }
.hero-band .btn.ghost { background: rgba(255,255,255,0.06); color: var(--white); border-color: rgba(255,255,255,0.4); }
.hero-band .btn.ghost:hover { background: rgba(255,255,255,0.14); border-color: var(--white); }

/* ---------------- Map (i) info popup ---------------- */
/* Ported from cec3.css/hub.html's own map-icon-btn/.map-about-pop pattern
   (the Need map's (i) button) - one static popup explaining every layer at
   once (never a per-layer drawer), so it can never drift from what the
   layer chips actually offer. Absolutely positioned within the map card
   (.map-card-body is the positioning parent) so it overlays the card
   rather than pushing the page around. */
.map-head-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.map-head-row h2 { margin-bottom: 0; }
.map-head-actions { display: flex; gap: 0.4rem; }
.map-icon-btn {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--teal); background: var(--white); color: var(--teal-deep);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.map-icon-btn:hover { background: var(--teal-08); }
.map-icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--teal-20), 0 0 0 1px var(--teal); }
.map-card-body { position: relative; }
.map-about-pop {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 20;
  width: min(420px, 92%); max-height: min(480px, 82%); overflow-y: auto;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1rem 1.1rem 1.1rem; font-size: 0.85rem;
}
.map-about-pop h5 { margin: 0.9rem 0 0.3rem; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--teal); font-weight: 900; }
.map-about-pop h5:first-of-type { margin-top: 0; }
.map-about-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.5rem; }
.map-about-head h4 { margin: 0; font-size: 1rem; color: var(--teal-deep); }
.map-about-close {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-tint); border: none; color: var(--grey);
  font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.map-about-close:hover { background: var(--teal-08); color: var(--teal-deep); }
.map-about-list { display: flex; flex-direction: column; gap: 0.55rem; }
.map-about-row { display: flex; align-items: flex-start; gap: 0.55rem; }
.map-about-swatch { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 0.2rem; }
.map-about-term { font-weight: 800; color: var(--teal-deep); font-size: 0.82rem; display: block; }
.map-about-def { font-size: 0.78rem; color: var(--grey); line-height: 1.4; display: block; }
.map-legend-ramp { display: flex; margin: 0.4rem 0; border-radius: 4px; overflow: hidden; }
.map-legend-ramp span { flex: 1; height: 14px; }
.map-legend-labels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--grey); }
/* Small colour-plus-text legend under the active (non-IMD) layer's caption -
   "the legend always pairs colour with text labels" (Jason, colour pass,
   item 1): a dot never carries meaning alone. */
.map-active-legend { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--grey); margin-top: 0.4rem; }
.map-active-legend .swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---------------- Ring gauge (institution head match score) ---------------- */
/* Shape ported from cec3.css/app.js's ringGaugeSvg: a track circle plus a
   value circle animated in via stroke-dashoffset, the whole SVG rotated
   -90deg so the sweep starts at 12 o'clock, with a centred label. Sized up
   from cec3's 52px KPI-band usage since this is one hero number, not a
   small band tile. */
.ring-gauge { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-gauge svg { transform: rotate(-90deg); }
.ring-gauge .ring-track { stroke: var(--pale); fill: none; }
.ring-gauge .ring-val { stroke: var(--teal); fill: none; stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease); }
.ring-gauge .ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--teal-deep); font-variant-numeric: tabular-nums; }

/* ---------------- Dumbbell row (institution: school vs in-scope average) --- */
.dumbbell-row { margin: 0.9rem 0; }
.dumbbell-row + .dumbbell-row { margin-top: 1.15rem; }
.dumbbell-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 0.8rem; margin-bottom: 0.35rem; }
.dumbbell-label { font-weight: 800; font-size: 0.86rem; color: var(--ink); }
.dumbbell-vals { font-size: 0.8rem; color: var(--grey); }
.dumbbell-svg { display: block; width: 100%; height: 34px; }
.dumbbell-track { stroke: var(--line-strong); stroke-width: 2; }
.dumbbell-connector { stroke: var(--line-strong); stroke-width: 3; }
.dumbbell-dot-school { fill: var(--teal-deep); }
.dumbbell-dot-avg { fill: var(--slate); }
.dumbbell-val-label { font-size: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dumbbell-val-label.school { fill: var(--teal-deep); }
.dumbbell-val-label.avg { fill: var(--slate); }

/* ---------------- Ranked bars (report top-N, chart above, table below) ---- */
.rbar-chart { display: flex; flex-direction: column; gap: 0.42rem; margin: 0.6rem 0 0.2rem; }
.rbar-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(90px,2fr) 3.4rem; align-items: center; gap: 0.6rem; }
.rbar-label { font-size: 0.8rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbar-track { position: relative; height: 10px; background: var(--pale); border-radius: 999px; }
.rbar-fill { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.rbar-bench { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--indigo); transform: translateX(-1px); }
.rbar-val { font-size: 0.8rem; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- Screen-reader-only text ---------------- */
/* Standard visually-hidden-but-announced pattern - used by the shortlist
   heart's "Shortlisted"/"Not shortlisted" state text (never colour/fill
   alone) and available generally. */
.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; }

/* ---------------- Shortlist heart toggle ---------------- */
/* CEC3-quiet: a plain circular outline button, teal outline heart, filled
   solid only when shortlisted - a SHAPE change (outline vs solid), not a
   colour-only signal, and every instance also carries an sr-only text state
   plus aria-pressed for assistive tech. Sized and positioned like the map's
   own small icon-buttons (.map-icon-btn) for a consistent icon-button family. */
.shortlist-form { position: relative; display: inline-flex; margin: 0; flex: none; }
/* Absolutely positioned so a failed-toggle message (e.g. shortlist cap)
   never reflows the card/panel it sits in - hearts appear in tight card
   corners, a map panel and the institution page alike. */
.shortlist-msg {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 5;
  max-width: 200px; padding: 0.3rem 0.6rem; border-radius: 8px;
  background: rgba(254,100,84,0.12); color: #9c3b28; border-left: 3px solid var(--coral);
  font-size: 0.72rem; font-weight: 600; line-height: 1.3; white-space: normal;
  box-shadow: var(--shadow-sm);
}
.shortlist-heart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-strong); background: var(--white); color: var(--teal);
  cursor: pointer; padding: 0;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 120ms var(--ease);
}
.shortlist-heart:hover { border-color: var(--teal); background: var(--teal-08); }
.shortlist-heart:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--teal-20), 0 0 0 1px var(--teal); }
.shortlist-heart.on { border-color: var(--teal); background: var(--teal-08); color: var(--teal-deep); }
.shortlist-heart:active { transform: scale(0.9); }

/* ---------------- Shortlist chips (dashboard / Lists index) ---------------- */
.saved-view-link svg, .icard h3 svg { color: var(--teal); }

/* ---------------- Map school dots (clickable, every layer) ---------------- */
/* Every dot on the map canvas carries data-urn (server) and is resolved by a
   single delegated click handler (partners.js's initSchoolDotSwap) - cursor
   feedback here is the only per-dot CSS needed, no 5,000 individual rules. */
.map-canvas circle[data-urn] { cursor: pointer; }

/* ---------------- Upload dropzone (real Uploads flow) ---------------- */
.upload-dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--pale);
  padding: 1.6rem 1.2rem; text-align: center; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.upload-dropzone:hover, .upload-dropzone:focus-visible { border-color: var(--teal); background: var(--teal-08); }
.upload-dropzone.drag { border-color: var(--teal); background: var(--teal-08); box-shadow: 0 0 0 3px var(--teal-20); }
.upload-dropzone p { margin: 0; }
.upload-dropzone .upload-filename { color: var(--teal-deep); font-weight: 800; }

/* ---------------- Saved views chip row (Priority Finder / dashboard) ---------------- */
.saved-views-wrap { margin: -0.5rem 0 1.35rem; }
.saved-views-label { margin: 0 0 0.4rem; }
.saved-views-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.saved-view-chip {
  display: inline-flex; align-items: center; gap: 0.1rem;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.28rem 0.3rem 0.28rem 0.9rem; font-size: 0.8rem;
}
.saved-view-link { color: var(--grey); font-weight: 700; text-decoration: none; }
.saved-view-link:hover { color: var(--teal-deep); }
.saved-view-del {
  border: none; background: transparent; color: var(--grey); font-size: 1rem; line-height: 1;
  cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 50%; font-family: var(--font);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.saved-view-del:hover { background: var(--negative-bg); color: var(--negative-ink); }

/* "Save this view" inline form (Priority Finder results header) - a compact
   name field + button sitting alongside the export/campaign/save-list
   actions already on that row, not a full stacked .filter form. flex-wrap +
   min-width:0 here (not just on the parent row) matter because this is
   itself a flex container with a fixed-width text input plus two buttons -
   at narrow widths their combined intrinsic width is wider than the
   viewport, and an inline-flex child does not shrink to fit just because
   its parent wraps. */
.save-view-form { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; min-width: 0; }
.save-view-form input[type=text] { width: 168px; min-width: 0; padding: 0.55rem 0.8rem; font-size: 0.82rem; }

/* ---------------- Mobile (<=640px) --------------------------------------
   Two unrelated fixes bundled at the same breakpoint (both from the
   security/mobile audit): (1) the Priority Finder results header - the
   save-view-form's fixed-width text input plus two buttons no longer fit a
   390px viewport even with flex-wrap on the parent row, so it stacks full-
   width below the name field on narrow screens; body must never scroll
   sideways. (2) small round icon buttons (pager arrows, map zoom/info,
   shortlist heart) sit below the ~40x40 minimum comfortable touch target on
   touchscreens - bumped up here only below the breakpoint so desktop mouse
   density (28-32px) is untouched. */
@media (max-width: 640px) {
  .save-view-form { flex-direction: column; align-items: stretch; width: 100%; }
  .save-view-form input[type=text] { width: 100%; }
  .save-view-form button { width: 100%; }
  #pf-results > .card, #pf-results > .card > div:last-child { width: 100%; }
  .pager-circle-btn, .map-icon-btn { width: 40px; height: 40px; }
  .shortlist-heart { width: 40px; height: 40px; }
  /* Segmented controls (Vocational, POLAR4, University relationship,
     Priority tier, Distance) - the desktop layout forces every option onto
     one row via flex:1 1 auto + min-width:0 + overflow:hidden, shrinking
     and clipping pill TEXT to fit. At 390px there isn't enough room left
     per pill once padding is accounted for across 4-5 options, and a
     visually clipped-to-nothing pill is also an unreachable tap target -
     worse than wrapping. Below the breakpoint, let the track wrap onto a
     second row instead: each pill sizes to its own content (no forced
     equal-share stretch/shrink) and stays fully visible and tappable. Every
     pill keeps its checked/unchecked styling independent of which row it
     lands on - nothing about .seg-group label's background/color rules is
     row-aware. Desktop (>=641px) is completely untouched - still the
     single shrink-to-fit row above. */
  .seg-group, .seg-view {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .seg-group label,
  .filter .seg-group label {
    flex: 0 1 auto;
    min-width: max-content;
    overflow: visible;
    text-overflow: clip;
    padding: 0.42rem 0.6rem;
  }
}

/* ---------------- Printable school brief ---------------- */
.brief-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.brief-toolbar a { font-size: 0.85rem; font-weight: 700; }
.brief-head { margin-bottom: 1.1rem; }
.brief-eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--teal); font-weight: 900; margin: 0 0 0.4rem; }
.brief-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 300; color: var(--teal-deep); margin: 0 0 0.4rem; }
.brief-generated { font-size: 0.76rem; }
.brief-notes-ruled, .brief-ruled-line { height: 1.9rem; border-bottom: 1px solid var(--line-strong); }
.brief-notes .brief-ruled-line:last-child { border-bottom: none; }

/* ---------------- Print ---------------- */
/* Chrome/nav/footer never belong on paper, on any page - a general, always-
   safe hardening independent of the brief feature below. */
@media print {
  .chrome-top, .app-tabs, .foot, .no-print { display: none !important; }
  a[href]::after { content: none !important; } /* never print raw URLs after link text */
}
/* Printable school brief - full print takeover, scoped to :has(.brief-doc) so
   every OTHER page's print output is completely unaffected (this rule would
   blank the whole page on any page without a .brief-doc in the DOM). */
@media print {
  body:has(.brief-doc) * { visibility: hidden; }
  body:has(.brief-doc) .brief-doc, body:has(.brief-doc) .brief-doc * { visibility: visible; }
  body:has(.brief-doc) .brief-doc {
    position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0 0.4cm;
  }
  body:has(.brief-doc) main.wrap { padding: 0; max-width: none; }
  .brief-doc .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; margin-bottom: 0.6rem; }
  .brief-doc .match-meter, .brief-doc .dumbbell-svg { break-inside: avoid; }
  .brief-doc .rbar-chart, .brief-doc .dist-bar { break-inside: avoid; }
}
/* Guide (/app/guide and its public twin /guide) - a customer prints/PDFs
   this page directly (Ctrl/Cmd+P), so it needs its own print pass: drop the
   TOC chips (a page you're holding on paper has no use for #anchor jumps),
   flatten every card to plain black-on-white with a hairline border instead
   of a shadow (a shadow is a screen-only cue and wastes toner as a grey
   smear), and never let a card split across a page break. Scoped to
   .guide-page so no other page's print output is touched - same pattern as
   the .brief-doc rule above. */
@media print {
  .guide-page .guide-toc { display: none !important; }
  .guide-page, .guide-page * { color: #000 !important; background: #fff !important; }
  .guide-page a { color: #000 !important; text-decoration: underline; }
  .guide-page .card { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; page-break-inside: avoid; margin-bottom: 0.6rem; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .auth-brand::before, .hero-band::before { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------------- Scroll reveal ---------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 420ms var(--ease), transform 420ms var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
