/* ==========================================================================
   LearnerEVO South Africa — Design System
   One stylesheet for every page: marketing, auth and the learner app.
   ========================================================================== */

/* ---- Tokens ---- */
:root {
  /* Brand */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  /* Neutrals */
  --ink:      #0f172a;
  --ink-2:    #334155;
  --ink-3:    #64748b;
  --border:   #e2e8f0;
  --surface:  #ffffff;
  --bg:       #f6f8fc;
  /* Warm neutral for explanatory surfaces — see .pm-inst on the path tree. Kept
     separate from --bg so the reporting surfaces stay cool and the teaching
     surfaces stay warm, rather than repainting the whole app. */
  --warm:     #f4f1ea;
  --warm-line:#e6e0d3;

  /* Status */
  --success:    #059669;
  --success-bg: #ecfdf5;
  --warning:    #b45309;
  --warning-bg: #fffbeb;
  --danger:     #dc2626;
  --danger-bg:  #fef2f2;

  /* Shape & depth */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:    0 4px 16px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1240px;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

img, svg { max-width: 100%; display: block; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--brand-300);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--brand-100); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

.text-muted { color: var(--ink-3); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-700);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 999;
}
.skip-link:focus { left: 0; color: #fff; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); color: #fff; box-shadow: var(--shadow); }

.btn-outline { background: transparent; color: var(--brand-700); border-color: var(--brand-300); }
.btn-outline:hover { background: var(--brand-50); color: var(--brand-800); border-color: var(--brand-500); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); }

.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ==========================================================================
   Site header (marketing pages)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand img { height: 36px; width: 36px; }
.brand .brand-accent { color: var(--brand-600); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.site-nav a {
  font-weight: 500;
  color: var(--ink-2);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.18s ease, color 0.18s ease;
}
.site-nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.site-nav a.active { color: var(--brand-700); background: var(--brand-50); font-weight: 600; }

.nav-cta { display: flex; align-items: center; gap: 0.6rem; margin-left: 0.75rem; }

.site-header .nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: var(--brand-50);
  border: 1px solid var(--brand-300);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  color: var(--brand-800);
}

@media (max-width: 900px) {
  .site-header .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.75rem 1.25rem 1.25rem;
    gap: 0.25rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.8rem 1rem; }
  .nav-cta {
    margin-left: 0;
    margin-top: 0.5rem;
    flex-direction: column;
    align-items: stretch;
  }
}

.site-nav.auth-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  position: static;
  margin-left: auto;
  background: transparent;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.site-nav.auth-nav .nav-cta {
  flex-direction: row;
  align-items: center;
  margin: 0;
}

/* ==========================================================================
   Hero & marketing sections
   ========================================================================== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 2.25rem;
  align-items: center;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -1px;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background:
    linear-gradient(96deg, rgba(238, 241, 255, 0) 0%, rgba(238, 241, 255, 0) 2%,
      rgba(245, 247, 255, 0.24) 5%, rgba(247, 248, 255, 0.9) 8%,
      rgba(247, 248, 255, 0.95) 12%, rgba(244, 246, 255, 0.86) 34%,
      rgba(242, 244, 255, 0.46) 48%, rgba(240, 242, 255, 0.08) 58%,
      rgba(238, 241, 255, 0) 66%, rgba(238, 241, 255, 0) 100%),
    url("../images/campus-hero.webp") center bottom / cover no-repeat,
    linear-gradient(168deg, #e5eaff 0%, #edf0fe 58%, #e6ebfb 100%);
  border-bottom: 1px solid #dfe3f5;
}
.hero > * { position: relative; }
.hero > * { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 0.9rem;
}
.hero h1 .highlight { color: var(--brand-600); }

.hero .lead {
  font-size: 1.08rem;
  color: var(--ink-3);
  margin-bottom: 1.25rem;
  max-width: 32rem;
}

.hero-checklist {
  list-style: none;
  margin-bottom: 1.4rem;
  display: grid;
  gap: 0.45rem;
}
.hero-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--ink-2);
  font-weight: 500;
}
.hero-checklist .check {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 0.85rem; }
.hero-note { font-size: 0.875rem; color: var(--ink-3); }

/* Trust strip across the foot of the hero: it spans both columns and rides
   over the artwork, covering the cut-out's straight bottom edge. */
/* The copy column needs its own clearance: the strip's negative margin is
   there to ride over the picture, not to crowd the line above it. */
.hero-content { padding-bottom: 2.5rem; }

