*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #FFFFFF;
  --primary-light: #E0E0E0;
  --accent: #FFFFFF;
  --accent-warm: #FF6B6B;
  --accent-yellow: #FFD166;
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-elevated: #1C1C1C;
  --border: #2A2A2A;
  --border-deep: #1C1C1C;
  --text: #F0F0F0;
  --text-sec: #909090;
  --text-muted: #555555;
  --text-mid: #C0C0C0;

  /* Tokens added for theming. Dark values are exactly what the app always used. */
  --on-primary: #000000;          /* text/icons sitting on a --primary fill */
  --page-bg: #060606;             /* page behind the app column on wide screens */
  --surface-deep: #0D0D0D;        /* inputs, bottom nav, expanded panels */
  --fg-rgb: 255, 255, 255;        /* translucent overlays: rgba(var(--fg-rgb), .06) */
  --warm-rgb: 255, 107, 107;
  --yellow-rgb: 255, 209, 102;
  --c-green: #00D4A1;             /* status colours (text) */
  --c-yellow: #FFD166;
  --c-red: #FF6B6B;
  /* legacy tinted neutrals still used in JS-generated markup */
  --n-muted: #55557A;
  --n-sec: #9090B0;
  --n-border: #2A2A40;
  --n-surface: #1A1A2E;
  --n-text: #F0F0FF;
  color-scheme: dark;
}

/* Light mode: black and white swapped. Chosen on the marketing site (shared
   cookie) or with the toggle here; set as data-theme on <html> before first paint. */
:root[data-theme="light"] {
  --primary: #000000;
  --primary-light: #2A2A2A;
  --accent: #000000;
  --accent-warm: #C22F2F;
  --accent-yellow: #8F5A00;
  --bg: #FFFFFF;
  --surface: #F5F5F5;
  --surface-elevated: #EBEBEB;
  --border: #D9D9D9;
  --border-deep: #E8E8E8;
  --text: #0A0A0A;
  --text-sec: #5E5E5E;
  --text-muted: #6B6B6B;
  --text-mid: #3A3A3A;

  --on-primary: #FFFFFF;
  --page-bg: #E6E6E6;
  --surface-deep: #F0F0F0;
  --fg-rgb: 0, 0, 0;
  --warm-rgb: 194, 47, 47;
  --yellow-rgb: 143, 90, 0;
  --c-green: #006F55;
  --c-yellow: #8F5A00;
  --c-red: #C22F2F;
  --n-muted: #6A6A85;
  --n-sec: #5A5A78;
  --n-border: #D4D4E0;
  --n-surface: #EDEDF5;
  --n-text: #111118;
  color-scheme: light;
}

/* JS-generated markup colours text with the raw status hexes (they also feed SVG
   stroke attributes, so they can't simply become variables). On a light
   background those hexes are too faint as *text*, so darken them there. */
:root[data-theme="light"] [style*="color:#00D4A1"] { color: var(--c-green) !important; }
:root[data-theme="light"] [style*="color:#FFD166"] { color: var(--c-yellow) !important; }
:root[data-theme="light"] [style*="color:#FF6B6B"] { color: var(--c-red) !important; }
:root[data-theme="light"] [style*="color:#6C3FF5"] { color: #5B33E0 !important; }

body {
  background: var(--page-bg);
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  width: 100%;
  max-width: 480px;
  height: 100vh;          /* fallback for browsers without dvh */
  height: 100dvh;         /* fills the device, excluding mobile browser chrome */
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* On screens taller/wider than a phone, keep the app a centered column
   and mark its edges so it reads as intentional, not cut off. */
@media (min-width: 500px) {
  body { padding: 24px 0; }
  .app-shell {
    height: calc(100dvh - 48px);
    max-height: 900px;
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
  }
}

.screen-container {
  height: 100%;
  overflow: hidden;
  position: relative;
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.screen-scroll { overflow: hidden; }

.screen-scroll .screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
  scrollbar-width: none;
}

.screen-scroll .screen-body::-webkit-scrollbar { display: none; }

.screen-scroll .screen-header {
  padding: max(20px, env(safe-area-inset-top)) 24px 0;
  flex-shrink: 0;
}

.screen-scroll .screen-footer {
  padding: 16px 24px 28px;
  flex-shrink: 0;
}

.has-nav .screen-body { padding-bottom: 8px; }

/* Tighten horizontal padding on very narrow phones so content breathes */
@media (max-width: 360px) {
  .screen-scroll .screen-body,
  .screen-scroll .screen-footer { padding-left: 16px; padding-right: 16px; }
  .screen-scroll .screen-header { padding-left: 16px; padding-right: 16px; }
  .screen-welcome { padding-left: 18px; padding-right: 18px; }
}

/* WELCOME */
.screen-welcome {
  padding: max(28px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
  justify-content: space-between;
}

.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orb-top-right {
  top: -80px; right: -80px;
  width: 300px; height: 300px;
  background: none;
}

.orb-bottom-left {
  bottom: 100px; left: -60px;
  width: 200px; height: 200px;
  background: none;
}

.welcome-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  position: relative;
}

.logo-row {
  display: flex; align-items: center;
  gap: 12px; margin-bottom: 48px;
}

.logo-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: center; font-size: 18px;
}

.logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em;
}

