@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ═════════════════════════════════════════════════════
   ADMIN — login, setup, dashboard, build detail
   ═════════════════════════════════════════════════════ */
.admin-shell {
  background: #f4f7f8;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

/* Auth pages (login / setup) */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, #eaf2f4 0%, #f4f7f8 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: white;
  border-radius: 14px;
  border: 1px solid #dde6ea;
  padding: 36px 32px 32px;
  box-shadow: 0 8px 24px rgba(6, 79, 98, 0.06);
}
.auth-brand { margin-bottom: 20px; }
.auth-card h1 { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -0.3px; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.auth-form label {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.auth-form label span { display: block; margin-bottom: 6px; }
.auth-form label small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #dde6ea;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  background: white;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-form .btn-block { width: 100%; margin-top: 6px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 12.5px; }
.auth-foot a { color: var(--muted); text-decoration: none; }
.auth-foot a:hover { color: var(--accent); }
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.flash-error   { background: #fdecec; color: #a72222; border-left: 3px solid #d1495b; }
.flash-success { background: #e8f5e9; color: #1e4620; border-left: 3px solid #2e6e1e; }

/* Admin header */
.admin-header {
  background: white;
  border-bottom: 1px solid #dde6ea;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 1px 0 rgba(6, 79, 98, 0.03);
}
.admin-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.admin-brand { display: flex; align-items: center; gap: 14px; }
.admin-title {
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  line-height: 1.15;
  border-left: 1px solid #dde6ea;
  padding-left: 14px;
}
.admin-title strong { font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: -0.1px; }
.admin-title span { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.admin-actions { display: flex; align-items: center; gap: 12px; }
.admin-user {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  padding-left: 8px;
  border-left: 1px solid #dde6ea;
  padding-left: 12px;
}
.admin-logout {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.admin-logout:hover { color: var(--accent); }

.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* KPI tiles */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-tile {
  background: white;
  border: 1px solid #dde6ea;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100px;
}
.kpi-tile-wide { grid-column: span 2; }
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: 6px;
  letter-spacing: -0.5px;
}
.kpi-value-sm {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 6px;
  line-height: 1.2;
}
.kpi-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Chart grid */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.chart-card {
  background: white;
  border: 1px solid #dde6ea;
  border-radius: 12px;
  padding: 20px 22px;
}
.chart-card.wide { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .chart-card.wide { grid-column: 1; }
}
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.chart-head h3 { font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: -0.1px; }
.chart-empty { font-size: 12.5px; color: var(--muted); font-style: italic; }

.trend-chart {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  align-items: end;
  gap: 6px;
  height: 130px;
}
.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  cursor: default;
}
.trend-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--sky) 0%, var(--accent) 100%);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: opacity 0.15s;
}
.trend-col:hover .trend-bar { opacity: 0.75; }
.trend-label { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }

.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-item {
  display: grid;
  grid-template-columns: 1fr 60px 26px;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
}
.rank-item .rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-item .rank-name code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 10.5px;
  color: var(--muted);
  margin-right: 4px;
}
a.rank-item:hover .rank-name { color: var(--accent); }
.rank-bar-wrap {
  height: 6px;
  background: #eef4f6;
  border-radius: 3px;
  overflow: hidden;
}
.rank-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--sky) 100%);
  border-radius: 3px;
}
.rank-val { font-size: 12px; font-weight: 700; color: var(--accent); text-align: right; }

