/* FundaRoute.
   The jacaranda idea, drawn as a tree rather than as flowers: it covers South Africa in
   October and November, right in matric exam season. Deep navy-indigo for structure, a firm
   blue-violet for anything you can press, and pollen yellow for the one loud thing on a page
   (your score). Cool neutral greys, firm corners, no pastel tints.
   Body text stays Atkinson Hyperlegible so it reads on a cheap phone in sunlight.

   Breakpoints: phone < 761px (bottom bar), tablet 761-1099px (top tabs, short labels),
   desktop 1100px+ (full labels, side-by-side layouts on Marks and Bursaries). */
:root {
  --paper: #f5f6f9;
  --page: #ffffff;
  --deep: #1b1e38;       /* navy-indigo: header, headings */
  --ink: #4440b5;        /* jacaranda blue-violet: links, buttons, selected */
  --ink-2: #33308f;
  --ink-soft: #eaebf4;
  --ink-line: #cfd2e3;
  --text: #1c1f2e;
  --muted: #575c6e;
  --line: #e1e3ea;
  --margin: #c2334d;     /* warnings, "forgot", closed doors */
  --ok: #157a4c;
  --ok-soft: #e3f4ea;
  --warn: #8a3a12;
  --hi: #ffc22e;         /* pollen */
  --hi-soft: #fff4d1;
  --hand: 'Bricolage Grotesque', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --radius: 14px;
  --lift: 0 1px 2px rgba(27, 30, 56, .06), 0 10px 28px -14px rgba(27, 30, 56, .22);
  --bar-h: 64px;
  --top-h: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; background: var(--paper); color: var(--text); font: 17px/1.55 var(--body); }
a { color: var(--ink); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .45em; color: var(--deep); font-family: var(--hand); }
h1 { font-size: clamp(1.9rem, 5.2vw, 3rem); font-weight: 800; letter-spacing: -.02em; max-width: 24ch; }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.65rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 .7em; max-width: 65ch; }
ul, ol { margin: 0; padding: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; color: var(--deep); }
input, select, textarea, button { font: inherit; color: inherit; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
@media (min-width: 761px) { .wrap { width: min(1200px, 100% - 56px); } }
.small { font-size: .9rem; }
.muted { color: var(--muted); }
.lede { font-size: 1.1rem; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 30; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- header + nav ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--deep); color: #fff; }
.top-row { display: flex; align-items: center; gap: 12px; min-height: var(--top-h); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; white-space: nowrap; margin-right: auto;
  font: 800 1.35rem/1 var(--hand); letter-spacing: -.02em; }
.brand-mark { color: #9a97f3; flex: none; }
.tabs { display: flex; gap: 4px; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; color: #d3d6ea; text-decoration: none; padding: 0 13px; min-height: 42px;
  border-radius: 10px; font-size: .95rem; white-space: nowrap; }
.tabs svg { width: 19px; height: 19px; flex: none; }
.tabs a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.tabs a[aria-current=page] { background: #fff; color: var(--deep); font-weight: 700; box-shadow: inset 0 -3px 0 var(--hi); }
.tabs .short { display: none; }
.tab-home { padding: 0 11px; }
.tab-home .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.streak { display: inline-flex; align-items: center; gap: 4px; color: #c2c5dc; text-decoration: none; font-weight: 700;
  padding: 6px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22); min-height: 42px; }
.streak.on { color: var(--deep); background: var(--hi); border-color: var(--hi); }
.streak svg { flex: none; }

/* tablet: icons + short labels so six tabs fit */
@media (min-width: 761px) and (max-width: 1099px) {
  .tabs .long { display: none; }
  .tabs .short { display: inline; }
  .tabs a { padding: 0 11px; gap: 6px; }
  .brand { font-size: 1.2rem; }
}
/* narrow tablets: brand text + six tabs + streak don't fit, so the bloom mark alone links
   home, the tabs are tighter, and if the row is still too wide it scrolls instead of
   pushing the page sideways */
@media (min-width: 761px) and (max-width: 900px) {
  .top-row { gap: 8px; }
  .tabs { gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 3px 2px; }   /* padding: room for focus rings */
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 0 8px; gap: 5px; flex: none; }
  .streak { padding: 6px 9px; flex: none; }
}
@media (min-width: 761px) and (max-width: 880px) {
  .brand span { display: none; }   /* the bloom mark alone still links home */
}

.bottom-bar { display: none; }
@media (max-width: 760px) {
  .tabs { display: none; }
  body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  .bottom-bar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: var(--bar-h); color: var(--muted); text-decoration: none; font-size: .74rem; position: relative; }
  .bottom-bar svg { width: 24px; height: 24px; }
  .bottom-bar a[aria-current=page] { color: var(--ink); font-weight: 700; }
  .bottom-bar a[aria-current=page]::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ink); }
}