.welcome-headline {
  font-family: 'Syne', sans-serif;
  font-size: 40px; font-weight: 800;
  line-height: 1.1; letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gradient-text {
  color: var(--text);
}

.welcome-sub {
  color: var(--text-sec);
  font-size: 15px; line-height: 1.6;
}

.feature-list {
  display: flex; flex-direction: column; gap: 12px;
}

.feature-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px; color: var(--text-mid);
}

.feature-icon { color: var(--text-sec); font-size: 16px; }

.welcome-actions {
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600; font-size: 15px;
  border-radius: 14px; border: none;
  cursor: pointer; transition: all 0.2s;
  padding: 14px 28px; width: 100%;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--primary-light);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sec);
  border: 1px solid var(--border);
}

/* PROGRESS BAR */
.step-bar-row {
  display: flex; align-items: center;
  gap: 12px; margin-bottom: 20px;
}

.progress-track {
  flex: 1; height: 6px;
  background: var(--border);
  border-radius: 99px; overflow: hidden;
}

.progress-fill {
  height: 100%; border-radius: 99px;
  background: var(--primary);
  transition: width 0.8s cubic-bezier(.4,0,.2,1);
}

.step-label {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap;
}

.progress-labels {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 11px;
  color: var(--text-muted);
}

/* SCREEN TITLE */
.screen-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px; font-weight: 700;
  margin-bottom: 6px;
}

.screen-sub {
  color: var(--text-sec);
  font-size: 14px; margin-bottom: 16px;
}

.back-btn {
  background: none; border: none;
  color: var(--text-sec); font-size: 20px;
  cursor: pointer; margin-bottom: 24px;
  display: block;
}

/* INTEREST GRID */
.interest-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding-bottom: 16px;
}

.interest-btn {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 6px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer;
  transition: all 0.2s; text-align: left;
}

.interest-btn.active {
  background: rgba(var(--fg-rgb),0.06);
  border-color: var(--primary);
}

.interest-btn .i-icon { font-size: 22px; }

.interest-btn .i-label {
  font-size: 13px; font-weight: 500;
  color: var(--text-sec);
  font-family: 'DM Sans', sans-serif;
}

.interest-btn.active .i-label { color: var(--text); }

/* UNIVERSITY LIST */
.uni-list {
  display: flex; flex-direction: column;
  gap: 10px; padding-bottom: 16px;
}

.uni-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer;
  transition: all 0.2s;
}

.uni-item.active {
  background: rgba(var(--fg-rgb),0.04);
  border-color: var(--primary);
}

/* ── Course selection cards ───────────────────────────────── */
.course-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer;
  transition: all 0.2s; margin-bottom: 10px;
}
.course-card.active {
  background: rgba(var(--fg-rgb),0.04);
  border-color: var(--primary);
}
.course-card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-elevated);
  display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: 20px;
}
.course-card-body { flex: 1; min-width: 0; }
.course-card-name {
  font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 3px;
}
.course-card-meta {
  font-size: 11px; color: var(--text-sec);
  margin-bottom: 4px;
}
.course-card-careers {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.course-card-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 12px; transition: all 0.2s;
  align-self: center;
}
.course-card.active .course-card-check {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}

.uni-thumb {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-elevated);
  display: flex; align-items: center;
  justify-content: center;
  flex-shrink: 0; font-size: 18px;
}

.uni-info { flex: 1; }

