@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Syne:wght@700;800&display=swap');

:root {
  --bg: #06080e;
  --s1: #0c1019;
  --s2: #101520;
  --s3: #161d2e;
  --s4: #1c2538;
  --brd: rgba(110,170,255,0.09);
  --brd2: rgba(110,170,255,0.2);
  --brd3: rgba(110,170,255,0.32);
  --blue: #4f8ef7;
  --blue2: #3a7de8;
  --violet: #8b6fe8;
  --green: #2dd4a0;
  --orange: #f5a623;
  --pink: #e85d9e;
  --red: #f04848;
  --cyan: #1fd1e8;
  --yellow: #f7c948;
  --text: #d8e2f5;
  --text2: #a0b3cc;
  --muted: #3d5068;
  --muted2: #6b82a0;
  --mono: 'DM Mono', monospace;
  --sans: 'Plus Jakarta Sans', sans-serif;
  --display: 'Syne', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  display: flex;
  font-size: 14px;
  line-height: 1.5;
}

/* ── STARFIELD ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(1px 1px at 7% 11%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 23% 38%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 41% 17%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 59% 71%, rgba(255,255,255,.25), transparent),
    radial-gradient(1px 1px at 77% 27%, rgba(255,255,255,.45), transparent),
    radial-gradient(1px 1px at 89% 54%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 14% 83%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 51% 91%, rgba(255,255,255,.28), transparent),
    radial-gradient(1.5px 1.5px at 33% 62%, rgba(79,142,247,.4), transparent),
    radial-gradient(ellipse 600px 250px at 88% 4%, rgba(79,142,247,.05), transparent),
    radial-gradient(ellipse 450px 350px at 4% 92%, rgba(139,111,232,.06), transparent);
}

/* ── SIDEBAR ── */
.sidebar {
  width: 220px; min-width: 220px; height: 100vh;
  background: var(--s1);
  border-right: 1px solid var(--brd);
  display: flex; flex-direction: column;
  z-index: 20; flex-shrink: 0;
  position: relative;
}

.logo-wrap {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--brd);
}
.logo-mark {
  display: flex; align-items: center; gap: 9px; margin-bottom: 3px;
}
.logo-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.logo-name {
  font-family: var(--display);
  font-size: 1.2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.logo-tag {
  font-size: .57rem; letter-spacing: 2.5px; color: var(--muted2);
  text-transform: uppercase; padding-left: 39px;
}

nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
nav::-webkit-scrollbar { width: 3px; }
nav::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 2px; }

.nav-label {
  font-size: .57rem; letter-spacing: 2.5px; color: var(--muted);
  text-transform: uppercase; padding: 0 10px;
  margin: 10px 0 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; color: var(--muted2);
  font-size: .8rem; font-weight: 500;
  transition: all .15s; margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: rgba(79,142,247,.07); color: var(--text); }
.nav-item.active {
  background: rgba(79,142,247,.12); color: var(--blue);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 2px;
  background: var(--blue);
}
.nav-icon { width: 18px; text-align: center; font-size: .85rem; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--blue);
  color: #fff; font-size: .55rem; font-weight: 700;
  padding: 1px 5px; border-radius: 10px;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--brd);
}
.user-row {
  display: flex; align-items: center; gap: 9px; margin-bottom: 8px;
}
.user-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .82rem; color: #fff; flex-shrink: 0;
}
.user-name { font-size: .8rem; font-weight: 700; }
.user-sub { font-size: .62rem; color: var(--muted2); }
.sidebar-reset {
  font-size: .6rem; color: var(--muted); cursor: pointer;
  text-decoration: underline; display: block; text-align: center;
  padding: 4px;
}
.sidebar-reset:hover { color: var(--red); }

/* ── MAIN ── */
.main { flex: 1; height: 100vh; overflow-y: auto; position: relative; z-index: 1; }
.main::-webkit-scrollbar { width: 5px; }
.main::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 3px; }

.page { display: none; padding: 26px 32px; animation: fadeUp .3s ease; }
.page.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CARDS ── */
.card {
  background: var(--s1); border: 1px solid var(--brd);
  border-radius: 14px; padding: 20px;
  transition: border-color .2s;
}
.card:hover { border-color: var(--brd2); }
.card-title {
  font-family: var(--display); font-weight: 700;
  font-size: .85rem; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px;
}

