/* ==========================================================================
   Student Atlas design system
   Tokens -> base -> layout -> components -> pages -> accessibility modes
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text-scale: 1;

  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef1f5;
  --bg-inset: #e6eaf0;
  --text: #0f172a;
  --text-muted: #556274;
  --text-faint: #5b6778;
  --border: #dde3ea;
  --border-strong: #c5ced9;

  --brand: #047857;
  --brand-strong: #065f46;
  --brand-soft: #def7ec;
  --brand-contrast: #ffffff;
  --accent: #6d5bd0;

  --success: #0e9f6e;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #c81e1e;
  --danger-soft: #fde8e8;
  --info: #1a56db;
  --info-soft: #e1effe;

  --c-stem: #1c64f2;
  --c-health: #d61f69;
  --c-business: #b45309;
  --c-arts: #7e3af2;
  --c-civics: #c81e1e;
  --c-humanitarian: #057a55;
  --c-scholarships: #8a4b08;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow: 0 4px 14px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 18px 50px rgb(15 23 42 / 0.18);
  --ring: 0 0 0 3px rgb(4 120 87 / 0.3);
  --focus: #047857;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-elevated: #121b2d;
    --bg-subtle: #172238;
    --bg-inset: #1d2a42;
    --text: #e8edf5;
    --text-muted: #a3b0c2;
    --text-faint: #8b98ad;
    --focus: #84e1bc;
    --border: #24324b;
    --border-strong: #33445f;
    --brand: #31c48d;
    --brand-strong: #84e1bc;
    --brand-soft: rgb(49 196 141 / 0.14);
    --brand-contrast: #062b1d;
    --accent: #a596f0;
    --warning: #faca15;
    --warning-soft: rgb(250 202 21 / 0.12);
    --danger: #f98080;
    --danger-soft: rgb(249 128 128 / 0.12);
    --info: #76a9fa;
    --info-soft: rgb(118 169 250 / 0.12);
    --c-stem: #76a9fa;
    --c-health: #f17eb8;
    --c-business: #fdba8c;
    --c-arts: #ac94fa;
    --c-civics: #f98080;
    --c-humanitarian: #31c48d;
    --c-scholarships: #faca15;
    --shadow: 0 4px 14px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 18px 50px rgb(0 0 0 / 0.5);
  }
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elevated: #121b2d;
  --bg-subtle: #172238;
  --bg-inset: #1d2a42;
  --text: #e8edf5;
  --text-muted: #a3b0c2;
  --text-faint: #8b98ad;
  --focus: #84e1bc;
  --border: #24324b;
  --border-strong: #33445f;
  --brand: #31c48d;
  --brand-strong: #84e1bc;
  --brand-soft: rgb(49 196 141 / 0.14);
  --brand-contrast: #062b1d;
  --accent: #a596f0;
  --warning: #faca15;
  --warning-soft: rgb(250 202 21 / 0.12);
  --danger: #f98080;
  --danger-soft: rgb(249 128 128 / 0.12);
  --info: #76a9fa;
  --info-soft: rgb(118 169 250 / 0.12);
  --c-stem: #76a9fa;
  --c-health: #f17eb8;
  --c-business: #fdba8c;
  --c-arts: #ac94fa;
  --c-civics: #f98080;
  --c-humanitarian: #31c48d;
  --c-scholarships: #faca15;
  --shadow: 0 4px 14px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 18px 50px rgb(0 0 0 / 0.5);
}

/* ---- Base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--text-scale)); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand-strong); text-underline-offset: 2px; }
:root:not([data-theme="dark"]) a { color: var(--brand-strong); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Solid outlines meet the 3:1 focus-indicator contrast (WCAG 1.4.11) and survive Windows High Contrast. */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus-visible { outline: none; }
::selection { background: var(--brand-soft); }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000;
  background: var(--brand); color: var(--brand-contrast) !important; padding: 10px 16px;
  border-radius: var(--radius); font-weight: 600; text-decoration: none;
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 12px; }
svg.lucide { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -0.15em; stroke-width: 2; }

/* ---- Layout ------------------------------------------------------------ */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; }
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand-strong); margin-bottom: 10px;
}
.muted { color: var(--text-muted); }
.lead { font-size: 1.15rem; }
.faint { color: var(--text-faint); }
.small { font-size: 0.875rem; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-center { justify-content: center; }
.zeus-avatar-lg { width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 16px; }
.zeus-avatar-lg svg { width: 28px; height: 28px; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--text) !important; text-decoration: none; white-space: nowrap;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff;
}
.brand-mark svg { width: 20px; height: 20px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 8px 10px; border-radius: var(--radius); text-decoration: none; white-space: nowrap;
  color: var(--text-muted) !important; font-weight: 550; font-size: 0.95rem;
}
.nav a:hover { color: var(--text) !important; background: var(--bg-subtle); }
.nav a[aria-current="page"] { color: var(--text) !important; background: var(--bg-inset); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn.menu-toggle { display: none; }

/* Seven nav links plus the header actions need ~1200px (more with large text), so collapse to the menu below that. */
@media (max-width: 1200px) {
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; padding: 12px 20px 20px; margin: 0;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 1rem; }
  .btn.menu-toggle { display: inline-flex; }
  /* Icon-only on small screens, but the label stays in the accessibility tree. */
  .header-actions .btn-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .header-actions .btn.header-cta { padding: 0; width: 42px; min-height: 42px; }
}
.nav-extra { display: none; }
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .site-header .container { gap: 8px; }
  .brand { font-size: 1.05rem; gap: 8px; white-space: nowrap; }
  .brand-mark { width: 30px; height: 30px; }
  .header-actions { gap: 4px; }
  /* Theme lives in the accessibility menu and the CTA in the nav drawer, so the bar never overflows at 320px. */
  .header-actions .theme-toggle, .header-actions .header-cta { display: none; }
  .nav .nav-extra { display: block; }
  .nav { padding-inline: 16px; }
}