.uni-name {
  font-size: 14px; font-weight: 600;
  color: var(--text); margin-bottom: 2px;
}

.uni-rank { font-size: 12px; color: var(--text-sec); }

.uni-match { text-align: right; }

.uni-match-pct {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  font-family: 'Syne', sans-serif;
}

.uni-match-lbl { font-size: 10px; color: var(--text-muted); }

/* SECTION LABEL */
.section-label {
  font-size: 13px; font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px; margin-top: 4px;
}

/* SUBJECT / EC ITEMS — despite the name, also used by the Extracurriculars
   activity list (renderActivities() in script.js reuses these classes). */
.subject-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.subject-info { flex: 1; }
.subject-name { font-size: 13px; font-weight: 600; }
.subject-level { font-size: 11px; color: var(--text-muted); }

.subject-remove {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer; font-size: 12px;
}

/* ADD BOX */
.add-subject-box {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px; margin-bottom: 12px;
}

.add-box-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-sec); margin-bottom: 10px;
}

.text-input {
  width: 100%;
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
  color: var(--text); font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none; display: block;
}

.text-input::placeholder { color: var(--text-muted); }
.select-input { appearance: none; }

/* FORM */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block; font-size: 13px;
  font-weight: 600; color: var(--text-mid);
  margin-bottom: 8px;
}

.form-group .text-input { padding: 13px 16px; font-size: 14px; }

/* INFO CARD */
.info-card {
  background: rgba(var(--fg-rgb),0.04);
  border: 1px solid rgba(var(--fg-rgb),0.1);
  border-radius: 16px; padding: 14px;
  display: flex; gap: 10px; margin-bottom: 12px;
}

.info-card p {
  font-size: 12px; color: var(--text-sec); line-height: 1.6;
}


/* CIRCULAR PROGRESS */
.circular-center {
  display: flex; flex-direction: column;
  align-items: center; margin-bottom: 20px;
}

.circular-wrap {
  position: relative;
  display: flex; align-items: center;
  justify-content: center;
}

.circular-wrap.small { width: 76px; height: 76px; }

.circular-svg { width: 96px; height: 96px; }
.circular-wrap.small .circular-svg { width: 76px; height: 76px; }

.circular-label {
  position: absolute;
  font-size: 21px; font-weight: 700;
  font-family: 'Syne', sans-serif;
  color: var(--text);
}

.circular-sub { margin-top: 8px; font-size: 13px; color: var(--text-sec); }

/* CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
  margin-bottom: 14px;
}

.card-gradient {
  background: var(--surface);
  border-color: var(--border);
}

.card-danger {
  background: rgba(var(--warm-rgb),0.06);
  border-color: rgba(var(--warm-rgb),0.19);
}

.card-section-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* SKILL BARS */
.skill-bar-row { margin-bottom: 14px; }

.skill-bar-top {
  display: flex; justify-content: space-between;
  margin-bottom: 5px;
}

.skill-bar-name { font-size: 13px; color: var(--text-mid); }

.skill-bar-val {
  font-size: 13px; font-weight: 700;
  font-family: 'Syne', sans-serif;
}

/* GAP LIST */
.danger-title {
  font-size: 13px; font-weight: 600;
  color: var(--accent-warm); margin-bottom: 10px;
}

.gap-item {
  display: flex; gap: 10px; margin-bottom: 7px;
  font-size: 13px; color: var(--text-mid);
  align-items: flex-start;
}

.gap-arrow { color: var(--accent-warm); margin-top: 1px; }

/* DASHBOARD */
.dashboard-topbar {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 20px;
}

.greeting-sub { font-size: 13px; color: var(--text-sec); margin-bottom: 2px; }

.greeting-name {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 700;
}