/* ---------- page scaffolding ---------- */
.view { padding-bottom: 28px; }
.page-head { padding: 34px 0 16px; }
.block { padding: 40px 0 6px; }
.home-hero { padding: 48px 0 14px; position: relative; }
.home-hero h1 { font-size: clamp(2.2rem, 7vw, 3.8rem); max-width: 15ch; }
.home-hero .lede { max-width: 52ch; }
.hand-h { font: 700 1.45rem var(--hand); color: var(--deep); margin: 22px 0 14px; }
/* one geometric jacaranda on the right of the home hero, wide screens only */
@media (min-width: 1000px) {
  .home-hero::after {
    content: ''; position: absolute; right: 0; top: 18px; width: 320px; height: 260px; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 260'%3E%3Cpath d='M160 252V150M160 196l-38-34M160 178l40-38M122 162l-22-10M200 140l26-8' stroke='%231b1e38' stroke-width='9' stroke-linecap='round' fill='none'/%3E%3Cg fill='%23b9bbe6'%3E%3Ccircle cx='86' cy='128' r='44'/%3E%3Ccircle cx='236' cy='118' r='48'/%3E%3C/g%3E%3Cg fill='%237c79d6'%3E%3Ccircle cx='132' cy='92' r='56'/%3E%3Ccircle cx='196' cy='80' r='52'/%3E%3C/g%3E%3Ccircle cx='164' cy='60' r='42' fill='%234440b5'/%3E%3Cg fill='%237c79d6'%3E%3Crect x='70' y='214' width='9' height='9' rx='2' transform='rotate(20 74 218)'/%3E%3Crect x='248' y='200' width='8' height='8' rx='2' transform='rotate(-15 252 204)'/%3E%3Crect x='212' y='236' width='7' height='7' rx='2'/%3E%3C/g%3E%3Cpath d='M40 252h240' stroke='%23cfd2e3' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right top / contain;
  }
}