/* Signed out: no tabs or menu, so Sign up stays in the bar at every width. */
.site-header.no-tabs .header-actions .header-cta { display: inline-flex; }
@media (max-width: 380px) { .site-header .brand { font-size: 0; gap: 0; } }
.lang-code { font-size: 0.7rem; font-weight: 800; margin-left: 2px; }
.lang-menu { position: absolute; right: 16px; top: calc(var(--header-h) - 4px); width: min(360px, calc(100vw - 32px)); z-index: 60; box-shadow: var(--shadow-lg); }
.lang-menu { padding: 18px; max-height: calc(100dvh - var(--header-h) - 12px); overflow-y: auto; }
.lang-menu h3 { font-size: 1rem; display: flex; gap: 8px; align-items: center; }
.lang-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
[dir="rtl"] .lang-menu, [dir="rtl"] .a11y-menu { right: auto; left: 16px; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-elevated); margin-top: 48px; }
.site-footer .footer-main { padding-top: 32px; padding-bottom: 32px; display: grid; gap: 24px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.footer-about p { max-width: 520px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: flex-end; }
.site-footer a { color: var(--text) !important; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
@media (max-width: 720px) { .site-footer .footer-main { grid-template-columns: 1fr; } .footer-links { justify-content: flex-start; } }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; min-height: 42px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--bg-subtle); color: var(--text);
  font-weight: 600; font-size: 0.95rem; line-height: 1; cursor: pointer; text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-inset); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); color: var(--brand-contrast) !important; }
.btn-primary:hover { background: var(--brand-strong); }
:root[data-theme="dark"] .btn-primary:hover { background: #46d39c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary:hover { background: #46d39c; } }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-subtle); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-lg { padding: 14px 24px; min-height: 52px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 0.875rem; }
.btn-icon { padding: 0; width: 42px; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; }
@media (max-width: 520px) {
  /* Let long labels wrap instead of pushing the page sideways (WCAG 1.4.10 Reflow). */
  .btn:not(.btn-icon) { white-space: normal; text-align: center; line-height: 1.25; }
}
a.btn { color: var(--text); }

/* ---- Cards & surfaces -------------------------------------------------- */
.card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.card-flat { box-shadow: none; }
.card h3 { margin-bottom: 6px; }
.surface { background: var(--bg-subtle); border-radius: var(--radius-lg); padding: 20px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 24px 0; }

/* ---- Badges & chips ---------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 650;
  background: var(--bg-subtle); color: var(--text-muted); white-space: nowrap;
}
/* Text is the cluster hue blended toward the body text so every palette (incl. color-blind) passes AA contrast. */
.badge-cluster { background: color-mix(in srgb, var(--cluster) 14%, transparent); color: color-mix(in srgb, var(--cluster) 55%, var(--text)); }
.badge-success { background: var(--brand-soft); color: var(--brand-strong); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
[data-cluster="STEM"] { --cluster: var(--c-stem); }
[data-cluster="Health"] { --cluster: var(--c-health); }
[data-cluster="Business"] { --cluster: var(--c-business); }
[data-cluster="Arts"] { --cluster: var(--c-arts); }
[data-cluster="Civics"] { --cluster: var(--c-civics); }
[data-cluster="Humanitarian"] { --cluster: var(--c-humanitarian); }
[data-cluster="Scholarships"] { --cluster: var(--c-scholarships); }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--radius-full); border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--text-muted); font-weight: 550; font-size: 0.9rem;
  cursor: pointer; transition: all 0.15s var(--ease); user-select: none;
}
.chip:hover { border-color: var(--brand); color: var(--text); }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.selected {
  background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong);
}

/* ---- Forms ------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 18px; }
.label { font-weight: 650; font-size: 0.92rem; }
.hint { font-size: 0.85rem; color: var(--text-faint); }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; min-height: 44px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: var(--ring); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.85rem; font-weight: 550; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid .field + .field { margin-top: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex-shrink: 0; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; font-size: 1.05rem; margin-bottom: 12px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; font-size: 0.92rem; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background 0.15s var(--ease); flex-shrink: 0; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 88px 0 72px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1;
  background:
    radial-gradient(40% 50% at 20% 30%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 .highlight { background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.2rem; color: var(--text-muted); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats { display: flex; gap: 28px; margin: 36px 0 0; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dd { margin: 0; font-size: 1.6rem; font-weight: 800; }
.hero-stats dt { color: var(--text-muted); font-size: 0.9rem; }

/* Landing page */
.mock-stack { position: relative; display: grid; gap: 14px; max-width: 420px; margin-inline: auto; }
.mock-card { padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.mock-opp { border-left: 4px solid var(--c-stem); }
.mock-match { font-weight: 800; color: var(--brand); font-size: 0.9rem; }
.mock-bar { height: 6px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; margin-top: 4px; }
.mock-bar span { display: block; width: 94%; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.mock-deadline { flex-direction: row; align-items: center; gap: 14px; margin-left: 36px; }
.mock-date { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.mock-date b { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
.mock-chat { margin-right: 28px; }
.mock-chat .bubble { max-width: 100%; font-size: 0.9rem; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: how; }
.how-steps li { position: relative; }
.how-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 14px; }
.how-steps h3::before { counter-increment: how; content: counter(how) ". "; color: var(--text-muted); }
.area-pills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.area-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated); }
.area-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cluster); }
.split-band { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 36px; }
.split-band h2 { margin-top: 8px; }
.split-band .reasons li { font-size: 1rem; }
@media (max-width: 800px) { .split-band { grid-template-columns: 1fr; padding: 24px; } }
.trust-row { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.trust-row li { display: flex; gap: 12px; align-items: flex-start; }
.trust-row li > svg { flex: none; width: 24px; height: 24px; color: var(--brand); margin-top: 2px; }
.trust-row strong { display: block; }
.trust-row span { color: var(--text-muted); font-size: 0.92rem; }
.trust-row strong { color: var(--text); font-size: 1rem; }
.hero-preview { position: relative; }
@media (max-width: 560px) {
  .hero-cta .btn { width: 100%; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .hero-stats dd { font-size: 1.35rem; }
  .hero-stats dt { font-size: 0.8rem; line-height: 1.3; }
  .hero .lead { font-size: 1.05rem; }
  .section { padding: 44px 0; }
  .section-tight { padding: 28px 0; }
  .section-head { margin-bottom: 20px; }
  .cta-band { padding: 32px 20px; border-radius: 18px; }
  .card { padding: 18px; }
}
.preview-chat { padding: 20px; }
.preview-chat .bubble { max-width: 92%; }
@media (max-width: 900px) {
  .hero { padding: 56px 0 40px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-preview { display: none; }
}

.feature-card .icon-tile {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 14px;
}
.feature-card .icon-tile svg { width: 22px; height: 22px; }
.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { position: relative; padding-top: 52px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; background: var(--text); color: var(--bg);
}

.cluster-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text) !important; transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.cluster-tile:hover { transform: translateY(-2px); border-color: var(--cluster); box-shadow: var(--shadow); }
.cluster-tile .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cluster); }
.cluster-tile strong { font-size: 1rem; }
.cluster-tile span { color: var(--text-muted); font-size: 0.86rem; }