/* ─── NOTIFICATIONS ────────────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notif-bell-wrap { position: relative; }

.notif-bell {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; position: relative;
  color: var(--text);
}
.notif-bell:hover { border-color: rgba(var(--fg-rgb),0.3); }

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: var(--accent-warm);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.notif-panel {
  position: absolute;
  top: 48px; right: 0;
  width: 320px; max-width: calc(100vw - 40px);
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 50;
}

.notif-panel-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-sec);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-deep);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.notif-unread { background: rgba(var(--fg-rgb),0.03); }

.notif-item-course {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 2px;
}
.notif-item-uni { font-size: 11px; color: var(--text-sec); margin-bottom: 6px; }
.notif-item-change { font-size: 11.5px; color: var(--text-mid); line-height: 1.5; margin-bottom: 10px; }
.notif-item-change b { color: var(--accent-warm); }

.notif-item-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notif-item-btn {
  font-size: 11px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px;
  cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text-mid);
}
.notif-item-btn-primary {
  background: var(--text); color: var(--bg);
  border-color: var(--text);
}
.notif-item-btn:disabled { opacity: 0.5; cursor: default; }

.avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: center;
  font-size: 16px; font-weight: 700;
}

.readiness-row {
  display: flex; justify-content: space-between;
  align-items: center;
}

.readiness-label {
  font-size: 12px; color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 4px;
}

.readiness-score { font-family: 'Syne', sans-serif; }
.score-big { font-size: 36px; font-weight: 800; color: var(--text); }
.score-denom { font-size: 20px; color: var(--text-sec); }
.readiness-trend { font-size: 12px; color: var(--text-sec); margin-top: 4px; }

/* MILESTONE STRIP */
.milestone-strip {
  display: flex; gap: 10px;
  overflow-x: auto; padding-bottom: 8px;
  margin-bottom: 16px; scrollbar-width: none;
}

.milestone-strip::-webkit-scrollbar { display: none; }

.milestone-chip {
  flex-shrink: 0; min-width: 116px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; text-align: center;
}

.milestone-chip.milestone-unlocked {
  background: var(--surface);
  border-color: var(--text);
}

.milestone-chip-icon { font-size: 20px; margin-bottom: 4px; }
.milestone-chip-name { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.3; margin-bottom: 2px; }
.milestone-chip-sub { font-size: 10px; color: var(--text-muted); }

@keyframes milestoneGlow {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: none; }
}

/* QUICK ACTIONS */
.quick-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 20px;
}

.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
  cursor: pointer; transition: border-color 0.15s;
}

.quick-card:hover { border-color: rgba(var(--fg-rgb),0.25); }

.quick-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center;
  justify-content: center;
  font-size: 16px; margin-bottom: 10px;
}

.quick-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.quick-sub { font-size: 12px; color: var(--text-muted); }

/* TODAY LIST */
.today-list {
  display: flex; flex-direction: column;
  gap: 8px; margin-bottom: 20px;
}

.today-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.today-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  transition: all 0.2s;
}

.today-check.today-done {
  background: var(--primary);
  border-color: var(--primary);
}

.today-check.today-done::after {
  content: '✓';
  color: var(--on-primary);
  font-size: 10px; font-weight: 700;
}

.today-text { font-size: 13px; color: var(--text-mid); flex: 1; line-height: 1.4; }
.today-text-done { color: var(--text-muted); text-decoration: line-through; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; flex-shrink: 0;
}

.badge-danger { background: rgba(var(--warm-rgb),0.13); color: var(--c-red); border: 1px solid rgba(var(--warm-rgb),0.27); }
.badge-warn   { background: rgba(var(--yellow-rgb),0.13); color: var(--c-yellow); border: 1px solid rgba(var(--yellow-rgb),0.27); }
.badge-green  { background: rgba(var(--fg-rgb),0.07); color: var(--text-mid); border: 1px solid rgba(var(--fg-rgb),0.15); }
.badge-purple { background: rgba(var(--fg-rgb),0.07); color: var(--text-mid); border: 1px solid rgba(var(--fg-rgb),0.15); }
.badge-muted  { background: rgba(144,144,144,0.13); color: var(--text-sec); border: 1px solid rgba(144,144,144,0.27); }

/* BOTTOM NAV */
.bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--surface-deep);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 10px 0 max(20px, env(safe-area-inset-bottom));
  flex-shrink: 0; z-index: 20;
}

.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); transition: color 0.2s;
  position: relative; font-family: 'DM Sans', sans-serif;
}

.nav-btn.nav-active { color: var(--primary); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; }

.nav-bar {
  position: absolute; top: -10px;
  width: 32px; height: 2px;
  background: var(--primary);
  border-radius: 0 0 2px 2px;
}

/* PHASE TABS */
.phase-tabs {
  display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}

.phase-tabs::-webkit-scrollbar { display: none; }

.phase-tab {
  padding: 7px 13px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-sec); transition: all 0.2s;
}