/* home: four ways in */
.stages { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
@media (min-width: 761px) and (max-width: 1099px) { .stages { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .stages { grid-template-columns: repeat(4, 1fr); } }
.stage {
  display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 20px 20px 22px;
  background: var(--page); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
@media (hover: hover) { .stage:hover { border-color: var(--ink); box-shadow: var(--lift); } }
.stage strong { font: 700 1.2rem/1.2 var(--hand); color: var(--deep); }
.stage span:last-child { color: var(--muted); font-size: .95rem; }
.stage-grade { align-self: flex-start; font-weight: 700; font-size: .85rem; color: var(--ink-2); background: var(--ink-soft); padding: 3px 9px; border-radius: 6px; }
.today-strip:empty { display: none; }
.today-strip { margin-top: 22px; padding: 14px 18px; background: var(--hi-soft); border: 1px solid #efd78e; border-radius: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.today-strip a { font-weight: 700; color: var(--deep); }

/* ---------- the marks / subjects panel ---------- */
.book {
  position: relative; container-type: inline-size;
  background: var(--page); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--lift); padding: 20px 24px 24px;
}
.book-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.book-title { font: 800 1.6rem/1.6 var(--hand); color: var(--deep); margin: 0; letter-spacing: -.01em; }
.book-head .hint { color: var(--muted); font-size: .92rem; margin: 0; }
.row {
  display: grid; grid-template-columns: minmax(0, 15rem) 1fr 5.4rem 2.4rem;
  align-items: center; gap: 14px; min-height: 76px; border-bottom: 1px solid #f1edf8;
}
.row:last-child { border-bottom: 0; }
.row-subj { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.row-lbl { font-size: .78rem; color: var(--muted); line-height: 1.2; }
.row select, .fixed {
  font: 700 1rem var(--body); background: transparent; border: 0; border-bottom: 1.5px dashed var(--ink-line);
  padding: 4px 0; max-width: 100%; border-radius: 0; min-height: 0; color: var(--deep);
}
.fixed { border-bottom-color: transparent; }
.pct { display: flex; align-items: baseline; gap: 2px; font-family: var(--hand); color: var(--deep); }
.pct input {
  width: 3.7rem; font: 700 1.7rem var(--hand); color: var(--deep); text-align: right;
  background: var(--ink-soft); border: 0; border-radius: 10px; padding: 2px 6px;
  -moz-appearance: textfield; appearance: textfield;
}
.pct input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); outline: 0; }
.pct input::-webkit-outer-spin-button, .pct input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pct input::placeholder { color: #a6aac0; }
.pct span { font-size: 1.1rem; color: var(--muted); }
.lvl { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%;
  font: 700 .95rem var(--body); color: var(--ink-2); background: var(--ink-soft); }
.lvl:empty { visibility: hidden; }
.row-dup { font-size: .8rem; line-height: 1.25; color: var(--margin); font-weight: 700; margin-top: 2px; }
.row-dup[hidden] { display: none; }
.row.is-dup .pct input, .row.is-dup .lvl { opacity: .55; }

.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; cursor: pointer; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--ink-soft); }
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--ink-soft); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--ink); border: 4px solid #fff; box-shadow: 0 0 0 1.5px var(--ink), 0 2px 6px rgba(27, 30, 56, .3); }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 4px solid #fff; box-shadow: 0 0 0 1.5px var(--ink); }
.slider[data-empty]::-webkit-slider-thumb { background: #c2c5d8; box-shadow: 0 0 0 1.5px #c2c5d8; }
.slider[data-empty]::-moz-range-thumb { background: #c2c5d8; }

/* narrow panel (phones, and the marks sidebar on desktop): slider goes under the subject */
@container (max-width: 600px) {
  .row { grid-template-columns: 1fr 5rem 2.4rem; grid-template-rows: auto auto; gap: 0 10px; min-height: 0; padding: 12px 0 6px; align-content: center; }
  .row-subj { grid-column: 1; grid-row: 1; }
  .pct { grid-column: 2; grid-row: 1; }
  .lvl { grid-column: 3; grid-row: 1; }
  .slider { grid-column: 1 / -1; grid-row: 2; }
  .row select { width: 100%; }
}
@media (max-width: 640px) { .book { padding: 16px 16px 20px; border-radius: 18px; } }

/* the score: a jacaranda bloom with a pollen-yellow number */
.score { display: flex; align-items: center; gap: 20px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.score-ring {
  flex: 0 0 auto; width: 112px; height: 112px; display: grid; place-items: center; align-content: center;
  border-radius: 20px; background: var(--deep); color: var(--hi);
  box-shadow: 0 0 0 6px var(--ink-soft);
}
.score-num { font: 800 2.9rem/1 var(--hand); letter-spacing: -.03em; }
.score-lbl { font: 700 .8rem var(--body); color: #c7cae2; }
.score-text { flex: 1 1 240px; }
.score-text p { margin: 0 0 .3em; }
.q13 { display: flex; gap: 8px; align-items: center; min-height: 40px; color: var(--text); }
#aps-line { font-weight: 700; font-size: 1.05rem; color: var(--deep); }
.pass-chip { display: inline-block; margin-top: 4px; padding: 3px 11px; border-radius: 6px; font-weight: 700; font-size: .9rem; background: var(--ink-soft); color: var(--ink-2); }
.pass-chip.bachelor { background: var(--ok-soft); color: var(--ok); }
.pass-chip.none { background: #fbe9ec; color: var(--margin); }
.score-ring.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.06); } }

/* ---------- forms, filters, buttons ---------- */
select, input[type=text], input[type=search], input[type=date], input[type=email], input[type=number], input[type=url], input[type=password], input[type=tel], input:not([type]), textarea {
  padding: 10px 12px; border: 1.5px solid var(--ink-line); border-radius: 12px; background: #fff; min-height: 46px; width: 100%;
}
select:focus, input[type=text]:focus, input[type=search]:focus, input[type=date]:focus, input[type=email]:focus, input[type=number]:focus, input[type=url]:focus, input[type=password]:focus, input[type=tel]:focus, input:not([type]):focus, textarea:focus { border-color: var(--ink); outline: 0; box-shadow: 0 0 0 3px var(--ink-soft); }
textarea { min-height: 120px; resize: vertical; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 6px 0 16px; padding: 14px; background: var(--page); border: 1px solid var(--line); border-radius: 16px; }
.filters label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: 4px; flex: 1 1 170px; max-width: 280px; }
.filters label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; min-height: 46px; flex: 0 1 auto; max-width: none; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 20px;
  font-weight: 700; color: #fff; background: var(--ink); border: 2px solid var(--ink);
  border-radius: 10px; text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--ink-line); }