.cta-band {
  border-radius: 24px; padding: 48px; text-align: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--bg-elevated)), color-mix(in srgb, var(--accent) 14%, var(--bg-elevated)));
  border: 1px solid var(--border);
}

/* ---- Opportunity cards ------------------------------------------------- */
.opp-card {
  display: flex; flex-direction: column; gap: 12px; height: 100%;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; position: relative; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.opp-card::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cluster); }
.opp-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.opp-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.opp-card h3 { font-size: 1.05rem; margin: 0; }
.surface > h3.fit-heading { font-size: 1rem; }
.opp-card h3 button { all: unset; cursor: pointer; }
.opp-card h3 button:hover { text-decoration: underline; }
.opp-card h3 button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.opp-org { color: var(--text-muted); font-size: 0.88rem; margin: 2px 0 0; }
.opp-desc { color: var(--text-muted); font-size: 0.92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.opp-meta { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.opp-meta .badge { white-space: normal; text-wrap: balance; border-radius: 12px; }
.opp-facts { display: grid; gap: 4px; font-size: 0.86rem; color: var(--text-muted); }
.opp-facts span { display: flex; gap: 6px; align-items: center; }
.opp-card-actions { margin-top: auto; display: flex; gap: 8px; }
.opp-card-actions .btn { flex: 1; }
.save-btn[aria-pressed="true"] { color: var(--brand-strong); background: var(--brand-soft); }
.match-pill { font-weight: 750; }
.match-high { background: var(--brand-soft); color: var(--brand-strong); }
.match-mid { background: var(--info-soft); color: var(--info); }
.match-low { background: var(--bg-subtle); color: var(--text-muted); }

/* ---- Explore page ------------------------------------------------------ */
.explore-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 380px; gap: 24px; padding: 24px 20px 0; max-width: 1560px; margin: 0 auto; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; padding: 20px; }
.filters h2 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.filter-block + .filter-block { margin-top: 18px; }
.filter-block .label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-toggles { display: grid; gap: 12px; }
.results-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; min-width: 220px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.search-wrap .input { padding-left: 42px; min-height: 48px; border-radius: 12px; }
.results-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.profile-nudge { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px; border-radius: var(--radius-lg); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--text-faint); }
.btn.filters-toggle { display: none; }
.btn.chat-fab, .btn.dock-close { display: none; }
/* The docked Zeus panel. It must come before the media queries below, which
   turn it into a floating panel that the "Ask Zeus" button and X open and close. */
.zeus-dock {
  position: sticky; top: calc(var(--header-h) + 16px); height: calc(100vh - var(--header-h) - 32px);
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.filters .chip { font-size: 0.84rem; padding: 5px 11px; }

@media (max-width: 1280px) {
  .explore-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .zeus-dock { position: fixed; right: 20px; bottom: 88px; width: min(420px, calc(100vw - 40px)); height: min(640px, calc(100vh - 160px)); z-index: 60; display: none; box-shadow: var(--shadow-lg); }
  .zeus-dock.open { display: flex; }
  .btn.dock-close { display: inline-flex; }
  .btn.chat-fab { display: inline-flex; position: fixed; right: 20px; bottom: 20px; z-index: 61; box-shadow: var(--shadow-lg); }
}
@media (max-width: 860px) {
  .explore-layout { grid-template-columns: 1fr; padding: 16px 16px 0; }
  .filters { position: fixed; inset: 0 auto 0 0; width: min(340px, 88vw); max-height: none; z-index: 70; border-radius: 0; transform: translateX(-105%); visibility: hidden; transition: transform 0.2s var(--ease), visibility 0s linear 0.2s; overscroll-behavior: contain; }
  /* Visible immediately on open (so focus can move in), hidden only after the slide-out. */
  .filters.open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform 0.2s var(--ease), visibility 0s; }
  .btn.filters-toggle { display: inline-flex; }
  .results-head .search-wrap { flex-basis: 100%; }
  .results-head > .row { width: 100%; flex-wrap: nowrap; }
  .results-head > .row > * { flex: 1; min-width: 0; }
  /* Leave room so the floating "Ask Zeus" button never covers the last card. */
  .explore-layout > section { padding-bottom: 88px; }
  .zeus-dock { right: 12px; left: 12px; width: auto; bottom: 80px; height: calc(100dvh - 150px); }
}
.drawer-backdrop { position: fixed; inset: 0; z-index: 65; background: rgb(8 12 22 / 0.45); animation: fade 0.15s var(--ease); }