/* ── GRID ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; margin-bottom: 18px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--s1); border: 1px solid var(--brd);
  border-radius: 12px; padding: 16px;
  position: relative; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--brd2); }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--accent, var(--blue));
}
.stat-val { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; line-height: 1.1; margin: 8px 0 2px; }
.stat-lbl { font-size: .67rem; color: var(--muted2); }
.stat-change { font-size: .63rem; margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
  padding: 7px 15px; border-radius: 8px; border: none;
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .15s; display: inline-flex;
  align-items: center; gap: 5px;
}
.btn-primary   { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue2); transform: translateY(-1px); }
.btn-ghost     { background: rgba(79,142,247,.1); color: var(--blue); border: 1px solid rgba(79,142,247,.2); }
.btn-ghost:hover { background: rgba(79,142,247,.18); }
.btn-danger    { background: rgba(240,72,72,.1); color: var(--red); border: 1px solid rgba(240,72,72,.15); }
.btn-danger:hover { background: rgba(240,72,72,.2); }
.btn-success   { background: rgba(45,212,160,.1); color: var(--green); border: 1px solid rgba(45,212,160,.15); }
.btn-success:hover { background: rgba(45,212,160,.2); }
.btn-sm { padding: 4px 10px; font-size: .7rem; border-radius: 6px; }
.btn-lg { padding: 11px 24px; font-size: .88rem; border-radius: 10px; }

/* ── INPUTS ── */
input, textarea, select {
  background: var(--s2); border: 1px solid var(--brd);
  border-radius: 8px; padding: 9px 12px;
  color: var(--text); font-family: var(--sans);
  font-size: .8rem; width: 100%; outline: none;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
select option { background: var(--s2); }
textarea { resize: vertical; min-height: 64px; }
.form-label { font-size: .68rem; color: var(--muted2); margin-bottom: 4px; display: block; letter-spacing: .4px; }
.form-row { margin-bottom: 12px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 200; display: none;
  align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--s1); border: 1px solid var(--brd2);
  border-radius: 16px; padding: 26px;
  width: 460px; max-width: 96vw;
  animation: fadeUp .2s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal::-webkit-scrollbar { width: 3px; }
.modal::-webkit-scrollbar-thumb { background: var(--brd); }
.modal-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 999;
  background: var(--s1); border: 1px solid var(--brd2);
  border-radius: 10px; padding: 11px 17px; font-size: .79rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  display: none; animation: fadeUp .2s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { display: flex; }

/* ── PROGRESS BAR ── */
.prog-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 2px; transition: width .7s ease; }
.prog-bar.thin { height: 3px; }

/* ── BADGE ── */
.badge {
  font-size: .58rem; padding: 2px 8px; border-radius: 20px;
  font-weight: 700; letter-spacing: .3px;
}
.badge-blue { background: rgba(79,142,247,.12); color: var(--blue); }
.badge-green { background: rgba(45,212,160,.12); color: var(--green); }
.badge-orange { background: rgba(245,166,35,.12); color: var(--orange); }
.badge-red { background: rgba(240,72,72,.12); color: var(--red); }
.badge-violet { background: rgba(139,111,232,.12); color: var(--violet); }

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 22px; }
.page-title { font-family: var(--display); font-size: 1.45rem; font-weight: 800; letter-spacing: -.4px; margin-bottom: 3px; }
.page-sub { color: var(--muted2); font-size: .76rem; }

/* ── TABS ── */
.tab-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-btn {
  padding: 5px 13px; border-radius: 20px;
  border: 1px solid var(--brd); background: transparent;
  color: var(--muted2); font-size: .72rem;
  font-family: var(--sans); cursor: pointer; transition: all .15s;
}
.tab-btn:hover { border-color: var(--brd2); color: var(--text); }
.tab-btn.active {
  background: rgba(79,142,247,.15); color: var(--blue);
  border-color: rgba(79,142,247,.3);
}

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted2); }
.empty-icon { font-size: 2.2rem; margin-bottom: 10px; }
.empty-text { font-size: .82rem; }

/* ── URGENCY COLOURS ── */
.urg-r { color: var(--red); }
.urg-o { color: var(--orange); }
.urg-b { color: var(--blue); }
.urg-g { color: var(--green); }