/* Table card */
.table-card {
  background: white;
  border: 1px solid #dde6ea;
  border-radius: 12px;
  overflow: hidden;
}
.table-head {
  padding: 18px 22px;
  border-bottom: 1px solid #dde6ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.table-head h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.table-head h3 small { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.table-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.table-filters input,
.table-filters select {
  padding: 7px 12px;
  border: 1.5px solid #dde6ea;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  background: white;
}
.table-filters input:focus,
.table-filters select:focus { border-color: var(--accent); }
.table-scroll { overflow-x: auto; }
.builds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.builds-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f8fafb;
  border-bottom: 1px solid #dde6ea;
}
.builds-table th.num { text-align: right; }
.builds-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #eef4f6;
  color: var(--text);
  vertical-align: middle;
}
.builds-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.builds-table tr:hover td { background: #fafcfd; }
.cell-when { line-height: 1.2; }
.cell-when .cell-date { display: block; font-weight: 600; }
.cell-when .cell-time { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell-ip code { font-size: 11px; color: var(--muted); font-family: 'SF Mono', 'Menlo', monospace; }
.cell-view { color: var(--accent); font-weight: 700; text-decoration: none; font-size: 12px; }
.cell-view:hover { text-decoration: underline; }
.tag-stream {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Build detail */
.build-header {
  background: white;
  border: 1px solid #dde6ea;
  border-radius: 12px;
  padding: 24px 26px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.build-meta {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.bm-item { display: flex; flex-direction: column; gap: 2px; }
.bm-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.bm-value { font-size: 13.5px; font-weight: 700; color: var(--text); }
.bm-value code { font-family: 'SF Mono', 'Menlo', monospace; font-size: 12px; font-weight: 500; color: var(--text); }

.build-selections {
  background: white;
  border: 1px solid #dde6ea;
  border-radius: 12px;
  padding: 20px 26px;
  margin-bottom: 20px;
}
.build-selections h2 { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 18px; }
.build-year { margin-bottom: 20px; }
.build-year > h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: #f8fafb;
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.build-sem { margin-bottom: 12px; padding-left: 8px; }
.build-sem h4 { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.build-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.build-row {
  display: grid;
  grid-template-columns: 90px 1fr 100px;
  gap: 12px;
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  background: #f8fafb;
}
.build-row .br-code { font-family: 'SF Mono', 'Menlo', monospace; font-size: 11px; color: var(--muted); font-weight: 600; }
.build-row .br-name { color: var(--text); font-weight: 500; }
.build-row .br-kind {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
  font-weight: 700;
}
.build-row-compulsory       { border-left-color: var(--accent); background: var(--accent-light); }
.build-row-stream           { border-left-color: #2e6e1e; background: #eef8ee; }
.build-row-compulsory_choice { border-left-color: var(--amber); background: #fff8e6; }
.build-row-elective         { border-left-color: #a5c887; background: #f5faf0; }

.raw-payload {
  background: white;
  border: 1px solid #dde6ea;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 12px;
}
.raw-payload summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.raw-payload pre {
  margin-top: 10px;
  padding: 12px;
  background: #f8fafb;
  border-radius: 6px;
  font-size: 11px;
  overflow-x: auto;
  font-family: 'SF Mono', 'Menlo', monospace;
  color: var(--text);
}

@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
  .kpi-tile-wide { grid-column: auto; }
  .build-header { flex-direction: column; }
  .build-row { grid-template-columns: 70px 1fr; }
  .build-row .br-kind { grid-column: 2; text-align: left; font-size: 10px; margin-top: 2px; }
}


/* ═════════════════════════════════════════════════════
   LANDING PAGE — emeris.ac.za styled top bar + hero
   ═════════════════════════════════════════════════════ */
.landing { background: #fff; }

.site-header {
  background: #fff;
  border-bottom: 1px solid #eef2f4;
  padding: 12px 32px;
  box-shadow: 0 1px 0 rgba(6, 79, 98, 0.03);
  position: sticky;
  top: 0;
  z-index: 60;
}
.site-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-logo { display: inline-flex; align-items: center; text-decoration: none; }
.site-logo img { display: block; }
.site-header-actions { display: flex; align-items: center; gap: 8px; }
.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.header-icon-btn:hover { background: var(--accent-hover); }

/* Breadcrumb strip */
.crumb-strip {
  background: #fff;
  border-bottom: 1px solid #eef2f4;
  padding: 8px 32px;
}
.crumb-inner {
  max-width: 1240px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.crumb-inner a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.crumb-inner a:hover { color: var(--accent); }
.crumb-sep { color: #b8c8ce; font-size: 14px; }
.crumb-current { color: var(--sky); font-weight: 600; }

/* Hero banner with diagonal stripes */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, #003545 0%, var(--accent) 60%, #05617A 100%);
  color: #fff;
  overflow: hidden;
  padding: 40px 32px;
  min-height: 120px;
  display: flex;
  align-items: center;
}
.hero-banner-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 22px,
    rgba(255, 255, 255, 0.05) 22px,
    rgba(255, 255, 255, 0.05) 44px
  );
}
.hero-banner-inner {
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}
.hero-banner h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 8px;
}
.hero-banner p {
  font-size: 15px;
  opacity: 0.9;
  max-width: 720px;
  line-height: 1.5;
}

/* Page content wrapper */
.page-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}
.results-count {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

/* Programme grid */
.programme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.programme-card {
  background: #fff;
  border: 1px solid #e5eaec;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}
.programme-card:hover {
  box-shadow: 0 8px 24px rgba(6, 79, 98, 0.12);
  border-color: var(--sky);
  transform: translateY(-3px);
}
.pc-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f0f4f5;
}
.pc-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.programme-card:hover .pc-image img { transform: scale(1.03); }
.pc-video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(32, 201, 151, 0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.pc-body {
  padding: 20px 20px 12px;
  flex: 1;
}
.pc-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.3;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}
.pc-meta {
  font-size: 12.5px;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
}
.pc-meta dt {
  font-weight: 700;
  color: var(--text);
}
.pc-meta dd {
  color: var(--muted);
  margin: 0;
}
.pc-actions {
  padding: 16px 20px 20px;
  display: flex;
  gap: 8px;
  flex-direction: column;
}
.pc-outline-btn,
.pc-primary-btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.pc-outline-btn {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.pc-outline-btn:hover {
  background: var(--accent-light);
}
.pc-primary-btn {
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
}
.pc-primary-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

@media (max-width: 900px) {
  .site-header, .crumb-strip, .hero-banner, .page-content { padding-left: 20px; padding-right: 20px; }
  .hero-banner h1 { font-size: 30px; }
  .hero-banner p { font-size: 13.5px; }
}
@media (max-width: 640px) {
  .site-header { padding: 10px 16px; }
  .crumb-strip { padding: 6px 16px; font-size: 11px; }
  .hero-banner { padding: 28px 16px; }
  .hero-banner h1 { font-size: 24px; }
  .page-content { padding: 20px 16px 40px; }
  .programme-grid { grid-template-columns: 1fr; }
}



:root {
  --bg: #f4f7f8;
  --surface: #ffffff;
  --border: #dde6ea;
  --text: #0d2b35;
  --muted: #5a7a85;
  --accent: #064f62;
  --accent-light: #e5f2f6;
  --accent-hover: #00577c;
  --sky: #6bbfe4;
  --yellow: #ffd055;
  --green: #a5c887;
  --amber: #f7b955;
  --danger: #d1495b;
  --tag-bg: #eef4f6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(6,79,98,0.08), 0 1px 2px rgba(6,79,98,0.05);
  --shadow-md: 0 4px 16px rgba(6,79,98,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Legacy header (kept only for reference — new pages use .site-header) ── */

/* ── Layout ── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px;
}
.container-narrow {
  max-width: 1240px;
}

/* ── Slim sticky progress strip (sits directly under the sticky site-header) ── */
.progress-strip {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 58px;                 /* matches the sticky site-header height */
  z-index: 50;
  box-shadow: 0 1px 4px rgba(6,79,98,0.06);
}
.progress-strip-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
}
.ps-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  white-space: nowrap;
}
.ps-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ps-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ps-total {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ps-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--tag-bg);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}
.ps-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--sky) 100%);
  transition: width 0.3s ease;
}
.ps-jump {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.ps-jump:hover { background: var(--accent-light); border-color: var(--sky); }

/* ── Review & Export card at bottom ── */
.review-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-top: 32px;
  overflow: hidden;
  scroll-margin-top: 90px;
}
.review-head {
  background: linear-gradient(135deg, var(--accent) 0%, #003545 100%);
  color: white;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.review-head h3 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.review-head p { font-size: 13px; opacity: 0.85; }
.review-status-line {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255,255,255,0.15);
  color: white;
}
.review-status-line.ok {
  background: white;
  color: var(--accent);
}

.review-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.review-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
  align-content: start;
}
.rs-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.rs-label { color: var(--muted); }
.rs-value {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rs-item.total {
  grid-column: 1 / -1;
  border-top: 2px solid var(--accent);
  border-bottom: none;
  padding-top: 10px;
  margin-top: 4px;
}
.rs-item.total .rs-label, .rs-item.total .rs-value {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}

.review-actions { display: flex; flex-direction: column; gap: 8px; }
.review-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: -2px;
}
.review-actions .student-input { margin-bottom: 4px; }

/* ── Home (stream picker) ── */
.hero {
  background: linear-gradient(135deg, var(--accent) 0%, #003545 100%);
  color: white;
  padding: 40px 32px;
  border-radius: 14px;
  margin-bottom: 24px;
}
.hero h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.hero p { font-size: 14px; opacity: 0.85; max-width: 720px; }

/* ── Detailed landing-page cards (emeris-style) ── */
.stream-grid-detailed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.stream-card-lg {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.stream-card-lg:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sky);
  transform: translateY(-2px);
}
.scl-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.scl-titles { flex: 1; min-width: 0; }
.scl-code {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.stream-card-lg h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.scl-tagline {
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
}
.video-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #20c997 0%, #12a373 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(32,201,151,0.25);
}
.scl-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  margin-top: -4px;
}
.scl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.scl-meta .tag {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  padding: 3px 10px;
}
.scl-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.scl-actions .btn-block {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
}

/* ── Original small cards (still exported by class) ── */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.stream-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stream-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--sky);
  transform: translateY(-2px);
}
.stream-card h3 { font-size: 16px; font-weight: 700; color: var(--accent); line-height: 1.3; }
.stream-card p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.stream-card .meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.stream-card .meta .tag {
  font-size: 11px;
  padding: 3px 9px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 10px;
  font-weight: 600;
}

/* ── Builder heading ── */
.sh-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.sh-titles { min-width: 0; flex: 1; }
.sh-titles h2 { margin-bottom: 4px !important; }
.sh-titles .meta-line { margin-bottom: 0 !important; }
.stream-heading h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.stream-heading .meta-line {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.stream-heading .meta-line span {
  display: inline-block;
  margin-right: 12px;
}

/* ── Year block ── */
.year-block {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  /* overflow visible so open dropdown menus can extend past the block */
}
.year-header {
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: calc(var(--radius) - 1.5px) calc(var(--radius) - 1.5px) 0 0;
}
.semester-grid { border-radius: 0 0 calc(var(--radius) - 1.5px) calc(var(--radius) - 1.5px); }

.semester-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.semester-block {
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}
.semester-block:last-child { border-right: none; }
.semester-block h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.module-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 44px 42px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
  word-wrap: break-word;
  min-width: 0;
}
.module-row > * { min-width: 0; }
.module-row .m-name { overflow-wrap: anywhere; }
.module-row:last-child { border-bottom: none; }
.module-row .m-code {
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.module-row .m-name { font-weight: 500; color: var(--text); line-height: 1.35; }
.module-row .m-nqf, .module-row .m-cr {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.module-row.compulsory { background: var(--accent-light); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.module-row.compulsory .m-code { color: var(--accent); }
.module-row.compulsory .m-name { color: var(--accent); font-weight: 600; }

.module-row.stream { background: #f0f9f2; margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.module-row.stream .m-code { color: #2e6e1e; }
.module-row.stream .m-name { color: #1a4d10; font-weight: 600; }

/* Clickable pre-filled rows — subtle "info available" affordance */
.module-row.clickable-row { cursor: pointer; transition: filter 0.12s, box-shadow 0.12s; }
.module-row.clickable-row:hover { filter: brightness(0.96); box-shadow: inset 3px 0 0 var(--accent); }
.module-row.compulsory.clickable-row:hover { box-shadow: inset 3px 0 0 var(--accent); }
.module-row.stream.clickable-row:hover { box-shadow: inset 3px 0 0 #2e6e1e; }

.row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.row-head strong { font-size: 12.5px; color: var(--text); font-weight: 600; flex: 1; min-width: 120px; }

.legend-strip {
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--accent);
  line-height: 1.9;
}
.legend-strip .stream-label { margin-right: 4px; margin-left: 8px; }

/* ── Quick-build banner ── */
.quick-build {
  background: linear-gradient(135deg, #6bbfe4 0%, #064f62 100%);
  color: white;
  border-radius: 14px;
  padding: 16px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 4px 16px rgba(6,79,98,0.15);
  flex-wrap: wrap;
}
.qb-copy { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 240px; }
.qb-icon {
  background: rgba(255,255,255,0.2);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qb-heading { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.qb-sub { font-size: 12.5px; opacity: 0.9; }
.qb-btn {
  background: white !important;
  color: var(--accent) !important;
  padding: 10px 18px !important;
  font-size: 13px !important;
  flex-shrink: 0;
}
.qb-btn:hover { background: #f2fafc !important; }

/* ── Wizard modal specifics ── */
.qb-step h4 {
  font-size: 14px !important;
  font-weight: 700;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--text) !important;
  margin-bottom: 6px !important;
}

.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.interest-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  background: white;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  display: block;
  position: relative;
  user-select: none;
}
.interest-card:hover { border-color: var(--sky); transform: translateY(-1px); }
.interest-card.checked {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 2px 6px rgba(6,79,98,0.1);
}
.interest-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ic-emoji { font-size: 22px; margin-bottom: 6px; line-height: 1; }
.ic-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ic-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.interest-card.checked .ic-name { color: var(--accent); }

.qb-question { margin-top: 18px; }
.qb-question:first-child { margin-top: 0; }
.qb-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.qb-radio-group { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.qb-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: white;
  font-size: 12.5px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.qb-radio:hover { border-color: var(--sky); }
.qb-radio input { margin-top: 3px; accent-color: var(--accent); }
.qb-radio input:checked ~ span { color: var(--accent); font-weight: 600; }
.qb-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }

.qb-warn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff3cd;
  color: #8a5a00;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  margin-top: 12px;
}
.qb-warn svg { flex-shrink: 0; }

/* ── Aptitude test ── */
.apt-modal { max-width: 640px; }
.apt-header h2 { font-size: 20px; line-height: 1.3; }
.apt-progress-wrap {
  padding: 14px 24px 4px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.apt-progress-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.apt-progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.apt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--sky) 100%);
  transition: width 0.3s ease;
  border-radius: 3px;
}
.apt-body { padding: 24px 24px 20px; }

.apt-intro { text-align: left; }
.apt-intro p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 10px;
}
.apt-intro .apt-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.apt-intro .apt-meta span {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 14px;
  font-weight: 600;
}

.apt-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.apt-option {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.apt-option:hover { border-color: var(--accent); background: var(--accent-light); }
.apt-option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

/* Results screen */
.apt-results { display: flex; flex-direction: column; gap: 20px; }
.apt-top-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.apt-type-badge {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.apt-type-badge.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #003545 100%);
  border-color: var(--accent);
  color: white;
}
.apt-type-badge .atb-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.apt-type-badge.primary .atb-name { color: white; }
.apt-type-badge .atb-blurb {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.apt-type-badge.primary .atb-blurb { color: rgba(255,255,255,0.85); }

.apt-section h4 {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}
.apt-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.apt-scores { display: flex; flex-direction: column; gap: 6px; }
.apt-score-row {
  display: grid;
  grid-template-columns: 110px 1fr 30px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.apt-score-label { color: var(--text); font-weight: 600; }
.apt-score-bar-wrap {
  height: 8px;
  background: var(--tag-bg);
  border-radius: 4px;
  overflow: hidden;
}
.apt-score-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--sky) 100%);
  border-radius: 4px;
}
.apt-score-val { font-size: 11px; color: var(--muted); font-weight: 700; text-align: right; }

.apt-rec-list { display: flex; flex-direction: column; gap: 6px; }
.apt-rec-btn {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.apt-rec-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}
.apt-rec-btn strong {
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
}
.apt-rec-btn .apt-arrow { color: var(--accent); font-weight: 700; }
.apt-rec-btn[data-current="1"] {
  border-color: var(--sky);
  background: var(--accent-light);
  cursor: default;
}
.apt-rec-btn[data-current="1"]:hover { transform: none; }
.apt-current-tag {
  font-size: 10.5px;
  padding: 3px 9px;
  background: var(--sky);
  color: var(--accent);
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 640px) {
  .apt-top-types { grid-template-columns: 1fr; }
  .apt-score-row { grid-template-columns: 100px 1fr 26px; }
}

@media (max-width: 640px) {
  .quick-build { padding: 14px 16px; }
  .qb-heading { font-size: 14px; }
  .qb-sub { font-size: 12px; }
  .qb-btn { width: 100%; margin-top: 8px; }
  .interest-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .interest-card { padding: 10px 12px; }
  .ic-name { font-size: 12.5px; }
  .ic-desc { font-size: 11px; }
}

.module-row.choice, .module-row.elective {
  padding: 10px 0;
  align-items: start;
}
.module-row.needs-selection {
  background: #fff8e6;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  border-left: 3px solid var(--amber);
}

.select-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* ── Custom dropdown (replaces native <select>) ── */
.cs-select {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
}
.cs-toggle {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
}
.cs-toggle:hover { border-color: var(--muted); }
.cs-select.open > .cs-toggle,
.cs-toggle:focus { border-color: var(--accent); }
.cs-select.needs-choice > .cs-toggle {
  border-color: var(--amber);
  background: #fffef7;
}
.cs-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}
.cs-label.placeholder { color: var(--muted); font-weight: 400; }
.cs-chevron {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.cs-select.open .cs-chevron { transform: rotate(180deg); }

.cs-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 90;
  background: white;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(6,79,98,0.18);
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 0;
}
.cs-select.open > .cs-menu { display: block; }
.cs-menu.drop-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.cs-option {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12.5px;
  border-bottom: 1px solid #f2f6f7;
  transition: background 0.1s;
  align-items: start;
}
.cs-option:last-child { border-bottom: none; }
.cs-option:hover { background: var(--accent-light); }
.cs-option.selected {
  background: var(--accent-light);
}
.cs-option.selected .cs-code,
.cs-option.selected .cs-name { color: var(--accent); font-weight: 700; }
.cs-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.cs-code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
  padding-top: 2px;
  white-space: nowrap;
}
.cs-name {
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
  min-width: 0;
}
.cs-recommended {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #8a5a00;
  background: #fff7e0;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Info button inside each dropdown option */
.cs-option { grid-template-columns: 78px 1fr auto; }
.cs-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--muted);
  font-family: 'Georgia', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  align-self: center;
}
.cs-info-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Module details pop-up (centred modal with backdrop) ── */
.mp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 79, 98, 0.45);
  backdrop-filter: blur(2px);
  z-index: 290;
}
.mp-backdrop.hidden { display: none; }