.hero-trust {
  grid-column: 1 / -1;
  list-style: none;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 0.5rem;
  margin: -2.25rem 0 -1.5rem;
  padding: 0.9rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.hero-trust li { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
/* Hairline separators between items, not after the last one. */
.hero-trust li + li { border-left: 1px solid var(--border); padding-left: 1.1rem; }
.trust-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
.trust-icon svg { width: 18px; height: 18px; }
.trust-icon.is-violet { background: #ede9fe; color: #6d28d9; }
.trust-icon.is-green { background: #dcfce7; color: #15803d; }
.trust-icon.is-indigo { background: #e0e7ff; color: #4338ca; }
.trust-icon.is-amber { background: #fef3c7; color: #b45309; }
.trust-copy { display: grid; min-width: 0; }
.trust-copy strong { font-size: 0.88rem; color: var(--ink); line-height: 1.25; }
.trust-copy span { font-size: 0.78rem; color: var(--ink-3); line-height: 1.3; }

@media (max-width: 860px) {
  .hero-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 0.5rem;
    margin: 0.5rem 0 -1.5rem;
  }
  /* The vertical rules stop making sense once items wrap onto two rows. */
  .hero-trust li + li { border-left: none; padding-left: 0; }
}
@media (max-width: 460px) {
  .hero-trust { grid-template-columns: 1fr; }
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Animated product-mockup hero */
/* Hero photograph. The cut-out sits on a soft radial wash rather than a card,
   so the subject reads as standing in the page instead of inside a box. */
.hero-photo { position: relative; }
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0 -4% 4%;
  border-radius: 50%;
  background: radial-gradient(circle at 52% 44%, rgba(165, 180, 252, 0.55), rgba(199, 210, 254, 0) 66%);
}
/* A shadow on the ground rather than on the figure: a drop-shadow filter
   traces the cut-out, so it drew a hard line under the exact edge the mask is
   there to hide. */
.hero-photo { align-self: end; }
.hero-photo img {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  /* .hero-image img gives every hero picture a card treatment. A cut-out with
     a transparent background must not inherit it, or the subject arrives in a
     visible white box with a rounded corner clipped through her shoulder. */
  border-radius: 0;
  box-shadow: none;
  /* No fade: the trust strip below overlaps the cut-out's straight bottom
     edge and hides it outright, which beats dissolving a figure that then
     looks washed out where she meets a solid card. */
}

/* The four tools and the picture of them working, side by side. Stacked, the
   claim and its evidence were read one after the other; alongside each other
   they are read together, which is the point of showing the product at all. */
.feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
}
/* 2x2 rather than a single row: four cards squeezed into half the width would
   be four narrow columns of wrapped text. */
.feature-split > .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }

/* A colour each: four white cards beside the product shot read as a blank
   margin. Scoped to this instance — the class is used on quieter pages. */
.feature-split > .card-grid > .feature-card {
  border-color: transparent;
  color: #fff;
}
.feature-split > .card-grid > .feature-card:nth-child(1) { background: linear-gradient(150deg, #6366f1, #4338ca); }
.feature-split > .card-grid > .feature-card:nth-child(2) { background: linear-gradient(150deg, #14b8a6, #0f766e); }
.feature-split > .card-grid > .feature-card:nth-child(3) { background: linear-gradient(150deg, #f59e0b, #c2410c); }
.feature-split > .card-grid > .feature-card:nth-child(4) { background: linear-gradient(150deg, #ec4899, #a21caf); }
.feature-split > .card-grid > .feature-card h3 { color: #fff; }
.feature-split > .card-grid > .feature-card p { color: rgba(255, 255, 255, 0.9); }
/* The badge was a pale tint of the brand on white; on a filled card it needs
   to borrow from the card instead, or it disappears into it. */
.feature-split > .card-grid > .feature-card .icon-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.feature-split > .card-grid > .feature-card:hover {
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}
.feature-visual { min-width: 0; }
@media (max-width: 1000px) {
  /* Stacked, the cards lead: the picture is supporting evidence, and pushing
     four tool descriptions below the fold to show it first gets that backwards. */
  .feature-split { grid-template-columns: 1fr; gap: 2rem; }
  .feature-split > .card-grid { order: -1; }
  .feature-visual { max-width: 620px; margin-inline: auto; }
}
@media (max-width: 560px) {
  .feature-split > .card-grid { grid-template-columns: 1fr; }
}

.hero-visual svg { width: 100%; height: auto; display: block; }
.hero-visual text { font-family: var(--font); }
.hero-visual .float-a,
.hero-visual .float-b,
.hero-visual .float-c { transform-box: fill-box; }
.hero-visual .float-a { animation: heroFloat 5s ease-in-out infinite; }
.hero-visual .float-b { animation: heroFloat 6.5s ease-in-out 0.8s infinite; }
.hero-visual .float-c { animation: heroFloat 5.8s ease-in-out 1.6s infinite; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
/* Ring sweep animates stroke-dashoffset (100 = hidden, 24 = 76% arc shown) —
   dashoffset interpolates reliably everywhere, unlike dasharray lists. */
.hero-visual .ring-progress { animation: heroRing 1.4s ease-out; }
@keyframes heroRing { from { stroke-dashoffset: 100; } }
.hero-visual .bar-anim {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: heroBar 0.9s ease-out backwards;
}
@keyframes heroBar { from { transform: scaleY(0); } }

.section { padding: 4.5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* A South African campus behind the national figures, so the numbers sit
   somewhere real rather than on another white band. */
.insights-section {
  position: relative;
  isolation: isolate;
  background: #0f172a;
  border-color: transparent;
}
.insights-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../images/campus.webp") center 62% / cover no-repeat;
}
/* A photograph is a terrible surface to read on, so the scrim is doing real
   work: dark enough for white text at AA, and heaviest where the copy sits. */
.insights-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.62) 0%, rgba(15, 23, 42, 0.34) 38%, rgba(15, 23, 42, 0.55) 100%),
    linear-gradient(100deg, rgba(49, 46, 129, 0.28), rgba(15, 23, 42, 0.06));
}
.insights-section .section-head h2 {
  color: #fff;
  text-shadow: 0 2px 12px rgba(2, 6, 23, 0.65);
}
.insights-section .section-head p {
  color: rgba(241, 245, 249, 0.95);
  text-shadow: 0 1px 8px rgba(2, 6, 23, 0.6);
}
/* The panels stay light: white text on a photo works for a heading, but a
   ranking table needs a solid surface to be read off. */
.insights-section .panel {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(2px);
}

.section-head { max-width: 44rem; margin: 0 auto 3rem; text-align: center; }
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.section-head p { color: var(--ink-3); font-size: 1.05rem; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.card-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card-grid > *, .panel-grid > * { min-width: 0; }
.card-grid,
.panel-grid,
.stat-grid,
.results-grid { align-items: stretch; }
.card-grid > .card,
.panel-grid > .panel,
.stat-grid > .stat-card,
.results-grid > .result-widget { height: 100%; }

.feature-card { transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease; }
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--brand-200); }

.icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand-600);
  margin-bottom: 1.1rem;
}
.icon-badge svg { width: 26px; height: 26px; }

.feature-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.feature-card p, .feature-card li { color: var(--ink-3); font-size: 0.95rem; }
.feature-card ul { margin: 0.75rem 0 0 1.1rem; display: grid; gap: 0.4rem; }

.how-journey {
  position: relative;
  display: grid;
  gap: 1.5rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.how-journey::before {
  content: '';
  position: absolute;
  top: 4rem;
  bottom: 4rem;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(var(--brand-300), #5eead4);
}
.how-step {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center;
  min-height: 260px;
}
.how-step__visual {
  grid-column: 1;
  padding: 1.25rem;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(238,242,255,0.92));
  box-shadow: 0 20px 45px rgba(67, 56, 202, 0.12);
  transform: rotate(-1deg);
}
.how-step:nth-child(even) .how-step__visual { grid-column: 3; transform: rotate(1deg); }
.step-art { display: block; width: 100%; height: auto; }
.how-step__marker {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin: auto;
  border: 6px solid #f4f6fc;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 8px 18px rgba(67, 56, 202, 0.24);
  font-size: 0.78rem;
  font-weight: 800;
}
.how-step__copy { grid-column: 3; padding: 1.5rem 1.75rem; }
.how-step:nth-child(even) .how-step__copy { grid-column: 1; grid-row: 1; text-align: right; }
.how-step__label { display: block; margin-bottom: 0.55rem; color: var(--brand-600); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.how-step__copy h3 { margin-bottom: 0.65rem; font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.how-step__copy p { color: var(--ink-3); line-height: 1.7; }
.how-step__outcome {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 700;
}
.how-step__outcome::before { content: '✓'; }
.how-journey__cta { display: flex; flex-direction: column; align-items: center; gap: 0.65rem; margin-top: 2.5rem; text-align: center; }

.section-steps {
  position: relative;
  background:
    radial-gradient(700px 380px at 12% 0%, rgba(129, 140, 248, 0.14), rgba(129, 140, 248, 0) 62%),
    radial-gradient(680px 400px at 88% 100%, rgba(45, 212, 191, 0.14), rgba(45, 212, 191, 0) 64%),
    linear-gradient(180deg, #f7f8fd 0%, #f2f5fc 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 720px) {
  .how-journey { gap: 1.25rem; padding-left: 2.5rem; }
  .how-journey::before { top: 2rem; bottom: 2rem; left: 15px; transform: none; }
  .how-step { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
  .how-step__visual,
  .how-step:nth-child(even) .how-step__visual {
    order: 1;
    padding: 0.8rem;
    border-radius: 18px;
    transform: none;
  }
  .how-step__marker {
    position: absolute;
    top: 1rem;
    left: -2.5rem;
    width: 34px;
    height: 34px;
    border-width: 4px;
    font-size: 0.68rem;
  }
  .how-step__copy,
  .how-step:nth-child(even) .how-step__copy {
    order: 2;
    padding: 1.15rem 0 0.5rem;
    text-align: left;
  }
}

/* Logo strip */
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2.5rem 3.5rem;
  padding: 0.5rem 0;
}
.logo-strip img {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.55;
  /* Slower than the usual 0.2s: this fades on its own rather than under a
     pointer, and a hover-speed fade happening by itself looks like a flicker. */
  transition: filter 0.45s ease, opacity 0.45s ease, transform 0.45s ease;
}
/* Lit by the cycle in main.js, by hover, or all at once during the hold. */
.logo-strip img:hover,
.logo-strip img.is-lit,
.logo-strip.is-all-lit img {
  filter: none;
  opacity: 1;
}
.logo-strip img.is-lit { transform: scale(1.06); }
.logo-strip.is-all-lit img { transform: none; }

/* Chips (careers etc.) */
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); }
.testimonial-author .avatar-initials { width: 42px; height: 42px; font-size: 0.95rem; }

/* Initials avatar */
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, #34d399, #15803d);
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  flex: none;
  user-select: none;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.26);
}

/* Profile / person cards */
.person-card { text-align: center; overflow: hidden; padding: 0; }
/* height:auto is load-bearing: the width/height attributes on each <img>
   are a presentational hint, and aspect-ratio is ignored without this. */
.person-card img { width: 100%; height: auto; aspect-ratio: 4 / 3.4; object-fit: cover; object-position: top; }
.person-card .person-body { padding: 1.25rem 1.25rem 1.5rem; }
.person-card h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.person-card p { color: var(--ink-3); font-size: 0.875rem; }

/* Learner stories */
.stories-section { padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.testimonial-panel { max-width: 1080px; margin: 0 auto; padding: clamp(1.1rem, 2vw, 1.5rem); background: linear-gradient(145deg,#fff 35%,#eef2ff); border-color: rgba(99,102,241,.2); }
/* The heading block sat at full section scale inside a card, which is most of
   why this section read as oversized before a single story loaded. */
.testimonial-panel .section-head { margin-bottom: 1.1rem; }
.testimonial-panel .section-head h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.testimonial-panel .section-head p { font-size: 0.92rem; }
.testimonials-frame { display: block; width: 100%; height: 9rem; max-height: 420px; border: 0; overflow: hidden; }
/* Tighter band: the stories are a note of reassurance, not a chapter. */
.stories-section { padding-block: clamp(2rem, 4vw, 3rem); }

/* Stats band */
.stats-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; text-align: center; }
.stats-band .stat-value { font-size: 2rem; font-weight: 800; color: var(--brand-600); letter-spacing: -0.02em; }
.stats-band .stat-label { color: var(--ink-3); font-size: 0.92rem; }

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900));
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-banner h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 0.75rem; }
.cta-banner p { color: var(--brand-200); max-width: 36rem; margin: 0 auto 1.75rem; }
.cta-banner .btn-primary { background: #fff; color: var(--brand-800); }
.cta-banner .btn-primary:hover { background: var(--brand-50); color: var(--brand-900); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 calc(2rem + env(safe-area-inset-bottom));
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.site-footer .brand { margin-bottom: 0.85rem; }
.site-footer .footer-about { color: var(--ink-3); font-size: 0.92rem; max-width: 26rem; }
.site-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 1rem; }
.site-footer ul { list-style: none; display: grid; gap: 0.6rem; }
.site-footer ul a { color: var(--ink-2); font-size: 0.95rem; }
.site-footer ul a:hover { color: var(--brand-700); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 0.875rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .hero-image {
    order: -1;
    width: min(100%, 520px);
    margin-inline: auto;
  }
  .hero-visual { width: min(100%, 580px); margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 560px) {
  .hero-image { width: min(100%, 330px); }
}

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--brand-100), transparent),
    var(--bg);
}
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem max(1.25rem, env(safe-area-inset-right))
    calc(3rem + env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2.25rem;
}
.auth-card .auth-logo { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth-card .auth-logo img { height: 52px; width: 52px; }
.auth-card h1 { font-size: 1.45rem; text-align: center; margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.auth-card .auth-sub { text-align: center; color: var(--ink-3); font-size: 0.95rem; margin-bottom: 1.75rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.95rem; color: var(--ink-3); }
.auth-switch a { font-weight: 600; }
.auth-recovery { margin: 0.55rem 0 0; text-align: right; }
.link-button {
  border: 0; padding: 0.25rem 0; background: transparent;
  color: var(--brand-700);
  font: 650 0.9rem var(--font);
  cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-button:hover { color: var(--brand-900); }
.link-button:disabled { opacity: 0.65; }
.btn-google {
  background: #fff;
  border: 1px solid #c9cdd4;
  color: #202124;
  gap: 0.75rem;
  justify-content: center;
}
.btn-google:hover { background: #f8fafd; border-color: #aeb4bd; color: #202124; }
.btn-google svg { width: 20px; height: 20px; flex: 0 0 20px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--ink-3);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group { margin-bottom: 1.15rem; }

label { display: block; font-weight: 500; font-size: 0.92rem; margin-bottom: 0.35rem; color: var(--ink-2); }

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}

input::placeholder, textarea::placeholder { color: #94a3b8; }

.form-hint { font-size: 0.82rem; color: var(--ink-3); margin-top: 0.3rem; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
}
legend { font-weight: 600; font-size: 0.95rem; padding: 0 0.5rem; color: var(--ink); }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}
.form-row .form-group { min-width: 0; }

/* Checkbox / radio pill groups */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.5rem;
}
.choice-grid label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.choice-grid label:hover { border-color: var(--brand-300); background: var(--brand-50); }
.choice-grid input { accent-color: var(--brand-600); width: 1.05rem; height: 1.05rem; flex: none; }

/* Alerts */
.alert {
  display: none;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 1.1rem;
  border: 1px solid transparent;
}
.alert.show { display: block; }
.alert-error   { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #a7f3d0; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #fde68a; }
.subject-warning { margin: 0.65rem 0 0; font-size: 0.85rem; }
.alert label { color: inherit; }

/* Unified planning tools */
.planning-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 1rem; }
.planning-list { display: grid; gap: 0.75rem; margin-top: 1rem; }
.planning-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.planning-row > div:first-child { min-width: 0; }
.planning-row strong { display: block; }
.planning-row span:not(.badge) { display: block; color: var(--ink-3); font-size: 0.86rem; margin-top: 0.15rem; }
.planning-score { font-size: 2rem; font-weight: 800; color: var(--brand-700); margin: 0.5rem 0; }
.planning-score small { font-size: 0.9rem; color: var(--ink-3); }
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.75rem;
}
.result-actions .btn {
  flex: 0 1 auto;
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  white-space: nowrap;
}
.bulk-result-row { align-items: end; }
.bulk-result-row .form-group:first-child { flex: 2 1 220px; }
.bulk-result-row .form-group { flex: 1 1 130px; margin: 0; }
@media (max-width: 650px) {
  .planning-row { align-items: flex-start; flex-direction: column; }
  .bulk-result-row .form-group,
  .bulk-result-row .remove-result-row { width: 100%; }
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
}
.spinner-dark { border-color: var(--brand-100); border-top-color: var(--brand-600); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   App shell (dashboard & tools)
   ========================================================================== */
.app-body { background: var(--bg); }

.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 250px;
  flex: none;
  background: linear-gradient(180deg, var(--brand-900), var(--brand-800));
  color: #fff;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.25rem 0.75rem;
}
.sidebar-header img { height: 38px; width: 38px; background: #fff; border-radius: 50%; }
.sidebar-header h2 { color: #fff; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }

.nav-list { list-style: none; display: grid; gap: 0.25rem; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  color: var(--brand-200);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-list a svg { width: 20px; height: 20px; flex: none; opacity: 0.9; }
.nav-list a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-list a.active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }

/* Expandable nav item. The label stays a plain link so Resources still
   navigates on click — only the chevron toggles, because a nav item that
   refuses to navigate is the standard way this pattern annoys people. */
.nav-row { display: flex; align-items: center; gap: 0.25rem; }
.nav-row > a { flex: 1 1 auto; min-width: 0; }
.nav-row > .nav-toggle {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--brand-200);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-row > .nav-toggle:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-row > .nav-toggle .nav-chev {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}
.nav-row > .nav-toggle[aria-expanded="true"] .nav-chev { transform: rotate(90deg); }
/* display on the element beats the [hidden] default, so the collapsed state
   has to be restated here or the branch renders open on every page. */
.nav-sub[hidden] { display: none; }
.nav-sub {
  list-style: none;
  display: grid;
  gap: 0.1rem;
  margin: 0.2rem 0 0.35rem 1.55rem;
  padding-left: 0.6rem;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
.nav-sub a {
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-200);
  opacity: 0.86;
}
.nav-sub a:hover { opacity: 1; }
.nav-sub a.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 600;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) { .nav-row > .nav-toggle .nav-chev { transition: none; } }

.sidebar-footer { margin-top: auto; }
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  color: var(--brand-200);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 10px;
}
.sidebar-footer a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding: 2.25rem 2.5rem 3.5rem;
}

.page-head { margin-bottom: 1.75rem; }
.page-head h1 { font-size: 1.6rem; letter-spacing: -0.01em; margin-bottom: 0.3rem; }
.page-head p { color: var(--ink-3); }

/* Mobile app topbar */
.app-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  align-items: center;
  gap: 0.85rem;
  background: var(--brand-900);
  color: #fff;
  padding: calc(0.75rem + env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right)) 0.75rem
    max(1rem, env(safe-area-inset-left));
}
.app-topbar img { height: 32px; width: 32px; background: #fff; border-radius: 50%; }
.app-topbar strong { font-size: 1rem; }
.sidebar-toggle {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 59;
}

@media (max-width: 1024px) {
  .app-topbar { display: flex; }
  .app-shell {
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px - env(safe-area-inset-top));
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    height: 100vh;
    height: 100dvh;
    padding: calc(1.5rem + env(safe-area-inset-top))
      max(1rem, env(safe-area-inset-right))
      calc(1.5rem + env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-overlay { display: block; }
  .main-content {
    padding: 1.5rem max(1.25rem, env(safe-area-inset-right))
      calc(3rem + env(safe-area-inset-bottom))
      max(1.25rem, env(safe-area-inset-left));
  }
}

/* ---- Dashboard widgets ---- */
/* Tinted, not filled: the journey banner below is already a solid gradient,
   and two heroes leave no hierarchy. */
.profile-header {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(115deg, #e9f8ef 0%, var(--surface) 58%);
  border: 1px solid #cdebd8;
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.profile-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #34d399, #15803d);
}
.profile-header h1 { font-size: 1.35rem; margin-bottom: 0.15rem; }
.profile-header p { color: var(--ink-3); font-size: 0.95rem; }
.profile-header > div { min-width: 0; }
/* The goal chips sit on the tint, so they need their own surface to stay
   legible rather than dissolving into the wash behind them. */
.profile-header .badge-brand {
  background: var(--surface);
  border: 1px solid #cdebd8;
  box-shadow: var(--shadow-sm);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1), 0 2px 4px rgba(15, 23, 42, 0.05);
}
/* A colour each, so the row is four readings rather than one blue block. The
   tint carries the identity and the value carries the hue; a fully filled card
   each would out-shout the journey banner above them. */
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--stat-hue, var(--border));
}
.stat-grid > .stat-card:nth-child(2) {
  --stat-hue: linear-gradient(90deg, #34d399, #059669);
  background: linear-gradient(160deg, #ecfdf5 0%, var(--surface) 62%);
  border-color: #cdebd8;
}
.stat-grid > .stat-card:nth-child(2) .stat-value { color: #047857; }
.stat-grid > .stat-card:nth-child(3) {
  --stat-hue: linear-gradient(90deg, #fbbf24, #d97706);
  background: linear-gradient(160deg, #fffbeb 0%, var(--surface) 62%);
  border-color: #f4e3bd;
}
.stat-grid > .stat-card:nth-child(3) .stat-value { color: #b45309; }
.stat-grid > .stat-card:nth-child(4) {
  --stat-hue: linear-gradient(90deg, #f472b6, #db2777);
  background: linear-gradient(160deg, #fdf2f8 0%, var(--surface) 62%);
  border-color: #f6d5e6;
}
.stat-grid > .stat-card:nth-child(4) .stat-value { color: #be185d; }

/* Opens outward from the row's centre: outer cards start further in and
   land later, so the four read as one spread. Runs once, on load. */
.stat-grid > .stat-card {
  animation: statSpread 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stat-grid > .stat-card:nth-child(1) { --stat-from: 132%; animation-delay: 0.1s; }
.stat-grid > .stat-card:nth-child(2) { --stat-from: 44%; animation-delay: 0.03s; }
.stat-grid > .stat-card:nth-child(3) { --stat-from: -44%; animation-delay: 0.03s; }
.stat-grid > .stat-card:nth-child(4) { --stat-from: -132%; animation-delay: 0.1s; }
@keyframes statSpread {
  from { opacity: 0; transform: translateX(var(--stat-from, 0)) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stat-grid > .stat-card { animation: none; }
  .stat-card:hover { transform: none; }
}
.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 0.4rem;
}
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.stat-card .stat-sub { font-size: 0.82rem; color: var(--ink-3); margin-top: 0.2rem; }
.stat-card.stat-accent {
  --stat-hue: linear-gradient(90deg, #a5b4fc, #7c3aed);
  background: linear-gradient(150deg, var(--brand-600), #6d28d9);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}
.stat-card.stat-accent:hover { box-shadow: 0 16px 32px rgba(79, 70, 229, 0.32); }
.stat-card.stat-accent .stat-label { color: var(--brand-200); }
.stat-card.stat-accent .stat-value { color: #fff; }
.stat-card.stat-accent .stat-sub { color: var(--brand-200); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
}
.panel > h2 {
  font-size: 1.1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}
.panel-grid > .panel { margin-bottom: 0; }
.panel-grid .panel { margin-bottom: 0; }
@media (max-width: 900px) { .panel-grid { grid-template-columns: 1fr; } }

/* Bar chart (CSS only) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  height: 180px;
  padding: 0.5rem 0.25rem 0;
}
.bar-chart .bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 0.4rem;
}
.bar-chart .bar {
  width: 100%;
  max-width: 64px;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
  border-radius: 8px 8px 3px 3px;
  min-height: 4px;
  position: relative;
  transition: opacity 0.15s ease;
}
.bar-chart .bar:hover { opacity: 0.85; }
.bar-chart .bar-value { font-size: 0.8rem; font-weight: 700; color: var(--brand-700); }
.bar-chart .bar-label { font-size: 0.8rem; color: var(--ink-3); }

/* Dashboard data stories */
.dashboard-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dashboard-section-head h2 { margin-bottom: 0.25rem; }
.dashboard-section-head .text-muted { font-size: 0.9rem; }

.performance-chart {
  min-height: 300px;
  overflow-x: auto;
  padding-top: 0.25rem;
}
.performance-chart svg {
  width: 100%;
  min-width: 620px;
  height: auto;
  overflow: visible;
}
.performance-chart text { font-family: var(--font); }
.performance-chart .trend-grid { stroke: var(--border); stroke-width: 1; }
.performance-chart .trend-target { stroke: var(--warning); stroke-width: 1.5; stroke-dasharray: 6 5; }

/* The fill fades in rather than scaling up: scaling detached from the line
   mid-animation. */
.performance-chart .trend-area {
  animation: trendAreaIn 0.9s ease 0.5s both;
}
@keyframes trendAreaIn { from { opacity: 0; } to { opacity: 1; } }

.performance-chart .trend-line {
  fill: none;
  stroke: url(#trendStroke);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: trendDraw 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes trendDraw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

/* Dots land just after the line has drawn past them, each with a small
   overshoot so the sequence feels alive rather than mechanical. */
.performance-chart .trend-dot {
  fill: var(--surface);
  stroke: var(--brand-600);
  stroke-width: 4;
  cursor: pointer;
  transition: r 0.18s ease, fill 0.18s ease, stroke-width 0.18s ease;
  animation: trendDot 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes trendDot {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* The most recent term keeps a soft pulse: on a page about progress, "where
   you are now" is the thing the eye should find first. */
.performance-chart .trend-pulse {
  fill: none;
  stroke: var(--brand-400, #818cf8);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  /* No fill-mode: with "both" the ring held its first keyframe through the
     delay, so it hung in the air before its dot had arrived. Without it the
     element keeps opacity:0 until the animation actually starts. */
  opacity: 0;
  animation: trendPulse 2.4s ease-out infinite;
}
@keyframes trendPulse {
  0%   { transform: scale(0.75); opacity: 0.65; }
  70%  { transform: scale(1.9);  opacity: 0; }
  100% { transform: scale(1.9);  opacity: 0; }
}

.performance-chart .trend-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
  animation: trendFade 0.5s ease both;
}
@keyframes trendFade { from { opacity: 0; } to { opacity: 1; } }
.performance-chart .trend-axis { fill: var(--ink-3); font-size: 11px; }
.performance-chart .trend-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }

.performance-chart .trend-point:hover .trend-dot,
.performance-chart .trend-point:focus .trend-dot {
  r: 9;
  fill: var(--brand-100);
  stroke-width: 5;
}
.performance-chart .trend-point:focus { outline: none; }

/* Detail on demand: the card stays hidden until a point is hovered or
   focused, so the chart reads cleanly at a glance. */
.performance-chart .trend-tip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.performance-chart .trend-point:hover .trend-tip,
.performance-chart .trend-point:focus .trend-tip { opacity: 1; }
.performance-chart .trend-tip-bg {
  fill: var(--ink);
  opacity: 0.94;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.28));
}
.performance-chart .trend-tip-label { fill: #c7d2fe; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.performance-chart .trend-tip-value { fill: #fff; font-size: 12px; font-weight: 700; }

.career-branch-map {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(0, 2.3fr);
  gap: 3rem;
  align-items: center;
}
.career-branch-map.is-empty { grid-template-columns: minmax(220px, 360px); }
.career-branch-map.is-empty .career-evidence::after,
.career-branch-map.is-empty .career-branch-rail { display: none; }
.career-evidence {
  position: relative;
  padding: 1.1rem;
  border: 1px solid var(--brand-200);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--brand-50), var(--surface));
  box-shadow: var(--shadow-sm);
}
.career-evidence::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -3rem;
  width: 3rem;
  border-top: 2px solid var(--brand-200);
}
.career-evidence-label {
  display: block;
  color: var(--brand-700);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.career-evidence strong { display: block; margin: 0.2rem 0; font-size: 1.05rem; }
.career-evidence-summary { color: var(--ink-3); font-size: 0.85rem; }

@media (max-width: 700px) {
  .dashboard-section-head { align-items: flex-start; }
  .career-branch-map { grid-template-columns: 1fr; gap: 2rem; }
  .career-evidence::after { top: auto; bottom: -2rem; left: 2rem; right: auto; width: 0; height: 2rem; border-top: 0; border-left: 2px solid var(--brand-200); }
}

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.data-table th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.data-table td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--border); color: var(--ink-2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--brand-50); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-brand   { background: var(--brand-50); color: var(--brand-700); }

/* Segmented control (tabs) */
.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.3rem;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}
.segmented button {
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 0.55rem 1.2rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.segmented button:hover { color: var(--brand-700); }
.segmented button.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }

/* Term toggle pills */
.pill-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0 1rem; }
.pill-row button {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill-row button:hover { border-color: var(--brand-400, var(--brand-500)); color: var(--brand-700); }
.pill-row button.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* Result rings */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.result-widget {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.result-widget .result-actions {
  margin-top: auto;
  padding-top: 0.75rem;
}
.result-widget-unlinked {
  border-color: #f59e0b;
  background: linear-gradient(180deg, var(--warning-bg), var(--surface));
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}
.result-widget-duplicate {
  border-color: #dc7a12;
  border-style: dashed;
  background: linear-gradient(180deg, #fff7ed, var(--surface));
  box-shadow: 0 0 0 2px rgba(220, 122, 18, 0.12);
}
.result-widget-unverified {
  border-style: dashed;
  border-color: var(--brand-300);
  background: linear-gradient(180deg, var(--brand-50), var(--surface));
}
.result-link-status {
  display: inline-flex;
  margin-top: 0.55rem;
  white-space: normal;
}
.result-source-panel {
  border-left: 4px solid var(--brand-500);
}
.result-source-panel .dashboard-section-head { margin-bottom: 0.75rem; }
.result-source-panel .alert { margin-bottom: 0.75rem; }
.result-row-unlinked {
  border-color: #f59e0b;
  background: var(--warning-bg);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.1);
}
.result-row-duplicate {
  border-color: #dc7a12;
  border-style: dashed;
  background: #fff7ed;
  box-shadow: 0 0 0 2px rgba(220, 122, 18, 0.12);
}
.subject-policy-note {
  margin: -0.35rem 0 1.25rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--brand-300);
  background: var(--brand-50);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.result-ring {
  --pct: 0;
  --ring-color: var(--brand-600);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 0.8rem;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--border) 0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-ring .ring-inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
}
.result-widget .subject { font-weight: 600; font-size: 0.92rem; color: var(--ink-2); }
.result-widget .meta { font-size: 0.8rem; color: var(--ink-3); margin-top: 0.15rem; }

/* Resource cards */
.resource-card { display: flex; flex-direction: column; gap: 0.4rem; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.resource-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.resource-card h3 { font-size: 1.02rem; }
.resource-card p { color: var(--ink-3); font-size: 0.9rem; }
.resource-card .resource-link { margin-top: auto; font-weight: 600; font-size: 0.9rem; padding-top: 0.75rem; }
.career-card h2 .count { font-size: 0.82rem; font-weight: 600; color: var(--ink-3); }
.career-card .program { padding: 0.9rem 0; border-top: 1px solid var(--border); font-size: 0.92rem; color: var(--ink-2); }
.career-card .program:first-of-type { border-top: none; padding-top: 0; }
.career-card .program strong { color: var(--ink); }

/* Career explorer */
.career-tile { cursor: pointer; display: flex; flex-direction: column; gap: 0.5rem; position: relative; }
.career-tile .career-icon { font-size: 1.9rem; line-height: 1; }
.career-tile h3 { font-size: 1.08rem; }
.career-tile .career-field { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-600); }
.career-tile p { color: var(--ink-3); font-size: 0.92rem; }
.career-tile .career-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
}
.match-badge.match-high { background: var(--success-bg); color: var(--success); }
.match-badge.match-mid  { background: var(--warning-bg); color: var(--warning); }
.match-badge.match-low  { background: var(--danger-bg); color: var(--danger); }

/* Progress bars */
.progress { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--brand-600); transition: width 0.4s ease; }
.progress-fill.ok   { background: var(--success); }
.progress-fill.warn { background: var(--warning); }
.progress-fill.bad  { background: var(--danger); }

.mastery-row { padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
.mastery-row:last-child { border-bottom: none; }
.mastery-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.45rem; }
.mastery-head strong { font-size: 0.95rem; }
.mastery-head span { font-size: 0.85rem; color: var(--ink-3); white-space: nowrap; }
.mastery-note { font-size: 0.82rem; color: var(--ink-3); margin-top: 0.4rem; }

/* Roadmap timeline */
.roadmap { list-style: none; margin: 0.5rem 0 0; padding: 0 0 0 2.4rem; position: relative; }
.roadmap::before { content: ""; position: absolute; left: 14px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
.roadmap-item.done::before { background: var(--success); border-color: var(--success); }
.roadmap-item.current::before { background: var(--brand-100); border-color: var(--brand-600); box-shadow: 0 0 0 4px var(--brand-100); }
.roadmap-item.done .roadmap-when { color: var(--success); }

/* Institution rows */
/* ==========================================================================
   "Where you can study this" — grouped by institution.
   A university that offers five routes into a career appears once, with its
   routes nested, rather than five times as unrelated rows.
   ========================================================================== */
.inst-groups { display: grid; gap: 0.9rem; }
.inst-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.inst-group:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); }
.inst-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  background: var(--brand-50);
  border-bottom: 1px solid var(--border);
}
.inst-group-head h3,
.inst-group-head > strong { font-size: 1rem; margin: 0; color: var(--ink); font-weight: 700; }
/* Course & Programme Finder reuses this header, with the course detail in a
   body beneath rather than a list of routes. */
.inst-group-body { padding: 0.85rem 1.1rem; }
.inst-group-body .inst-offer-main { margin-bottom: 0.55rem; }
.inst-group-body .req-list { margin-top: 0.6rem; }
.inst-group-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.inst-routes { list-style: none; margin: 0; padding: 0; }
/* One grid per route row so the badges and source links line up down the
   whole group. Cells stretch to full row height — centring them would put
   each cell's border at its own content bottom and step the divider. */
.inst-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  align-items: stretch;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.inst-route:last-child { border-bottom: none; }
.inst-route > * { display: flex; align-items: center; min-width: 0; }
.inst-route-name { font-size: 0.92rem; color: var(--ink-2); padding-right: 1.25rem; }
.inst-route-tags { gap: 0.4rem; flex-wrap: wrap; padding-right: 1.25rem; }
.inst-route-source { justify-content: flex-end; white-space: nowrap; }
.inst-route-source a { font-size: 0.82rem; font-weight: 600; }

@media (max-width: 760px) {
  /* Columns cannot align on a narrow phone without squeezing the course
     name, so each route stacks instead. */
  .inst-route { display: block; }
  .inst-route > * { display: flex; }
  .inst-route-name { padding-right: 0; margin-bottom: 0.45rem; }
  .inst-route-tags { padding-right: 0; margin-bottom: 0.35rem; }
  .inst-route-source { justify-content: flex-start; }
}

/* ==========================================================================
   Resources hub — tiles that open one section at a time.
   ========================================================================== */
.res-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}
.res-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  text-align: left;
  padding: 1.05rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: streamIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.res-tile::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.26s ease;
}
.res-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-200); }
.res-tile:hover::after, .res-tile.is-active::after { transform: scaleX(1); }
.res-tile:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.res-tile.is-active { border-color: var(--brand-600); background: var(--brand-50); }
.res-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 0.15rem; transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1); }
.res-tile:hover .res-icon { transform: scale(1.15) rotate(-4deg); }
.res-name { font-weight: 700; color: var(--ink); font-size: 1rem; }
.res-note { font-size: 0.82rem; color: var(--ink-3); line-height: 1.4; }
.res-count {
  margin-top: 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-50);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.res-tile.is-active .res-count { background: var(--brand-100); }
/* Say plainly when a section is not built yet, rather than dressing it up. */
.res-count.res-soon { color: var(--warning); background: var(--warning-bg); }

/* Once a section is chosen the cards have done their job, so they collapse
   into a pill row and hand the space to the content. Keeping six full cards
   parked above an open panel was the whole reason the page felt cluttered. */
.res-hub.is-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}
.res-hub.is-compact .res-tile {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
}
.res-hub.is-compact .res-tile::after { content: none; }
.res-hub.is-compact .res-icon { font-size: 1rem; margin-bottom: 0; }
.res-hub.is-compact .res-name { font-size: 0.88rem; font-weight: 600; }
.res-hub.is-compact .res-note,
.res-hub.is-compact .res-count { display: none; }
.res-hub.is-compact .res-tile:hover { transform: none; box-shadow: var(--shadow-sm); }
.res-hub.is-compact .res-tile:hover .res-icon { transform: none; }
.res-hub.is-compact .res-tile.is-active {
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.res-hub.is-compact .res-tile.is-active .res-name { color: #fff; }

/* Way back to the full cards. Only meaningful once they have collapsed. */
.res-all {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border: 1px dashed var(--border);
  background: transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.res-hub.is-compact .res-all { display: inline-flex; }
.res-all:hover { color: var(--brand-700); border-color: var(--brand-300); }

/* Browsers without the View Transitions API still get a settle rather than a
   jump, and the tiles animate their own shape either way. */
.res-tile, .res-icon, .res-name {
  transition: padding 0.28s ease, border-radius 0.28s ease, font-size 0.28s ease,
    transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .res-tile, .res-icon, .res-name { transition: none; }
}

.res-panel { animation: courseIn 0.35s ease both; margin-bottom: 2rem; }
.res-panel > h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.res-panel > p { margin-bottom: 1.15rem; max-width: 68ch; }

/* The section's own opening card: tinted so it reads as the answer to the pill
   you just pressed, and run full width so the standfirst is not a narrow
   column floating in an empty row. */
.res-intro {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--surface) 65%);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem 1.25rem;
  margin-bottom: 1.5rem;
  animation: resIntroIn 0.35s ease both;
}
.res-intro::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
}
.res-intro h2 { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--ink); }
/* Justified with hyphenation: without it, long institution names open rivers
   of whitespace at this measure. */
.res-intro p {
  margin-bottom: 0;
  max-width: none;
  text-align: justify;
  hyphens: auto;
  color: var(--ink-2);
}
@keyframes resIntroIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .res-intro { animation: none; } }
/* Justification needs room to breathe; on a phone it just looks broken. */
@media (max-width: 640px) {
  .res-intro { padding: 1rem 1.05rem; }
  .res-intro p { text-align: left; }
}
.res-sub { font-size: 0.95rem; margin: 1.6rem 0 0.75rem; color: var(--ink); }
.res-hint { margin: -0.4rem 0 1rem; font-size: 0.9rem; }

/* Second-level tabs inside an open section. Labels like "Universities of
   technology" are long, so this scrolls sideways on a phone rather than
   wrapping into a two-line block that pushes the content off the screen. */
.res-subtabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 1.25rem 0 1.5rem;
}
.res-subtabs::-webkit-scrollbar { display: none; }
.res-subtabs button { white-space: nowrap; flex: 0 0 auto; }
.res-group { animation: resGroupIn 0.25s ease both; }
@keyframes resGroupIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .res-group { animation: none; } }
.res-panel .card-grid { margin-bottom: 0.5rem; }
.res-empty p { max-width: 68ch; }
.res-subjects .badge { margin-top: 0.15rem; }