/* ── TASK ITEMS ── */
.task-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; background: var(--s2);
  border-radius: 9px; margin-bottom: 7px;
  border: 1px solid transparent;
  transition: all .15s; cursor: pointer;
}
.task-item:hover { border-color: var(--brd); }
.task-item.done { opacity: .42; }
.task-check {
  width: 19px; height: 19px; border-radius: 5px;
  border: 2px solid var(--brd2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s; font-size: .65rem;
}
.task-item.done .task-check { background: var(--green); border-color: var(--green); color: #fff; }
.task-text { flex: 1; font-size: .8rem; }
.task-item.done .task-text { text-decoration: line-through; }
.task-subject-tag {
  font-size: .62rem; padding: 2px 7px; border-radius: 20px;
  font-weight: 600; flex-shrink: 0;
}
.task-delete { color: var(--muted); font-size: .75rem; padding: 2px 5px; border-radius: 3px; opacity: 0; transition: opacity .12s; }
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--red); }

/* ── POMODORO ── */
.pomo-ring { position: relative; width: 200px; height: 200px; margin: 20px auto; }
.pomo-ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--s2); stroke-width: 11; }
.ring-fill {
  fill: none; stroke: var(--blue); stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: 534; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .4s;
}
.pomo-abs { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pomo-time { font-family: var(--mono); font-size: 2.3rem; font-weight: 500; letter-spacing: 2px; }
.pomo-phase-lbl { font-size: .64rem; color: var(--muted2); letter-spacing: 2px; text-transform: uppercase; margin-top: 3px; }
.pomo-ctrl { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.pomo-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--brd); background: var(--s2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; transition: all .18s;
}
.pomo-btn.main { width: 58px; height: 58px; background: var(--blue); border-color: var(--blue); font-size: 1.2rem; }
.pomo-btn:hover { transform: scale(1.06); }

/* ── FLASHCARDS ── */
.fc-wrap { perspective: 1000px; height: 180px; cursor: pointer; user-select: none; margin-bottom: 14px; }
.fc-inner {
  width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
  border-radius: 14px; position: relative;
}
.fc-inner.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; border-radius: 14px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; backface-visibility: hidden; text-align: center;
}
.fc-front { background: linear-gradient(135deg,rgba(79,142,247,.1),rgba(139,111,232,.1)); border: 1px solid rgba(79,142,247,.2); }
.fc-back  { background: linear-gradient(135deg,rgba(45,212,160,.08),rgba(79,142,247,.08)); border: 1px solid rgba(45,212,160,.2); transform: rotateY(180deg); }
.fc-question { font-size: .93rem; font-weight: 600; line-height: 1.5; }
.fc-answer { font-family: var(--mono); font-size: .88rem; color: var(--green); line-height: 1.6; }
.fc-hint { font-size: .63rem; color: var(--muted2); margin-top: 8px; }
.rate-btn { flex: 1; padding: 9px; border-radius: 9px; border: none; cursor: pointer; font-family: var(--sans); font-size: .76rem; font-weight: 600; transition: all .18s; }
.rate-wrong  { background: rgba(240,72,72,.1); color: var(--red); border: 1px solid rgba(240,72,72,.12); }
.rate-wrong:hover  { background: rgba(240,72,72,.2); }
.rate-hard   { background: rgba(245,166,35,.1); color: var(--orange); border: 1px solid rgba(245,166,35,.12); }
.rate-hard:hover   { background: rgba(245,166,35,.2); }
.rate-good   { background: rgba(45,212,160,.1); color: var(--green); border: 1px solid rgba(45,212,160,.12); }
.rate-good:hover   { background: rgba(45,212,160,.2); }

/* ── QUIZ ── */
.quiz-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--brd); cursor: pointer;
  margin-bottom: 8px; background: var(--s2);
  transition: all .15s; font-size: .82rem;
}
.quiz-opt:hover:not(.disabled) { border-color: var(--brd2); background: var(--s3); }
.quiz-opt.correct { border-color: var(--green); background: rgba(45,212,160,.1); color: var(--green); }
.quiz-opt.wrong   { border-color: var(--red); background: rgba(240,72,72,.1); color: var(--red); }
.quiz-opt.disabled { cursor: default; }
.opt-letter {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--s3); display: flex; align-items: center;
  justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0;
}
.quiz-question-text { font-size: .92rem; font-weight: 600; line-height: 1.5; margin-bottom: 16px; }
.quiz-explain {
  padding: 12px 14px; border-radius: 9px;
  background: rgba(79,142,247,.07); border: 1px solid rgba(79,142,247,.15);
  font-size: .77rem; color: var(--muted2); line-height: 1.6;
  display: none; margin-top: 10px;
}
.quiz-prog-dots { display: flex; gap: 4px; margin-bottom: 18px; }
.qpd { height: 4px; border-radius: 2px; background: var(--s3); flex: 1; transition: background .3s; }
.qpd.done-c { background: var(--green); }
.qpd.done-w { background: var(--red); }
.qpd.current { background: var(--blue); }

