/* Dhivehi letters use Faruma (shipped with the app, works offline). unicode-range: only Thaana and the Dhivehi
   comma/semicolon/question mark come from it, so English text and numbers keep the app's own font. */
@font-face { font-family: "Faruma"; src: url("../fonts/faruma.woff") format("woff"); unicode-range: U+0780-07BF, U+060C, U+061B, U+061F; font-display: swap; }
/* English text: Raleway for headings, titles and big numbers; Quicksand for everything else. Both are open-licence
   (SIL OFL, see fonts/OFL-*.txt) variable fonts shipped with the app, so they work offline and look the same on every phone.
   Bold where it matters (headings, names, amounts, buttons, chosen tabs); light everywhere else. */
@font-face { font-family: "Raleway"; src: url("../fonts/raleway.woff") format("woff"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Quicksand"; src: url("../fonts/quicksand.woff") format("woff"); font-weight: 300 700; font-style: normal; font-display: swap; }
/* Dark theme (onyx and champagne gold): onyx canvas #121214, cards #1C1C20 (raised with drop shadows), ivory text #F2EDE4,
   champagne gold #C9A96E for primary buttons (onyx #121214 text on them), links and the chosen tab, hairline dividers #2E2D30.
   Alhudha-Institute — Apple-style theme: Al-Hudha teal accent, iOS system colours for the register, San Francisco type and pills.
   Tokens first, then the frame (side rail / tab bar), then each part, then the Apple layer at the end. Flat surfaces: no blur or glow. */
:root {
  /* Light theme (ivory and gold, to match the dark onyx and gold): ivory paper, white cards, onyx ink,
     onyx primary buttons with ivory text, antique gold #8A6A2F for links, chosen tabs, highlights and charts */
  --bg: #F7F4EE; --surface: #FFFFFF; --sunk: #EFE9DD; --raise: #FFFFFF;
  --ink: #1C1C20; --ink-2: #3E3B36; --ink-3: #494541; --line: #E7E1D6;
  --accent: #8A6A2F; --accent-fill: #1C1C20; --accent-ink: #F2EDE4; --accent-soft: rgba(138, 106, 47, .12); --accent-2: #B7832F;
  --pos: #248A3D; --neg: #E5352B;
  /* the open class on the Classes tab: a white pill with a thick champagne-gold outline here (17 Nov 2026, was an
     onyx block); a solid champagne-gold block with dark text in the dark theme. The students panel has the same outline. */
  --hl: #FFFFFF; --hl-ink: #1C1C20; --hl-ink-2: #494541; --hl-line: #C9A96E; --hl-ring: #C9A96E; --hl-bw: 2.5px;
  /* register codes in iOS system colours */
  --c-p: #34C759; --c-p-soft: rgba(52, 199, 89, .16); --c-p-ink: #fff;
  --c-r: #FF3B30; --c-r-soft: rgba(255, 59, 48, .14); --c-r-ink: #fff;
  --c-a: #FF9500; --c-a-soft: rgba(255, 149, 0, .16); --c-a-ink: #fff;
  --c-c: #5856D6; --c-c-soft: rgba(88, 86, 214, .14); --c-c-ink: #fff;
  --c-h: #FFCC00; --c-h-soft: rgba(255, 204, 0, .2); --c-h-ink: #3A2C00;
  /* Faruma first only catches Dhivehi letters (see its unicode-range); English uses Raleway / Quicksand */
  --f-display: "Faruma", "Raleway", system-ui, sans-serif;
  --f-body: "Faruma", "Quicksand", system-ui, sans-serif;
  --r: 22px; --r-sm: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .06);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214; --surface: #1C1C20; --sunk: rgba(242, 237, 228, .06); --raise: #26262B; --ink: #F2EDE4; --ink-2: #D2CCC1; --ink-3: #C9C4BA; --line: #2E2D30;
    --accent: #C9A96E; --accent-fill: #C9A96E; --accent-ink: #121214; --accent-soft: rgba(201, 169, 110, .16); --accent-2: #E3C08A; --pos: #30D158; --neg: #FF453A; --hl: #C9A96E; --hl-ink: #17140d; --hl-ink-2: #3a3019; --hl-line: #C9A96E; --hl-ring: transparent;
    --c-p: #30D158; --c-r: #FF453A; --c-a: #FF9F0A; --c-c: #5E5CE6; --c-h: #FFD60A;
    --c-p-soft: rgba(48, 209, 88, .2); --c-r-soft: rgba(255, 69, 58, .2); --c-a-soft: rgba(255, 159, 10, .2); --c-c-soft: rgba(94, 92, 230, .24); --c-h-soft: rgba(255, 214, 10, .18);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121214; --surface: #1C1C20; --sunk: rgba(242, 237, 228, .06); --raise: #26262B; --ink: #F2EDE4; --ink-2: #D2CCC1; --ink-3: #C9C4BA; --line: #2E2D30;
  --accent: #C9A96E; --accent-fill: #C9A96E; --accent-ink: #121214; --accent-soft: rgba(201, 169, 110, .16); --accent-2: #E3C08A; --pos: #30D158; --neg: #FF453A; --hl: #C9A96E; --hl-ink: #17140d; --hl-ink-2: #3a3019; --hl-line: #C9A96E; --hl-ring: transparent;
  --c-p: #30D158; --c-r: #FF453A; --c-a: #FF9F0A; --c-c: #5E5CE6; --c-h: #FFD60A;
  --c-p-soft: rgba(48, 209, 88, .2); --c-r-soft: rgba(255, 69, 58, .2); --c-a-soft: rgba(255, 159, 10, .2); --c-c-soft: rgba(94, 92, 230, .24); --c-h-soft: rgba(255, 214, 10, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; } /* no blue tap box on Android */
body { margin: 0; background: var(--bg); color: var(--ink); font: 300 17px/1.4 var(--f-body); font-feature-settings: "lnum" 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; letter-spacing: 0; }
.hero-num, .stats b, .sum3 b, .big, .owed b, .import-sum b, .time-chip, .fee-amt, .yc, .year td, .bar-v, .tally, .cal-day { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 700 25px/1.2 var(--f-display); letter-spacing: -.022em; }
h2 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
small { font-size: 12.5px; font-weight: 400; } /* small and grey text is never light: it would be too faint */
.muted { color: var(--ink-3); font-weight: 400; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.hint { color: var(--ink-3); font-size: 12.5px; font-weight: 400; }
.pad { padding: 12px 4px; }
.big { font: 650 22px var(--f-display); letter-spacing: -.015em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 16px; height: 16px; } .ic-xs { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- frame ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
#view { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 24px); outline: none; }
.rail { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative; }
.tabbar a .ic { width: 23px; height: 23px; transition: transform .2s; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on::before { content: ""; position: absolute; top: 7px; width: 46px; height: 30px; border-radius: 15px; background: var(--accent-soft); z-index: -1; }
.tabbar a:active .ic { transform: scale(.9); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 232px 1fr; }
  .tabbar { display: none; }
  .rail { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--raise); }
  .rail a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
  .rail a:hover { background: var(--sunk); }
  .rail a.on { background: var(--accent-soft); color: var(--accent); }
  #view { padding-bottom: 40px; max-width: 880px; width: 100%; }
}
.rail-brand { display: flex; align-items: center; gap: 10px; font: 650 18px var(--f-display); letter-spacing: -.015em; padding: 4px 8px 18px; }
/* the institute's mark, drawn in the current text colour (works in light and dark) */
.logo { width: 40px; height: 31px; flex: none; display: inline-block; background: currentColor;
  -webkit-mask: url(../icons/logo-mark.png) center / contain no-repeat; mask: url(../icons/logo-mark.png) center / contain no-repeat; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name b { font: 600 15.5px var(--f-display); letter-spacing: .02em; }
.brand-name small { font: 500 9.5px var(--f-display); letter-spacing: .42em; margin-top: 3px; color: var(--ink-2); }
.brand-name .brand-custom { letter-spacing: -.01em; font-size: 17px; }
.brand-full { width: 210px; height: 155px; margin: 0 auto 6px; background: var(--ink);
  -webkit-mask: url(../icons/logo-full.png) center / contain no-repeat; mask: url(../icons/logo-full.png) center / contain no-repeat; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- theme button (top corner of every screen) ---------- */
.theme-btn { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 60; width: 44px; height: 44px; border-radius: 999px;
  display: grid; place-items: center; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--accent); box-shadow: var(--shadow);
  cursor: pointer; transition: transform .35s var(--spring), background .2s; }
.theme-btn:active { transform: scale(.9); }
.theme-btn .ic { width: 22px; height: 22px; }
.shell #view .page-head { padding-right: 68px; }   /* leave room so the button never covers a screen's own buttons */
.shell-parent .preview-bar { padding-right: 68px; }

/* ---------- pages ---------- */
.page-head { padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.page-head.sticky { position: sticky; top: 0; z-index: 20; background: var(--bg); padding-top: calc(12px + env(safe-area-inset-top)); }
.page-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; margin-left: -4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sec-h { font: 700 12px var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.note-card { background: var(--sunk); border-radius: var(--r); padding: 14px 16px; color: var(--ink-2); }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.skeleton { height: 64px; border-radius: var(--r); background: linear-gradient(90deg, var(--sunk), var(--surface), var(--sunk)); background-size: 200% 100%; animation: sk 1.2s infinite linear; margin-bottom: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; transition: transform .1s, background .15s; }
.btn:active { transform: scale(.97); }
.btn:hover { background: var(--sunk); }
.btn-primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, var(--ink)); }
.btn-danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn-ghost-danger { border-color: transparent; background: none; color: var(--neg); padding: 0 10px; }
.btn-ghost-danger:hover { background: var(--c-r-soft); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn.is-busy { opacity: .6; pointer-events: none; }
.btn-google { width: 100%; background: var(--surface); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--sunk); }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .mini-search {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); font-size: 16px;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:not([type=checkbox]):not([type=radio]):focus, .field select:focus, .field textarea:focus, .mini-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.field input[readonly] { color: var(--ink-3); font-weight: 400; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-err { color: var(--neg); font-weight: 600; font-size: 14px; }
.ok-msg { color: var(--pos); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); font-weight: 400; }
.search input { flex: 1; border: 0; background: none; min-height: 44px; outline: none; font-size: 16px; color: var(--ink); }
.mini-search { min-height: 40px; margin-bottom: 6px; }

/* segmented control */
.seg { display: flex; padding: 3px; gap: 3px; background: var(--sunk); border-radius: 12px; }
.seg-opt { flex: 1; position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 0 10px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); text-align: center; white-space: nowrap; transition: background .15s, color .15s; }
.seg-opt span small { color: var(--ink-3); font-weight: 600; }
.seg-opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); }
.seg-sm .seg-opt span { min-height: 34px; font-size: 13.5px; padding: 0 8px; }
.seg-scroll { overflow-x: auto; scrollbar-width: none; } .seg-scroll .seg-opt { flex: 1 0 auto; }
.seg-icons .seg-opt span .ic { width: 16px; height: 16px; }
.seg-codes { flex-wrap: wrap; }
.seg-codes .seg-opt { flex: 1 1 30%; }
.seg-codes .seg-opt span { flex-direction: column; gap: 0; min-height: 50px; font-size: 12px; }
.seg-codes .seg-opt span b { font-size: 16px; }
.seg-codes .seg-opt input:checked + span { color: var(--k-ink); background: var(--k); }
.code-p { --k: var(--c-p); --k-soft: var(--c-p-soft); --k-ink: var(--c-p-ink); }
.code-r { --k: var(--c-r); --k-soft: var(--c-r-soft); --k-ink: var(--c-r-ink); }
.code-a { --k: var(--c-a); --k-soft: var(--c-a-soft); --k-ink: var(--c-a-ink); }
.code-c { --k: var(--c-c); --k-soft: var(--c-c-soft); --k-ink: var(--c-c-ink); }
.code-h { --k: var(--c-h); --k-soft: var(--c-h-soft); --k-ink: var(--c-h-ink); }

/* pills, dots, avatar */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.code-p, .pill.code-r, .pill.code-a, .pill.code-c, .pill.code-h { background: var(--k-soft); color: var(--ink); }
.pill-ok { background: var(--c-p-soft); color: var(--pos); }
.st-paid { background: var(--c-p-soft); color: var(--pos); }
.st-partial { background: var(--c-a-soft); color: color-mix(in srgb, var(--c-a) 55%, var(--ink)); }
.st-unpaid { background: var(--c-r-soft); color: var(--neg); }
.st-stopped { background: var(--sunk); color: var(--ink-3); font-weight: 400; }
.st-break { background: var(--c-c-soft); color: color-mix(in srgb, var(--c-c) 60%, var(--ink)); }
.st-free { background: var(--sunk); color: var(--ink-3); font-weight: 400; }
.st-checking { background: var(--accent-soft); color: var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-owed { background: var(--c-r); }
.av { --h: 160; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; font-weight: 700; font-size: 14px; letter-spacing: .02em;
  background: hsl(var(--h) 45% 88%); color: hsl(var(--h) 45% 26%); }
:root[data-theme="dark"] .av { background: hsl(var(--h) 30% 24%); color: hsl(var(--h) 50% 82%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av { background: hsl(var(--h) 30% 24%); color: hsl(var(--h) 50% 82%); } }
.av-sm { width: 28px; height: 28px; font-size: 11px; }
.av-lg { width: 56px; height: 56px; font-size: 19px; }
.av-mask { background: var(--sunk) !important; }   /* attendance sheet, names hidden: a blank circle, no initials, no color */

/* ---------- today / register ---------- */
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-btn { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font: 650 18px var(--f-display); letter-spacing: -.015em; cursor: pointer; }
.date-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.date-btn input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.tally { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.tally:empty { display: none; }
.cls-sec { display: flex; flex-direction: column; gap: 6px; }
.cls-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 2px; }
.cls-head h2 { font: 650 17px var(--f-display); letter-spacing: -.015em; }
.cls-head .muted { font-size: 13px; }
.rows { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.srow { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 0; min-height: 64px; border-bottom: 1px solid var(--line); position: relative; background: var(--surface); color: var(--ink); text-decoration: none; }
.srow:last-child { border-bottom: 0; }
.srow::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.srow.is-p::before { background: var(--c-p); } .srow.is-r::before { background: var(--c-r); } .srow.is-a::before { background: var(--c-a); } .srow.is-c::before { background: var(--c-c); } .srow.is-h::before { background: var(--c-h); }
.srow.is-cant-attend::before { background: var(--warn, var(--c-a)); }
.today-line.cant-flag { color: var(--warn-ink, var(--c-a)); }
.srow-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 10px 0 10px 12px; text-align: left; align-self: stretch; }
.srow-link { padding: 10px 12px; gap: 12px; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.srow-link:hover, .srow-main:hover { background: var(--raise); }
.srow-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.srow-text b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-line { color: var(--accent); font-weight: 600; }
.codes { display: flex; gap: 6px; flex: none; }
.code { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3); font-weight: 700; font-size: 14px; transition: transform .12s, background .15s, color .15s, border-color .15s; padding: 0; }
.code:not(.on):hover { border-color: var(--k); color: var(--k); }
.code.on { background: var(--k); border-color: var(--k); color: var(--k-ink); }
.code:active { transform: scale(.88); }
.code.sm { width: 24px; height: 24px; font-size: 11px; font-style: normal; border-width: 0; }
.more-row { display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-2); font-weight: 600; padding: 8px 2px; }
.rows-card { margin-top: 2px; }
.fee-srow .srow-main { padding-right: 4px; }

/* ---------- student ---------- */
.stu-head { gap: 14px; }
.stu-id { display: flex; gap: 14px; align-items: center; }
.stu-id h1 { font-size: 23px; }
.stu-id p { font-size: 13.5px; margin-top: 2px; }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.tabs button { border: 0; background: none; padding: 12px 10px; font-weight: 600; color: var(--ink-3); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs + .page-body { padding-top: 16px; }
.hero { display: flex; flex-direction: column; gap: 4px; }
.hero-num { font: 700 40px/1 var(--f-display); letter-spacing: -.03em; color: var(--accent); }
.hero-sub { color: var(--ink-2); font-weight: 500; }
.now { margin-top: 6px; }
/* a lesson that opens on Quran.com */
.q-link { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.q-link:hover { text-decoration-color: currentColor; }
/* the book button beside a lesson (Today rows, the student's lesson list) */
.q-btn { width: 34px; height: 34px; flex: none; color: var(--accent); }
.q-btn .ic { width: 19px; height: 19px; }
.timeline li.tl-has-q { position: relative; }
.timeline li.tl-has-q .tl-item { padding-right: 44px; }
.tl-q { position: absolute; right: 2px; top: 8px; }
.bar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; margin-top: 8px; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.juz-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.juz { position: relative; aspect-ratio: 1; border-radius: 7px; background: var(--sunk); overflow: hidden; display: grid; place-items: center; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.juz::before { content: ""; position: absolute; inset: 0; background: var(--accent); opacity: var(--f); }
.juz b { position: relative; font-weight: 700; }
.juz.full b { color: var(--accent-ink); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { display: flex; flex-direction: column; background: var(--raise); border-radius: var(--r-sm); padding: 10px; }
.stats b { font: 650 22px var(--f-display); letter-spacing: -.015em; }
.stats span { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar-b { width: 100%; max-width: 36px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: var(--accent); opacity: .85; }
.bar-v { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.bar-l { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
/* month / year picker on a student's progress */
.stat-head { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.stat-nav { display: flex; align-items: center; gap: 4px; }
.stat-nav h3 { margin: 0; min-width: 8.5em; text-align: center; }
.stat-nav .icon-btn:disabled { opacity: .3; pointer-events: none; }
button.bar-col { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; border-radius: var(--r-sm); }
button.bar-col:hover .bar-b { opacity: 1; }
.bar-col.on .bar-b { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.bar-col.on .bar-l { color: var(--ink); font-weight: 700; }
.bars:has(.bar-col.on) .bar-col:not(.on) .bar-b { opacity: .45; }
.bar-future .bar-b { opacity: .15; }
.bars-12 { gap: 4px; }
.stats .st-sub { font-size: 11.5px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.bars-12 .bar-l, .bars-12 .bar-v { font-size: 10.5px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.timeline li:last-child .tl-item { border-bottom: 0; }
button.tl-item:hover { background: var(--raise); }
.tl-item .code { margin-top: 1px; }
.tl-text { display: flex; flex-direction: column; min-width: 0; }
.tl-note { margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.cal-nav h3 { font: 650 17px var(--f-display); letter-spacing: -.015em; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd span { text-align: center; font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
.cal-day { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; position: relative; padding: 0; color: var(--ink-2); }
.cal-day small { font-size: 10px; font-weight: 700; line-height: 1; }
/* a moved class (C) that was made up on its new day: C✓ */
.code.sm.made-up { width: auto; min-width: 24px; padding: 0 5px; border-radius: 99px; }
.code.made-up:not(.sm) { font-size: 13px; letter-spacing: -.02em; }
.cal-day.on { background: var(--k); border-color: var(--k); color: var(--k-ink); }
/* today: the date is bold and underlined (the outline is kept for nothing, so a tapped day can't be mistaken for today) */
.cal-day.is-today > span { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cal-day.has-lesson::after { content: ""; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
/* legend key: a small calendar square, the same as the days */
.lg-sw { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--k-soft); box-shadow: inset 0 -2px 0 var(--k); font-style: normal; }
.lg-sw small { font-size: 10.5px; font-weight: 700; line-height: 1; color: color-mix(in srgb, var(--k) 80%, var(--ink)); }
.lg-sw.code-h small { color: color-mix(in srgb, var(--k) 45%, var(--ink)); }
/* parents: tap a day to see it */
button.cal-day { cursor: pointer; font: inherit; }
/* the tapped day (parents): fills with its full colour; on the tap two rings ripple out, then a soft glow settles and stays.
   A deliberate exception to "no glow": only here. Only opacity and transform animate (smooth on phones). */
.cal-day.picked, .cal-day.on.picked { background: var(--k); color: var(--k-ink); box-shadow: none; z-index: 2; }
.cal-day.picked small, .cal-day.on.picked small, .cal-day.code-h.on.picked small { color: var(--k-ink); }
.cal-day.picked.has-lesson::after { background: var(--k-ink); }
.pk-fx { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.pk-fx b { position: absolute; inset: 0; border-radius: inherit; }
.pk-glow { box-shadow: 0 0 14px 3px color-mix(in srgb, var(--k) 55%, transparent); z-index: -1; }
.pk-ring { border: 2px solid var(--k); opacity: 0; }
.pk-new .pk-ring { will-change: transform, opacity; animation: pk-ripple 1s cubic-bezier(.22, .61, .36, 1) both; }
.pk-new .pk-ring + .pk-ring { animation-delay: .38s; }
.pk-new .pk-glow { will-change: opacity; animation: pk-settle .7s ease-out .75s both; }
@keyframes pk-ripple { from { transform: scale(1); opacity: .75; } to { transform: scale(1.6); opacity: 0; } }
@keyframes pk-settle { from { opacity: 0; } to { opacity: 1; } }
.day-card { position: relative; margin: 10px 0 4px; padding: 4px 12px; border-radius: var(--r-sm); background: var(--raise); border: 1px solid var(--line); }
.day-card .tl-item { border-bottom: 0; padding-right: 40px; }
.day-x { position: absolute; top: 6px; right: 6px; }
.fee-list { display: flex; flex-direction: column; }
.fee-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; }
.fee-row:last-child { border-bottom: 0; }
.fee-row > span:first-child { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fee-amt { font-weight: 650; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 14px; white-space: nowrap; }
.owed { text-align: right; } .owed small { display: block; color: var(--ink-3); font-weight: 400; } .owed b { color: var(--neg); font: 650 20px var(--f-display); letter-spacing: -.015em; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { display: flex; gap: 8px; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.notes li:last-child { border-bottom: 0; }
.notes p { white-space: pre-wrap; }
.flag { background: var(--c-a-soft); padding: 10px 12px; border-radius: 10px; font-weight: 600; }

/* ---------- fees ---------- */
.summary .sum3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sum3 div { display: flex; flex-direction: column; }
.sum3 small { color: var(--ink-3); font-weight: 600; }
.sum3 b { font: 650 19px var(--f-display); letter-spacing: -.015em; white-space: nowrap; }
.year-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.year { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.year th, .year td { padding: 0; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.year thead th { padding: 8px 6px; font-size: 12px; color: var(--ink-3); position: sticky; top: 0; background: var(--surface); font-weight: 400; }
.year tbody th, .year tfoot th { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 8px 10px; font-weight: 600; z-index: 1; max-width: 140px; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--line); }
.year td button { width: 100%; min-width: 50px; height: 36px; border: 0; background: none; font-weight: 600; font-size: 12.5px; color: inherit; }
.yc.st-paid { background: var(--c-p-soft); color: var(--pos); }
.yc.st-partial { background: var(--c-a-soft); }
.yc.st-unpaid { background: var(--c-r-soft); color: var(--neg); }
.yc.yc-future { background: none; }
.yc.st-stopped { background: var(--sunk); color: var(--ink-3); font-weight: 400; }
.yc.st-break { background: var(--c-c-soft); }
.yt, .year tfoot td { font-weight: 700; padding: 0 10px; }
.year tfoot td { padding: 8px 6px; }
.year tr.is-left th { color: var(--ink-3); font-weight: 500; }

/* ---------- attendance sheet (Students > Attendance) ---------- */
.att td.yc { padding: 8px 2px; font-weight: 700; font-size: 12.5px; }   /* plain cells, no button like the fee year-view has */
.att .yc.code-p { background: var(--c-p-soft); color: color-mix(in srgb, var(--c-p) 55%, var(--ink)); }
.att .yc.code-r { background: var(--c-r-soft); color: color-mix(in srgb, var(--c-r) 55%, var(--ink)); }
.att .yc.code-a { background: var(--c-a-soft); color: color-mix(in srgb, var(--c-a) 55%, var(--ink)); }
.att .yc.code-c { background: var(--c-c-soft); color: color-mix(in srgb, var(--c-c) 55%, var(--ink)); }
.att .yc.code-h { background: var(--c-h-soft); color: color-mix(in srgb, var(--c-h) 55%, var(--ink)); }
.att th.is-today, .att td.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.att-sep th { background: var(--sunk); font-weight: 700; padding: 6px 10px; position: static; max-width: none; overflow: visible; text-overflow: clip; box-shadow: none; }
.att-name { display: inline-flex; align-items: center; gap: 8px; }
.att-name .av { width: 26px; height: 26px; font-size: 10px; }
/* day-of-week row above the date numbers, with the weekend tinted so a run of blanks reads as "no class" */
.att thead tr.wk th { position: sticky; top: 0; padding: 3px 6px 1px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); }
.att thead tr.dates th { position: sticky; top: 21px; }
.att thead tr.wk th.is-weekend { color: color-mix(in srgb, var(--accent) 70%, var(--ink-3)); }
/* a day with no class at all (off the class's weekly days, no make-up session that day, or a confirmed holiday) */
.att .yc.yc-off { color: var(--ink-3); font-weight: 400; background: var(--sunk); }
/* a cancelled class still waiting on a make-up: small dot; once shortCode() shows "C✓" the dot drops away */
.att .yc.needs-makeup { position: relative; }
.att .yc.needs-makeup::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--neg); box-shadow: 0 0 0 1.5px var(--surface); }
.att .yc.made-up { letter-spacing: -.04em; }
/* a student's rate under the follow-up threshold */
.yt.yt-low { color: var(--neg); }
/* one badge per class per date — a group class is cancelled once for everyone, not once per student */
.att td.att-resched, .att .att-sep td.att-resched { padding: 0 10px; text-align: left; white-space: nowrap; }

/* ---------- more ---------- */
.menu { display: flex; flex-direction: column; }
.menu > a, .menu > button { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-decoration: none; font-weight: 600; text-align: left; flex-wrap: wrap; }
.menu > *:last-child { border-bottom: 0; }
.menu small { color: var(--ink-3); font-weight: 500; flex: 1 0 auto; order: 3; width: 100%; margin-left: 32px; margin-top: -10px; }
.menu > a .ic:last-child { margin-left: auto; }
.menu-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.menu-card > a:hover, .menu-card > button:hover { background: var(--raise); }
.sheet .menu > button { border-radius: 12px; }
.sheet .menu > button:hover { background: var(--sunk); }
.sheet .menu small { margin-left: 52px; }
.time-chip { font: 650 14px var(--f-display); letter-spacing: -.015em; background: var(--accent-soft); color: var(--accent); padding: 6px 8px; border-radius: 8px; min-width: 56px; text-align: center; }
.days { display: flex; gap: 5px; flex-wrap: wrap; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; }
.days span { display: grid; place-items: center; min-width: 46px; height: 38px; border-radius: 10px; background: var(--sunk); font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.days input:checked + span { background: var(--accent-fill); color: var(--accent-ink); }
.days input:focus-visible + span { outline: 2px solid var(--accent); }
.pick-list { display: flex; flex-direction: column; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-list label:last-child { border-bottom: 0; }
.pick-list input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.import-sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.import-sum div { background: var(--raise); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.import-sum b { font: 650 22px var(--f-display); letter-spacing: -.015em; }
.import-sum span { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.signed { align-items: flex-start; }

/* ---------- parent ---------- */
.parent-head { padding-top: calc(16px + env(safe-area-inset-top)); }
.parent-head .rail-brand { padding: 0; }
.kid-card { flex-direction: row; align-items: center; gap: 14px; }
.kid-card h1 { font-size: 22px; }
.kid-tabs { display: flex; gap: 6px; overflow-x: auto; }
.kid-tabs button { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.kid-tabs button.on { border-color: var(--accent); background: var(--accent-soft); }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--c-h-soft); font-size: 14px; }
.preview-bar span { flex: 1; }
.preview-bar a { font-weight: 700; }
/* Home tab's compact two-tile row into Progress / Fees */
.tiles { display: flex; gap: 10px; }
.tiles .tile { flex: 1; min-width: 0; text-decoration: none; color: inherit; gap: 4px; }
.tile-num { font: 650 19px var(--f-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.tile-label { display: flex; align-items: center; gap: 2px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.tile-label .ic { width: 15px; height: 15px; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(10, 16, 14, .42); opacity: 0; transition: opacity .22s; }
.sheet { position: relative; width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.18);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .9, .25, 1); padding-bottom: env(safe-area-inset-bottom); }
.sheet-wrap.in .sheet-back { opacity: 1; }
.sheet-wrap.in .sheet { transform: none; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px 20px; flex: none; }
.sheet-head h2 { flex: 1; font: 650 20px var(--f-display); letter-spacing: -.015em; }
.sheet-body { overflow: auto; padding: 8px 20px 18px; flex: 1; overscroll-behavior: contain; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); flex: none; }
.sheet-foot .btn-primary { min-width: 120px; }
.foot-left { display: flex; gap: 6px; align-items: center; }
.sheet-sub { color: var(--ink-3); font-size: 13.5px; margin-top: -6px; font-weight: 400; }
.sheet-confirm .sheet-body:empty { display: none; }
.sheet-confirm .sheet-foot { border-top: 0; flex-wrap: wrap; row-gap: 8px; }
.foot-left { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.sheet-foot .btn { padding: 0 16px; font-size: 15px; }
body.has-sheet { overflow: hidden; }
@media (min-width: 760px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 22px; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .22s, opacity .22s; }
  .sheet-wrap.in .sheet { opacity: 1; }
  .sheet-wide { max-width: 820px; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 14px; }
}
.lesson-ed { display: flex; flex-direction: column; gap: 10px; }
.ed-pane { display: flex; flex-direction: column; gap: 10px; }
.rev { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-top: 10px; }
.rev summary { padding: 12px 0; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.rev[open] { padding-bottom: 12px; }
.receipts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 8px; }
.receipts p { grid-column: 1 / -1; }
.rcpt { aspect-ratio: 3 / 4; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: var(--sunk); padding: 0; display: grid; place-items: center; }
.rcpt img { width: 100%; height: 100%; object-fit: cover; }
.rcpt-load { background: linear-gradient(90deg, var(--sunk), var(--surface), var(--sunk)); background-size: 200% 100%; animation: sk 1.2s infinite linear; width: 100%; height: 100%; }
.rcpt-pdf { font-weight: 800; color: var(--neg); }
.rcpt-full { display: block; max-width: 100%; margin: 0 auto; border-radius: 10px; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

/* ---------- gate (sign in) ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.gate-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.gate-card .stack { text-align: left; }
.gate-card h1 { font-size: 32px; }
.gate .brand-mark .logo { width: 60px; height: 60px; margin: 0 auto 4px; display: block; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; font-weight: 400; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
code { background: var(--sunk); padding: 1px 6px; border-radius: 6px; font-size: .92em; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
body.has-sheet #toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 480px; padding: 11px 14px 11px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); transform: translateY(10px); opacity: 0; transition: transform .2s, opacity .2s; }
.toast.in { transform: none; opacity: 1; }
.toast-err { background: var(--neg); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; }
@media (min-width: 900px) { #toasts { bottom: 20px; } }

@media (max-width: 380px) {
  .code { width: 36px; height: 36px; }
  .codes { gap: 4px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .sum3 b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.juz-pick span { min-width: 38px; height: 34px; }

/* student switcher (top of a student's page) */
.switcher { margin: 12px 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.switcher:empty { display: none; }
.sw-bar { display: flex; align-items: center; gap: 2px; padding: 2px; }
.sw-bar .icon-btn:disabled { opacity: .3; cursor: default; }
.sw-toggle { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; background: none; font-weight: 650; color: var(--ink-2); border-radius: 10px; }
.sw-toggle:hover { background: var(--sunk); }
.sw-search { margin: 0 8px 6px; min-height: 0; background: var(--raise); }
.sw-search input { min-height: 38px; font-size: 15px; }
.sw-list { max-height: calc(5 * 50px); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); scroll-behavior: auto; }
.sw-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: var(--ink); }
.sw-item:last-child { border-bottom: 0; }
.sw-item:hover { background: var(--raise); }
.sw-item > span:not(.av) { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sw-item b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-item small { font-size: 12px; }
.sw-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.sw-item.on b { color: var(--accent); }
.switcher + [data-head] .stu-head { padding-top: 12px; }

/* foldable classes on Today */
.cls-toggle { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 4px 4px 0; text-align: left; color: inherit; min-width: 0; border-radius: 10px; }
.cls-toggle > span { display: flex; flex-direction: column; min-width: 0; }
.cls-toggle .fold-ic { transition: transform .18s; color: var(--ink-3); font-weight: 400; }
.is-shut .cls-toggle .fold-ic { transform: rotate(-90deg); }
.is-shut .cls-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 4px 6px 12px; }
.fold-sum { display: flex; gap: 4px; }
.fold-sum .code.sm { width: auto; min-width: 24px; padding: 0 6px; border-radius: 99px; }

/* computer: the student list sits in its own column on the left */
@media (min-width: 900px) {
  /* the student list sits on the right, in the free space beside the student */
    #view.stu-page { display: grid; grid-template-columns: minmax(0, 1fr) 290px; grid-template-rows: auto auto 1fr; align-items: start; max-width: 1240px; }
  .stu-page > .switcher { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 16px; margin: 16px 16px 16px 0; }
  .stu-page > :not(.switcher) { grid-column: 1; min-width: 0; }
  .stu-page .sw-list { max-height: calc(100vh - 150px); }
  .stu-page .switcher + [data-head] .stu-head { padding-top: 18px; }
  .stu-page .stu-head .back { display: none; }
}

.notice-row { align-items: flex-start; padding: 12px 14px; }
.notice-body { margin-top: 4px; white-space: pre-wrap; font-size: 14px; color: var(--ink-2); }
.notify-card .sec-h { display: flex; align-items: center; gap: 6px; }
.cls-head h2 small { font-weight: 600; }

.banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; }
.banner-warn { background: var(--c-a-soft); color: var(--ink); }
.notices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.notices li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.notices li:last-child { border-bottom: 0; }
.notices li p { margin: 2px 0; white-space: pre-wrap; }
.notices .code.sm { flex: none; }

/* =====================================================================================================
   APPLE LAYER — iOS shapes and type
   ===================================================================================================== */
/* large titles, iOS type scale */
h1 { font: 700 30px/1.15 var(--f-display); letter-spacing: -.02em; }
.page-head > h1, .page-head .row-between > h1 { font-size: 34px; letter-spacing: -.025em; }
.cls-head h2, .cal-nav h3 { font-weight: 650; font-size: 20px; letter-spacing: -.02em; }
.sec-h { font: 600 13px var(--f-body); letter-spacing: -.005em; text-transform: none; color: var(--ink-3); }
.hint, small { letter-spacing: 0; }
.back { color: var(--accent); font-weight: 500; font-size: 17px; }
.back .ic { stroke-width: 2.4; }

/* pills: every button is a capsule; springy press */
.btn { border-radius: 999px; min-height: 44px; padding: 0 20px; font-weight: 600; font-size: 16px; border: 0; background: var(--sunk); color: var(--accent);
  transition: transform .35s var(--spring), background .2s, box-shadow .2s; }
.btn:hover { background: color-mix(in srgb, var(--sunk) 100%, var(--accent) 6%); }
.btn:active { transform: scale(.95); transition-duration: .08s; }
.btn-primary { background: var(--accent-fill); color: var(--accent-ink); box-shadow: none; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 90%, #000); }
.btn-danger { background: var(--c-r); color: #fff; }
.btn-ghost-danger { background: none; color: var(--neg); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 999px; }
.btn-google { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; }
.icon-btn { border-radius: 999px; color: var(--accent); transition: transform .35s var(--spring), background .2s; }
.icon-btn:active { transform: scale(.9); }
.link { color: var(--accent); font-weight: 500; font-size: 15px; }

/* iOS fields: filled, no border, blue focus */
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-3); padding-left: 4px; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .mini-search { border: 1px solid var(--field-line); background: var(--field-bg); border-radius: 12px; font-size: 17px; min-height: 46px; }
:root { --field-bg: #FBF9F5; --field-line: #DDD5C6; }
:root[data-theme="dark"] { --field-bg: rgba(242, 237, 228, .05); --field-line: #3A3833; }
:root[data-theme="dark"] .toast { background: #2A2A2F; color: var(--ink); }
.field input:not([type=checkbox]):not([type=radio]):focus, .field select:focus, .field textarea:focus, .mini-search:focus { box-shadow: 0 0 0 1px var(--accent) inset; }
.search { border: 1px solid var(--field-line); background: var(--field-bg); border-radius: 999px; padding: 0 14px; }
.search input { font-size: 17px; min-height: 40px; }
.check input, .pick-list input { accent-color: var(--accent); }

/* segmented control: capsule track, floating thumb */
.seg { border-radius: 999px; padding: 3px; background: var(--sunk); }
.seg-opt span { border-radius: 999px; font-weight: 600; color: var(--ink); transition: background .25s, box-shadow .25s, transform .35s var(--spring); }
.seg-opt input:checked + span { background: var(--surface); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }
.seg-codes { border-radius: 20px; }
.seg-codes .seg-opt span { border-radius: 16px; }

/* chips */
.pill { border-radius: 999px; padding: 4px 11px; font-size: 13px; }
.time-chip { border-radius: 999px; padding: 6px 10px; }
.days span { border-radius: 999px; }
.kid-tabs button { border: 0; background: var(--sunk); }
.kid-tabs button.on { background: var(--accent-fill); color: var(--accent-ink); }

/* date pill on Today */
.date-btn { border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 650; font-size: 19px; }

/* P / R / A: round, filled when chosen */
.code { border: 0; background: var(--sunk); color: var(--ink-2); font-weight: 650; transition: transform .35s var(--spring), background .2s, color .2s, box-shadow .2s; }
.code:not(.on):hover { background: var(--k-soft); color: var(--k); }
.code.on { box-shadow: none; }
.code:active { transform: scale(.85); transition-duration: .08s; }
.cal-day { border: 0; background: var(--sunk); border-radius: 12px; }

/* inset grouped lists: rounded, separators start after the avatar */
.rows, .menu-card, .switcher { border: 0; border-radius: var(--r); box-shadow: var(--shadow); }
.card { border: 0; border-radius: var(--r); box-shadow: var(--shadow); }
.srow { border-bottom: 0; background: transparent; }
.srow::after { content: ""; position: absolute; left: 64px; right: 0; bottom: 0; height: 1px; background: var(--line); transform: scaleY(.6); transform-origin: bottom; }
.srow:last-child::after, .srow-link:last-child::after { display: none; }
.srow-link::after { left: 16px; }
.srow::before { top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; }
.menu > a, .menu > button { border-bottom: 0; position: relative; font-weight: 500; font-size: 17px; }
.menu > a + a::before, .menu > a + button::before, .menu > button + a::before, .menu > button + button::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; height: 1px; background: var(--line); transform: scaleY(.6); }
.menu > a .ic:first-child, .menu > button .ic:first-child { color: var(--accent); }
.sw-item { border-bottom: 0; }
.sw-item.on { box-shadow: none; background: var(--accent-soft); }
.is-shut .cls-head { border: 0; box-shadow: var(--shadow); border-radius: 999px; padding: 4px 6px 4px 14px; }

/* student tabs become a capsule switcher */
.tabs { border-bottom: 0; gap: 6px; padding: 8px 16px; background: var(--bg); }
.tabs button { border-bottom: 0; border-radius: 999px; padding: 8px 16px; color: var(--ink-2); font-size: 15px; transition: background .25s, color .25s; }
.tabs button.on { color: var(--accent-ink); background: var(--accent-fill); }

/* big numbers in SF Rounded where available */
.juz { border-radius: 9px; }
.bar-b { border-radius: 8px 8px 3px 3px; }

/* sheets: big round corners, grabber, no hard lines */
.sheet { border-radius: 34px 34px 0 0; }
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink-3) 50%, transparent); margin-top: 7px; }
.sheet-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sheet-head .icon-btn { background: var(--sunk); color: var(--ink-3); width: 32px; height: 32px; font-weight: 400; }
.sheet-foot { border-top: 0; flex-wrap: wrap; row-gap: 8px; }
.foot-left { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.sheet-foot .btn { padding: 0 16px; font-size: 15px; }
.sheet-back { background: rgba(0, 0, 0, .28); }
@media (min-width: 760px) { .sheet { border-radius: 34px; } }

/* toasts: solid dark capsules, like iOS banners */
.toast { border-radius: 999px; padding: 12px 18px; background: #1C1C1E; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast button { text-decoration: none; color: #C9A96E; font-weight: 600; } /* champagne gold on the dark capsule, both themes */
.toast-err { background: rgba(255, 59, 48, .92); }

/* tab bar labels like iOS */
.tabbar a { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: var(--ink-3); }
.tabbar a .ic { width: 25px; height: 25px; stroke-width: 1.9; transition: transform .35s var(--spring); }
.tabbar a.on { color: var(--accent); }
.tabbar a.on .ic { stroke-width: 2.2; }
@media (min-width: 900px) {
  .rail a { border-radius: 999px; font-weight: 500; font-size: 16px; }
  .rail a.on { background: var(--accent-fill); color: var(--accent-ink); }
}

/* ---------- the public Apply page ---------- */
.apply { max-width: 620px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.apply > .spinner { margin-top: 30vh; }
.apply-head { text-align: center; display: flex; flex-direction: column; gap: 4px; padding: 6px 0 4px; }
.apply-head .brand-full { width: 170px; height: 125px; }
.apply-head h1 { font-size: 34px; letter-spacing: -.025em; }
.apply-classes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.apply-classes li { display: flex; align-items: center; gap: 12px; padding: 11px 0; position: relative; }
.apply-classes li + li::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; height: 1px; background: var(--line); transform: scaleY(.6); }
.apply-classes li > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.apply-fee { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.apply-fee b { font-family: var(--f-display); }
.apply-private { display: flex; gap: 8px; align-items: center; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.apply-note { white-space: pre-wrap; }
.apply-email { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--pos); }
.apply-email span { color: var(--ink); flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* Apply buttons on the class list, and the "You chose" line */
.apply-classes li, .apply-private { flex-wrap: wrap; }
.apply-private > span { flex: 1; min-width: 0; }
.apply-go { flex: none; min-height: 44px; min-width: 76px; }
.apply-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); scroll-margin-top: 12px; }
.apply-pick[hidden] { display: none; }
.apply-pick > .ic-sm { color: var(--pos); }
.apply-pick span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.apply-misfit { color: var(--ink); }
@media (max-width: 479px) {
  .apply-classes li > .apply-go { flex: 1 0 100%; }
  .apply-private > .apply-go { flex: 1 0 100%; }
}
.apply-tick { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--c-p); color: #fff; margin: 0 auto; }
.apply-tick .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.apply-done { text-align: center; align-items: center; }
.apply-mine { list-style: none; margin: 0; padding: 0; }
.apply-mine li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.apply-mine li > div { display: flex; flex-direction: column; min-width: 0; }
.apply-foot { text-align: center; }
fieldset.kid { margin: 0; min-width: 0; }
.kid h2 { font-size: 20px; letter-spacing: -.02em; }
.kid .pick-list { max-height: none; }
.apply-cta { color: var(--accent); }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--c-r); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.tabbar a .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }
.rail a .badge { margin-left: auto; }
.menu > a .badge { margin-left: 4px; }
.app-row .pill { flex: none; }

/* one kind of tick everywhere: round, iOS-style, centred on its text (multi- and single-choice look the same) */
.pick-list label { align-items: center; gap: 12px; padding: 11px 14px; min-height: 48px; }
.pick-list input[type="checkbox"], .pick-list input[type="radio"], .check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; min-width: 24px; min-height: 24px; padding: 0; margin: 0; flex: none; border-radius: 50%; cursor: pointer; box-shadow: none;
  border: 2px solid color-mix(in srgb, var(--ink-3) 70%, transparent); background: var(--surface); display: inline-grid; place-items: center;
  transition: background-color .15s, border-color .15s, transform .3s var(--spring);
}
.pick-list input:checked, .check input[type="checkbox"]:checked {
  border-color: var(--accent-fill); background: var(--accent-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.pick-list input:active, .check input:active { transform: scale(.88); }
.pick-list input:focus-visible, .check input:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.pick-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.3; }
.pick-text b { font-weight: 500; }
.pick-text small { font-size: 13px; }
.apply-days { display: flex; gap: 8px; align-items: center; padding: 2px 0 6px; color: var(--ink-2); }

.teacher-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.teacher-id > span:not(.av) { display: flex; flex-direction: column; min-width: 0; }

.rail-out { display: none; }
@media (min-width: 900px) {
  .rail-out { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 10px 12px; border: 0; background: none; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 16px; text-align: left; }
  .rail-out:hover { background: var(--sunk); color: var(--neg); }
}

/* text size (More › Appearance), per device, like Pocket Ledger: the whole app scales smoothly */
:root[data-fs] body { zoom: var(--fs-zoom, 1); }
:root[data-fs] .sheet { max-height: calc(92dvh / var(--fs-zoom, 1)); }
@media (min-width: 900px) { :root[data-fs] .rail { height: calc(100vh / var(--fs-zoom, 1)); } }
.fs-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.fs-a { font-weight: 700; color: var(--ink-2); line-height: 1; }
.fs-a.sm { font-size: 13px; } .fs-a.lg { font-size: 24px; }
.fs-range { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; touch-action: pan-y; }
.fs-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.fs-range::-moz-range-track { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
.fs-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.fs-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.fs-foot { display: flex; align-items: center; justify-content: space-between; }

.summary .sum3 { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.search input { min-width: 0; width: 100%; }
.seg-scroll { max-width: 100%; min-width: 0; }
.menu small { width: auto; flex: 1 0 calc(100% - 32px); max-width: calc(100% - 32px); overflow-wrap: anywhere; }
.sheet .menu small { flex-basis: calc(100% - 52px); max-width: calc(100% - 52px); }

.menu > a { padding-right: 42px; }
.menu > a > .ic:last-child { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); margin: 0; }

.menu > :is(a, button):has(> .mt) { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; align-items: center; }
.menu > :is(a, button):has(> .mt) > .ic:first-child { grid-row: 1 / span 2; align-self: center; }
.menu > :is(a, button):has(> .mt) > .mt { grid-column: 2; display: flex; align-items: center; gap: 6px; }
.menu > :is(a, button):has(> .mt) > small { grid-column: 2; margin: 0; max-width: none; flex: none; }

/* appearance option */
.opt-group { display: flex; flex-direction: column; gap: 6px; }
.opt-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* ---- arrow steppers (from/to pages, ayahs, surahs) ---- */
.step { display: flex; align-items: stretch; min-width: 0; border: 1px solid var(--field-line, var(--line)); background: var(--field-bg, var(--surface)); border-radius: 12px; overflow: hidden; }
.step:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.field .step input:not([type=checkbox]):not([type=radio]), .field .step select { flex: 1; min-width: 0; width: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; border-radius: 0; text-align: center; padding-left: 2px; padding-right: 2px; -moz-appearance: textfield; text-overflow: ellipsis; }
.field .step select { text-align: left; text-align-last: center; }
.field .step input:focus, .field .step select:focus { box-shadow: none !important; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { flex: 0 0 auto; width: 42px; min-height: 46px; display: grid; place-items: center; border: 0; background: transparent; color: var(--accent); cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.step-btn:active { background: var(--accent-soft); }
.step-btn .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.step-btn:first-child { border-right: 1px solid var(--line); }
.step-btn:last-child { border-left: 1px solid var(--line); }

/* ---- chips (absence reasons) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.chip { border: 1px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 999px; padding: 7px 13px; font: 600 14px var(--f-body); cursor: pointer; }
.chip.on { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }

/* ---- this day's private notes in the lesson sheet / timelines ---- */
.day-notes { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.day-notes li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 6px 8px 12px; border-radius: 12px; background: color-mix(in srgb, #FF9F0A 14%, transparent); }
.day-notes li p { flex: 1; margin: 0; white-space: pre-wrap; font-size: 15px; }
.tl-priv { background: color-mix(in srgb, #FF9F0A 14%, transparent); display: flex; gap: 6px; align-items: flex-start; }
.tl-priv .ic { flex: 0 0 auto; margin-top: 2px; }

.step .pick-field { flex: 1; min-width: 0; display: grid; }
.step .pick-field::after { display: none; }

/* ---- the app's own dropdown (js/picker.js) ---- */
.pick-field { display: inline-grid; position: relative; max-width: 100%; min-width: 0; cursor: pointer; }
.field .pick-field { display: grid; }
.pick-field > select { pointer-events: none; -webkit-appearance: none; appearance: none; padding-right: 36px; text-overflow: ellipsis; }
.pick-field::after { content: ""; position: absolute; right: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; pointer-events: none; background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9.5 5-5 5 5M7 14.5l5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9.5 5-5 5 5M7 14.5l5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.step .pick-field > select { padding-right: 2px; }
.pick-field.open > select { border-color: var(--accent); }
.pick-wrap { position: fixed; inset: 0; z-index: 150; }
.pick-catch { position: absolute; inset: 0; }
.pick-pop { position: fixed; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px;
  background: var(--raise);
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 12px 32px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .08); will-change: transform, opacity; }
:root[data-theme="dark"] .pick-pop { box-shadow: 0 14px 36px rgba(0, 0, 0, .55); border-color: #3A3833; }
.pick-search { margin: 8px 8px 2px; padding: 9px 12px; border-radius: 10px; border: 0; background: var(--sunk); font-size: 16px; min-height: 38px; outline: none; }
.pick-search:focus { box-shadow: 0 0 0 1px var(--accent) inset; }
.pick-list { overflow-y: auto; overscroll-behavior: auto; padding: 6px; display: grid; gap: 1px; align-content: start; }
.pick-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.pick-opt:hover, .pick-opt:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); outline: none; }
.pick-opt[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.pick-opt .pick-tick { flex: none; color: var(--accent); }
.pick-none { padding: 12px; color: var(--ink-3); margin: 0; font-weight: 400; }

/* ---- show password ---- */
.pw-wrap { position: relative; display: grid; min-width: 0; }
.field .pw-wrap input:not([type=checkbox]):not([type=radio]) { padding-right: 48px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: 10px; font-weight: 400; }
.pw-eye[aria-pressed="true"] { color: var(--accent); }
.pw-eye .ic { width: 22px; height: 22px; }

/* ---- confirm boxes sit in the middle of the screen (Apple alert style), on phones too ---- */
.sheet-wrap:has(.sheet-confirm) { align-items: center; padding: 20px; }
.sheet-wrap .sheet.sheet-confirm { max-width: 380px; border-radius: 26px; transform: scale(.94); opacity: 0; transition: transform .2s cubic-bezier(.2, .9, .3, 1.15), opacity .18s; padding-bottom: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.sheet-wrap.in .sheet.sheet-confirm { transform: none; opacity: 1; }
.sheet-confirm .sheet-grip { display: none; }
.sheet-confirm .sheet-head { padding-top: 18px; }
.sheet-confirm .sheet-head h2 { font-size: 18px; }
.sheet-confirm .sheet-foot { padding: 10px 14px 16px; }
.sheet-confirm .sheet-foot .btn { flex: 1; min-width: 0; }

/* ---- switch account ---- */
@media (min-width: 900px) { .rail-switch + .rail-out { margin-top: 0; } .rail-out.rail-switch:hover { color: var(--accent); } }
.acct-row[disabled] { opacity: 1; cursor: default; }
.acct-row.on .ic { color: var(--accent); }
.menu > .acct-row:has(> .mt) > .mt { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.acct-row .mt b { overflow-wrap: anywhere; max-width: 100%; font-weight: 600; }
.acct-row .mt small { display: block; margin: 0; width: auto; color: var(--ink-3); font-weight: 500; }
.sheet .menu > .acct-row[disabled] { background: var(--accent-soft); color: var(--ink); }
.acct-list { display: flex; flex-direction: column; gap: 8px; }
.acct-btn { display: flex; align-items: center; gap: 10px; text-align: left; justify-content: flex-start; height: auto; min-height: 52px; padding: 8px 14px; }
.acct-btn > span { display: flex; flex-direction: column; min-width: 0; }
.acct-btn b { overflow-wrap: anywhere; font-weight: 600; }

.field .step select, .field .step input { color: var(--ink); }
.sheet-confirm .sheet-x { display: none; }

/* ---- receipts: drop zone and read slips ---- */
.drop { border: 1.5px dashed transparent; border-radius: 16px; margin: -6px; padding: 6px; transition: border-color .15s, background .15s; }
.drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop-hint { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
@media (pointer: coarse) { .drop-hint { display: none; } }
.slips { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.slips:empty { display: none; }
.slip { border-radius: 14px; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line); font-size: 15px; }
.slip-busy { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-weight: 400; }
.spin-sm { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.slip-ok { border-color: color-mix(in srgb, var(--pos) 45%, transparent); }
.slip-warn { border-color: color-mix(in srgb, #FF9F0A 60%, transparent); }
.slip-bad { border-color: color-mix(in srgb, var(--neg) 60%, transparent); background: color-mix(in srgb, var(--neg) 7%, var(--surface)); }
.slip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.slip-head b { font-size: 18px; }
.slip-from { font-size: 13.5px; margin: 2px 0 0; }
.slip-checks { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.slip-checks li { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; }
.slip-checks .ic { flex: none; margin-top: 2px; }
.sc-ok .ic { color: var(--pos); } .sc-warn .ic { color: #FF9F0A; } .sc-bad { color: var(--neg); } .sc-info .ic { color: var(--ink-3); font-weight: 400; }
.verify-check { align-items: flex-start; }
.verify-check small { display: block; }
.pill-verified { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.stmt-sec { margin-top: 14px; }
.stmt-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.stmt-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stmt-list li > span:first-child { display: block; min-width: 0; }
.stmt-list li small { display: block; }
.stmt-bad .sec-h { color: var(--neg); }
.stmt-sec summary { cursor: pointer; font-weight: 600; padding: 6px 0; }

/* ---- v22 refresh: readable "last lesson" line, private classes together, register colours, wide screens ---- */
/* the line under a name may take two lines, so the last lesson is never cut off */
.srow-text small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; margin-top: 1px; }
.row-time { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; vertical-align: 1px; }
/* P / R / A keep a hint of their colour before they're tapped */
.code:not(.on) { color: color-mix(in srgb, var(--k) 78%, var(--ink-2)); }
/* register calendar: soft tints with the letter in colour, so a month reads calmly */
.cal-day.on { background: var(--k-soft); color: var(--ink); box-shadow: inset 0 -3px 0 var(--k); }
.cal-day.on small { color: color-mix(in srgb, var(--k) 80%, var(--ink)); }
.cal-day.code-h.on small { color: color-mix(in srgb, var(--k) 45%, var(--ink)); }
.cal-day.on.is-today { box-shadow: inset 0 -3px 0 var(--k); }
.cal-day.has-lesson::after { background: var(--k, currentColor); }
/* student switcher: "Enrolled · 6 of 32" stays on one line */
.sw-toggle { min-width: 0; padding: 0 6px; }
.sw-toggle > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Today on a wide screen: classes in two columns */
@media (min-width: 1180px) {
  #view.today-page { max-width: 1240px; }
}

/* a slip sent by a parent */
.banner .btn { margin-left: auto; flex: none; align-self: center; }
.fee-row-rej small { color: var(--neg); }
.slip-preview { display: flex; justify-content: center; background: var(--sunk); border-radius: 14px; padding: 8px; }
.slip-preview img { max-width: 100%; max-height: 46vh; border-radius: 10px; object-fit: contain; }
.sub-card { border-radius: 16px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sub-head { display: flex; gap: 10px; align-items: flex-start; }
.sub-head img, .sub-head .rcpt-pdf { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; cursor: zoom-in; background: var(--card, #fff); }
.sub-head > div { display: flex; flex-direction: column; min-width: 0; }
.sub-card .field { margin: 0; }
.sub-actions { display: flex; gap: 8px; }
.sub-actions .btn { flex: 1; justify-content: center; }
.fee-row-act { flex-wrap: wrap; }
.fee-row-act > [data-send] { flex-basis: 100%; justify-content: center; }
.subs-list .srow small { white-space: normal; }

/* ---- progress reports ---- */
.report .seg { flex: none; }
.rep-range { margin: 6px 0 2px; font-size: 13px; }
.rep-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; margin-bottom: 12px; }
.rep-line { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.rep-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; flex: none; color: var(--ink); background: var(--sunk); }
.rep-chip .ic { stroke-width: 2.6; }
.rep-good { background: var(--c-p-soft); }
.rep-good .ic { color: var(--pos); }
.rep-warn { background: var(--c-a-soft); }
.rep-warn .ic { color: color-mix(in srgb, var(--c-a) 70%, var(--ink)); }
.rep-ok .ic { color: var(--accent); }
.rep-stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 420px) { .rep-stats { grid-template-columns: repeat(3, 1fr); } }
.rep-stats em { font-style: normal; font-weight: 700; margin-left: 2px; }
.rep-stats em.up { color: var(--pos); }
.rep-stats em.down { color: var(--ink-2); }
.rep-now { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.sign-row { display: flex; flex-wrap: wrap; gap: 6px; }
section + .sign-row, .sign-row + section { margin-top: 0; }
.page-body > .sign-row { padding: 0 4px; }

/* weekly / monthly columns: one series; the reported period in full colour, the others lighter,
   the period still running as an outline. Values: only the reported period is labelled; tap a bar for the rest. */
.wk-chart { display: flex; align-items: flex-end; gap: 2px; height: 132px; margin-top: 16px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.wk-col { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink-3); -webkit-tap-highlight-color: transparent; }
.wk-b { width: 100%; max-width: 24px; min-height: 2px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--accent) 38%, var(--surface)); }
.wk-col.is-focus .wk-b { background: var(--accent); }
.wk-col.is-now .wk-b { background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent); }
.wk-v { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.wk-l { position: absolute; top: 100%; margin-top: 5px; font-size: 11px; white-space: nowrap; }
.wk-chart + .hint { margin-top: 26px; }
.wk-col::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 210px; white-space: normal; text-align: center;
  background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 600; line-height: 1.3; padding: 6px 9px; border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 3; }
.wk-col:nth-child(-n+2)::after { left: 0; transform: none; }
.wk-col:nth-last-child(-n+3)::after { left: auto; right: 0; transform: none; }
.wk-col:hover::after, .wk-col:focus-visible::after, .wk-col:focus::after { opacity: 1; }
.wk-col:hover .wk-b, .wk-col:focus .wk-b { filter: brightness(.92); }

/* the teacher's Progress view */
.head-acts { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.row-between:has(> .head-acts) { flex-wrap: wrap; row-gap: 8px; }
.seg-iconly .seg-opt span { padding-inline: 10px; }
.prog-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prog-sum > div { display: flex; flex-direction: column; gap: 2px; }
.prog-row .srow-text { gap: 3px; }
.prog-row .sign-row { margin-top: 3px; }
.spark { display: flex; align-items: flex-end; gap: 2px; width: 46px; height: 24px; flex: none; }
.spark i { flex: 1; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.spark i.is-now { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }

/* ---- holidays ---- */
.hol-row { gap: 12px; align-items: center; flex-wrap: wrap; }
.hol-row .srow-text { flex: 1 1 160px; }
.hol-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 46px; border-radius: 12px; background: var(--c-h-soft); flex: none; line-height: 1.05; }
.hol-date b { font: 650 18px var(--f-display); font-variant-numeric: tabular-nums; }
.hol-date small { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.hol-acts { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.sync-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sync-line .btn { margin-left: auto; }
.hol-note { display: flex; align-items: center; gap: 12px; background: var(--c-h-soft); color: var(--ink); margin-bottom: 12px; }
.hol-note > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hol-note small { color: var(--ink-2); }
.hol-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hol-list li { display: flex; flex-direction: column; gap: 1px; }
.remind-card .seg { margin-top: 4px; }
.hol-row { padding: 10px 12px; row-gap: 8px; }
.hol-row::after { left: 68px; }
.hol-row .hol-acts { flex-basis: 100%; }
.hol-row .hol-acts:has(.icon-btn) { flex-basis: auto; }

/* ---- moving a class, telling parents ---- */
.moved-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 600; }
.row-time.is-moved { background: var(--accent-fill); color: var(--accent-ink); }
.field textarea.tell-msg { resize: none; min-height: 0; field-sizing: content; max-height: 40vh; }
.tell-block { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sunk); }
.tell-app { flex-direction: row; align-items: center; gap: 12px; background: var(--accent-soft); }
.tell-h { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tell-h b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.tell-h b .ic { flex: none; }
.tell-h small { font-size: 13px; }
.tell-list { display: flex; flex-direction: column; border-radius: 12px; background: var(--surface); }
.tell-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 56px; }
.tell-row + .tell-row { border-top: 1px solid var(--line); }
.tell-who { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tell-who b { font-size: 15px; }
.tell-who small { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tell-btn { flex: none; min-width: 104px; justify-content: center; }
.tell-row.is-done .tell-who { opacity: .5; }
.tell-row.is-done .tell-btn::after { content: "✓"; margin-left: 2px; }
.tell-block .hint { margin: 0; }


/* thin scrollbars inside sheets (Windows shows chunky arrows otherwise) */
.sheet-body { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 25%, transparent) transparent; }
.srow .row-menu { width: 34px; height: 34px; margin-left: -4px; flex: none; color: var(--ink-3); font-weight: 400; }
.hol-row:has(> .hol-acts .icon-btn) { flex-wrap: nowrap; }
.hol-row:has(> .hol-acts .icon-btn) .hol-acts { flex: none; }
/* Hifz + Tilawah */
.rep-stats:has(> :nth-child(4)) { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .rep-stats:has(> :nth-child(4)) { grid-template-columns: repeat(2, 1fr); } }
.chart-h { margin: 18px 0 -8px; font: 600 13px var(--f-body); color: var(--ink-2); }
.hero-2 { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tl-h { margin-top: 14px; }

/* Right-to-left text (Dhivehi/Thaana, Arabic) — set by initBidi() in ui.js. Typing boxes follow the first letter typed. */
input[dir="auto"], textarea[dir="auto"] { text-align: start; }
[data-bidi="rtl"] { text-align: right; }
/* a text column holding right-to-left text fills its row, so the text can sit on the right */
:has(> [data-bidi="rtl"]) { flex-grow: 1; min-width: 0; }

/* student page: the tabs stay at the top; once the name has scrolled away, a slim bar with it shows under them */
.stu-sticky { position: sticky; top: 0; z-index: 10; background: var(--bg); }
.stu-sticky .tabs { position: static; }
.stu-mini { position: absolute; left: 0; right: 0; top: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .18s ease-out, transform .18s ease-out; }
.stu-mini b { font: 650 15.5px var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stu-mini .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }
.stu-page.head-gone .stu-mini { opacity: 1; transform: none; }
/* student page: each box can be folded away */
.sfold-bar { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 4px 8px; color: var(--ink-3); font: 650 13px var(--f-body); letter-spacing: .04em; text-transform: uppercase; text-align: left; cursor: pointer; border-radius: 10px; }
.sfold-bar .fold-ic { transition: transform .18s; }
.sfold.is-shut .sfold-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--ink-2); }
.sfold.is-shut .sfold-bar .fold-ic { transform: rotate(-90deg); }
.sfold-body { display: flex; flex-direction: column; gap: 14px; }
/* Hifz + Tilawah: the two buttons choosing what this day has */
.part-pick { display: flex; gap: 8px; margin-bottom: 12px; }
.part-pick .chip { padding: 8px 18px; }
.part-last { font-weight: 400; text-transform: none; letter-spacing: 0; }
[data-tpart] { margin-top: 14px; }

/* ---- v63: folding classes ----
   Open, a class is one card: the header is its rounded top and the students hang straight below it. Folded,
   it is just the header, a pill. Folding slides the list up under the header in one piece and the card's rounded
   bottom edge rides up with it into the pill (v67: the corners never switch shape); opening is the reverse. The
   movement is played by foldFlip() in pages/today.js; the two resting states below are plain CSS.
   Flat, no glow; switched off for "reduce motion". Only the Classes page: the Students page
   uses the same class groups and keeps its own look. */
:root { --deal: cubic-bezier(.2, .9, .25, 1); --deal-t: .3s; }
.today-page .cls-sec { position: relative; isolation: isolate; gap: 0; }
.today-page .cls-toggle { touch-action: manipulation; }
.today-page .cls-toggle .fold-ic, .sfold-bar .fold-ic { transition: transform var(--deal-t) var(--deal); }
/* one shadow for the whole card (the pill, when folded) */
.today-page .cls-sec::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: var(--r); box-shadow: var(--shadow); pointer-events: none; }
.today-page .cls-sec.is-shut::before { border-radius: 999px; }
/* the card's top: the header */
.today-page .cls-head { position: relative; z-index: 50; background: var(--surface); box-shadow: none; border: 0;
  border-radius: var(--r) var(--r) 0 0; padding: 4px 6px 4px 14px; }
/* one line each for the class name and its times, so the header never changes height (e.g. when the counts show) */
.today-page .cls-toggle h2, .today-page .cls-toggle .muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-page .cls-sec:not(.is-shut) .cls-head::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 1px; background: var(--line); transform: scaleY(.6); }
/* the students: one block hanging under the header; the card's rounded bottom is the last student's */
.today-page .rows-wrap { position: relative; }
.today-page .rows-wrap > .rows { margin-top: 0; background: transparent; overflow: visible; border-radius: 0 0 var(--r) var(--r); box-shadow: none; }
.today-page .cls-sec .rows > .srow { background: var(--surface); }
.today-page .cls-sec .rows > .srow:last-child { clip-path: inset(0 round 0 0 var(--r) var(--r)); }
/* folded: just the pill */
.today-page .cls-sec.is-shut .cls-head { border-radius: 999px; box-shadow: none; }
.today-page .cls-sec.is-shut .rows-wrap { height: 0; visibility: hidden; }
/* a touch shows at once, before the finger lifts, and only while it is down (set in pages/today.js) */
.today-page .cls-toggle.is-press { opacity: .7; }
.fold-sum { animation: fold-in .16s both; }
@keyframes fold-in { from { opacity: 0; transform: scale(.9); } }
/* the boxes on a student's page */
.sfold-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .34s var(--deal), visibility 0s; }
.sfold-wrap > .sfold-body { min-height: 0; overflow: clip; overflow-clip-margin: 30px; transition: opacity .3s, transform .34s var(--deal); }
.sfold.is-shut .sfold-wrap { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .3s var(--deal), visibility 0s .3s; }
.sfold.is-shut .sfold-wrap > .sfold-body { opacity: 0; transform: translateY(-8px); transition-duration: .14s, .3s; }
.sfold-bar { transition: background-color .3s, border-color .3s, padding .3s var(--deal), color .3s; }
/* Revision (and the other open/close boxes) slide too, where the phone's browser can do it */
@supports selector(::details-content) {
  details { interpolate-size: allow-keywords; }
  details::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size .38s var(--deal), opacity .28s, content-visibility .38s allow-discrete; }
  details[open]::details-content { block-size: auto; opacity: 1; }
}

/* Parents who sign in by phone: language bar, code box, status lines */
.lang-bar { display: inline-flex; align-self: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2, rgba(127,127,127,.12)); }
.lang-bar button { border: 0; background: none; color: inherit; font: inherit; font-size: 13.5px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.lang-bar button.on { background: var(--accent); color: #fff; }
.ph-body { text-align: start; }
.ph-body h1 { text-align: center; }
.phone-line { font-size: 20px; text-align: center; letter-spacing: .04em; }
.code-in { text-align: center; font-size: 26px; letter-spacing: .35em; }
.lede { text-align: center; font-weight: 600; }
.ps { font-size: 12.5px; font-weight: 600; }
.ps-joined { color: var(--pos); }
.ps-invited { color: var(--c-a, #b7791f); }
.ps-expired, .ps-none { color: var(--muted, #777); }
.ps-locked { color: var(--neg, #c0392b); }

/* scrolling over a form list (classes, children, level) must still scroll the page; only the pop-up picker holds its own scroll */
.pick-pop .pick-list { overscroll-behavior: contain; }

/* Apply page: heavier, clearer text (the body weight is a light 300, too thin for the class list) */
.apply { font-weight: 400; }
.apply-days, .apply-private { color: var(--ink); }
.apply-classes li > div > b { font-weight: 600; font-size: 17px; }
.apply-classes small.muted, .apply .hint { color: var(--ink-2); font-weight: 450; }
.apply-fee b { font-weight: 650; }

/* ---------- parent page in Dhivehi (right to left) ---------- */
.parent-head .lang-bar { align-self: flex-start; }
:lang(dv) { font-synthesis: none; }   /* Faruma has one weight: never fake a bold or italic */
[dir="rtl"] .cal-nav h3 { direction: rtl; }

/* fee sheet: suggested first-month fee, payments list */
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); border-radius: 14px; padding: 10px 12px; }
.pays { display: grid; gap: 6px; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pay-row b { flex: 1; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- v105: Classes: the list stays put ----
   Every class is a pill that never changes size or place. One class is open at a time. On a wide screen its
   students show in a panel beside the list; on a phone they slide up as a sheet over it (pages/today.js).
   The open class is marked by one solid gold block that sits BEHIND the pills and slides from pill to pill; the
   open pill itself turns see-through so the gold shows from behind it. Timings are the ones the user approved
   on the demo (16 Nov 2026, speed 1.0x): gold 340ms on a soft "back" curve, students rise 360ms 55ms apart,
   sheet 420ms. Flat, no glow; switched off for "reduce motion". */
.today-page [data-list] { position: relative; z-index: 0; }
.today-page .cls-sec { position: static; isolation: auto; }
.today-page .cls-sec::before { content: none; }
.today-page .cls-head, .today-page .cls-sec.is-shut .cls-head { z-index: 1; min-height: 56px; border-radius: 999px; box-shadow: var(--shadow); scroll-margin-top: 130px;
  transition: background-color .2s linear, color .2s linear, box-shadow .2s linear, transform .12s cubic-bezier(.22, 1, .36, 1); }
.today-page .cls-sec:not(.is-shut) .cls-head::after { content: none; }
.today-page .cls-head:active { transform: scale(.985); }
.today-page .cls-toggle.is-press { opacity: 1; }
.today-page .cls-toggle .muted, .today-page .cls-head > .icon-btn { transition: color .2s linear; }
.today-page .cls-sec.is-open:not(.is-closing) .cls-head { background: transparent; box-shadow: none; color: var(--hl-ink); }
.today-page .cls-sec.is-open:not(.is-closing) .cls-head .cls-toggle .muted { color: var(--hl-ink-2); }
.today-page .cls-sec.is-open:not(.is-closing) .cls-head > .icon-btn { color: var(--hl-ink); }
.cls-hl { position: absolute; left: 0; top: 0; z-index: 0; width: var(--hl-w, 0); height: var(--hl-h, 56px); transform: translate(var(--hl-x, 0), var(--hl-y, 0));
  border-radius: 999px; background: var(--hl); box-shadow: inset 0 0 0 var(--hl-bw, 2.5px) var(--hl-ring, transparent); opacity: 0; pointer-events: none;
  transition: transform .34s cubic-bezier(.34, 1.23, .64, 1), height .34s cubic-bezier(.34, 1.23, .64, 1), width .34s cubic-bezier(.34, 1.23, .64, 1), opacity .16s linear; }
.today-page [data-list].has-hl .cls-hl { opacity: 1; }
/* hovering a class that isn't open: the same soft beige as the side bar (an overlay, so it also works on the dark theme's cards) */
@media (hover: hover) { .today-page .cls-sec:not(.is-open) .cls-head:hover { background-image: linear-gradient(var(--sunk), var(--sunk)); } }
.cp-dim { display: none; }
/* the open class's students */
.today-page .cls-sec.is-shut .rows-wrap { display: none; height: auto; visibility: visible; }
.today-page .rows-wrap { background: var(--surface); }
.today-page .cls-sec .rows > .srow:last-child { clip-path: none; }
.cp-grip { width: 44px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink-3) 45%, transparent); margin: 8px auto 2px; touch-action: none; }
.cp-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px 18px; touch-action: none; animation: cp-fade .22s linear; }
.cp-head > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cp-head h3 { margin: 0; font: 650 20px var(--f-display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-head small { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-page .cls-sec.is-open .srow { animation: cp-rise .36s cubic-bezier(.34, 1.23, .64, 1) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
.today-page .cls-sec.is-open .srow .code.on { animation: cp-pop .3s cubic-bezier(.34, 1.23, .64, 1); }
@keyframes cp-rise { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes cp-pop { from { transform: scale(.8); } }
@keyframes cp-fade { from { opacity: 0; } }
/* phone: the students are a sheet over the list, just above the tab bar; the list behind still scrolls */
@media (max-width: 899.98px) {
  .today-page .cls-sec.is-open .rows-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 3; max-height: 60vh; max-height: 60dvh;
    overflow-y: auto; overscroll-behavior: contain; border-radius: 28px 28px 0 0; border-top: var(--hl-bw, 2.5px) solid var(--hl-line); box-shadow: 0 -8px 40px rgba(0, 0, 0, .18); will-change: transform; }
  :root[data-fs] .today-page .cls-sec.is-open .rows-wrap { max-height: calc(60dvh / var(--fs-zoom, 1)); }
  .cp-dim { display: block; position: fixed; inset: 0; z-index: 2; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .26s linear; }
  .today-page.has-cp .cp-dim { opacity: 1; }
  .today-page.has-cp [data-list] { padding-bottom: 64vh; padding-bottom: 64dvh; }
  .today-page.has-cp .cls-head { scroll-margin-bottom: 64vh; scroll-margin-bottom: 64dvh; }
}
/* wide: the list on the left, the open class's students in a panel on the right */
@media (min-width: 900px) {
  .today-page [data-list] { display: grid; grid-template-columns: minmax(230px, 36%) minmax(0, 1fr); grid-template-rows: repeat(var(--cp-n, 1), auto) 1fr; column-gap: 20px; row-gap: 10px; align-items: start; }
  .today-page [data-list] > * { grid-column: 1; }
  .today-page [data-list] > :is(.empty, .skeleton) { grid-column: 1 / -1; }
  .today-page [data-list] > .cls-hl { grid-column: auto; }   /* measured from the list's own edge, not a grid cell */
  .today-page [data-list] > .cls-sec { display: contents; }
  .today-page .cls-head { grid-column: 1; }
  .today-page .cls-sec.is-open .rows-wrap { grid-column: 2; grid-row: 1 / -1; position: sticky; top: 124px; border: var(--hl-bw, 2.5px) solid var(--hl-line); border-radius: 28px; overflow: hidden; padding-top: 8px; }
  .cp-grip, .cp-head [data-cpclose] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cls-hl, .today-page .cls-head, .cp-dim { transition: none; }
  .today-page .cls-sec.is-open .srow, .today-page .cls-sec.is-open .srow .code.on, .cp-head { animation: none; }
}