@media (max-width: 620px) {
  /* A grid of six tiles is most of a phone screen before any content shows.
     One scrolling row keeps the choice visible and the section underneath it
     reachable without scrolling past the menu every time. */
  .res-hub {
    display: flex;
    grid-template-columns: none;
    gap: 0.6rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-inline: -1rem;
    padding-inline: 1rem;
    padding-bottom: 0.35rem;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .res-hub::-webkit-scrollbar { display: none; }
  .res-hub .res-tile {
    flex: 0 0 68%;
    scroll-snap-align: start;
    padding: 0.9rem;
  }
  .res-note { display: none; }
  /* Collapsed pills stay a wrapping row — they are short, and scrolling to
     find the section you are already in would be worse than a second line. */
  .res-hub.is-compact {
    display: flex;
    flex-wrap: wrap;
    overflow-x: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .res-hub.is-compact .res-tile { flex: 0 0 auto; }
}

/* Capture-results steps. One long form gave no sense of order — this says
   what happens first, what happens next, and what the button will do. */
.capture-step {
  padding: 1.15rem 0 1.35rem;
  border-top: 1px solid var(--border);
}
.capture-step:first-of-type { border-top: none; padding-top: 0.35rem; }
.capture-step-head {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.capture-step-head h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.capture-step-head .form-hint { margin: 0; max-width: 62ch; }
.capture-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}
.capture-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }

/* The photo shortcut, offered before the manual rows it fills and folded away
   until wanted, so it never reads as a fourth step. */
.capture-scan {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.95rem;
  margin-bottom: 1rem;
  background: var(--bg);
}
.capture-scan > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand-700);
  list-style: none;
}
.capture-scan > summary::-webkit-details-marker { display: none; }
.capture-scan > summary::before { content: "📷 "; }
.capture-scan[open] > summary { margin-bottom: 0.8rem; }
.capture-scan-body .alert { margin-bottom: 0.85rem; }