/* ── RESOURCES ── */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 12px; }
.res-card {
  background: var(--s1); border: 1px solid var(--brd);
  border-radius: 12px; padding: 17px;
  transition: all .18s; cursor: pointer;
  text-decoration: none; display: block; color: inherit;
}
.res-card:hover { border-color: var(--brd2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.res-type { font-size: .58rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; font-weight: 700; }
.res-title { font-size: .84rem; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.res-desc { font-size: .71rem; color: var(--muted2); line-height: 1.45; }
.res-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.res-open { font-size: .62rem; color: var(--blue); opacity: .7; }

/* ── PAST PAPERS ── */
.pp-card {
  background: var(--s2); border: 1px solid var(--brd);
  border-radius: 9px; padding: 13px 15px;
  text-decoration: none; color: var(--text);
  transition: all .15s; display: flex; align-items: center; gap: 12px;
}
.pp-card:hover { border-color: var(--brd2); background: var(--s3); }
.pp-year { font-family: var(--mono); font-size: 1rem; font-weight: 500; min-width: 38px; color: var(--blue); }
.pp-detail { flex: 1; }
.pp-paper-name { font-size: .76rem; font-weight: 600; }
.pp-board-tag { font-size: .62rem; color: var(--muted2); margin-top: 1px; }
.pp-links { display: flex; gap: 5px; margin-top: 5px; }
.pp-link {
  font-size: .62rem; padding: 3px 8px; border-radius: 5px;
  font-weight: 700; text-decoration: none; transition: all .15s;
}
.pp-q  { background: rgba(79,142,247,.1); color: var(--blue); border: 1px solid rgba(79,142,247,.2); }
.pp-q:hover  { background: rgba(79,142,247,.2); }
.pp-ms { background: rgba(45,212,160,.1); color: var(--green); border: 1px solid rgba(45,212,160,.2); }
.pp-ms:hover { background: rgba(45,212,160,.2); }

/* ── EXAM CARDS ── */
.exam-card {
  background: var(--s1); border: 1px solid var(--brd);
  border-radius: 12px; padding: 16px 20px;
  display: flex; align-items: center; gap: 15px;
  margin-bottom: 10px; transition: border-color .2s;
}
.exam-card:hover { border-color: var(--brd2); }
.exam-days-big { font-family: var(--mono); font-size: 1.9rem; font-weight: 500; min-width: 52px; text-align: center; line-height: 1; }
.exam-days-lbl { font-size: .5rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted2); margin-top: 2px; text-align: center; }
.exam-info { flex: 1; }
.exam-name { font-size: .82rem; font-weight: 700; }
.exam-meta { font-size: .67rem; color: var(--muted2); margin-top: 3px; }

/* ── GRADES ── */
.grade-subject-card {
  background: var(--s1); border: 1px solid var(--brd);
  border-radius: 12px; padding: 17px;
  transition: border-color .18s;
}
.grade-subject-card:hover { border-color: var(--brd2); }
.grade-header { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.grade-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.grade-subj-name { font-size: .83rem; font-weight: 700; flex: 1; }
.grade-current { font-family: var(--mono); font-size: 1.3rem; font-weight: 500; }
.grade-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .74rem; color: var(--muted2); }
.grade-sel { width: auto; font-size: .74rem; padding: 4px 8px; flex: 1; }
.grade-val { font-family: var(--mono); font-size: .85rem; font-weight: 600; }

/* ── PLANNER ── */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px; margin-bottom: 18px;
}
.day-col { min-height: 160px; }
.day-header {
  font-size: .67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted2);
  text-align: center; padding: 6px 0; margin-bottom: 6px;
  border-bottom: 1px solid var(--brd);
}
.day-header.today { color: var(--blue); }
.plan-slot {
  background: var(--s2); border-radius: 6px;
  padding: 6px 8px; margin-bottom: 5px;
  font-size: .68rem; font-weight: 600; line-height: 1.3;
  border-left: 3px solid var(--blue);
  cursor: pointer; transition: opacity .15s;
}
.plan-slot:hover { opacity: .8; }
.plan-add {
  width: 100%; margin-top: 4px;
  background: rgba(79,142,247,.06);
  border: 1px dashed rgba(79,142,247,.2);
  border-radius: 6px; color: var(--muted);
  font-size: .65rem; padding: 5px; cursor: pointer;
  font-family: var(--sans); transition: all .15s;
}
.plan-add:hover { background: rgba(79,142,247,.1); color: var(--blue); }