.phase-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* MILESTONE BANNER */
.milestone-banner {
  padding: 14px 16px; border-radius: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.milestone-banner.unlocked {
  background: var(--surface);
  border-color: var(--text);
}

.milestone-banner-row {
  display: flex; align-items: flex-start; gap: 12px;
}

.milestone-banner-icon { font-size: 24px; flex-shrink: 0; }

.milestone-banner-status {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 4px;
}

.milestone-banner-title {
  font-size: 15px; font-weight: 700;
  font-family: 'Syne', sans-serif;
  margin-bottom: 8px;
}

.milestone-criterion {
  display: flex; gap: 8px;
  align-items: flex-start;
  font-size: 12px; margin-bottom: 5px;
}

/* CATEGORY ACCORDION */
.category-wrap { margin-bottom: 10px; }

.category-header {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer;
  text-align: left;
}

.category-header.open { border-radius: 14px 14px 0 0; }

.category-header-left {
  display: flex; align-items: center; gap: 10px;
}

.category-label { font-size: 14px; font-weight: 600; color: var(--text); }

.category-chevron {
  color: var(--text-muted); font-size: 11px;
  transition: transform 0.2s;
}

.category-chevron.open { transform: rotate(180deg); }

.category-body {
  background: var(--surface-deep);
  border-radius: 0 0 14px 14px;
  border: 1px solid var(--border);
  border-top: none;
  overflow: hidden; display: none;
}

.category-body.open { display: block; }

/* TASK ITEM */
.task-item {
  padding: 13px 14px;
  border-top: 1px solid var(--border-deep);
}

.task-item:first-child { border-top: none; }

.task-row { display: flex; gap: 12px; align-items: flex-start; }

.task-check {
  width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--border); flex-shrink: 0;
  margin-top: 2px; cursor: pointer;
  display: flex; align-items: center;
  justify-content: center;
  transition: all 0.2s; background: transparent;
}

.task-check.done {
  background: var(--primary);
  border-color: var(--primary);
}

.task-check.done::after {
  content: '✓';
  color: var(--on-primary); font-size: 10px; font-weight: 700;
}

.task-content { flex: 1; }

.task-title {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 5px; line-height: 1.4;
}

.task-title.done { color: var(--text-muted); text-decoration: line-through; }
.task-detail { font-size: 12px; color: var(--text-sec); line-height: 1.6; margin-bottom: 7px; }
.task-tags { display: flex; gap: 8px; flex-wrap: wrap; }

/* ADMISSIONS */
.admission-card { margin-bottom: 12px; }

.admission-row {
  display: flex; align-items: flex-start; gap: 14px;
}

.admission-thumb {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-elevated);
  display: flex; align-items: center;
  justify-content: center;
  flex-shrink: 0; font-size: 20px;
}

.admission-info { flex: 1; }
.admission-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.admission-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }

.admission-bar-row {
  display: flex; align-items: center; gap: 10px;
}

.admission-pct {
  font-size: 12px; font-weight: 700;
  font-family: 'Syne', sans-serif; flex-shrink: 0;
}

.admission-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 8px;
}

/* PROFILE */
.profile-hero {
  padding: 40px 24px 24px;
  text-align: center; position: relative;
}

.profile-hero-bg {
  position: absolute; top: 0; left: 0; right: 0;
  height: 120px;
  background: none;
}

.profile-avatar {
  width: 80px; height: 80px; border-radius: 24px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: center; font-size: 32px;
  font-weight: 700; margin: 0 auto 12px;
  position: relative; z-index: 1;
}

.profile-name {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 700; margin-bottom: 4px;
}

.profile-meta { font-size: 14px; color: var(--text-sec); margin-bottom: 6px; }

.profile-stats {
  display: flex; gap: 1px; margin-top: 20px;
  background: var(--border);
  border-radius: 14px; overflow: hidden;
}

.stat-cell {
  flex: 1; padding: 12px 8px;
  background: var(--surface); text-align: center;
}

.stat-val {
  font-family: 'Syne', sans-serif;
  font-size: 20px; font-weight: 700;
  color: var(--text);
}

.stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.milestone-card { display: flex; gap: 14px; align-items: center; }
.milestone-card-icon { font-size: 22px; }
.milestone-card-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.milestone-card-desc { font-size: 12px; color: var(--text-sec); }