.capture-step-save { display: grid; gap: 0.9rem; justify-items: start; }
.capture-step-save .btn { min-width: 15rem; }

/* Plain-language key for the two numbers on every career card, folded behind
   an "i" so it is available without being permanently in the way. */
.explain-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.explain-toggle:hover { border-color: var(--brand-300); color: var(--brand-700); }
.explain-toggle.is-open {
  border-color: var(--brand-300);
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}
.explain-i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
}
.explain-panel {
  background: var(--warm);
  border-color: var(--warm-line);
  animation: resGroupIn 0.22s ease both;
}
.explain-panel[hidden] { display: none; }
.explain-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.explain-list dt {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--brand-700);
  margin-bottom: 0.25rem;
}
.explain-list dd { font-size: 0.88rem; color: var(--ink-2); max-width: 52ch; }
.explain-caveat { margin-top: 1rem; font-size: 0.84rem; max-width: 78ch; }

/* Career goal action, in the header card beside the heading it applies to. */
.career-goal-actions {
  flex: none;
  margin-left: auto;
  align-self: flex-start;
}
#goalFeedback:not(.show) { display: none; }
#goalFeedback { margin: -0.75rem 0 1.75rem; max-width: 72ch; }
@media (max-width: 640px) {
  /* The corner disappears on a phone, so the action returns to the flow
     rather than being squeezed against the title. */
  .career-goal-actions { margin: 0.85rem 0 0; align-self: stretch; width: 100%; }
  .career-goal-actions .btn { width: 100%; }
}
/* Swap choices, shown only when the learner is already at three goals. */
.goal-swap { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.goal-swap .btn { font-size: 0.85rem; padding: 0.4rem 0.8rem; }

/* Footer link on a card that shows a truncated view of something bigger. */
.card-more { margin-top: 1rem; font-size: 0.88rem; font-weight: 600; }

/* Where you could study — a ranked list, because the question is "which of
   these first" and a grid of equal cards refuses to answer that. */
.match-toggle { margin-bottom: 1.25rem; }
.study-list { list-style: none; display: grid; gap: 0.7rem; counter-reset: study; }
.study-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.study-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.study-row.is-live { border-left-color: #22c55e; }
.study-row.is-near { border-left-color: #f59e0b; }
.study-row.is-far, .study-row.is-unknown { border-left-color: var(--border); }
.study-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink-3);
}
.study-row.is-live .study-rank { background: #dcfce7; color: #15803d; }
.study-copy { display: grid; gap: 0.15rem; min-width: 0; }
.study-copy strong { font-size: 0.95rem; }
.study-prog { font-size: 0.85rem; color: var(--ink-2); }
.study-leads { font-size: 0.78rem; color: var(--ink-3); }
.study-meta { display: grid; justify-items: end; gap: 0.3rem; text-align: right; }
.study-years { font-size: 0.76rem; color: var(--ink-3); }
a.study-years { color: var(--brand-700); font-weight: 600; }

@media (max-width: 620px) {
  .study-row { grid-template-columns: auto minmax(0, 1fr); }
  .study-meta { grid-column: 2; justify-items: start; text-align: left; }
}

/* Journey map (dashboard roadmap) */
.journey-panel { padding-bottom: 1.1rem; position: relative; overflow: hidden; }
/* Soft hills behind the rail, so the panel is not a white rectangle. */
.journey-panel::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -70px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(199, 210, 254, 0.10), rgba(199, 210, 254, 0) 62%);
  filter: blur(2px);
  pointer-events: none;
}
.journey-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  position: relative;
  z-index: 1;
}
.journey-head h2 { font-size: 1.2rem; }
.journey-goal { font-size: 0.92rem; color: var(--ink-3); margin: 0.3rem 0 0; max-width: 62ch; }
.journey-foot { margin: 0.9rem 0 0; font-size: 0.82rem; color: var(--ink-3); position: relative; z-index: 1; }