/* ── ANALYTICS ── */
.chart-wrap { position: relative; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.bar-body {
  width: 100%; border-radius: 5px 5px 0 0;
  background: linear-gradient(to top, var(--blue), rgba(79,142,247,.3));
  min-height: 4px; transition: height .8s ease;
}
.bar-lbl { font-size: .6rem; color: var(--muted2); }
.bar-val { font-family: var(--mono); font-size: .62rem; color: var(--text2); }
.donut-wrap { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.donut-wrap svg { transform: rotate(-90deg); }
.donut-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-num { font-family: var(--mono); font-size: 1.4rem; font-weight: 500; }
.donut-lbl { font-size: .6rem; color: var(--muted2); margin-top: 1px; }
.stat-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--brd); }
.stat-row:last-child { border-bottom: none; }
.stat-row-icon { font-size: 1rem; width: 26px; text-align: center; }
.stat-row-label { flex: 1; font-size: .78rem; }
.stat-row-val { font-family: var(--mono); font-size: .82rem; font-weight: 500; }

/* ── NOTES ── */
.note-area {
  width: 100%; min-height: 340px; font-size: .84rem; line-height: 1.75;
  padding: 16px; background: var(--s2);
  border: 1px solid var(--brd); border-radius: 12px;
  color: var(--text); font-family: var(--sans);
  resize: none; outline: none; transition: border-color .2s;
}
.note-area:focus { border-color: var(--blue); }

/* ── STREAK ── */
.streak-day {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .58rem; font-weight: 700;
  background: var(--s2); color: var(--muted);
}
.streak-day.done { background: rgba(45,212,160,.15); color: var(--green); }
.streak-day.today { background: rgba(79,142,247,.15); color: var(--blue); border: 1px solid rgba(79,142,247,.3); }

/* ── ONBOARDING ── */
#onboarding {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 20px;
}
#onboarding.hidden { display: none; }
.ob-wrap { width: 820px; max-width: 98vw; }
.ob-step { display: none; animation: fadeUp .3s ease; }
.ob-step.active { display: block; }
.ob-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.ob-logo-icon { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg,var(--blue),var(--violet)); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.ob-logo-name { font-family: var(--display); font-size: 1.6rem; font-weight: 800; background: linear-gradient(135deg,var(--blue),var(--violet)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ob-tagline { color: var(--muted2); font-size: .8rem; margin-bottom: 30px; }
.ob-step-dots { display: flex; gap: 5px; margin-bottom: 26px; }
.ob-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--s3); }
.ob-dot.active { background: var(--blue); width: 20px; border-radius: 3px; }
.ob-dot.done { background: var(--green); }
.ob-heading { font-family: var(--display); font-size: 1.4rem; font-weight: 800; margin-bottom: 5px; }
.ob-sub { color: var(--muted2); font-size: .8rem; margin-bottom: 22px; }

/* Subject grid in onboarding */
.subj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px; max-height: 430px; overflow-y: auto;
  padding: 2px; margin-bottom: 20px;
}
.subj-grid::-webkit-scrollbar { width: 4px; }
.subj-grid::-webkit-scrollbar-thumb { background: var(--brd); border-radius: 2px; }