/* ---- Zeus chat --------------------------------------------------------- */
.zeus-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.zeus-avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; flex-shrink: 0; }
.zeus-avatar svg { width: 20px; height: 20px; }
.zeus-head .title { font-weight: 750; line-height: 1.2; }
.zeus-head .subtitle { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); }
.zeus-head .actions { margin-left: auto; display: flex; gap: 4px; }
.zeus-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.zeus-welcome { text-align: center; padding: 12px 4px; color: var(--text-muted); }
.zeus-welcome h3 { color: var(--text); }
.suggestions { display: grid; gap: 8px; margin-top: 14px; }
.suggestion { text-align: left; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); cursor: pointer; font-size: 0.9rem; color: var(--text); transition: border-color 0.15s var(--ease), background 0.15s var(--ease); }
.suggestion:hover { border-color: var(--brand); background: var(--brand-soft); }
.bubble { padding: 10px 14px; border-radius: 16px; max-width: 88%; font-size: 0.94rem; line-height: 1.55; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--brand); color: var(--brand-contrast); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bubble.assistant { align-self: flex-start; background: var(--bg-subtle); border-bottom-left-radius: 4px; }
.bubble.error { align-self: stretch; max-width: none; background: var(--danger-soft); color: var(--danger); display: flex; gap: 8px; align-items: flex-start; }
.bubble.notice { align-self: stretch; max-width: none; background: var(--warning-soft); color: var(--warning); font-size: 0.88rem; }
.bubble.assistant p:last-child, .bubble.assistant ul:last-child, .bubble.assistant ol:last-child { margin-bottom: 0; }
.bubble.assistant ul, .bubble.assistant ol { padding-left: 1.25em; margin: 0 0 0.8em; }
.bubble.assistant li + li { margin-top: 4px; }
.bubble.assistant h3, .bubble.assistant h4 { font-size: 1rem; margin: 0.6em 0 0.3em; }
.bubble.assistant code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-inset); padding: 1px 5px; border-radius: 4px; }
.bubble.assistant a { color: var(--brand-strong); }
.opp-link {
  all: unset; display: inline; cursor: pointer; font-weight: 650; color: var(--brand-strong);
  border-bottom: 1.5px solid color-mix(in srgb, var(--brand) 45%, transparent);
}
.opp-link:hover { border-bottom-color: var(--brand); }
.opp-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.zeus-status { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center; padding: 0 2px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span[aria-hidden] { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); animation: blink 1.2s infinite both; }
.typing span:nth-child(3) { animation-delay: 0.15s; }
.typing span:nth-child(4) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.zeus-input { border-top: 1px solid var(--border); padding: 12px; display: grid; gap: 10px; }
.zeus-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip.chip-sm { padding: 5px 11px; font-size: 0.82rem; white-space: nowrap; flex-shrink: 0; }
.zeus-form { display: flex; gap: 8px; align-items: center; }
.zeus-field { position: relative; flex: 1; }
.zeus-field input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); }
.zeus-field input:focus { border-color: var(--brand); box-shadow: var(--ring); }
.zeus-field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.zeus-predictions {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 5; margin: 0; padding: 6px; list-style: none;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.zeus-prediction { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.zeus-prediction svg { color: var(--text-faint); }
.zeus-prediction:hover, .zeus-prediction[aria-selected="true"] { background: var(--brand-soft); color: var(--brand-strong); }
.zeus-disclaimer { font-size: 0.74rem; color: var(--text-faint); text-align: center; }

/* ---- Modal ------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgb(8 12 22 / 0.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade 0.15s var(--ease); }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop 0.18s var(--ease); }
.modal-wide { width: min(860px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 22px 24px 14px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px 24px; }
@media (max-width: 560px) {
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal, .modal-wide { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; }
  .modal-header { padding: 18px 16px 12px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-footer .btn { flex: 1 1 auto; }
}
.modal-footer { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 24px; background: var(--bg-elevated); border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.detail-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 18px 0; }
.detail-item { background: var(--bg-subtle); border-radius: var(--radius); padding: 12px 14px; }
.detail-item .k { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.detail-item .v { font-weight: 600; margin-top: 2px; }
.reasons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.reasons li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.92rem; }
.reasons li svg { margin-top: 3px; }
.reasons .good svg { color: var(--success); }
.reasons .warn svg { color: var(--warning); }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--info-soft); color: var(--text); font-size: 0.9rem; }
.callout svg { color: var(--info); margin-top: 3px; }

/* ---- Wizard ------------------------------------------------------------ */
.wizard-progress { display: flex; gap: 6px; margin-top: 14px; }
.wizard-progress span { flex: 1; height: 5px; border-radius: 999px; background: var(--bg-inset); transition: background 0.2s var(--ease); }
.wizard-progress span.done { background: var(--brand); }
.option-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.option {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 12px; text-align: left;
  border: 1.5px solid var(--border); background: var(--bg-elevated); cursor: pointer; transition: all 0.15s var(--ease);
}
.option:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.option .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cluster, var(--brand)); margin-top: 6px; flex-shrink: 0; }
.option strong { display: block; font-size: 0.95rem; }
.option small { color: var(--text-muted); font-size: 0.8rem; line-height: 1.35; display: block; margin-top: 2px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented .chip { min-width: 64px; justify-content: center; }

/* ---- Profile ----------------------------------------------------------- */
.profile-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .profile-layout { grid-template-columns: minmax(0, 1fr); } }
.avatar { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; }
.kv { display: grid; gap: 12px; margin: 18px 0 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--border); padding-bottom: 10px; font-size: 0.93rem; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 16px; border-radius: var(--radius-lg); background: var(--bg-subtle); }
.stat strong { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--text-muted); font-size: 0.85rem; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 48px; gap: 12px; align-items: center; font-size: 0.9rem; }
.bar-track { height: 10px; border-radius: 999px; background: var(--bg-inset); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--cluster); width: 0; transition: width 0.6s var(--ease); }
@media (max-width: 560px) { .bar-row { grid-template-columns: 110px 1fr 40px; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.saved-item { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.saved-item:last-child { border-bottom: 0; }

/* ---- Sharing ----------------------------------------------------------- */
.opp-card-tools { display: flex; gap: 2px; flex-shrink: 0; }
.share-link-row { display: flex; gap: 8px; }
.share-link-row .input { flex: 1; min-width: 0; }
.share-options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.share-option { justify-content: center; }
.share-details summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); }
.share-preview { white-space: pre-wrap; font-family: var(--font-sans); font-size: 0.86rem; background: var(--bg-subtle); border-radius: var(--radius); padding: 12px 14px; max-height: 220px; overflow: auto; margin: 10px 0 0; }
.shared-nudge strong { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 480px) { .share-link-row { flex-direction: column; } }

/* ---- Application tracker ----------------------------------------------- */
:root { --src-applied: var(--brand-strong); --src-planning: var(--info); --src-saved: var(--accent); }
.page-actions .btn { white-space: nowrap; }
.h3 { font-size: 1.15rem; }
.me-auto { margin-right: auto; }
.ms-1 { margin-left: 6px; }
.text-danger { color: var(--danger); font-weight: 600; }
.select-sm { min-height: 36px; padding-top: 6px; padding-bottom: 6px; width: auto; }
.status-badge { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.status-badge svg { width: 14px; height: 14px; }
.status-planning { background: var(--info-soft); color: var(--info); }
.status-applied { background: var(--brand-soft); color: var(--brand-strong); }
.status-decided { background: var(--bg-inset); color: var(--text); }
.track-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.track-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--radius-lg); background: var(--bg-elevated); border: 1px solid var(--border); }
.track-card-head { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.track-card h3 { font-size: 1.05rem; margin: 0; }
.track-card h3 button { all: unset; cursor: pointer; }
.track-card h3 button:hover { text-decoration: underline; }
.track-card h3 button:focus-visible { box-shadow: var(--ring); border-radius: 4px; }
.track-progress { display: grid; gap: 4px; }
.track-progress progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; background: var(--bg-inset); overflow: hidden; }
.track-progress progress::-webkit-progress-bar { background: var(--bg-inset); border-radius: 999px; }
.track-progress progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
.track-progress progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.track-card-actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.track-status { flex: 1 1 170px; }
.track-status .select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.soon-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.soon-list li { display: flex; gap: 12px; align-items: center; }
.soon-main { min-width: 0; }
.date-chip { display: inline-grid; place-items: center; min-width: 64px; padding: 4px 8px; border-radius: var(--radius-sm); background: var(--bg-subtle); font-weight: 700; font-size: 0.85rem; }
.date-chip.near { background: var(--warning-soft); color: var(--warning); }
.date-chip.overdue { background: var(--danger-soft); color: var(--danger); }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin-inline: 0; }
.fieldset legend { font-weight: 700; padding: 0 6px; }
.task-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.task-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.task-list li > span { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-add { display: flex; gap: 8px; }
.inline-add .input { flex: 1; min-width: 0; }
.event-add { display: grid; gap: 10px; grid-template-columns: 2fr 1.2fr 1fr auto; align-items: end; }
.event-add .field + .field { margin-top: 0; }
@media (max-width: 640px) {
  .event-add { grid-template-columns: 1fr 1fr; }
  .event-add .field:first-child, .event-add .btn { grid-column: 1 / -1; }
  .inline-add { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---- Calendar ---------------------------------------------------------- */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-title { font-size: 1.25rem; margin: 0 6px; min-width: 9ch; }
.cal-filter[aria-pressed="false"] { opacity: 0.7; text-decoration: line-through; }
.cal-filter svg, .segmented .chip svg { width: 15px; height: 15px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-grid { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cal-grid th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; padding: 4px 0; }
.cal-grid td { padding: 0; vertical-align: top; }
.cal-day {
  width: 100%; min-height: 92px; display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left;
  padding: 6px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); cursor: pointer; font: inherit;
}
.cal-day:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.cal-day:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--brand); }
.cal-day[aria-pressed="true"] { border-color: var(--brand); border-width: 2px; padding: 5px; background: var(--brand-soft); }
.cal-num { font-weight: 700; font-size: 0.9rem; }
.cal-today .cal-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-contrast); }
.cal-pills { display: grid; gap: 3px; }
.cal-pill { font-size: 0.72rem; line-height: 1.3; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--src); background: color-mix(in srgb, var(--src) 12%, transparent); }
.cal-more { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
[data-source="applied"] { --src: var(--src-applied); }
[data-source="planning"] { --src: var(--src-planning); }
[data-source="saved"] { --src: var(--src-saved); }
.cal-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cal-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-subtle); border-left: 4px solid var(--src); }
.cal-item-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--bg-elevated); color: var(--src); }
.cal-item-main strong { display: block; line-height: 1.3; overflow-wrap: anywhere; }
.cal-label { font-weight: 650; }
.cal-side .cal-item { grid-template-columns: auto minmax(0, 1fr); }
.cal-side .cal-item-actions { grid-column: 2; }
.cal-item-actions { display: flex; gap: 4px; align-items: center; }
.cal-source { display: inline-flex; gap: 4px; align-items: center; color: var(--src); font-weight: 650; }
.cal-source svg { width: 13px; height: 13px; }
.cal-agenda { display: grid; gap: 24px; }
.cal-month h3 { font-size: 1.05rem; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
@media (max-width: 640px) {
  .cal-grid { border-spacing: 2px; }
  .cal-day { min-height: 48px; align-items: center; padding: 4px 2px; }
  .cal-day[aria-pressed="true"] { padding: 3px 1px; }
  .cal-pills { display: flex; gap: 3px; justify-content: center; }
  .cal-pill { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--src); font-size: 0; }
  .cal-more { font-size: 0.66rem; }
  .cal-item, .cal-side .cal-item { grid-template-columns: minmax(0, 1fr); }
  .cal-item-actions, .cal-side .cal-item-actions { grid-column: 1; }
  .cal-item-icon { display: none; }
}
html.high-contrast .cal-pill, html.high-contrast .cal-item { outline: 1px solid var(--text); }