/* ---- Stage banner ------------------------------------------------------ */
.jt-now {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1.15fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.15rem;
  padding: 1.15rem 1.4rem;
  margin-bottom: 1rem;
  border-radius: 18px;
  background: linear-gradient(115deg, #4f46e5 0%, #5b53ea 45%, #6d5df0 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.28);
}
/* Faint sweep across the banner, matching the panel's hills. */
.jt-now::before {
  content: "";
  position: absolute;
  right: -8%;
  top: -60%;
  width: 60%;
  height: 220%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.jt-now > * { position: relative; z-index: 1; }
.jt-now-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.jt-now-icon svg { width: 26px; height: 26px; }
.jt-now-eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.3rem;
}
.jt-now h3 { font-size: 1.5rem; line-height: 1.15; color: #fff; margin-bottom: 0.25rem; }
.jt-now p { font-size: 0.85rem; color: rgba(255, 255, 255, 0.86); margin: 0; max-width: 46ch; }
.jt-ready { margin-top: 0.5rem !important; font-weight: 700; font-size: 0.82rem !important; color: #fff; }
.jt-now-next {
  list-style: none;
  display: grid;
  gap: 0.4rem;
  padding-left: 1.15rem;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}
.jt-now-next li { display: flex; align-items: center; gap: 0.55rem; font-size: 0.82rem; }
.jt-step-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
}
.jt-step-icon svg { width: 14px; height: 14px; }
.jt-now-mark {
  font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
  font-size: 1.1rem;
  line-height: 1.15;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  padding-left: 0.5rem;
}
.jt-now-mark svg { display: block; width: 100%; height: 12px; margin-top: 0.25rem; }

/* ---- The rail ---------------------------------------------------------- */
.journey-map { overflow-x: auto; overflow-y: hidden; position: relative; z-index: 1; }
.jt-flow { display: flex; align-items: flex-start; min-width: 820px; }
.jt-rail { list-style: none; display: flex; flex: 1 1 auto; }
.jt-stop {
  flex: 1 1 0;
  position: relative;
  animation: jtIn 0.34s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
@keyframes jtIn { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .jt-stop, .jt-goal { animation: none; } }

/* Connector belongs to the stop it arrives at, and stops 24px short of each
   circle: a later sibling's line would otherwise paint over the previous
   milestone, which z-index cannot fix across stacking contexts. */
.jt-stop::before {
  content: "";
  position: absolute;
  top: 22px;
  right: calc(50% + 24px);
  left: calc(-50% + 24px);
  height: 3px;
  border-radius: 3px;
  background: var(--border);
}
.jt-stop:first-child::before { display: none; }
.jt-stop.is-done::before { background: #22c55e; }
.jt-stop.is-current::before { background: var(--brand-600); }
.jt-stop.is-next::before {
  background: none;
  border-top: 3px dashed var(--border);
  height: 0;
}

.jt-hit {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.jt-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.jt-hit:hover .jt-dot { transform: translateY(-2px); }
.jt-hit:focus-visible { outline: none; }
.jt-hit:focus-visible .jt-dot { outline: 2px solid var(--brand-600); outline-offset: 3px; }
.jt-stop.is-done .jt-dot {
  background: linear-gradient(150deg, #34d399, #16a34a);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}
.jt-stop.is-current .jt-dot {
  background: #fff;
  border: 3px solid var(--brand-600);
  box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.12), 0 6px 14px rgba(79, 70, 229, 0.2);
}
.jt-hit.is-open .jt-dot { border-color: var(--brand-500); }
.jt-label { font-size: 0.85rem; font-weight: 700; color: var(--ink); }
.jt-stop.is-next .jt-label { color: var(--ink-3); }
.jt-pill {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  white-space: nowrap;
}
.jt-pill.jt-done { background: #dcfce7; color: #15803d; }
.jt-pill.jt-here { background: var(--brand-50); color: var(--brand-700); letter-spacing: 0.04em; }
.jt-pill.jt-next { background: var(--bg); color: var(--ink-3); }
/* One readiness scale, shared with the path tree, so a learner never sees the
   same number described two ways. */
.jt-pill.jt-live { background: #dcfce7; color: #15803d; }
.jt-pill.jt-near { background: var(--warning-bg); color: var(--warning); }
.jt-pill.jt-far, .jt-pill.jt-unknown { background: var(--bg); color: var(--ink-3); }

/* ---- The branch -------------------------------------------------------- */
.jt-branch { flex: 0 0 auto; position: relative; padding-left: 44px; }
/* Dashed comb: one spine down the destinations, a stub into each, and a stub
   back to the rail — drawn in CSS so it follows however many goals there are. */
.jt-branch::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 22px;
  bottom: 22px;
  border-left: 2px dashed var(--border);
}
/* The run to the spine belongs to the milestone, not the branch: anchored on
   the branch it was a fixed stub floating in the middle of the gap. */
.jt-stop:last-child::after {
  content: "";
  position: absolute;
  top: 22px;
  left: calc(50% + 24px);
  right: -21px;
  border-top: 2px dashed var(--border);
}
.jt-flow:not(.is-branched) .jt-branch::before { display: none; }
.jt-goals { list-style: none; display: grid; gap: 0.75rem; }
.jt-goal { position: relative; animation: jtIn 0.34s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
.jt-goal::before {
  content: "";
  position: absolute;
  left: -23px;
  width: 21px;
  top: 22px;
  border-top: 2px dashed var(--border);
}
.jt-goal-hit {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 0.65rem;
  justify-items: start;
  text-align: left;
  width: auto;
}
.jt-goal-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  font-size: 1.1rem;
}
.jt-goal-copy { display: grid; justify-items: start; gap: 0.2rem; }
.jt-goal-name { font-size: 0.86rem; font-weight: 700; color: var(--ink); }
.jt-tick { width: 20px; height: 20px; }
.jt-ready.jt-warn { color: #fde68a; font-weight: 600; }

@media (max-width: 900px) {
  .jt-now { grid-template-columns: auto minmax(0, 1fr); gap: 1rem; padding: 1.2rem; }
  .jt-now h3 { font-size: 1.5rem; }
  .jt-now-next { grid-column: 1 / -1; padding-left: 0; border-left: none; border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 0.9rem; }
  .jt-now-mark { display: none; }
}

/* Full path map sheet */
.pathmap-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: resGroupIn 0.2s ease both;
}
.pathmap-veil[hidden] { display: none; }
.pathmap-sheet {
  width: min(1100px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-lg, 0 24px 60px rgba(15, 23, 42, 0.3));
}
.pathmap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.pathmap-head h2 { font-size: 1.3rem; }
.pathmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.8rem;
  color: var(--ink-3);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.1rem;
}
.pathmap-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.35rem;
}
.dot-live { background: #22c55e; }
.dot-near { background: #f59e0b; }
.dot-far { background: #cbd5e1; }
.pathmap-note { margin-top: 1.2rem; font-size: 0.8rem; color: var(--ink-3); }
.pathmap-empty p { max-width: 60ch; color: var(--ink-2); }

/* Path tree. One graph rather than a stack of cards: the useful part is where
   branches share an institution, and a list cannot show that. */
.pm-treewrap { overflow-x: auto; padding-bottom: 0.5rem; }
.pm-tree { width: 100%; min-width: 1060px; height: auto; display: block; }
.pm-tree text { font-family: var(--font); font-size: 13px; font-weight: 700; fill: var(--ink); }
.pm-tree .pm-sub { font-size: 11px; font-weight: 500; fill: var(--ink-3); }
.pm-tree .pm-icon { font-size: 15px; }
.pm-col { font-size: 10px !important; font-weight: 800 !important; fill: var(--ink-3) !important; letter-spacing: 0.1em; }

.pm-edge { fill: none; stroke: var(--border); stroke-width: 1.6; }
.pm-edge.is-live { stroke: #86efac; }
.pm-edge.is-near { stroke: #fcd34d; }
.pm-edge.is-faint { opacity: 0.35; stroke-dasharray: 4 4; }

.pm-node rect, .pm-node circle {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}
.pm-root circle { fill: var(--brand-600); stroke: var(--brand-700); }
.pm-root text { fill: #fff; }
.pm-root .pm-root-top { font-size: 14px; }
.pm-root .pm-root-sub { font-size: 11px; font-weight: 600; fill: rgba(255, 255, 255, 0.85); }
.pm-inst rect { fill: var(--warm); stroke: var(--warm-line); }
.pm-inst.is-yours rect { fill: var(--brand-50); stroke: var(--brand-300); }
.pm-career.is-live rect, .pm-prog.is-live rect { stroke: #22c55e; }
.pm-career.is-near rect, .pm-prog.is-near rect { stroke: #f59e0b; }
/* Careers the marks opened up but the learner never chose: visible, plainly
   secondary, and never mistaken for something they picked. */
.pm-node.is-faint { opacity: 0.45; }
.pm-emerging-note { margin-top: 0.9rem; font-size: 0.82rem; color: var(--ink-3); }

@media (max-width: 780px) {
  .jt-now { grid-template-columns: auto minmax(0, 1fr); gap: 0.85rem; }
  .jt-now-next { grid-column: 1 / -1; }
  .pathmap-sheet { padding: 1.1rem; }
}
.goal-setter .form-group { margin: 0; }
.goal-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1rem; }

/* Milestone roadmap — a vertical timeline that draws itself in */
.milestone-track {
  position: relative;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0 0 0 3rem;
}
.milestone-track::before,
.milestone-track::after {
  content: "";
  position: absolute;
  left: 16px;
  width: 3px;
  border-radius: 3px;
}
.milestone-track::before { top: 8px; bottom: 8px; background: var(--border); }
.milestone-track::after {
  top: 8px;
  height: var(--track-progress, 0%);
  background: linear-gradient(180deg, var(--success), var(--brand-600));
  animation: trackGrow 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes trackGrow { from { height: 0; } }

.milestone {
  position: relative;
  padding-bottom: 1.6rem;
  animation: milestoneIn 0.5s ease-out backwards;
}
.milestone:last-child { padding-bottom: 0; }
@keyframes milestoneIn { from { opacity: 0; transform: translateY(14px); } }

.milestone-dot {
  position: absolute;
  left: -3rem;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  background: var(--surface);
  border: 3px solid var(--border);
  color: var(--ink-3);
  animation: nodePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  z-index: 1;
}
@keyframes nodePop { from { transform: scale(0.3); opacity: 0; } }
.milestone.is-done .milestone-dot {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}
.milestone.is-current .milestone-dot {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
  box-shadow: 0 0 0 5px var(--brand-100);
}
.milestone.is-current .milestone-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--brand-500);
  animation: nodePulse 2.2s ease-out infinite;
}
@keyframes nodePulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.75); opacity: 0; }
}

.milestone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.milestone-card:hover { box-shadow: var(--shadow); transform: translateX(2px); }
.milestone.is-current .milestone-card { border-left-color: var(--brand-600); box-shadow: var(--shadow-sm); }
.milestone.is-done .milestone-card { border-left-color: var(--success); }
.milestone-when {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-700);
}
.milestone.is-done .milestone-when { color: var(--success); }
.milestone.is-upcoming .milestone-when { color: var(--ink-3); }
.milestone-card h3 { font-size: 1.02rem; margin: 0.2rem 0 0.4rem; }
.milestone-card p { font-size: 0.92rem; color: var(--ink-3); margin: 0; }
.milestone-card ul { margin: 0.5rem 0 0 1.05rem; display: grid; gap: 0.3rem; }
.milestone-card li { font-size: 0.9rem; color: var(--ink-2); }
.milestone-metrics { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.milestone-metric {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  min-width: 84px;
}
.milestone-metric strong { display: block; font-size: 1.15rem; line-height: 1.2; color: var(--ink); }
.milestone-metric span { font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; }

/* Animated progress bars: grow from zero on first paint */
.progress-animate .progress-fill {
  animation: barGrow 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes barGrow { from { width: 0 !important; } }

/* Career simulator */
.sim-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; align-items: end; }
.sim-controls .form-group { margin: 0; }
.sim-result { animation: simIn 0.45s ease-out; }
@keyframes simIn { from { opacity: 0; transform: translateY(12px); } }
.sim-headline {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sim-headline .result-ring { margin: 0; width: 78px; height: 78px; }
.sim-headline .result-ring .ring-inner { width: 58px; height: 58px; font-size: 0.95rem; }
.sim-headline-copy { flex: 1; min-width: 0; }
.sim-headline-copy h3 { font-size: 1.15rem; margin-bottom: 0.15rem; }
.sim-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.sim-columns h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 0.6rem;
}
.sim-step {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--ink-2);
}
.sim-step:last-child { border-bottom: none; }
.sim-step .sim-icon { flex: none; font-size: 0.95rem; line-height: 1.4; }
.sim-path { display: grid; gap: 0.45rem; }
.sim-path-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
}
.sim-path-row strong { display: block; font-size: 0.9rem; }
.sim-path-row span.inst { display: block; color: var(--ink-3); font-size: 0.8rem; }
.sim-compare {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  font-size: 0.9rem;
  color: var(--brand-800);
}

@media (max-width: 560px) {
  .milestone-track { padding-left: 2.5rem; }
  .milestone-dot { left: -2.5rem; width: 30px; height: 30px; font-size: 0.85rem; }
  .milestone-track::before, .milestone-track::after { left: 14px; }
}

/* Learner Profile section-level editing */
.profile-section {
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.profile-section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.profile-section-toolbar h2 {
  font-size: 1.05rem;
  margin: 0;
}
.profile-section-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--brand-700);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.profile-section-edit:hover,
.profile-section-edit:focus-visible {
  border-color: var(--brand-500);
  background: var(--brand-50);
}
.profile-section:not(.profile-section-editing) > :not(.profile-section-toolbar):not(.profile-section-edit):not(legend) {
  opacity: 0.74;
}
.profile-section:not(.profile-section-editing) .choice-grid label { cursor: default; }
.profile-section.profile-section-editing {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-50);
}
.profile-section > .profile-section-edit {
  float: right;
  margin: -2.7rem 0 0.75rem 1rem;
}
.profile-section-actions {
  display: none;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.profile-section-editing .profile-section-actions { display: flex; }

@media (max-width: 520px) {
  .profile-section-toolbar {
    align-items: flex-start;
  }
  .profile-section-edit {
    flex: none;
    min-width: 44px;
  }
  .profile-section > .profile-section-edit {
    float: none;
    margin: 0 0 0.85rem auto;
  }
  .profile-section-actions {
    display: none;
    grid-template-columns: 1fr 1fr;
  }
  .profile-section-editing .profile-section-actions { display: grid; }
  .profile-section-actions .btn { width: 100%; }
}

/* Loader overlay */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(246, 248, 252, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.loader-overlay .spinner { width: 42px; height: 42px; border-width: 4px; }

/* Simple content page (privacy / terms) */
.prose { max-width: 46rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.prose h1 { font-size: 2rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 0.85rem; }
.prose ul { margin: 0 0 1rem 1.25rem; }

/* Compact phones: keep every workflow readable without viewport overflow. */
@media (max-width: 520px) {
  body {
    font-size: 0.95rem;
    overflow-x: hidden;
    overflow-wrap: anywhere;
  }

  .container {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .site-header .header-inner {
    min-height: 60px;
    gap: 0.7rem;
  }
  .brand { font-size: 1.05rem; }
  .brand img { width: 32px; height: 32px; }
  .site-nav {
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    padding: 0.65rem 1rem 1rem;
  }
  .site-nav a { min-height: 44px; display: flex; align-items: center; }
  .site-nav.auth-nav {
    display: flex;
    overflow: visible;
    padding: 0;
  }
  .site-nav.auth-nav .nav-cta {
    flex-direction: row;
    gap: 0.35rem;
    margin: 0;
  }
  .site-nav.auth-nav .btn {
    min-height: 40px;
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
  }

  .btn {
    max-width: 100%;
    min-height: 44px;
    text-align: center;
    white-space: normal;
  }

  .section { padding: 3rem 0; }
  .section-head { margin-bottom: 2rem; }
  .hero {
    gap: 1.75rem;
    padding-top: 2.25rem;
    padding-bottom: 3rem;
  }
  .hero h1 { font-size: clamp(1.9rem, 10vw, 2.55rem); }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero-actions .btn { width: 100%; }
  .cta-banner { padding: 2.25rem 1rem; }

  .card-grid,
  .stats-band,
  .planning-grid,
  #careerGrid,
  #planGrid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .card,
  .panel {
    border-radius: 12px;
    padding: 1rem;
  }

  .auth-main {
    align-items: flex-start;
    padding: 1.25rem max(1rem, env(safe-area-inset-right))
      calc(2rem + env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
  }
  .auth-card {
    padding: 1.5rem 1rem;
    border-radius: 12px;
  }
  .auth-card .auth-logo { margin-bottom: 0.75rem; }
  .auth-card h1 { font-size: 1.3rem; }
  .auth-card .auth-sub { margin-bottom: 1.25rem; }

  .app-topbar {
    min-height: 56px;
    padding: calc(0.65rem + env(safe-area-inset-top))
      max(1rem, env(safe-area-inset-right)) 0.65rem
      max(1rem, env(safe-area-inset-left));
  }
  .app-topbar strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar {
    width: min(86vw, 300px);
    padding: max(1rem, env(safe-area-inset-top)) 0.75rem
      max(1rem, env(safe-area-inset-bottom));
  }
  .nav-list a,
  .sidebar-footer a {
    min-height: 44px;
  }
  .nav-sub a { min-height: 40px; align-items: center; }
  .nav-toggle { width: 44px; height: 44px; }
  .main-content {
    padding: 1rem max(1rem, env(safe-area-inset-right))
      calc(2.5rem + env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
  }
  .page-head { margin-bottom: 1.1rem; }
  .page-head h1 { font-size: 1.35rem; }

  .profile-header {
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
  }
  .profile-header h1 { font-size: 1.15rem; }
  .avatar-initials { width: 48px; height: 48px; flex: 0 0 48px; }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .stat-card { padding: 1rem; border-radius: 12px; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .panel-grid { gap: 1rem; }
  .panel { margin-bottom: 1rem; }

  .dashboard-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-section-head .btn,
  .dashboard-section-head select { width: 100%; }

  .form-row { grid-template-columns: minmax(0, 1fr); }
  fieldset { padding: 1rem; }
  .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .choice-grid label { min-height: 44px; }

  .planning-row {
    gap: 0.65rem;
    padding: 0.8rem;
  }
  .planning-row > :last-child {
    width: 100%;
    text-align: left;
  }
  .planning-row select { width: 100%; }
  .mastery-head {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .segmented button {
    min-height: 44px;
    padding: 0.65rem 0.5rem;
    white-space: normal;
  }
  .pill-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }
  .pill-row > * { flex: none; }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .result-widget { padding: 1rem 0.6rem; }
  .result-ring { width: 80px; height: 80px; }
  .result-ring .ring-inner { width: 60px; height: 60px; }
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .result-actions .btn {
    width: 100%;
    min-height: 44px;
    white-space: normal;
  }

  .bar-chart {
    gap: 0.55rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
  .bar-chart .bar-col { flex: 0 0 46px; }
  .performance-chart,
  .journey-map,
  .table-wrap {
    margin-inline: -1rem;
    padding-inline: 1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .data-table { min-width: 560px; }

  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .prose {
    padding: 2rem max(1.25rem, env(safe-area-inset-right))
      calc(3rem + env(safe-area-inset-bottom))
      max(1.25rem, env(safe-area-inset-left));
  }
  .prose h1 { font-size: 1.65rem; }
}

@media (max-width: 360px) {
  .stat-grid,
  .results-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-page .header-inner {
    flex-wrap: wrap;
    padding-block: 0.6rem;
  }
  .auth-page .site-nav.auth-nav { width: 100%; }
  .auth-page .site-nav.auth-nav .nav-cta { width: 100%; }
  .auth-page .site-nav.auth-nav .btn { flex: 1; }
}

/* Reduced motion */
/* ==========================================================================
   Course & Programme Finder
   Browse-first: a prominent search, then a grid of study fields. The learner's
   subjects and APS come from their profile, so the page never asks again — it
   only offers "Refine". Each course card expands in place to show every
   institution offering it and the careers it leads to.
   ========================================================================== */
.finder-search-panel {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
}
.finder-search-label {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}
.finder-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.4rem 0.4rem 0.4rem 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.finder-search:focus-within {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), var(--shadow);
  transform: translateY(-1px);
}
.finder-search-icon { display: flex; color: var(--ink-3); flex: none; }
.finder-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: var(--ink);
  padding: 0.6rem 0;
}
.finder-search input::-webkit-search-cancel-button { cursor: pointer; }
.finder-search .btn { flex: none; }
.finder-search-panel #contextChip { color: rgba(255, 255, 255, 0.92); }
.finder-search-panel #contextChip a { color: #fff; text-decoration: underline; }
.finder-search-panel #contextChip strong { color: #fff; }

/* ---- Field-of-study grid ---- */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.9rem;
}
.stream-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  text-align: left;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  animation: streamIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.stream-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}
.stream-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand-200);
}
.stream-card:hover::after, .stream-card.is-active::after { transform: scaleX(1); }
.stream-card:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.stream-card.is-active {
  border-color: var(--brand-600);
  background: var(--brand-50);
  box-shadow: var(--shadow-sm);
}
.stream-icon {
  font-size: 1.65rem;
  line-height: 1;
  margin-bottom: 0.15rem;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stream-card:hover .stream-icon { transform: scale(1.16) rotate(-4deg); }
.stream-name { font-weight: 700; color: var(--ink); font-size: 0.98rem; }
.stream-blurb { font-size: 0.8rem; color: var(--ink-3); line-height: 1.4; }
.stream-count {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-50);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.stream-card.is-active .stream-count { background: var(--brand-100); }
@keyframes streamIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

/* ---- Results header, refine ---- */
.finder-result-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.refine-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
  background: #f8fafc;
  animation: refineIn 0.3s ease backwards;
}
@keyframes refineIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.refine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}
.refine-grid .form-group { margin: 0; }
.refine-chevron { display: inline-block; transition: transform 0.22s ease; }

/* ---- Course cards ---- */
.course-list { display: grid; gap: 0.8rem; }
.course-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
  animation: courseIn 0.36s ease backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.course-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); }
.course-card.is-open { border-color: var(--brand-600); box-shadow: var(--shadow); }
@keyframes courseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.course-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.course-head:hover { background: var(--brand-50); }
.course-head:focus-visible { outline: 2px solid var(--brand-600); outline-offset: -2px; }
.course-head-main { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.course-title { font-weight: 700; color: var(--ink); font-size: 1rem; line-height: 1.35; }
.course-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.course-chevron {
  flex: none;
  color: var(--brand-600);
  font-size: 1.1rem;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.course-card.is-open .course-chevron { transform: rotate(180deg); }
.course-body {
  padding: 0.25rem 1.2rem 1.2rem;
  border-top: 1px solid var(--border);
  animation: bodyIn 0.3s ease;
}
@keyframes bodyIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}
.course-section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  font-weight: 700;
  margin: 1.1rem 0 0.6rem;
}
.inst-offer-main { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 0.5rem; }
.inst-offer-main strong { color: var(--ink); }
.inst-offer-main span { color: var(--ink-3); font-size: 0.86rem; }
.inst-offer-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.inst-offer-tags a { font-size: 0.82rem; font-weight: 600; }
.req-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0.6rem 0 0;
  border-top: 1px dashed var(--border);
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.career-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.career-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.career-chip.is-linked {
  background: var(--brand-50);
  color: var(--brand-700);
  border-color: var(--brand-200);
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.career-chip.is-linked:hover { background: var(--brand-100); transform: translateY(-2px); }

.finder-search-panel #contextChip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.finder-search-panel #goalJump {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.finder-search-panel #goalJump:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-1px); }
.finder-search-panel #goalJump:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 700px) {
  .finder-search-panel { padding: 1.25rem; }
  .finder-search { flex-wrap: wrap; padding: 0.5rem; }
  .finder-search input { flex: 1 1 100%; order: 2; padding: 0.5rem 0.4rem; }
  .finder-search .btn { flex: 1 1 100%; order: 3; }
  .finder-search-icon { order: 1; }
  .stream-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
  .stream-card { padding: 0.9rem; }
  .stream-blurb { display: none; }
  .course-head { padding: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
}

/* Optional analytics consent. It remains usable above app sidebars and on compact phones. */
.analytics-consent {
  position: fixed;
  z-index: 1200;
  left: max(1rem, env(safe-area-inset-left));
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--brand-200);
  border-radius: 16px;
  background: #fff;
  color: var(--ink-2);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
}
.analytics-consent__copy { display: grid; gap: 0.25rem; line-height: 1.45; }
.analytics-consent__copy strong { color: var(--ink); }
.analytics-consent__actions { display: flex; flex: 0 0 auto; gap: 0.55rem; }
@media (max-width: 700px) {
  .analytics-consent { align-items: stretch; flex-direction: column; }
  .analytics-consent__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .analytics-consent__actions .btn { width: 100%; }
}

/* Private feedback and administrator moderation workspace. */
.feedback-layout { align-items: start; }
.feedback-contact { grid-template-columns: 1fr; margin-bottom: 1rem; }
.feedback-list { display: grid; gap: 0.85rem; margin-top: 1rem; }
.feedback-item {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface, #fff);
}
.feedback-item > * + * { margin-top: 0.7rem; }
.feedback-item p { overflow-wrap: anywhere; }
.feedback-item__head,
.review-heading,
.review-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.review-heading { align-items: flex-start; }
.review-actions { justify-content: flex-start; flex-wrap: wrap; }
.status-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
}
.status-new, .status-pending { background: #fef3c7; color: #92400e; }
.status-reviewing { background: #dbeafe; color: #1e40af; }
.status-resolved, .status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.btn-small { min-height: 38px; padding: 0.45rem 0.75rem; font-size: 0.88rem; }
.admin-review-shell { width: min(1100px, 100%); margin: 0 auto; }

@media (max-width: 700px) {
  .review-heading { display: grid; }
  .review-heading .btn { width: 100%; }
  .feedback-item__head { align-items: flex-start; }
}

/* Delayed, non-modal usefulness rating for signed-in learner screens. */
.page-feedback {
  position: fixed;
  z-index: 1100;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(370px, calc(100vw - 2rem));
  padding: 1rem;
  border: 1px solid var(--brand-200);
  border-radius: 16px;
  background: var(--surface, #fff);
  color: var(--ink-2);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}
.page-feedback__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}
.page-feedback__head strong { display: block; color: var(--ink); font-size: 1rem; }
.page-feedback__head p { margin-top: 0.2rem; color: var(--ink-3); font-size: 0.86rem; line-height: 1.4; }
.page-feedback__dismiss {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.45rem;
  border: 0;
  background: transparent;
  color: var(--brand-700);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.page-feedback__body { margin-top: 0.85rem; }
.page-feedback__scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.45rem; }
.page-feedback__rating {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--brand-200);
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-800);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.page-feedback__rating:hover { background: var(--brand-100); border-color: var(--brand-400); }
.page-feedback__rating:disabled { cursor: wait; opacity: 0.6; }
.page-feedback__rating:focus-visible,
.page-feedback__dismiss:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 2px; }
.page-feedback__anchors {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  color: var(--ink-3);
  font-size: 0.75rem;
}
.page-feedback__status { min-height: 1.15rem; margin-top: 0.5rem; color: var(--ink-3); font-size: 0.82rem; }
.page-feedback__privacy { margin-top: 0.35rem; color: var(--ink-3); font-size: 0.75rem; }
.page-feedback__thanks { color: var(--ink); font-weight: 700; }
.page-feedback__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.85rem; }
.page-feedback__actions .btn { min-height: 44px; }
.page-feedback__comment-label { display: block; color: var(--ink); font-weight: 700; }
.page-feedback__comment { width: 100%; margin-top: 0.45rem; resize: vertical; }
.page-feedback-visible { scroll-padding-bottom: 17rem; }
.page-feedback-visible .main-content { padding-bottom: max(17rem, calc(3.5rem + env(safe-area-inset-bottom))); }

.page-rating-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.page-rating-summary__card {
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--brand-50);
}
.page-rating-summary__score { margin-top: 0.35rem; color: var(--brand-800); font-size: 1.35rem; font-weight: 800; }
.page-rating-summary__distribution { margin-top: 0.4rem; color: var(--ink-3); font-size: 0.78rem; }
.page-rating-history { margin-top: 1.5rem; }

@media (max-width: 700px) {
  .page-feedback {
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: auto;
  }
  .page-feedback__scale { gap: 0.35rem; }
  .page-feedback-visible .main-content { padding-bottom: max(19rem, calc(3rem + env(safe-area-inset-bottom))); }
}