.highlight-card { display: flex; gap: 14px; align-items: center; }
.highlight-icon { font-size: 24px; }
.highlight-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.highlight-sub { font-size: 12px; color: var(--text-sec); }

/* ── UNIVERSITY SLIDER ───────────────────────────────────── */
.uni-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 4px;
  scrollbar-width: none;
}
.uni-slider::-webkit-scrollbar { display: none; }

.uni-slide-card {
  flex-shrink: 0;
  width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.uni-slide-card:hover { border-color: rgba(var(--fg-rgb),0.3); transform: translateY(-2px); }
.uni-slide-card.active-card {
  border-color: var(--primary);
  background: rgba(var(--fg-rgb),0.04);
}

.uni-slide-name {
  font-size: 13px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.uni-slide-course {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.uni-slide-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.uni-slide-score {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
}
.uni-slide-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.4;
}

/* ── UNIVERSITY DETAIL PANEL ─────────────────────────────── */
.uni-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* SKELETON LOADERS — placeholder blocks shaped like the content they precede */
.sk {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-elevated) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  display: block;
}
.sk-circle { border-radius: 50%; }
.sk-pill   { border-radius: 99px; }
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.uni-detail-name {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.uni-detail-meta { font-size: 12px; color: var(--text-sec); margin-bottom: 14px; }

.uni-detail-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.uni-detail-score-big {
  font-family: 'Syne', sans-serif;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}
.uni-detail-score-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.uni-course-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(var(--fg-rgb),0.06);
  border: 1px solid rgba(var(--fg-rgb),0.15);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-mid);
  margin-right: 6px;
  margin-bottom: 6px;
}

.gap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-deep);
}
.gap-row:last-child { border-bottom: none; }
.gap-row-name { font-size: 12px; color: var(--text-mid); }
.gap-row-score { font-size: 12px; font-weight: 700; font-family: 'Syne', sans-serif; }

/* ── University roadmap pill selector ──────────────────────── */
.uni-roadmap-selector {
  margin-bottom: 16px;
}

.uni-pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.uni-pill-row::-webkit-scrollbar { display: none; }

.uni-roadmap-pill {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Syne', sans-serif;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.uni-roadmap-pill:hover {
  border-color: rgba(var(--fg-rgb),0.3);
  color: var(--text);
}
.uni-roadmap-pill.active {
  background: rgba(var(--fg-rgb),0.08);
  border-color: var(--primary);
  color: var(--primary);
}
.uni-roadmap-pill.cached::after {
  content: ' ✓';
  color: var(--text-sec);
  font-size: 10px;
}

/* ── Social sign-in ─────────────────────────────────────────── */
.social-auth-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}
.social-auth-row:empty { display: none; }
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--n-border);
  transition: filter 0.15s, opacity 0.15s;
}
.social-btn:hover { filter: brightness(1.08); }
.social-btn:active { opacity: 0.85; }
.social-btn:disabled { opacity: 0.6; cursor: default; }
.social-btn-icon { width: 18px; height: 18px; flex-shrink: 0; }
.social-btn-google    { background: #fff;    color: #1f1f1f; border-color: #dadce0; }
.social-btn-apple     { background: #000;    color: #fff;    border-color: #000; }
.social-btn-microsoft { background: #2f2f2f; color: #fff;    border-color: #3a3a3a; }

.social-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--text-muted, #55557A);
  font-size: 12px;
}
.social-auth-divider::before,
.social-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--n-border);
}

/* ─── SKILL RATING NUMBERLINE ──────────────────────────────── */
/* Shared, constant 1-10 benchmark legend — rendered once, referenced by
   every skill tag's slider below it (the benchmarks never change per skill). */
.rating-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  padding: 14px;
  margin-bottom: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.rating-legend-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.rating-legend-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
  width: 14px;
}
.rating-legend-text {
  font-size: 10.5px;
  color: var(--text-sec);
  line-height: 1.4;
}

.rating-row { margin-bottom: 30px; }
.rating-tag-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.rating-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  margin: 8px 0;
}
.rating-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--text);
  cursor: pointer;
}
.rating-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--text);
  cursor: pointer;
}

.rating-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}
.rating-tick {
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  width: 16px;
  text-align: center;
  transition: color 0.15s, font-weight 0.15s;
}
.rating-tick.active-tick {
  color: var(--text);
  font-weight: 800;
}