/* ---- About / sources --------------------------------------------------- */
.prose { max-width: 760px; }
.prose a, .source-list a { overflow-wrap: anywhere; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.source-list { columns: 2 320px; column-gap: 32px; padding-left: 1.1em; font-size: 0.9rem; }
.source-list li { break-inside: avoid; margin-bottom: 6px; }

/* ---- Toasts ------------------------------------------------------------ */
.toast-region { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 550; font-size: 0.92rem; animation: pop 0.18s var(--ease); }
.toast.success svg { color: #31c48d; }
.toast.error svg { color: #f98080; }

/* ---- Carousel ------------------------------------------------------------
   A scroll-snap track: swipe on touch, buttons or Tab with a keyboard. It
   never auto-advances, so there is nothing to pause (WCAG 2.2.2). */
.carousel { position: relative; }
.carousel-controls { display: flex; align-items: center; gap: 8px; }
.carousel-status { font-size: 0.875rem; color: var(--text-muted); min-width: 7ch; text-align: right; font-variant-numeric: tabular-nums; }
.carousel-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 16px) / 3); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  padding: 6px 6px 16px; margin: -6px -6px 0; scrollbar-width: thin;
}
.carousel-slide { scroll-snap-align: start; min-width: 0; display: flex; }
.carousel-slide > * { flex: 1; }
.carousel-track:focus-visible { outline-offset: 4px; }
@media (max-width: 1024px) { .carousel-track { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 640px) {
  /* Show a sliver of the next card so it's obvious the row scrolls. */
  .carousel-track { grid-auto-columns: 86%; gap: 12px; scroll-padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) { .carousel-track { scroll-behavior: auto; } }
html.reduce-motion .carousel-track { scroll-behavior: auto; }

/* ---- Accessibility menu ------------------------------------------------ */
.a11y-menu { position: absolute; right: 20px; top: calc(var(--header-h) - 4px); width: min(320px, calc(100vw - 40px)); z-index: 80; padding: 18px; }
.a11y-menu h3 { font-size: 1rem; display: flex; gap: 8px; align-items: center; }
.a11y-menu .field + .field { margin-top: 14px; }
.a11y-menu .switches { display: grid; gap: 12px; margin-top: 14px; }

/* ---- Utilities --------------------------------------------------------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-subtle), var(--bg-inset), var(--bg-subtle)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-lg); min-height: 210px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==========================================================================
   Accessibility modes (toggled on <html>)
   ========================================================================== */
html.text-lg { --text-scale: 1.125; }
html.text-xl { --text-scale: 1.25; }

html.readable-font body { font-family: Verdana, "Atkinson Hyperlegible", Tahoma, sans-serif; letter-spacing: 0.03em; word-spacing: 0.12em; line-height: 1.8; }
html.readable-font .opp-desc { -webkit-line-clamp: 4; }

html.high-contrast {
  --text-muted: var(--text);
  --text-faint: var(--text);
  --border: var(--text);
  --border-strong: var(--text);
}
html.high-contrast a { text-decoration: underline; }
html.high-contrast .btn-primary { outline: 2px solid var(--text); }

/* Okabe-Ito palette: distinguishable for the common forms of color vision deficiency */
html.cvd-palette {
  --c-stem: #0072b2;
  --c-health: #cc79a7;
  --c-business: #e69f00;
  --c-arts: #56b4e9;
  --c-civics: #d55e00;
  --c-humanitarian: #009e73;
  --c-scholarships: #8a7a00;
}

html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important; scroll-behavior: auto !important;
}
@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; }
}