.module-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 85vh;
  background: white;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(6, 79, 98, 0.3);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.module-popover.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.mp-header {
  background: linear-gradient(135deg, var(--accent) 0%, #003545 100%);
  color: white;
  padding: 18px 20px 16px;
  border-radius: 14px 14px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-shrink: 0;
}
.mp-titles { flex: 1; min-width: 0; }
.mp-code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 10.5px;
  opacity: 0.7;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.mp-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.mp-nqf {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 3px;
  font-style: italic;
}
.mp-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.mp-close:hover { background: rgba(255, 255, 255, 0.3); }
.mp-body {
  overflow-y: auto;
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mp-name { font-size: 17px; }
.mp-section h4 { font-size: 11px; }
.mp-section p { font-size: 13px; }
.module-popover .outcomes-list li { font-size: 12.5px; padding-left: 42px; }
.mp-section h4 {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.mp-section p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.mp-callout {
  background: #fff7e0;
  border-left: 3px solid var(--amber);
  color: #7a4a00;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
}
.mp-callout strong { color: #5a3900; font-weight: 700; }

/* Compact overrides inside the popover */
.module-popover .outcomes-list li { font-size: 12px; padding-left: 40px; }
.module-popover .mo-label { font-size: 9.5px; padding: 1px 6px; }
.module-popover .assess-table { font-size: 11.5px; }
.module-popover .assess-table th { padding: 6px 8px; font-size: 10px; }
.module-popover .assess-table td { padding: 6px 8px; }
.module-popover .mod-book { padding: 8px 12px; font-size: 12px !important; }

.outcomes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.outcomes-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding-left: 44px;
  position: relative;
}
.mo-label {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.assess-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.assess-table th {
  background: var(--accent-light);
  color: var(--accent);
  text-align: left;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.assess-table td {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.assess-table td:last-child {
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  white-space: nowrap;
}

.mod-book {
  font-size: 13px !important;
  color: var(--text) !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: 'Georgia', serif;
  font-style: italic;
}
@media (max-width: 640px) {
  .cs-option { grid-template-columns: 68px 1fr; padding: 10px; }
  .cs-menu { max-height: 260px; }
  .cs-code { font-size: 10px; }
}

.help-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.help-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
/* .help-panel divs are used as a text source for the help pop-up; never rendered inline */
.help-panel { display: none !important; }

.stream-label {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-right: 6px;
  vertical-align: middle;
}
.label-comp   { background: var(--accent); color: white; }
.label-stream { background: #2e6e1e; color: white; }
.label-choice { background: var(--amber); color: white; }
.label-elec   { background: var(--green); color: white; }

/* ── Buttons ── */
.btn-block {
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.btn-block.primary {
  background: var(--accent);
  color: white;
}
.btn-block.primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
}
.btn-block.primary:disabled {
  background: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-block.ghost {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.btn-block.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.student-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  background: white;
}
.student-input:focus { border-color: var(--accent); }

/* ── Responsive ── */
/* Tight two-column: slim padding on semester block */
@media (max-width: 1100px) {
  .semester-block { padding: 14px 16px; }
  .module-row { grid-template-columns: 70px minmax(0, 1fr) 40px 38px; gap: 8px; }
}

/* Stack semesters vertically — each becomes full-width */
@media (max-width: 820px) {
  .semester-grid { grid-template-columns: 1fr; }
  .semester-block { border-right: none; border-bottom: 1px solid var(--border); padding: 16px 20px; }
  .semester-block:last-child { border-bottom: none; }
  .review-body { grid-template-columns: 1fr; }
  .container { padding: 20px 16px; }
  .hero { padding: 28px 20px; }
  .hero h2 { font-size: 20px; }
  .module-row { grid-template-columns: 78px minmax(0, 1fr) 44px 42px; gap: 10px; font-size: 12.5px; }
}

/* Small phones */
@media (max-width: 640px) {
  .progress-strip { top: 54px; }
  .progress-strip-inner { padding: 8px 16px; gap: 12px; }
  .ps-jump { display: none; }
  .ps-item { gap: 3px; }
  .ps-value { font-size: 14px; }
  .module-row {
    grid-template-columns: 66px minmax(0, 1fr) 40px;
    gap: 8px;
    font-size: 12px;
  }
  .module-row .m-nqf { display: none; }
  .review-head { padding: 18px 20px; }
  .review-head h3 { font-size: 16px; }
  .review-body { padding: 18px; }
  .review-summary { grid-template-columns: 1fr; }
  .year-header { padding: 10px 16px; font-size: 12px; }
  .semester-block { padding: 14px 16px; }
}
@media (max-width: 400px) {
  .ps-item.hide-xs { display: none; }
}

/* ── Modal (stream detail) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 79, 98, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg);
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(6, 79, 98, 0.3);
}
.modal-header {
  background: linear-gradient(135deg, var(--accent) 0%, #003545 100%);
  color: white;
  padding: 24px 28px;
  position: relative;
  flex-shrink: 0;
}
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.modal-close-btn:hover { background: rgba(255,255,255,0.3); }
.mh-code {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.modal-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.25;
  margin-bottom: 4px;
}
.mh-subtitle {
  font-size: 13px;
  opacity: 0.85;
  font-style: italic;
}
.modal-body {
  padding: 22px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.modal-footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.modal-footer .btn-block { flex: 1; padding: 12px 16px; }

.detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.df-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.df-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.df-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.detail-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.detail-section p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}
.detail-hint {
  font-size: 12px !important;
  color: var(--muted) !important;
  margin-bottom: 10px;
}
.video-container {
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-container video,
.video-container iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}
.module-list {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.module-list li {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  align-items: center;
}
.module-list li:last-child { border-bottom: none; }
.ml-code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.ml-name { font-weight: 500; color: var(--text); }
.ml-meta { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.career-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.career-pill {
  background: var(--accent-light);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .modal { max-width: 100%; max-height: 100vh; border-radius: 0; }
  .modal-header { padding: 20px 20px 18px; }
  .modal-header h2 { font-size: 18px; }
  .modal-body { padding: 18px 20px; gap: 18px; }
  .modal-footer { padding: 12px 16px; }
  .module-list li { grid-template-columns: 66px 1fr; }
  .module-list li .ml-meta { grid-column: 2; font-size: 10px; }
  .stream-grid-detailed { grid-template-columns: 1fr; gap: 14px; }
}

/* ── Stream switcher on builder page ── */
.stream-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 4px 4px 4px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.stream-switcher label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stream-switcher select {
  border: none;
  background: transparent;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  outline: none;
  cursor: pointer;
  max-width: 260px;
}
.stream-switcher select:focus { color: var(--accent-hover); }