.rating-caption {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-sec);
  line-height: 1.5;
}
.rating-caption b { color: var(--text); }
.social-auth-divider.hidden { display: none; }

/* ─── THEME TOGGLE ─────────────────────────────────────────── */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.15s;
}
.theme-toggle:hover { border-color: rgba(var(--fg-rgb), 0.3); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.theme-toggle .half { fill: currentColor; }
.welcome-theme { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 2; }
.profile-theme { position: absolute; top: 12px; right: 0; z-index: 2; }

/* ─── RESPONSIVE ───────────────────────────────────────────── */
/* Welcome: the headline block scrolls if it has to, while the buttons stay
   pinned in view — previously the buttons could be pushed off a short phone
   screen with no way to reach them. */
.screen-welcome { overflow: hidden; }
.welcome-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; scrollbar-width: none;
  justify-content: flex-start;              /* auto margins below centre it only when there is room */
  gap: clamp(16px, 3.2vh, 32px);
}
.welcome-body::-webkit-scrollbar { display: none; }
.welcome-body > :first-child { margin-top: auto; }
.welcome-body > :last-child  { margin-bottom: auto; }
.welcome-actions { flex-shrink: 0; padding-top: 12px; }
.logo-row { margin-bottom: clamp(20px, 5vh, 48px); }
.welcome-headline { font-size: clamp(30px, 10.5vw, 40px); }

/* The decorative off-canvas orbs poke past the screen edge. overflow:hidden still
   lets a focus or tap slide the whole screen sideways; overflow:clip forbids even
   that (the plain hidden line is the fallback for older browsers). */
.app-shell, .screen-container, .screen { overflow: hidden; overflow: clip; }

/* The bottom nav is absolutely positioned, so a scrolling body that runs to the
   bottom of the screen slides underneath it and its last ~68px can never be
   scrolled clear. Screens without their own spacer (Roadmap, Skills) reserve
   the nav's height instead: 10px top + ~38px buttons + bottom padding. */
.nav-clear { margin-bottom: calc(48px + max(20px, env(safe-area-inset-bottom))); }

/* Safe areas: notches and home indicators */
.screen-scroll .screen-footer { padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 8px)); }

/* Short phones (e.g. 375x667 and below) */
@media (max-height: 740px) {
  .screen-welcome { padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .logo-row { margin-bottom: 20px; }
  .welcome-headline { font-size: clamp(30px, 9vw, 34px); margin-bottom: 10px; }
  .welcome-sub { font-size: 14px; line-height: 1.5; }
  .feature-list { gap: 6px; }
  .feature-item { padding: 8px 14px; font-size: 13px; }
  .screen-scroll .screen-header { padding-top: max(14px, env(safe-area-inset-top)); }
  .step-bar-row { margin-bottom: 12px; }
  .screen-scroll .screen-footer { padding-top: 12px; padding-bottom: max(16px, calc(env(safe-area-inset-bottom) + 6px)); }
}
@media (max-height: 660px) {
  .feature-list { display: none; }          /* keep the buttons in reach on very short screens */
  .screen-title { font-size: 21px; }
}

/* Phones held sideways / very short viewports: drop the framed-card look, use every pixel */
@media (min-width: 500px) and (max-height: 600px) {
  body { padding: 0; }
  .app-shell { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; box-shadow: none; }
}

/* Tablets and desktop: a wider column instead of a phone-sized strip */
@media (min-width: 768px) { .app-shell { max-width: 560px; } }
@media (min-width: 1100px) { .app-shell { max-width: 620px; } }

/* Touch devices: 16px inputs stop iOS Safari zooming the page in on focus (which
   pushes part of the screen out of view), and back buttons get a proper hit area. */
@media (max-width: 768px) {
  .text-input, .form-group .text-input { font-size: 16px; }
}
.back-btn { padding: 10px 14px 10px 0; margin: -10px 0 14px; }

/* Long names must wrap instead of forcing sideways scroll */
.uni-info, .subject-info, .admission-info, .task-content, .course-card-body { min-width: 0; }
.uni-name, .course-card-name, .subject-name, .admission-name, .greeting-name { overflow-wrap: anywhere; }
.dashboard-topbar > div:first-child { min-width: 0; flex: 1; }
.topbar-right { flex-shrink: 0; }