.btn.ghost:hover { background: var(--ink-soft); border-color: var(--ink); }
.btn[aria-pressed=true], .btn.ghost[aria-pressed=true], .btn.ghost[aria-pressed=true]:hover { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn.good { background: var(--ok); border-color: var(--ok); }
.btn.good:hover { background: #0f6440; border-color: #0f6440; }
.btn.bad { color: var(--margin); border-color: #f0bcc6; }
.btn.bad:hover { background: #fbe9ec; border-color: var(--margin); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 32px; }
.more { margin-top: 14px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ink-soft); }
.seg button { flex: 1 1 auto; border: 0; background: none; padding: 9px 14px; min-height: 42px; cursor: pointer; color: var(--ink-2); font-weight: 700; border-radius: 8px; }
.seg button:hover { background: rgba(255, 255, 255, .7); }
.seg button[aria-pressed=true], .seg button[aria-checked=true] { background: #fff; color: var(--deep); box-shadow: 0 1px 3px rgba(27, 30, 56, .18); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--ink-line); background: #fff; color: var(--text); border-radius: 10px;
  padding: 8px 14px; min-height: 42px; cursor: pointer; font-size: .95rem;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.chip[aria-pressed=true]::before { content: '\2713  '; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.small-chips .chip { padding: 5px 12px; min-height: 36px; font-size: .88rem; }

.card-flat { background: var(--page); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin: 10px 0 22px; }

/* ---------- subjects (Grade 9) ---------- */
.subj-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .subj-layout { grid-template-columns: 1fr; } }
.subj-book { padding-top: 16px; }
.subj-book fieldset { margin: 16px 0 18px; }
.fixed-subj { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.fixed-subj li { font-weight: 700; font-size: .92rem; color: var(--ink-2); background: var(--ink-soft); padding: 4px 10px; border-radius: 6px; }
.maths-note { margin-top: 8px; color: var(--warn); }
.maths-note:empty { display: none; }
.doors-wrap { position: sticky; top: calc(var(--top-h) + 16px); }
@media (max-width: 860px) { .doors-wrap { position: static; } }
.doors-sum { font-size: 1.05rem; }
.doors-sum strong { font: 800 1.8rem var(--hand); color: var(--ink); }
.doors { list-style: none; margin-top: 12px; max-height: calc(100vh - 260px); overflow: auto; padding-right: 6px; }
@media (max-width: 860px) { .doors { max-height: none; } }
.door { display: grid; grid-template-columns: 26px 1fr; gap: 2px 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.door svg { width: 22px; height: 22px; margin-top: 2px; }
.door strong { color: var(--deep); }
.door.open svg { color: var(--ok); }
.door.shut { color: var(--muted); }
.door.shut strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--margin); }
.door.shut svg { color: var(--margin); }
.door p { grid-column: 2; margin: 0; font-size: .9rem; }
.door .why { color: var(--warn); }
.door.flip { animation: flip .6s ease; }
@keyframes flip { 0% { background: var(--hi-soft); } 100% { background: transparent; } }
.search input { font-size: 1.05rem; max-width: 560px; }
.career-hits { list-style: none; margin-top: 12px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.career-hits li { background: var(--page); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.career-hits h3 { margin-bottom: 4px; }
.career-hits .need-list { font-weight: 700; color: var(--ink-2); margin: 6px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.pass-ladder { list-style: none; counter-reset: p; }
.pass-ladder li { position: relative; padding: 12px 0 12px 48px; border-top: 1px solid var(--line); }
.pass-ladder li::before { counter-increment: p; content: counter(p); position: absolute; left: 0; top: 12px; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%; background: var(--deep); color: var(--hi); font: 800 1rem var(--hand); }
.pass-ladder strong { display: block; color: var(--deep); }
.stream { padding: 12px 0; border-top: 1px solid var(--line); }

/* ---------- marks + courses: side by side on desktop ---------- */
@media (min-width: 1100px) {
  .marks-layout { display: grid; grid-template-columns: minmax(400px, 450px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .marks-side { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto;
    border-radius: 20px; scrollbar-width: thin; }
  .marks-main { padding-top: 0; }
  .marks-main > h2:first-child { margin-top: 4px; }
  /* score first in the sidebar, so it stays in view while you drag a slider */
  .marks-side .book { display: flex; flex-direction: column; }
  .marks-side .book-head { order: 0; }
  .marks-side .score { order: 1; margin: 12px 0 4px; padding: 0 0 16px; border-top: 0; border-bottom: 1px solid var(--line); flex-wrap: nowrap; align-items: flex-start; }
  .marks-side .rows { order: 2; }
  .marks-side .score-ring { width: 96px; height: 96px; }
  .marks-side .score-num { font-size: 2.5rem; }
}

/* ---------- courses ---------- */
.count-line { font-size: 1.1rem; }
.count-line strong { font: 800 1.8rem var(--hand); color: var(--ink); }
.course-list, .burs-list, .ticks, .res-list, .decks, .exams, .focus-log { list-style: none; }
.course-list, .burs-list { background: var(--page); border: 1px solid var(--line); border-radius: 18px; padding: 0 20px; }
.course-list:empty, .burs-list:empty { display: none; }
.course { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.course:first-child, .burs:first-child { border-top: 0; }
.course h3 { margin: 0 0 2px; }
.where { color: var(--muted); margin: 0 0 4px; }
.need { margin: 0 0 4px; font-weight: 700; }
.gap { margin: 0; color: var(--warn); }
.course-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; font-size: .92rem; }
.tag { font-weight: 700; color: var(--ok); white-space: nowrap; background: var(--ok-soft); padding: 2px 10px; border-radius: 6px; }
.tag::before { content: '\2713  '; }
.is-near .tag, .is-check .tag { color: var(--warn); background: var(--hi-soft); }
.is-near .tag::before, .is-check .tag::before { content: ''; }
.field { color: var(--muted); }
.src { color: var(--muted); }
details.more-info summary { cursor: pointer; color: var(--ink); font-size: .9rem; min-height: 32px; }
details.more-info p { font-size: .9rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 560px) {
  .course-list, .burs-list { padding: 0 14px; }
  .course { grid-template-columns: 1fr; }
  .course-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; text-align: left; }
}
.empty { padding: 18px; background: var(--ink-soft); border-radius: 14px; color: var(--muted); list-style: none; margin: 14px 0; }

/* ---------- bursaries ---------- */
.burs-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "nsfas" "main" "check"; column-gap: 32px; }
.burs-layout > .nsfas { grid-area: nsfas; }
.burs-main { grid-area: main; }
.burs-check { grid-area: check; }
@media (min-width: 1100px) {
  .burs-layout { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "main nsfas" "main check"; grid-template-rows: auto 1fr; align-items: start; }
  .burs-layout > .nsfas { margin-top: 6px; }
  .burs-check { padding-top: 0; }
  .burs-check .ticks label { padding: 10px 0; }
}
.nsfas { background: var(--deep); color: #e3e5f1; border: 0; border-radius: var(--radius); }
.nsfas h2 { color: #fff; }
.nsfas strong { color: var(--hi); }
.nsfas .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.nsfas .btn.ghost:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.nsfas .btn.ghost[aria-pressed=true] { background: var(--hi); border-color: var(--hi); color: var(--deep); }
.nsfas a { color: #cfd2f4; }
#nsfas-answer { margin-top: 10px; }
#nsfas-answer ul { padding-left: 1.2em; }
.burs { padding: 18px 0; border-top: 1px solid var(--line); }
.burs h3 { margin: 6px 0 4px; }
.burs p { margin: 0 0 4px; }
.when { display: inline-block; font-weight: 700; font-size: .88rem; color: var(--ink-2); background: var(--ink-soft); padding: 2px 10px; border-radius: 6px; }
.when.soon { background: var(--hi); color: #3b2f00; }
.when.closed { color: var(--muted); background: #f1eff5; text-decoration: line-through; }
.when.unknown { color: var(--muted); font-weight: 400; background: none; padding: 0; }
.fit { color: var(--warn); }
.fit.ok { color: var(--ok); font-weight: 700; }
.burs-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95rem; }
.burs-check { }
@media (min-width: 1100px) { .burs-check { background: var(--page); border: 1px solid var(--line); border-radius: 18px; padding: 20px; } }
.ticks li { border-top: 1px solid var(--line); }
.ticks label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; }
.ticks input { margin-top: 3px; }
.ticks input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--ok); }
.tick-bar { height: 8px; background: var(--ink-soft); border-radius: 4px; overflow: hidden; margin: 6px 0 2px; max-width: 360px; }
.tick-bar span { display: block; height: 100%; background: var(--ok); transition: width .3s; }
#waivers ul { padding-left: 1.2em; }

/* ---------- study ---------- */
.subtabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex: none; padding: 0 15px; border-radius: 10px; border: 1.5px solid var(--ink-line); color: var(--ink-2); text-decoration: none; background: #fff; min-height: 42px; display: inline-flex; align-items: center; }
.subtabs a:hover { border-color: var(--ink); }
.subtabs a[aria-current=page] { background: var(--deep); border-color: var(--deep); color: #fff; font-weight: 700; }
@media (min-width: 1100px) { .subtabs { flex-wrap: wrap; overflow: visible; } }
/* phones and tablets: the tab row scrolls sideways, so say so (study.js hides it once used) */
.swipe-hint { display: none; margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
.swipe-arrow { display: inline-block; animation: swipe-nudge 1.4s ease-in-out infinite; }
@keyframes swipe-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@media (max-width: 1099px) { .swipe-hint.on { display: block; } }
.sub { padding-top: 16px; }
.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .today-grid { grid-template-columns: 1fr; } }
.today-grid .card-flat { margin: 0; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; margin: 8px 0; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: .78rem; color: var(--muted); }
.week .day > span { min-height: 1.3em; line-height: 1.3; flex: none; }   /* same height on every day, even with no minutes */
/* The bar's height is a share of this track, which takes all the room the two labels leave,
   so 30 minutes is always half as tall as 60 on every day. */
.week .bar-track { position: relative; flex: 1 1 0; min-height: 0; width: 100%; max-width: 36px; }
.week .bar { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ink-soft); border-radius: 10px 10px 3px 3px; min-height: 4px; transition: height .4s; }
.week .day.done .bar { background: var(--ink); }
.week .day.today { color: var(--deep); font-weight: 700; }
.week .day.today .bar { box-shadow: 0 0 0 2px var(--hi); }
.due-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }

.decks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 12px 0 20px; }
.deck { background: var(--page); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.deck::after { content: ''; position: absolute; inset: auto 14px -6px 14px; height: 6px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: var(--ink-soft); }
.deck h3 { margin: 0; }
.deck .due { font-weight: 700; color: var(--margin); }
.deck .due.none { color: var(--ok); }
.deck .btn-row { margin-top: auto; }
.deck .del { margin-left: auto; color: var(--muted); font-size: .85rem; }
.new-deck summary { list-style: none; display: inline-flex; }
.new-deck summary::-webkit-details-marker { display: none; }
.stack-form { display: grid; gap: 12px; margin-top: 12px; max-width: 600px; }
.stack-form label { display: grid; gap: 4px; font-size: .92rem; color: var(--muted); }

.review-top { display: flex; justify-content: space-between; align-items: center; margin: 0 auto 12px; max-width: 720px; }
.flash { display: block; width: 100%; max-width: 720px; height: 300px; margin: 0 auto; perspective: 1400px; background: none; border: 0; padding: 0; cursor: pointer; }
@media (min-width: 761px) { .flash { height: 360px; } }
.flash-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flash.snap .flash-inner { transition: none; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 28px 32px; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px;
  border: 1px solid var(--line); text-align: center; font-size: 1.35rem; color: var(--deep);
  background: var(--page); box-shadow: var(--lift);
}
@media (min-width: 761px) { .flash-face { font-size: 1.6rem; padding: 36px 56px; } }
.flash-face.back { transform: rotateY(180deg); font: 700 1.7rem/1.3 var(--hand); color: var(--hi); background: var(--deep); border-color: var(--deep); }
@media (min-width: 761px) { .flash-face.back { font-size: 2rem; } }
.flash-hint { font-size: .85rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .flash-face.back { transform: none; } .flash .flash-face.back { display: none; } .flash.flipped .flash-face.back { display: flex; } .flash.flipped .flash-face.front { display: none; } .flash.flipped .flash-inner { transform: none; } }
.grade-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
#review-done { text-align: center; padding: 30px 0; }
#review-done p { margin-inline: auto; }
#review-done .big { font: 800 2.4rem var(--hand); color: var(--ok); }

.focus { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 36px; align-items: center; }
@media (max-width: 700px) { .focus { grid-template-columns: 1fr; justify-items: center; } .focus-side { width: 100%; } }
@media (min-width: 1100px) { .focus { grid-template-columns: 380px minmax(0, 560px); justify-content: center; gap: 56px; } }
.focus-dial { position: relative; width: min(320px, 80vw); aspect-ratio: 1; }
@media (min-width: 1100px) { .focus-dial { width: 380px; } }
.focus-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial-bg { fill: none; stroke: var(--ink-soft); stroke-width: 12; }
.dial-fg { fill: none; stroke: var(--ink); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 552.92; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.focus-dial.break .dial-fg { stroke: var(--ok); }
.focus-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#focus-time { font: 800 3.6rem/1 var(--hand); color: var(--deep); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
@media (min-width: 1100px) { #focus-time { font-size: 4.4rem; } }
#focus-mode { color: var(--muted); font-weight: 700; }
.focus-side { display: grid; gap: 14px; }
.focus-side label { display: grid; gap: 4px; font-size: .92rem; color: var(--muted); }
.focus-custom { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.focus-custom[hidden] { display: none; }
.focus-custom label { flex: 1 0 100%; }
.focus-custom input { width: 110px; min-height: 42px; }
.small-h { font-size: .95rem; margin: 6px 0 0; }
.focus-log li { padding: 6px 0; border-top: 1px solid var(--line); font-size: .92rem; display: flex; justify-content: space-between; }

.exam-form { display: grid; grid-template-columns: 2fr 1.3fr 1.2fr auto; gap: 10px; align-items: end; margin: 10px 0; padding: 16px; background: var(--page); border: 1px solid var(--line); border-radius: 18px; }
.exam-form label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
@media (max-width: 760px) { .exam-form { grid-template-columns: 1fr 1fr; } .exam-form label:first-child { grid-column: 1 / -1; } }
.exams li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.exams .ex-name { font-weight: 700; flex: 1 1 160px; color: var(--deep); }
.exams .ex-when { color: var(--muted); }
.conf { font-size: .8rem; padding: 2px 9px; border-radius: 6px; background: var(--ink-soft); color: var(--ink-2); font-weight: 700; }
.conf.c1 { background: #fbe9ec; color: var(--margin); }
.conf.c3 { background: var(--ok-soft); color: var(--ok); }
.plan-opts { margin: 18px 0 8px; max-width: 420px; }
.plan-opts input[type=range] { width: 100%; accent-color: var(--ink); }
.plan-days { list-style: none; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 12px; }
.plan-day { background: var(--page); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.plan-day.is-today { border-color: var(--ink); box-shadow: inset 0 4px 0 var(--ink); }
.plan-day h3 { font-size: .98rem; margin-bottom: 6px; }
.plan-day h3 .exam-flag { color: var(--margin); }
.plan-day ul { list-style: none; }
.plan-day li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: .93rem; }
.plan-day li.done span { text-decoration: line-through; color: var(--muted); }

.methods { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 14px; }
.method { background: var(--page); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.method h3 { color: var(--deep); margin: 0; }
.method .try { background: var(--ink-soft); border-radius: 12px; padding: 11px 13px; font-size: .93rem; }
.method .try strong { display: block; color: var(--ink-2); }
.method .best-for { font-size: .85rem; color: var(--muted); }
.method.picked { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok); }
.quiz { border-radius: var(--radius); background: var(--hi-soft); border-color: #efd78e; }
.quiz .q { font-weight: 700; margin: 6px 0; }
.quiz .btn-row { margin-bottom: 12px; }

.res-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.res-list li { background: var(--page); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.res-list h3 { margin: 0 0 4px; }
.res-list h3 a { text-decoration: none; }
.res-list h3 a:hover { text-decoration: underline; }
.zr { display: inline-block; font-size: .78rem; font-weight: 700; background: var(--ok-soft); color: var(--ok); padding: 1px 8px; border-radius: 6px; margin-left: 6px; font-family: var(--body); }
.for-tag { font-size: .82rem; color: var(--muted); }
.yt-head { margin: 32px 0 4px; }

/* ---------- footer, toast, print ---------- */
.foot { margin-top: 48px; padding: 30px 0 42px; background: var(--deep); color: #c3c6da; font-size: .92rem; }
.foot a, .foot .link-btn { color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--deep); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; box-shadow: var(--lift);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); z-index: 40;
}
@media (max-width: 760px) { .toast { bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom)); border-radius: 14px; } }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--ok); }

@media print {
  .top, .bottom-bar, .filters, .btn-row, .toast, .skip, .slider, .src, .subtabs, .more, .foot a, .foot button { display: none !important; }
  body { background: #fff; font-size: 12pt; padding: 0; }
  .book, .flash-face { box-shadow: none; }
  .marks-side { position: static; max-height: none; overflow: visible; }
  .course, .burs, .plan-day { break-inside: avoid; }
  .foot { background: none; color: #000; }
  a { color: #000; }
}

/* ---- password fields: show/hide button, strength meter, live username check ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 72px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 4px 10px; border: 0; border-radius: 8px;
  background: var(--ink-soft); color: var(--ink-2); font: 700 .85rem var(--body); cursor: pointer; }
.pw-eye:hover { background: var(--ink-line); }
.pw-eye:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pw-meter { display: flex; align-items: center; gap: 10px; margin: -6px 0 0; min-height: 18px; font-size: .85rem; }
.pw-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pw-bar > span { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .2s, background .2s; }
.pw-meter[data-level="1"] .pw-bar > span { width: 33%; background: #c0392b; }
.pw-meter[data-level="2"] .pw-bar > span { width: 66%; background: #d68a00; }
.pw-meter[data-level="3"] .pw-bar > span { width: 100%; background: #1e8e4f; }
.pw-meter[data-level="1"] .pw-word { color: #a8321f; }
.pw-meter[data-level="3"] .pw-word { color: #1a7a44; }
.pw-meter:not([data-level]) .pw-bar, .pw-meter[data-level="0"] .pw-bar { visibility: hidden; }
.field-note { margin: -6px 0 0; min-height: 18px; font-size: .85rem; color: var(--muted, #5b6072); }
.field-note.good { color: #1a7a44; font-weight: 600; }
.field-note.bad { color: #a8321f; }