.subj-tile {
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--brd); cursor: pointer;
  transition: all .15s; background: var(--s1);
  display: flex; flex-direction: column;
}
.subj-tile:hover { border-color: var(--brd2); }
.subj-tile.selected { border-color: var(--blue); background: rgba(79,142,247,.07); }
.subj-tile-top { display: flex; align-items: center; gap: 8px; }
.subj-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.subj-name { font-size: .78rem; font-weight: 600; flex: 1; }
.subj-group { font-size: .59rem; color: var(--muted2); }
.subj-check { margin-left: auto; font-size: .8rem; color: var(--blue); opacity: 0; }
.subj-tile.selected .subj-check { opacity: 1; }
.subj-board-row { display: none; gap: 4px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--brd); }
.subj-tile.selected .subj-board-row { display: flex; }
.board-btn {
  font-size: .58rem; padding: 2px 7px; border-radius: 4px;
  border: 1px solid var(--brd); background: transparent;
  color: var(--muted2); cursor: pointer; font-family: var(--sans);
  transition: all .13s;
}
.board-btn.active { background: rgba(79,142,247,.15); color: var(--blue); border-color: rgba(79,142,247,.3); }
.board-btn:hover { border-color: var(--brd2); }

/* ══════════════════════════════════════════════════
   LANDING PAGE
══════════════════════════════════════════════════ */
#landing {
  position: fixed; inset: 0; z-index: 400;
  background: var(--bg); overflow-y: auto;
  font-family: var(--sans);
}
#landing.hidden { display: none; }