/* Windows High Contrast / forced colors: keep state visible where it was shown with background color only. */
@media (forced-colors: active) {
  .switch input { border: 2px solid ButtonText; forced-color-adjust: none; background: Canvas; }
  .switch input::after { background: ButtonText; }
  .switch input:checked { background: Highlight; }
  .switch input:checked::after { background: HighlightText; }
  .chip[aria-pressed="true"], .chip[aria-checked="true"], .option[aria-pressed="true"], .tab[aria-selected="true"] { border: 3px solid Highlight; }
  .btn, .chip, .card, .opp-card { border: 1px solid ButtonText; }
  .opp-card::before, .cluster-tile .dot, .bar-fill { forced-color-adjust: none; }
}

@media print {
  .site-header, .site-footer, .zeus-dock, .chat-fab, .filters, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---- Reviews ------------------------------------------------------------ */
:root { --star: #b45309; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --star: #fbbf24; } }
:root[data-theme="dark"] { --star: #fbbf24; }
.stars { display: inline-flex; gap: 1px; color: var(--border-strong); }
.stars .star.on, .star-input .star.on { color: var(--star); }
.stars .star.on svg, .star-input .star.on svg { fill: currentColor; }
.rating-badge { background: var(--warning-soft); color: var(--text); }
.rating-badge svg { color: var(--star); fill: currentColor; }
.reviews { border-top: 1px solid var(--border); padding-top: 20px; display: grid; gap: 16px; }
.reviews-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.reviews-score { display: grid; justify-items: start; gap: 2px; }
.reviews-score strong { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.reviews-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.reviews-bars li { display: grid; grid-template-columns: 1.2em minmax(0, 1fr) 2.5em; gap: 8px; align-items: center; }
.reviews-bars .bar-track { height: 8px; }
.reviews-bars .bar-track, .reviews-bars .bar-fill { display: block; }
.reviews-bars .bar-fill { background: var(--star); }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; }
.review { padding: 14px 0; border-bottom: 1px solid var(--border); display: grid; gap: 6px; }
.review:last-child { border-bottom: 0; }
.review h4 { font-size: 0.98rem; }
.review-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.review-own { margin-left: 8px; }
.review-form { display: grid; gap: 14px; }
.review-form .field + .field, .review-form .mt-2 { margin-top: 0; }
.star-input { display: flex; align-items: center; gap: 2px; }
.star-input .star { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; color: var(--border-strong); }
.star-input .star svg { width: 28px; height: 28px; }
.star-input .star:hover { background: var(--bg-inset); }
.star-input input:focus-visible + .star { box-shadow: var(--ring); }
.star-input > span:last-child { margin-left: 8px; }
@media (max-width: 560px) {
  .reviews-summary { grid-template-columns: 1fr; gap: 12px; }
  .reviews-score { grid-template-columns: auto auto; align-items: center; column-gap: 10px; }
  .star-input .star { width: 40px; height: 44px; }
}
@media (forced-colors: active) {
  .stars .star.on svg, .star-input .star.on svg, .rating-badge svg { fill: CanvasText; }
  .star-input input:focus-visible + .star { outline: 2px solid Highlight; }
}
.reviews > [role="status"]:empty { display: none; }

/* ---- Accounts, rooms, My Story, and the teacher dashboard ---------------- */
.redirecting body { visibility: hidden; }
.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.stack-sm > * + * { margin-top: 8px; }
.cta-icon { display: inline-flex; font-size: 1.05rem; line-height: 1; }
.btn.header-logout[hidden], .btn.header-cta[hidden] { display: none; }
@media (max-width: 1200px) {
  .header-actions .btn.header-logout { padding: 0; width: 42px; min-height: 42px; }
}
.hero-join { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 18px; }
.hero-join svg { width: 18px; height: 18px; }
.wizard-account { margin: 8px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wizard-account:empty { display: none; }

.account-code-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); }
.account-id { display: flex; gap: 12px; align-items: center; }
.account-emoji { font-size: 2rem; line-height: 1; }
.account-id > div { display: grid; }
.account-username { font-size: 1.25rem; overflow-wrap: anywhere; }
.account-secret { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-elevated); border: 1px dashed var(--border-strong); }
.account-secret .mono { font-size: 1.2rem; overflow-wrap: anywhere; }

/* Pages that need an account stay hidden while we check (see js/auth-gate.js). */
.gate-checking main, .gate-checking .site-footer { visibility: hidden; }
.ml-1 { margin-left: 6px; }
.badge svg { width: 12px; height: 12px; }
.callout-warn { background: var(--warning-soft); }
.callout-warn svg { color: var(--warning); }

/* Picture password pad */
.picture-pad { display: grid; gap: 10px; }
.picture-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.picture-head .label { margin: 0; }
.picture-slots { display: flex; gap: 8px; }
.picture-slot { position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius); border: 2px dashed var(--border-strong); background: var(--bg-elevated); font-size: 1.7rem; }
.picture-slot.filled { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.picture-slot.next { border-color: var(--brand); }
.picture-slot-num { position: absolute; top: 2px; left: 5px; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.picture-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand-strong); }
.picture-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.picture-option {
  display: grid; justify-items: center; gap: 2px; min-height: 72px; padding: 8px 4px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-elevated); color: var(--text);
  cursor: pointer; font: inherit; transition: transform 0.1s var(--ease), border-color 0.1s var(--ease);
}
.picture-option:hover { border-color: var(--brand); }
.picture-option:active { transform: scale(0.96); }
.picture-option:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.picture-grid.full .picture-option { opacity: 0.6; cursor: default; }
.picture-emoji { font-size: 1.9rem; line-height: 1.1; }
.picture-name { font-size: 0.78rem; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.picture-status { margin: 0; min-height: 1.4em; color: var(--text-muted); }
.picture-actions { gap: 4px; }
@media (max-width: 480px) {
  .picture-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .picture-option { min-height: 64px; }
  .picture-slot { width: 46px; height: 46px; font-size: 1.5rem; }
}
.reduce-motion .picture-option { transition: none; }
.reduce-motion .picture-option:active { transform: none; }
.high-contrast .picture-option[aria-disabled="true"] { opacity: 1; }

/* Login Pass and sign-in links */
.pass-preview { display: grid; gap: 12px; justify-items: center; }
.pass-image { width: 100%; max-width: 320px; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
.scan-frame { display: grid; justify-items: center; }
.scan-video { width: 100%; max-width: 420px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); background: #000; }
.scan-video[hidden] { display: none; }
.signin-methods { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.signin-method { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.signin-method-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); flex-shrink: 0; }
.link-card-body { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.link-qr { border-radius: var(--radius-sm); background: #fff; }
.link-text { overflow-wrap: anywhere; word-break: break-all; font-size: 0.85rem !important; }

.zeus-nudges { border-left: 4px solid var(--accent); }
.zeus-nudges-head { gap: 10px; margin-bottom: 10px; }
.zeus-nudge-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.zeus-nudge-list li { display: grid; gap: 8px; justify-items: start; }
.zeus-nudges.compact { margin-bottom: 16px; }
.zeus-tailor { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--bg-subtle); margin-bottom: 12px; }
.story-section { margin-top: 16px; }
.story-section h3 { display: flex; gap: 8px; align-items: center; }
.form-grid.three { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.fieldset.field, .field.years { border: 0; padding: 0; margin: 0; min-width: 0; }
.field.years legend { padding: 0; margin-bottom: 6px; }
.field.years .row { gap: 16px; }
.story-list { display: grid; gap: 12px; }
.check { min-height: 24px; }

.milestone-group { margin-top: 20px; }
.milestone-group h3 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.milestone-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.milestone { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); }
.milestone:hover { background: var(--bg-subtle); }
.milestone .check { align-items: center; }
.milestone .check input { margin-top: 0; }
.ms-progress .bar-fill { background: var(--brand); }

/* My classes */
.teacher-home { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .teacher-home { grid-template-columns: minmax(0, 1fr); } }
.class-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.class-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; }
.class-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.teacher-shortcut { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--text) !important; }
.teacher-shortcut:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.teacher-shortcut .how-icon { flex: none; margin: 0; }
.teacher-shortcut > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.student-side .lab-chips { flex-wrap: wrap; overflow: visible; }
.narrow-card { max-width: 560px; }
details.card > summary, .privacy-details > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 650; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▸"; margin-left: auto; transition: transform 0.15s var(--ease); }
details.card[open] > summary::after { transform: rotate(90deg); }
.class-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 20px; }
.class-code { display: flex; flex-direction: column; }
.class-code strong { font-size: 1.6rem; letter-spacing: 0.08em; }
.class-actions { align-items: center; gap: 12px; }
.more-menu { position: relative; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 2px; padding: 8px; min-width: 250px; box-shadow: var(--shadow-lg); }
.more-menu-list .btn { justify-content: flex-start; }
[dir="rtl"] .more-menu-list { right: auto; left: 0; }
/* One student's overview */
.student-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.student-side { position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 960px) { .student-layout { grid-template-columns: minmax(0, 1fr); } .student-side { position: static; } }
.student-layout .portfolio-block, .student-side .strategy-chat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.room-code-big { display: grid; gap: 4px; justify-items: start; }
.room-code-big .mono { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.1; letter-spacing: 0.08em; overflow-wrap: anywhere; }
.roster-tools { display: grid; gap: 12px; grid-template-columns: minmax(200px, 2fr) repeat(2, minmax(150px, 1fr)); }
.roster-tools .field + .field { margin-top: 0; }
@media (max-width: 640px) { .roster-tools { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.roster { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 760px; }
.roster th, .roster td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.roster thead th { background: var(--bg-subtle); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }
.roster tbody tr:last-child > * { border-bottom: 0; }
.roster tbody tr:hover { background: var(--bg-subtle); }
.roster tbody th { font-weight: 650; }
.flag-list { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

.insights-panel { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius-lg); background: var(--bg-subtle); border-left: 4px solid var(--accent); }
.insights-panel h3 { display: flex; gap: 10px; align-items: center; }
.insights-panel .zeus-avatar { width: 32px; height: 32px; }
.insights-summary { font-size: 1.02rem; font-weight: 550; margin: 0; }
.portfolio-block { border-top: 1px solid var(--border); padding-top: 16px; }
.portfolio-block h3 { display: flex; gap: 8px; align-items: center; }
.pipeline { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.pipeline-col { background: var(--bg-subtle); border-radius: var(--radius); padding: 12px; }
.pipeline-col h4, .pipeline-col h3 { font-size: 0.875rem; margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.pipeline-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pipeline-col li { display: grid; gap: 2px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.compact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.compact-list svg { width: 16px; height: 16px; color: var(--success); vertical-align: -3px; }
.milestone-columns { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.milestone-columns h4, .portfolio-block h4, .student-layout .portfolio-block h3 { margin: 0 0 6px; }
.strategy-chat { display: grid; gap: 10px; }
.strategy-chat h3 { display: flex; gap: 8px; align-items: center; margin: 0; }
.strategy-log { max-height: 360px; min-height: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.strategy-log:empty { display: none; }

.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; }
@media (forced-colors: active) {
  .zeus-nudges, .insights-panel { border: 1px solid CanvasText; }
}
.h3 > svg:first-child, h3 > svg:first-child { margin-right: 8px; vertical-align: -3px; }
.form-grid > .field { align-content: start; }

/* ==========================================================================
   Every device: short landscape phones, touch screens, and very large monitors
   ========================================================================== */
/* Header drop-downs scroll on their own when they're taller than the screen
   (a phone on its side, or large text), so every link and setting stays reachable. */
@media (max-width: 1200px) {
  .nav.open { max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain; }
}
.a11y-menu { max-height: calc(100vh - var(--header-h) - 12px); max-height: calc(100dvh - var(--header-h) - 12px); overflow-y: auto; overscroll-behavior: contain; }

/* Short screens (phones in landscape, small laptop windows): give the content more room. */
@media (max-height: 500px) {
  :root { --header-h: 52px; }
  .brand-mark { width: 30px; height: 30px; }
  .section { padding: 36px 0; }
  .section-tight { padding: 24px 0; }
  /* Let the whole dialog scroll instead of pinning a tall header over a sliver of content. */
  .modal-backdrop { padding: 8px; }
  .modal, .modal-wide { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .modal-header { position: static; padding: 14px 20px 10px; }
  .modal-body { padding: 14px 20px; }
  .modal-footer { padding: 10px 20px; }
}
@media (max-width: 1280px) {
  .zeus-dock { height: min(640px, calc(100vh - 160px)); height: min(640px, calc(100dvh - 160px)); }
}
@media (max-width: 1280px) and (max-height: 500px) {
  /* The floating chat fills the screen, above the "Ask Zeus" button; its X closes it. */
  .zeus-dock { top: 8px; bottom: 8px; left: auto; right: 12px; width: min(560px, calc(100vw - 24px)); height: auto; z-index: 62; }
  .zeus-messages { min-height: 72px; }
}

/* Touch screens: no hover lift that sticks after a tap, and card titles get a tap area of at least 24px (WCAG 2.5.8). */
@media (hover: none) {
  .opp-card:hover, .cluster-tile:hover { transform: none; }
}
/* At least 24px tall to click or tap (WCAG 2.5.8). */
.opp-card h3 button, .track-card h3 button { display: inline-block; padding: 3px 0; }

/* Large monitors: scale text and widen the page so it doesn't sit in a thin strip. */
@media (min-width: 1800px) {
  html { font-size: calc(112.5% * var(--text-scale)); }
  .container { max-width: 1360px; }
  .container-narrow { max-width: 920px; }
  .explore-layout { max-width: 1760px; grid-template-columns: 300px minmax(0, 1fr) 420px; }
}
@media (min-width: 2400px) {
  html { font-size: calc(125% * var(--text-scale)); }
  .container { max-width: 1520px; }
  .container-narrow { max-width: 1020px; }
  .explore-layout { max-width: 1960px; grid-template-columns: 320px minmax(0, 1fr) 460px; }
}

/* ---- Sign up --------------------------------------------------------------- */
.btn.signup-choice { display: flex; width: 100%; justify-content: flex-start; text-align: left; gap: 12px; padding: 12px 16px; white-space: normal; }
.signup-choice svg { flex: none; width: 22px; height: 22px; }
.signup-choice-text { display: flex; flex-direction: column; gap: 2px; }
.signup-choice-text .small { font-weight: 400; }