/* Nav */
.lp-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0;
  padding: 0 clamp(20px, 5vw, 80px);
  height: 64px;
  background: rgba(6,8,14,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--brd);
}
.lp-nav-logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; flex-shrink: 0;
}
.lp-nav-logo-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.lp-nav-logo-name {
  font-family: var(--display); font-size: 1.15rem; font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lp-nav-links {
  display: flex; align-items: center; gap: 0;
  margin-left: 36px; flex: 1;
}
.lp-nav-link {
  color: var(--muted2); text-decoration: none;
  font-size: .8rem; font-weight: 500;
  padding: 8px 14px; border-radius: 6px;
  transition: color .15s;
}
.lp-nav-link:hover { color: var(--text); }
.lp-nav-actions {
  display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.lp-nav-btn { font-size: .78rem; padding: 7px 16px; }
.lp-hamburger {
  display: none; background: none; border: none;
  color: var(--text); font-size: 1.2rem; cursor: pointer;
  margin-left: auto; padding: 6px;
}
.lp-mobile-menu {
  position: fixed; top: 64px; left: 0; right: 0;
  background: var(--s1); border-bottom: 1px solid var(--brd);
  padding: 16px 24px; z-index: 49;
  display: flex; flex-direction: column; gap: 4px;
}
.lp-mobile-menu.hidden { display: none; }
.lp-mobile-link {
  color: var(--text2); text-decoration: none;
  font-size: .85rem; padding: 10px 0;
  border-bottom: 1px solid var(--brd);
}

/* Hero */
.lp-hero {
  padding: clamp(60px, 10vh, 120px) clamp(20px, 5vw, 80px) 60px;
  max-width: 900px; margin: 0 auto;
  text-align: center; position: relative;
}
.lp-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 600; letter-spacing: .5px;
  color: var(--blue); background: rgba(79,142,247,.1);
  border: 1px solid rgba(79,142,247,.25);
  padding: 5px 14px; border-radius: 20px; margin-bottom: 24px;
  animation: fadeUp .6s ease both;
}
.lp-hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1.08; letter-spacing: -1.5px;
  color: var(--text); margin-bottom: 20px;
  animation: fadeUp .6s .1s ease both;
}
.lp-hero-gradient {
  background: linear-gradient(135deg, var(--blue), var(--violet) 50%, var(--pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lp-hero-sub {
  font-size: clamp(.85rem, 2vw, 1rem); color: var(--text2);
  max-width: 580px; margin: 0 auto 32px; line-height: 1.7;
  animation: fadeUp .6s .2s ease both;
}
.lp-hero-actions {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; flex-wrap: wrap; margin-bottom: 36px;
  animation: fadeUp .6s .3s ease both;
}
.lp-cta-btn { font-size: .9rem; padding: 13px 28px; }
.lp-hero-link {
  color: var(--muted2); font-size: .82rem; text-decoration: none;
  transition: color .15s;
}
.lp-hero-link:hover { color: var(--text); }
.lp-hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 0; flex-wrap: wrap; margin-bottom: 48px;
  animation: fadeUp .6s .4s ease both;
}
.lp-hero-stat {
  padding: 0 28px; text-align: center;
}
.lp-stat-num {
  display: block; font-family: var(--mono);
  font-size: 1.5rem; font-weight: 500; color: var(--text);
  line-height: 1;
}
.lp-stat-lbl {
  display: block; font-size: .63rem; color: var(--muted2);
  margin-top: 4px; letter-spacing: .5px; text-transform: uppercase;
}
.lp-stat-divider {
  width: 1px; height: 36px; background: var(--brd);
  flex-shrink: 0;
}

/* Preview mock */
.lp-hero-preview {
  border-radius: 16px; border: 1px solid var(--brd);
  overflow: hidden; box-shadow: 0 40px 80px rgba(0,0,0,.5);
  animation: fadeUp .6s .5s ease both;
  max-width: 860px; margin: 0 auto;
  background: var(--s1);
}
.lp-preview-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--s2);
  border-bottom: 1px solid var(--brd);
}
.lp-preview-dots { display: flex; gap: 5px; }
.lp-preview-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brd2);
}
.lp-preview-url {
  flex: 1; text-align: center;
  font-size: .65rem; font-family: var(--mono); color: var(--muted2);
  background: rgba(0,0,0,.2); border-radius: 4px;
  padding: 3px 10px; max-width: 200px; margin: 0 auto;
}
.lp-preview-body {
  display: flex; height: 260px;
}
.lp-preview-sidebar {
  width: 140px; min-width: 140px; background: var(--bg);
  border-right: 1px solid var(--brd);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 3px;
  overflow: hidden;
}
.lp-ps-logo {
  font-family: var(--display); font-size: .65rem; font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 12px; padding-left: 4px;
}
.lp-ps-item {
  font-size: .6rem; color: var(--muted2); padding: 5px 8px;
  border-radius: 6px; font-weight: 500;
}
.lp-ps-active {
  background: rgba(79,142,247,.12); color: var(--blue);
}
.lp-preview-main {
  flex: 1; padding: 18px 20px; overflow: hidden;
}
.lp-pm-greeting {
  font-family: var(--display); font-size: .9rem; font-weight: 800;
  margin-bottom: 12px; color: var(--text);
}
.lp-pm-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 12px;
}
.lp-pm-stat {
  background: var(--s2); border: 1px solid var(--brd);
  border-radius: 8px; padding: 8px;
  border-top: 2px solid var(--ac, var(--blue));
  position: relative; overflow: hidden;
}
.lp-pm-stat-val {
  font-family: var(--mono); font-size: .9rem; color: var(--text);
}
.lp-pm-stat-lbl { font-size: .48rem; color: var(--muted2); margin-top: 2px; }
.lp-pm-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.lp-pm-card {
  background: var(--s2); border: 1px solid var(--brd);
  border-radius: 8px; padding: 10px 12px;
}
.lp-pm-card-title {
  font-size: .6rem; font-weight: 700; margin-bottom: 7px; color: var(--text);
}
.lp-pm-subj {
  display: flex; align-items: center; gap: 6px;
  font-size: .56rem; color: var(--text2); margin-bottom: 4px;
}
.lp-pm-subj span {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.lp-pm-exam-name { font-size: .68rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.lp-pm-exam-date { font-size: .58rem; color: var(--muted2); margin-bottom: 2px; }
.lp-pm-exam-days {
  font-size: .58rem; color: var(--blue);
  font-family: var(--mono);
}

/* Section shared */
.lp-section { padding: clamp(60px, 8vw, 100px) clamp(20px, 5vw, 80px); }
.lp-section-alt { background: var(--s1); border-top: 1px solid var(--brd); border-bottom: 1px solid var(--brd); }
.lp-section-inner { max-width: 1000px; margin: 0 auto; }
.lp-section-label {
  font-size: .67rem; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--blue); font-weight: 700; margin-bottom: 12px;
}
.lp-section-title {
  font-family: var(--display); font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.8px; margin-bottom: 12px; color: var(--text);
}
.lp-section-sub {
  color: var(--text2); font-size: .88rem; margin-bottom: 40px;
  max-width: 540px; line-height: 1.7;
}

/* Features grid */
.lp-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
}
.lp-feature-card {
  background: var(--s1); border: 1px solid var(--brd);
  border-radius: 14px; padding: 22px;
  transition: border-color .2s, transform .2s;
}
.lp-feature-card:hover { border-color: var(--brd2); transform: translateY(-3px); }
.lp-feature-lg {
  grid-column: span 2;
}
.lp-feature-icon {
  font-size: 1.6rem; margin-bottom: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(from var(--fc) r g b / 0.12);
}
.lp-feature-title {
  font-family: var(--display); font-size: .95rem; font-weight: 800;
  margin-bottom: 8px; color: var(--text);
}
.lp-feature-desc {
  font-size: .78rem; color: var(--text2); line-height: 1.65;
  margin-bottom: 12px;
}
.lp-feature-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.lp-feature-tags span {
  font-size: .58rem; font-weight: 600;
  background: rgba(79,142,247,.1); color: var(--blue);
  border: 1px solid rgba(79,142,247,.2);
  padding: 2px 8px; border-radius: 4px;
}

/* Subjects */
.lp-subjects-pills {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;
}
.lp-pill {
  font-size: .75rem; font-weight: 600;
  padding: 5px 14px; border-radius: 20px;
  background: rgba(from var(--pc) r g b / 0.1);
  border: 1px solid rgba(from var(--pc) r g b / 0.25);
  color: var(--pc, var(--text2));
  transition: all .15s; cursor: default;
}
.lp-pill-more {
  --pc: #6b82a0;
  font-style: italic;
}
.lp-boards {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.lp-board {
  font-size: .7rem; font-weight: 700; letter-spacing: 1px;
  padding: 5px 14px; border-radius: 6px;
  background: var(--s2); border: 1px solid var(--brd);
  color: var(--muted2); font-family: var(--mono);
}

/* Steps */
.lp-steps {
  display: flex; align-items: flex-start; gap: 0;
  flex-wrap: wrap;
}
.lp-step {
  flex: 1; min-width: 220px; padding: 28px;
  background: var(--s1); border: 1px solid var(--brd);
  border-radius: 14px;
}
.lp-step-num {
  font-family: var(--mono); font-size: 1.8rem; font-weight: 500;
  color: var(--blue); opacity: .4; line-height: 1; margin-bottom: 12px;
}
.lp-step-title {
  font-family: var(--display); font-size: 1rem; font-weight: 800;
  margin-bottom: 8px; color: var(--text);
}
.lp-step-desc { font-size: .78rem; color: var(--text2); line-height: 1.65; }
.lp-step-arrow {
  font-size: 1.2rem; color: var(--muted); padding: 0 10px;
  align-self: center; flex-shrink: 0;
}

/* CTA */
.lp-cta-section {
  padding: clamp(60px, 8vw, 100px) clamp(20px, 5vw, 80px);
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(79,142,247,.08), transparent);
  text-align: center; border-top: 1px solid var(--brd);
}
.lp-cta-inner { max-width: 600px; margin: 0 auto; }
.lp-cta-badge {
  font-size: .65rem; color: var(--muted2); letter-spacing: .5px;
  margin-bottom: 18px; text-transform: uppercase;
}
.lp-cta-title {
  font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800; letter-spacing: -0.8px; margin-bottom: 14px; color: var(--text);
}
.lp-cta-sub {
  font-size: .88rem; color: var(--text2); margin-bottom: 28px; line-height: 1.7;
}

/* Footer */
.lp-footer {
  padding: 24px clamp(20px, 5vw, 80px);
  border-top: 1px solid var(--brd);
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.lp-footer-logo { display: flex; align-items: center; gap: 8px; }
.lp-footer-text {
  font-size: .65rem; color: var(--muted2); margin-left: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .lp-nav-links, .lp-nav-actions { display: none; }
  .lp-hamburger { display: flex; }
  .lp-preview-sidebar { display: none; }
  .lp-pm-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-features-grid { grid-template-columns: 1fr 1fr; }
  .lp-feature-lg { grid-column: span 2; }
  .lp-step-arrow { display: none; }
  .lp-step { min-width: 100%; }
}
@media (max-width: 480px) {
  .lp-features-grid { grid-template-columns: 1fr; }
  .lp-feature-lg { grid-column: span 1; }
  .lp-pm-stats { grid-template-columns: repeat(2, 1fr); }
  .lp-pm-cards { grid-template-columns: 1fr; }
  .lp-preview-body { height: 200px; }
  .lp-hero-stats { gap: 20px; flex-direction: column; }
  .lp-stat-divider { display: none; }
}
