/* Premium look (upgrade 9). Loaded after app.css: it only restyles — layout rules and behaviour stay in app.css.
   To go back to the old look, remove the premium.css line from index.html. */
:root {
  --hi: #d6f23c; --hi2: #9fc400; --hi-ink: #0b0d08;
  --bg: #eceee7; --surface: #ffffff; --surface-2: #f2f4ed; --line: #e0e3d8; --text: #0e100c; --muted: #646a5e; --faint: #9a9f93;
  --brand: #141612; --brand-2: #33372f; --brand-soft: #eaf5ae; --brand-text: #3c4a00;
  --ok: #1f9d57; --ok-soft: #dcf5e4; --late: #c77a06; --late-soft: #fbeed2; --bad: #d93a3a; --bad-soft: #fde3e1; --exc: #6d5bd0; --exc-soft: #ebe7fb;
  --shadow: 0 1px 2px rgba(20,24,10,.04), 0 8px 24px rgba(20,24,10,.06); --shadow-lg: 0 24px 60px rgba(20,24,10,.22);
  --r: 22px; --r-sm: 14px;
  --card-bg: var(--surface); --ambient: color-mix(in srgb, var(--hi) 30%, transparent);
  --hero-bg: var(--hi); --hero-text: #0b0d08; --hero-soft: rgba(11,13,8,.66); --hero-chip: rgba(11,13,8,.1); --hero-btn: #0e100c; --hero-btn-text: #ffffff; --gauge-a: #0b0d08; --gauge-b: #3a4030;
}
:root[data-theme="dark"] {
  --hi: #d6f23c; --hi2: #6fe98f;
  --bg: #0a0b0b; --surface: #131516; --surface-2: #1c1f20; --line: #272b2c; --text: #f3f5ee; --muted: #9ba197; --faint: #666c64;
  --brand: #d6f23c; --brand-2: #9df05a; --brand-soft: #232a0d; --brand-text: #dcf46a;
  --ok: #5fe39a; --ok-soft: #0f3222; --late: #ffb648; --late-soft: #3d2a0a; --bad: #ff6b6b; --bad-soft: #401818; --exc: #b6a6ff; --exc-soft: #25204a;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px rgba(0,0,0,.38); --shadow-lg: 0 30px 70px rgba(0,0,0,.7);
  --card-bg: linear-gradient(180deg, color-mix(in srgb, #fff 3.5%, var(--surface)), var(--surface) 55%);
  --ambient: color-mix(in srgb, var(--hi) 9%, transparent);
  --hero-bg: radial-gradient(130% 150% at 0% 108%, var(--hi) 0%, #a5c62c 16%, #4d6a20 40%, #1b251b 68%, #121514 100%);
  --hero-text: #ffffff; --hero-soft: rgba(255,255,255,.7); --hero-chip: rgba(255,255,255,.12); --hero-btn: #0c0e0c; --hero-btn-text: #ffffff; --gauge-a: var(--hi2); --gauge-b: var(--hi);
}
body { background: radial-gradient(900px 520px at 88% -12%, var(--ambient), transparent 62%), radial-gradient(700px 420px at -8% 108%, var(--ambient), transparent 60%), var(--bg); font-feature-settings: "ss01", "cv11"; }
::selection { background: var(--hi); color: var(--hi-ink); }
h1, h2, h3, h4 { font-weight: 620; letter-spacing: -.022em; }
h1 { font-size: 26px; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* side menu */
.side { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.brand .logo { background: var(--hi); color: var(--hi-ink); border-radius: 14px; box-shadow: 0 8px 22px color-mix(in srgb, var(--hi) 30%, transparent); }
.nav a { border-radius: 999px; padding: 9px 14px; }
.nav a.on { background: var(--hi); color: var(--hi-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--hi) 22%, transparent); }
.nav a svg.ic { transition: transform .2s cubic-bezier(.2, .8, .2, 1); } .nav a:hover svg.ic { transform: scale(1.12); }
.me { border-radius: 20px; border: 1px solid var(--line); }

/* buttons and controls */
.btn { border-radius: 999px; padding: 9px 16px; }
.btn.sm { border-radius: 999px; padding: 6px 12px; } .btn.icon { padding: 9px; aspect-ratio: 1; } .btn.sm.icon { padding: 7px; }
:root[data-theme="dark"] .btn:not(.primary):not(.ghost) { background: var(--surface-2); }
.btn:hover { border-color: var(--faint); transform: translateY(-1px); } .btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(110deg, var(--hi) 42%, #f6ffc4 50%, var(--hi) 58%); background-size: 260% 100%; background-position: 100% 0; color: var(--hi-ink); border-color: transparent;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--hi) 26%, transparent); transition: background-position .7s cubic-bezier(.2, .8, .2, 1), transform .12s, box-shadow .15s; }
.btn.primary:hover { background-position: 0 0; box-shadow: 0 10px 28px color-mix(in srgb, var(--hi) 38%, transparent); }
:root:not([data-theme="dark"]) .btn.primary { box-shadow: 0 6px 16px rgba(20,24,10,.12); border-color: rgba(11,13,8,.08); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=email], input[type=tel], input[type=search], input[type=month], select, textarea { border-radius: 14px; }
:root[data-theme="dark"] input:focus, :root[data-theme="dark"] select:focus, :root[data-theme="dark"] textarea:focus { border-color: var(--hi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hi) 20%, transparent); }
.stepper, .hstep { border-radius: 999px; } .stepper button { border-radius: 50%; }
.seg { border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.seg button { border-radius: 999px; padding: 6px 14px; transition: background .2s, color .2s; }
.seg button.on { background: var(--hi); color: var(--hi-ink); box-shadow: none; }
.switch input:checked { background: var(--hi); } .switch input:checked::after { background: var(--hi-ink); }
.search input { border-radius: 999px; }
.tabs { border-bottom: 0; gap: 6px; padding-bottom: 2px; }
.tabs button { border: 1px solid var(--line); border-radius: 999px; margin-bottom: 0; padding: 8px 15px; background: var(--surface); transition: background .2s, color .2s, border-color .2s; }
.tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge { letter-spacing: .01em; }

/* cards */
.card { background: var(--card-bg); border-radius: var(--r); }
.card > h2 > svg.ic:first-child { width: 34px; height: 34px; padding: 8px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.card:has(> .hero) { background: radial-gradient(520px 260px at 100% 0%, color-mix(in srgb, var(--hi) 13%, transparent), transparent 70%), var(--card-bg); }
.kpi { background: var(--card-bg); border-radius: var(--r); }
.kpi::after { content: ""; position: absolute; right: 0; top: 0; width: 120px; height: 86px; pointer-events: none; background-image: radial-gradient(currentColor 1px, transparent 1.7px); background-size: 9px 9px; color: var(--faint); opacity: .55;
  -webkit-mask-image: radial-gradient(120px 86px at 100% 0, #000, transparent 72%); mask-image: radial-gradient(120px 86px at 100% 0, #000, transparent 72%); }
.kpi .dot { border-radius: 50%; width: 32px; height: 32px; }
.kpi .val { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
a.kpi:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.22); border-color: var(--faint); }
.kpis > .kpi:first-child:not(.bad):not(.late) { background: var(--hi); border-color: transparent; color: var(--hi-ink); box-shadow: 0 12px 30px color-mix(in srgb, var(--hi) 20%, transparent); }
.kpis > .kpi:first-child:not(.bad):not(.late) .lbl, .kpis > .kpi:first-child:not(.bad):not(.late) .foot, .kpis > .kpi:first-child:not(.bad):not(.late) .val small { color: rgba(11,13,8,.68); }
.kpis > .kpi:first-child:not(.bad):not(.late) .dot { background: var(--hi-ink); color: var(--hi); }
.kpis > .kpi:first-child:not(.bad):not(.late)::after { color: var(--hi-ink); opacity: .32; }
.avatar { border-radius: 50%; } .avatar.sm { border-radius: 50%; }
.avatar.lg { border-radius: 50%; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--hi), 0 14px 34px color-mix(in srgb, var(--hi) 22%, transparent); }
.list a.item { border-radius: 14px; transition: background .15s, transform .15s; } .list a.item:hover { transform: translateX(2px); }
th { background: transparent; }
.summary, .doc, .memcard, .drop, .finishbox { border-radius: 18px; }
.issue .sev { border-radius: 50%; }
.empty { position: relative; isolation: isolate; }
.empty::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--faint) 1px, transparent 1.7px); background-size: 12px 12px; opacity: .4;
  -webkit-mask-image: radial-gradient(closest-side, #000 10%, transparent); mask-image: radial-gradient(closest-side, #000 10%, transparent); }
.empty svg { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }

/* hatched tracks: the part still to go */
.progress { height: 10px; border-radius: 99px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, color-mix(in srgb, var(--faint) 38%, var(--surface-2)) 4px 6px); }
.progress i { border-radius: 99px; background: linear-gradient(90deg, var(--hi2), var(--hi)); }
.mbar { border-radius: 99px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, color-mix(in srgb, var(--faint) 38%, var(--surface-2)) 4px 6px); }
.calcell.shut { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, color-mix(in srgb, var(--faint) 16%, var(--surface-2)) 6px 8px); }
:root[data-theme="dark"] .calpill.present, :root[data-theme="dark"] .calpill.late, :root[data-theme="dark"] .calpill.absent, :root[data-theme="dark"] .calpill.excused { color: #0b0d08; }
.calcell { border-radius: 12px; } .calcell.today { border-color: var(--hi); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hi) 28%, transparent); }

/* timetable */
.tgrid-wrap { border-radius: 20px; } .tbox { border-radius: 12px; } .slot { border-radius: 12px; } .tt .day { border-radius: 18px; }
.tt .day.today { border-color: var(--hi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hi) 20%, transparent); }
.tghost { border-color: var(--hi); background: color-mix(in srgb, var(--hi) 16%, transparent); }

/* charts */
.chart .track { fill: var(--surface-2); opacity: .55; }
.chart .gridline { stroke-dasharray: 2 6; }
.chart .glow { stroke-opacity: .26; filter: blur(7px); }
.chart .pt circle { opacity: 0; transition: opacity .15s; } .chart .pt:hover circle, .chart .pt.on circle { opacity: 1; } .chart .bar.pt:hover { opacity: 1; }
.chart .guide { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 4; }
.legend i { border-radius: 50%; }
.dtrack { stroke: var(--surface-2); }
.donut-wrap text.big { font-weight: 650; letter-spacing: -.03em; }
.gauge { width: 100%; max-width: 236px; display: block; overflow: visible; }
.gauge .gtrack { stroke: var(--hero-chip); } .gauge .ghatch { stroke: var(--hero-soft); opacity: .5; }
.gauge text.big { font-size: 30px; font-weight: 680; letter-spacing: -.03em; fill: var(--hero-text); } .gauge .gsub { font-size: 11px; font-weight: 600; fill: var(--hero-soft); }
@keyframes sweep { from { stroke-dasharray: 0 200; } }
.nav-anim .chart g.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: growY .85s cubic-bezier(.2, .8, .2, 1) both; }
.nav-anim .chart path.draw { stroke-dasharray: 1; animation: drawLine 1.25s cubic-bezier(.4, 0, .2, 1) both; }
.nav-anim .chart .peak { animation: pop .4s .75s both; }
.nav-anim .donut-wrap circle.seg { animation: fade .55s both; }
.nav-anim .gauge .sweep { animation: sweep 1.15s .1s cubic-bezier(.2, .8, .2, 1) both; }

/* dashboard: today panel */
.thero { position: relative; overflow: hidden; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 22px; margin-bottom: 16px; border-radius: 28px; background: var(--hero-bg); color: var(--hero-text);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--hi) 14%, rgba(0,0,0,.25)); }
.thero::after { content: ""; position: absolute; right: 0; top: 0; width: 260px; height: 150px; pointer-events: none; background-image: radial-gradient(currentColor 1px, transparent 1.7px); background-size: 10px 10px; opacity: .3;
  -webkit-mask-image: radial-gradient(260px 150px at 100% 0, #000, transparent 72%); mask-image: radial-gradient(260px 150px at 100% 0, #000, transparent 72%); }
.thero > * { position: relative; z-index: 1; }
.thero-main { flex: 1 1 160px; min-width: 0; }
.thero-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--hero-chip); font-size: 12px; font-weight: 650; letter-spacing: .03em; }
.thero-tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.thero-num { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thero-num b { font-size: 54px; line-height: 1; font-weight: 680; letter-spacing: -.045em; font-variant-numeric: tabular-nums; } .thero-num span { font-size: 15px; font-weight: 600; color: var(--hero-soft); }
.thero-sub { margin-top: 6px; font-size: 13.5px; color: var(--hero-soft); font-weight: 550; }
.thero-acts { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 100%; }
.thero-acts .btn { background: var(--hero-btn); color: var(--hero-btn-text); border-color: transparent; box-shadow: none; }
.thero-acts .btn.primary { background: #ffffff; color: #0b0d08; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.thero-acts .btn:hover { filter: brightness(1.12); }
.thero-side { flex: 0 1 236px; min-width: 0; text-align: center; }

/* overlays */
.overlay { background: rgba(4,5,4,.6); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
.modal { border-radius: 28px; border: 1px solid var(--line); }
.formerr, .warnbox { border-radius: 14px; }
.toast { background: #0e100c; color: #fff; border-radius: 999px; padding: 11px 18px; border: 1px solid rgba(255,255,255,.12); }
.results { border-radius: 18px; } .results a { border-radius: 12px; }
.auth { background: radial-gradient(900px 520px at 12% -8%, color-mix(in srgb, var(--hi) 22%, transparent), transparent 62%), radial-gradient(760px 460px at 108% 108%, color-mix(in srgb, var(--hi2) 16%, transparent), transparent 60%), var(--bg); position: relative; }
.auth::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(var(--faint) 1px, transparent 1.7px); background-size: 14px 14px; opacity: .35;
  -webkit-mask-image: linear-gradient(160deg, #000, transparent 55%); mask-image: linear-gradient(160deg, #000, transparent 55%); }
.auth .card { border-radius: 30px; position: relative; box-shadow: var(--shadow-lg); }
.qr { border-radius: 20px; }

/* phones: floating bar */
@media (max-width: 820px) {
  .main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .bottom-nav { left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 6px; gap: 2px; border: 1px solid var(--line); border-radius: 28px;
    background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 16px 40px rgba(0,0,0,.38); }
  .bottom-nav a { border-radius: 22px; padding: 7px 2px; transition: background .25s cubic-bezier(.2, .8, .2, 1), color .2s, transform .12s; }
  .bottom-nav a.on { background: var(--hi); color: var(--hi-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--hi) 30%, transparent); }
  .bottom-nav a.on svg { animation: navpop .35s cubic-bezier(.2, 1.4, .4, 1); }
  .side.open { padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .card { border-radius: 20px; } .kpi { border-radius: 20px; } .kpi .val { font-size: 23px; }
  .modal { border-radius: 28px 28px 0 0; border-bottom: 0; animation: sheet .28s cubic-bezier(.2, .8, .2, 1); } .modal header { border-radius: 28px 28px 0 0; }
  .tabs button { padding: 8px 13px; }
  .thero { padding: 18px; border-radius: 24px; } .thero-num b { font-size: 46px; } .thero-acts .btn { flex: 1 1 auto; } .thero-side { flex: 0 0 136px; } .thero { gap: 14px 10px; }
  h1 { font-size: 22px; }
}
@keyframes navpop { from { transform: scale(.6); } to { transform: none; } }
@keyframes sheet { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .thero-tag i, .bottom-nav a.on svg, .modal, .nav-anim .chart g.grow, .nav-anim .chart path.draw, .nav-anim .gauge .sweep, .nav-anim .chart .peak { animation: none !important; } .btn.primary { transition: none; } }
@media print { body { background: #fff !important; } .thero { display: none; } }
:root[data-theme="dark"] { color-scheme: dark; } :root:not([data-theme="dark"]) { color-scheme: light; }

/* ---- upgrade 10: layout fixes, available hours, tutorial, role label ---- */
/* a finished page-open animation must leave nothing behind: on iPhone it trapped pop-up boxes inside their card */
.nav-anim > * { animation-fill-mode: backwards; }

/* phones: an opened timetable box is a card in the middle of the screen, above everything, with room around the text */
@media (max-width: 820px) {
  .tbox.open, .tgrid.fit .tbox.open, .tgrid.fit .tcol.r .tbox.open { position: fixed; left: 12px; right: 12px; width: auto; min-width: 0; top: calc(env(safe-area-inset-top) + 8vh) !important;
    max-height: calc(100dvh - 8vh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; z-index: 46; padding: 16px 16px 14px; border-radius: 20px; font-size: 13px; line-height: 1.4;
    box-shadow: 0 0 0 100vmax rgba(4, 5, 4, .55), var(--shadow-lg); }
  .tbox.open > b, .tgrid.fit .tbox.open > b { font-size: 16px; padding-right: 0; } .tbox.open .grip { display: none; }
  .tbox.open .tdetails { gap: 11px; margin-top: 10px; padding-top: 10px; } .tbox.open .tmarks { gap: 6px; } .tbox.open .tmarks .mark { min-height: 40px; padding: 8px 12px; }
  /* More menu: the last block (name, dark mode, sign out) must scroll clear of the floating bar */
  .side.open { padding-bottom: 0; }
  .side.open::after { content: ""; flex: none; height: calc(118px + env(safe-area-inset-bottom)); }
  .side.open .me { margin-top: 18px; }
}

/* computer and sideways phone: never let a row run off the right edge */
.marks { flex-wrap: wrap; }
@media (min-width: 821px) and (max-width: 1280px) {
  .att { grid-template-columns: minmax(0, 1fr) auto; } .att .marks { grid-column: 1 / -1; }
}
@media (min-width: 821px) {
  .shell { grid-template-columns: calc(var(--side) + env(safe-area-inset-left)) minmax(0, 1fr); }
  .side { padding-left: calc(12px + env(safe-area-inset-left)); }
  .main { padding-top: max(22px, env(safe-area-inset-top)); padding-right: max(clamp(14px, 3vw, 34px), calc((100% - 1380px) / 2), env(safe-area-inset-right)); }
}
/* narrow computer windows and phones held sideways: the side menu shrinks to icons so the page keeps its room */
@media (min-width: 821px) and (max-width: 1100px) {
  :root { --side: 74px; }
  .side { padding: 14px 8px 14px calc(8px + env(safe-area-inset-left)); }
  .side .brand { padding: 2px 0 12px; justify-content: center; } .side .brand > div:last-child { display: none; }
  .nav-label { height: 1px; padding: 0; margin: 8px 12px; background: var(--line); overflow: hidden; font-size: 0; }
  .nav a { justify-content: center; padding: 11px 0; position: relative; } .nav a > span:not(.badge) { display: none; }
  .nav .badge { position: absolute; top: 1px; right: 4px; margin: 0; padding: 1px 5px; font-size: 10px; }
  .me { flex-direction: column; padding: 8px 4px; gap: 6px; } .me .grow { display: none; }
  .top h1 { min-width: 140px; }
}
@media (min-width: 821px) and (max-height: 520px) { .main { padding-top: max(12px, env(safe-area-inset-top)); } .thero { padding: 16px 20px; } .thero-num b { font-size: 40px; } }

/* instructor available hours */
.availrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.availrow .btn { margin-left: auto; }
.tna, .tav { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0; }
.tna { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bg) 62%, transparent) 0 6px, color-mix(in srgb, var(--faint) 30%, transparent) 6px 8px); -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.tav { background: color-mix(in srgb, var(--hi) 12%, transparent); box-shadow: inset 3px 0 0 var(--hi), inset 0 1px 0 color-mix(in srgb, var(--hi) 55%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--hi) 55%, transparent); }
.tcol.navail .thead b, .tcol.navail .thead span { opacity: .38; filter: blur(.6px); }
.tgrid.fit .tav { box-shadow: inset 2px 0 0 var(--hi); }
.avlist { display: grid; gap: 8px; }
.avrow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s, background .2s; }
.avrow.on { border-color: color-mix(in srgb, var(--hi) 55%, var(--line)); background: color-mix(in srgb, var(--hi) 6%, transparent); }
.avrow:not(.on) .avtimes { opacity: .3; pointer-events: none; filter: blur(.6px); }
.avtimes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .avpair { display: flex; gap: 6px; align-items: center; } .avpair input { width: 122px; min-height: 38px; padding: 6px 10px; } .avpair span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 820px) { .avrow { grid-template-columns: 1fr; } .avpair { flex: 1 1 100%; } .avpair input { flex: 1; width: auto; } .availrow .btn { margin-left: 0; flex: 1 1 100%; } }

/* role next to the name */
.rolefx { display: inline-flex; vertical-align: middle; margin-left: 8px; padding: 4px 11px; border-radius: 999px; background: var(--hi); color: var(--hi-ink); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; white-space: pre; position: relative; top: -2px; }
.rolefx i { font-style: normal; display: inline-block; }
.rolefx.play { animation: roleglow 1.6s ease-out both; }
.rolefx.play i { animation: rolein .62s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rolein { 0% { opacity: 0; transform: translateY(-.5em) scale(3.2); filter: blur(7px); } 55% { opacity: 1; transform: translateY(0) scale(.82); filter: blur(0); } 78% { transform: scale(1.12); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes roleglow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hi) 70%, transparent); background: transparent; color: var(--hi); } 45% { background: transparent; color: var(--hi); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; background: var(--hi); color: var(--hi-ink); } }
:root:not([data-theme="dark"]) .rolefx { background: var(--text); color: var(--hi); }
:root:not([data-theme="dark"]) .rolefx.play { animation: none; }
.rolepill { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }

/* tutorial */
#tour-root { position: fixed; inset: 0; z-index: 95; }
.tour-dim { position: absolute; inset: 0; background: rgba(4, 5, 4, .62); transition: background .25s; } .tour-dim.clear { background: transparent; }
.tour-ring { position: absolute; border-radius: 18px; border: 2px solid var(--hi); box-shadow: 0 0 0 200vmax rgba(4, 5, 4, .62), 0 0 26px color-mix(in srgb, var(--hi) 55%, transparent); pointer-events: none; transition: left .3s cubic-bezier(.2, .8, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1), width .3s, height .3s; animation: fade .3s; }
.tour-card { position: absolute; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 24px)); padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .25s; color: var(--text); }
.tour-card.top { bottom: auto; top: calc(18px + env(safe-area-inset-top)); }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-step { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.tour-bar { height: 5px; border-radius: 9px; background: var(--surface-2); margin: 10px 0 14px; overflow: hidden; } .tour-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--hi2), var(--hi)); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.tour-card h3 { font-size: 18px; margin-bottom: 6px; } .tour-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; } .tour-card p b { color: var(--text); }
.tour-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; } .tour-acts .btn.primary { flex: 1; }
@media (max-width: 820px) { .tour-card { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); } }
@media (max-height: 520px) { .tour-card { padding: 14px; right: 12px; bottom: 12px; width: min(360px, 60vw); max-height: calc(100dvh - 24px); overflow-y: auto; } .tour-card.top { top: 12px; } .tour-card p { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .rolefx.play, .rolefx.play i, .tour-ring, .tour-card { animation: none !important; } }

/* ---- upgrade 11 ---- */
/* the page header (search box and its drop-down) always sits above the panels below it */
.top { position: relative; z-index: 30; }
/* student calendar: each class shows its time, what it is and who teaches it */
.calpill { display: flex; flex-direction: column; align-items: stretch; text-align: left; white-space: normal; padding: 3px 5px; line-height: 1.22; border-radius: 8px; }
.calpill b { font-size: 10.5px; font-weight: 750; } .calpill em { font-style: normal; font-weight: 600; font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calpill em.who { font-weight: 500; opacity: .85; }
.calpill.booked { padding: 2px 4px; } .calpill.booked em, .calpill.unmarked em { color: var(--text); } .calpill.booked em.who, .calpill.unmarked em.who { color: var(--muted); opacity: 1; }
.callist { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.calrow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); } .calrow .cdot { width: 11px; height: 11px; margin-top: 5px; }
@media (max-width: 820px) { .calpill { padding: 2px 3px; text-align: center; } .calpill b { font-size: 9px; } .calpill em { font-size: 7.5px; } .calpill em.who { display: none; } }

/* ---- upgrade 12: per-day class times, past attendance, contract pickers ---- */
.wholink { color: inherit; display: inline-flex; align-items: center; gap: 4px; } .wholink svg.ic { width: 14px; height: 14px; color: var(--faint); transition: transform .15s, color .15s; }
.wholink:hover b { text-decoration: underline; } .wholink:hover svg.ic { transform: translateX(3px); color: var(--brand-text); } .wholink .avatar { transition: transform .15s; } .wholink:hover .avatar { transform: scale(1.06); }
.kidcard { transition: border-color .15s, transform .15s; } .kidcard:hover { border-color: var(--faint); }
.slotlist { display: grid; gap: 8px; }
.slotrow { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto 90px auto; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.slotrow input { min-height: 38px; padding: 6px 10px; }
.pastrow { display: grid; grid-template-columns: 150px 78px minmax(0, 1.2fr) 80px minmax(0, 1.2fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pastrow input, .pastrow select { min-height: 38px; padding: 6px 10px; }
details.mpick { border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; background: var(--surface); }
details.mpick summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); list-style: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
details.mpick summary::-webkit-details-marker { display: none; } details.mpick summary::after { content: "▾"; margin-left: auto; color: var(--faint); transition: transform .2s; } details.mpick[open] summary::after { transform: rotate(180deg); }
details.mpick summary b { color: var(--text); font-weight: 650; } details.mpick .chips { margin-top: 10px; }
.paybtn { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 650; }
@media (max-width: 820px) {
  .slotrow { grid-template-columns: 1fr 1fr auto; } .slotrow b { grid-column: 1 / -1; } .slotrow span:last-child { display: none; }
  .pastrow { grid-template-columns: 1fr 1fr; padding: 10px 0; } .pastrow > span { display: none; } .pastrow .btn { justify-self: end; }
}

/* ---- upgrade 14: my list (side panel) and the drop-a-file veil ---- */
.todo-fab { position: fixed; right: 0; top: 46%; z-index: 44; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 9px 12px 11px; border: 1px solid var(--line); border-right: 0; border-radius: 16px 0 0 16px;
  background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s, padding .2s; }
.todo-fab:hover { padding-right: 15px; background: var(--hi); color: var(--hi-ink); border-color: transparent; }
.todo-fab b { font-size: 12px; font-weight: 800; min-width: 20px; padding: 2px 5px; border-radius: 99px; background: var(--hi); color: var(--hi-ink); text-align: center; } .todo-fab:hover b { background: var(--hi-ink); color: var(--hi); }
.todo-fab.urgent b { background: var(--bad); color: #fff; animation: pulse 1.8s ease-in-out infinite; }
.todo-shade { position: fixed; inset: 0; z-index: 47; background: rgba(4, 5, 4, .45); opacity: 0; pointer-events: none; transition: opacity .25s; } .todo-shade.open { opacity: 1; pointer-events: auto; }
.todo-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 48; width: min(400px, 100vw); display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
.todo-panel.open { transform: none; visibility: visible; }
.todo-panel header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.todo-panel form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); margin-bottom: 12px; }
.todo-panel form input[type=text] { border: 0; background: transparent; padding: 6px 4px; min-height: 36px; font-size: 15.5px; box-shadow: none !important; }
.todo-panel form input[type=date] { width: auto; min-height: 34px; padding: 4px 10px; font-size: 13px; }
.todo-panel .seg { align-self: flex-start; margin-bottom: 10px; }
.todo-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 11px 8px 11px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-bg); animation: rise .28s cubic-bezier(.2, .8, .2, 1) both; transition: opacity .3s, transform .3s; }
.todo .tick { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--faint); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 1px; transition: all .2s cubic-bezier(.2, 1.4, .4, 1); }
.todo .tick svg { width: 15px; height: 15px; stroke-width: 3; } .todo .tick:hover { border-color: var(--hi); transform: scale(1.1); }
.todo.done .tick, .todo.going .tick { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); transform: scale(1.12); }
.todo.done .ttext, .todo.going .ttext { text-decoration: line-through; color: var(--muted); }
.todo.going, .todo.coming { opacity: 0; transform: translateX(26px); }
.todo .ttext { display: block; outline: none; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; border-radius: 6px; cursor: text; } .todo .ttext:focus { background: var(--surface-2); box-shadow: 0 0 0 4px var(--surface-2); }
.todo .notedot { width: 8px; height: 8px; border-radius: 50%; background: var(--hi); flex: none; margin: 8px 9px 0; }
.todo.note { border-style: dashed; } .todo .btn.icon { opacity: .35; } .todo:hover .btn.icon, .todo .btn.icon:focus { opacity: 1; }
@media (max-width: 820px) {
  .todo-fab { top: auto; bottom: calc(104px + env(safe-area-inset-bottom)); padding: 11px 8px 11px 10px; }
  .todo-panel { width: 100vw; border-left: 0; }
}
@media print { #todo-root { display: none; } }

#dropveil { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(4, 5, 4, .5); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); animation: fade .15s; }
#dropveil * { pointer-events: none; } #dropveil .dropkind { pointer-events: auto; } #dropveil .dropkind * { pointer-events: none; }
.dropbox { width: min(720px, 100%); text-align: center; padding: 34px 26px; border-radius: 34px; border: 2.5px dashed var(--hi); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); box-shadow: 0 0 60px color-mix(in srgb, var(--hi) 22%, transparent); animation: pop .2s; }
.dropbox.no { border-color: var(--faint); box-shadow: none; }
.dropbox > svg.ic { width: 54px; height: 54px; padding: 13px; border-radius: 50%; background: var(--hi); color: var(--hi-ink); margin-bottom: 12px; animation: dropbob 1.2s ease-in-out infinite; } .dropbox.no > svg.ic { background: var(--surface-2); color: var(--muted); animation: none; }
.dropbox h2 { font-size: 23px; margin-bottom: 6px; } .dropbox p { margin: 0; color: var(--muted); }
.dropkinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.dropkind { padding: 22px 8px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--surface-2); display: grid; gap: 8px; justify-items: center; transition: transform .15s cubic-bezier(.2, .8, .2, 1), background .15s, border-color .15s, color .15s; }
.dropkind svg.ic { width: 26px; height: 26px; } .dropkind b { font-size: 13.5px; }
.dropkind.over { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); transform: scale(1.07); box-shadow: 0 14px 34px color-mix(in srgb, var(--hi) 30%, transparent); }
@keyframes dropbob { 50% { transform: translateY(-7px); } }
@media (max-width: 700px) { .dropkinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- upgrade 15 ---- */
.aphead { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .aphead svg.ic { width: 16px; height: 16px; }
.aphead:first-of-type { margin-top: 2px; }
.pastfill { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 10px; align-items: end; margin-top: 4px; } .pastfill input { min-height: 40px; }
.pasthead, .pastrow { display: grid; grid-template-columns: 146px 34px 112px minmax(0, 1.2fr) 74px minmax(0, 1.2fr) 34px; gap: 8px; align-items: center; }
.pasthead { font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.pastrow { padding: 7px 0; }
@media (max-width: 820px) {
  .pastfill { grid-template-columns: 1fr 1fr; } .pastfill .btn { grid-column: 1 / -1; }
  .pasthead { display: none; }
  .pastrow { grid-template-columns: 1fr 1fr; padding: 12px 0; } .pastrow > span[data-wd] { display: none; } .pastrow .btn { justify-self: end; grid-column: 2; }
}

/* ---- upgrade 16 ---- */
.avatar.gfig { padding: 0; overflow: hidden; display: block; } .avatar.gfig svg { width: 100%; height: 100%; display: block; }
.avatar.gfig.male { background: #4f8ef7; } .avatar.gfig.female { background: #ec6aa6; }
.hero .photo.canpick { cursor: pointer; } .hero .photo.canpick .avatar { transition: transform .2s cubic-bezier(.2, .8, .2, 1), filter .2s; } .hero .photo.canpick:hover .avatar { transform: scale(1.04); filter: brightness(1.08); }
.seg.mini { padding: 2px; } .seg.mini button { padding: 3px 9px; font-size: 11.5px; }

/* ---- upgrade 17 ---- */
.payline { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--late-soft) 55%, transparent); } .payline input { max-width: 220px; }

/* ---- upgrade 19 ---- */
details.more { position: relative; display: inline-block; } details.more > summary { list-style: none; cursor: pointer; } details.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; display: grid; gap: 2px; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .15s; }
.more-menu .btn { justify-content: flex-start; width: 100%; border-radius: 12px; }
.more-head { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 2px; } .more-head span { text-transform: none; font-weight: 500; letter-spacing: 0; }
.hero .photo.canpick::after { content: "Change"; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); padding: 2px 9px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: 10.5px; font-weight: 700; opacity: 0; transition: opacity .15s; pointer-events: none; }
.hero .photo.canpick:hover::after { opacity: 1; }
@media (max-width: 820px) {
  .hero > .row.wrap > details.more { flex: 1 1 calc(50% - 6px); } .hero > .row.wrap > details.more > summary { width: 100%; }
  .more-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 46; max-height: 60vh; overflow-y: auto; }
}

/* ---- upgrade 21: working without a connection ---- */
#offline-pill { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; box-shadow: var(--shadow-lg); animation: pop .2s; }
#offline-pill svg.ic { width: 16px; height: 16px; } #offline-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#offline-pill.off { background: var(--late-soft); color: var(--late); border-color: transparent; } #offline-pill.wait { background: var(--hi); color: var(--hi-ink); border-color: transparent; }
#offline-pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
@media print { #offline-pill { display: none; } }

/* ---- upgrade 22 ---- */
/* the magnifier rule of the search box must not reach the little figures in its results (it made one fill the screen) */
.search .avatar svg, .results .avatar svg { position: static; left: auto; top: auto; width: 100%; height: 100%; color: inherit; }

/* ---- upgrade 24 ---- */
.seg.mini.fill { display: flex; width: 100%; overflow: visible; } .seg.mini.fill button { flex: 1 1 0; min-width: 0; padding: 4px 2px; text-align: center; }

/* ---- upgrade 27: navy blue and yellow (these values replace the earlier green-black and lime ones) ---- */
:root {
  --hi: #ffd60a; --hi2: #e0a800; --hi-ink: #0a1128;
  --bg: #eef1f8; --surface: #ffffff; --surface-2: #f1f4fb; --line: #dde3f0; --text: #0b1433; --muted: #5b6685; --faint: #98a1ba;
  --brand: #0b1f4b; --brand-2: #1c3a7a; --brand-soft: #e3eafc; --brand-text: #0b2a6b;
  --shadow: 0 1px 2px rgba(11,31,75,.05), 0 8px 24px rgba(11,31,75,.08); --shadow-lg: 0 24px 60px rgba(11,31,75,.24);
  --ambient: color-mix(in srgb, #1c3a7a 14%, transparent);
  --hero-bg: linear-gradient(135deg, #0b1f4b 0%, #1c3a7a 70%, #2a4db0 100%); --hero-text: #ffffff; --hero-soft: rgba(255,255,255,.74); --hero-chip: rgba(255,255,255,.15);
  --hero-btn: rgba(255,255,255,.14); --hero-btn-text: #ffffff; --gauge-a: #ffb703; --gauge-b: #ffd60a;
}
:root[data-theme="dark"] {
  --hi: #ffd60a; --hi2: #ffb703;
  --bg: #070d1f; --surface: #0e1730; --surface-2: #152042; --line: #22305a; --text: #f2f5ff; --muted: #9aa6c7; --faint: #5f6c92;
  --brand: #ffd60a; --brand-2: #ffb703; --brand-soft: #1b2b55; --brand-text: #ffe066;
  --ok-soft: #0d3a35; --late-soft: #3d2f12; --bad-soft: #43182a; --exc-soft: #262663;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px rgba(0,3,20,.45); --shadow-lg: 0 30px 70px rgba(0,3,20,.75);
  --card-bg: linear-gradient(180deg, color-mix(in srgb, #fff 4%, var(--surface)), var(--surface) 55%);
  --ambient: color-mix(in srgb, #2a4db0 18%, transparent);
  --hero-bg: radial-gradient(130% 150% at 0% 108%, var(--hi) 0%, #c99a10 12%, #2b3f80 40%, #14224a 70%, #0e1730 100%);
  --hero-text: #ffffff; --hero-soft: rgba(255,255,255,.72); --hero-chip: rgba(255,255,255,.13); --hero-btn: #081026; --hero-btn-text: #ffffff; --gauge-a: var(--hi2); --gauge-b: var(--hi);
}
.btn.primary { background: linear-gradient(110deg, var(--hi) 42%, #fff3b0 50%, var(--hi) 58%); background-size: 260% 100%; background-position: 100% 0; }
.btn.primary:hover { background-position: 0 0; }
:root:not([data-theme="dark"]) .btn.primary { box-shadow: 0 6px 16px rgba(11,31,75,.14); border-color: rgba(10,17,40,.08); }
:root[data-theme="dark"] .calpill.present, :root[data-theme="dark"] .calpill.late, :root[data-theme="dark"] .calpill.absent, :root[data-theme="dark"] .calpill.excused { color: #0a1128; }
:root[data-theme="dark"] .chip.on, :root[data-theme="dark"] .mark.on { color: #0a1128; }
.kpis > .kpi:first-child:not(.bad):not(.late) .lbl, .kpis > .kpi:first-child:not(.bad):not(.late) .foot, .kpis > .kpi:first-child:not(.bad):not(.late) .val small { color: rgba(10,17,40,.7); }
.thero-acts .btn.primary { background: #ffffff; color: #0a1128; }
.toast { background: #0a1128; }
.overlay { background: rgba(3,7,20,.62); } .todo-shade { background: rgba(3,7,20,.5); } #dropveil { background: rgba(3,7,20,.55); }
.tour-dim { background: rgba(3,7,20,.64); } .tour-ring { box-shadow: 0 0 0 200vmax rgba(3,7,20,.64), 0 0 26px color-mix(in srgb, var(--hi) 55%, transparent); }
:root:not([data-theme="dark"]) .rolefx { background: var(--brand); color: var(--hi); }
.hero > .grow { flex: 1 1 240px; }   /* the name keeps its room: the buttons drop to the next line instead of squeezing it */

/* ---- upgrade 28 ---- */
.pilldel { border-radius: 999px; padding: 4px 12px; min-height: 0 !important; height: auto; width: auto; font-size: 12.5px; color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); align-self: center; justify-self: start; } .pilldel svg.ic { width: 13px; height: 13px; }
.classlink { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: inherit; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); transition: border-color .15s, background .15s; }
.classlink:hover, .classlink:active { border-color: var(--hi); } .classlink svg.ic { width: 13px; height: 13px; color: var(--brand-text); flex: none; }
.tbox.spot { outline: 3px solid var(--hi); outline-offset: 2px; z-index: 6; animation: spotpulse 1.1s ease-in-out 3; }
@keyframes spotpulse { 50% { outline-offset: 6px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--hi) 28%, transparent); } }
.optbtn { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, transform .1s; }
.optbtn:hover { border-color: var(--hi); } .optbtn:active { transform: scale(.985); } .optbtn > svg.ic { width: 18px; height: 18px; margin-top: 2px; color: var(--brand-text); flex: none; } .optbtn b { display: block; margin-bottom: 2px; }
.kidblock { border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin: 10px 0; background: var(--surface-2); } .kidblock > .row b { display: inline-flex; align-items: center; gap: 6px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; } .steps span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--line); color: var(--faint); }
.steps span.on { border-style: solid; background: var(--brand-soft); color: var(--brand-text); }
@media (max-width: 820px) { .planrow .pilldel { grid-column: 1 / -1; justify-self: end; } .kidblock .grid { grid-template-columns: 1fr; } .kidblock .span2 { grid-column: auto; } }

/* ---- upgrade 32: Arabic interface (right-to-left) ---- */
#langpill { position: fixed; top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 14px; z-index: 60; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
body:has(.shell) #langpill { display: none; }
.langbtn { font-weight: 800; font-size: 13px; min-width: 34px; }
[dir="rtl"] body { font-family: "Segoe UI", "SF Arabic", "Noto Sans Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif; letter-spacing: 0; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] th, [dir="rtl"] .nav-label, [dir="rtl"] .badge, [dir="rtl"] .thero-tag, [dir="rtl"] .rolepill { letter-spacing: 0; }
[dir="rtl"] .side { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] th, [dir="rtl"] .optbtn, [dir="rtl"] .tbox { text-align: right; }
[dir="rtl"] .right { text-align: left; }
[dir="rtl"] [style*="margin-left:auto"] { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] [style*="text-align:left"] { text-align: right !important; }
[dir="rtl"] .search svg { left: auto; right: 12px; } [dir="rtl"] .search input { padding-left: 14px; padding-right: 38px; }
[dir="rtl"] .num, [dir="rtl"] input[type="number"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="time"], [dir="rtl"] .phone, [dir="rtl"] .stepper,
[dir="rtl"] svg.chart, [dir="rtl"] .gauge, [dir="rtl"] .qr { direction: ltr; }
[dir="rtl"] .num { unicode-bidi: isolate; } [dir="rtl"] td.num, [dir="rtl"] th.right, [dir="rtl"] td.right { text-align: left; }
[dir="rtl"] .tgrid-wrap { direction: ltr; } [dir="rtl"] .tbox, [dir="rtl"] .tdetails, [dir="rtl"] .thead { direction: rtl; }
[dir="rtl"] .wholink svg.ic, [dir="rtl"] .btn svg.ic-back, [dir="rtl"] [data-act="attDay"] svg, [dir="rtl"] [data-act="insWeek"] svg { transform: scaleX(-1); }
[dir="rtl"] ul, [dir="rtl"] ol { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .toast, [dir="rtl"] .warnbox, [dir="rtl"] .formerr { text-align: right; }
[dir="rtl"] .rolefx { direction: ltr; margin-left: 0; margin-right: 8px; }
[dir="rtl"] .todo-fab { right: auto; left: 0; transform: scaleX(-1); } [dir="rtl"] .todo-fab > * { transform: scaleX(-1); }
.me { flex-wrap: wrap; row-gap: 6px; } .me .grow { flex: 1 1 96px; }

/* ---- upgrade 35 ---- */
.bottom-nav a.navplus { flex: 0 0 54px; width: 54px; height: 54px; align-self: center; margin: -6px 4px; padding: 0; border-radius: 50%; justify-content: center; background: var(--hi); color: var(--hi-ink);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--hi) 45%, transparent), 0 0 0 4px color-mix(in srgb, var(--hi) 22%, transparent); }
.bottom-nav a.navplus svg { width: 28px; height: 28px; stroke-width: 2.6; } .bottom-nav a.navplus:active { transform: scale(.9); }
.dayclasses { display: grid; gap: 8px; } .dayclasses .chip { display: block; width: 100%; text-align: start; border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 13.5px; line-height: 1.5; }
.dayclasses .chip .badge { margin-inline-start: 6px; }

/* ---- upgrade 36 ---- */
.only-m { display: none; } .only-m svg.ic { width: 11px; height: 11px; vertical-align: -1px; }
.pausebar { margin-bottom: 16px; padding: 12px 16px; display: grid; gap: 10px; } .pausebar.on { border-color: color-mix(in srgb, var(--late) 55%, var(--line)); background: color-mix(in srgb, var(--late) 9%, var(--surface)); }
@media (max-width: 820px) {
  .only-m { display: inline; }
  .bottom-nav { padding: 6px 4px; gap: 0; } .bottom-nav a { font-size: 9.5px; padding: 7px 0; min-width: 0; } .bottom-nav a svg { width: 20px; height: 20px; }
  .bottom-nav a.navplus { flex: 0 0 52px; width: 52px; height: 52px; margin: -6px 3px; }
  /* the student list as cards: name on one line, hours and balance at the side, nothing cut off */
  .stlist thead { display: none; } .stlist, .stlist tbody { display: block; width: 100%; }
  .stlist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
  .stlist td { padding: 0; border: 0; } .stlist td:first-child { grid-row: 1 / span 2; min-width: 0; } .stlist td:first-child .row > div { min-width: 0; }
  .stlist td:first-child b { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
  .stlist td:nth-child(4), .stlist td:nth-child(6) { justify-self: end; text-align: end; font-size: 12.5px; }
  .pausebar .row > .grow { flex: 1 1 100%; order: 2; } .pausebar .row > .btn { order: 3; margin-inline-start: auto; }
  .flags .list > div { flex-wrap: wrap; } .flags .list > div > .grow { flex: 1 1 62%; min-width: 0; } .flags .list > div > .btn { margin-inline-start: auto; }
}

/* ---- upgrade 37 ---- */
.fmenu { position: relative; display: inline-block; max-width: 100%; }
.fmenu > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 650; font-size: 13.5px; cursor: pointer; max-width: 100%; }
.fmenu > summary::-webkit-details-marker { display: none; } .fmenu > summary svg.ic { width: 15px; height: 15px; color: var(--muted); flex: none; } .fmenu > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmenu[open] > summary { border-color: var(--hi); } .fmenu > summary i { font-style: normal; color: var(--muted); }
.fmenu-list { position: absolute; z-index: 30; top: calc(100% + 6px); inset-inline-start: 0; width: max-content; max-width: min(92vw, 420px); max-height: 60vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); }
.fmenu-list .chips { margin: 0 !important; }
.sectabs { margin: 0 0 14px; flex-wrap: wrap; } .cols.tabbed { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; } .cols.tabbed > .stack { display: contents; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.fact { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--card-bg, var(--surface)); min-width: 0; }
.fact span { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); } .fact b { font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; } .fact small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.fact.warn b { color: var(--late); } .fact.bad b { color: var(--bad); }
.eod { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; text-decoration: none; color: inherit; }
/* nothing squeezes its neighbour: rows of a list wrap, long words break, headers wrap */
.list > div, .list > a.item { flex-wrap: wrap; row-gap: 8px; } .list > div > .grow, .list > a.item > .grow { flex: 1 1 58%; min-width: min(100%, 210px); overflow-wrap: anywhere; }
.top { flex-wrap: wrap; row-gap: 10px; } .top > h1 { min-width: 0; overflow-wrap: anywhere; } .card h2 { flex-wrap: wrap; row-gap: 6px; } .summary > div { flex-wrap: wrap; gap: 4px 12px; } .summary > div > b { overflow-wrap: anywhere; }
.btn { max-width: 100%; } td, th { overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .bottom-nav a { white-space: nowrap; letter-spacing: -.02em; font-size: 9px; overflow: visible; } .bottom-nav a.on { flex: 1.5 1 0; padding-inline: 4px; }
  .facts { grid-template-columns: 1fr 1fr; } .fact b { font-size: 17px; }
  .hero > .row.wrap:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; } .hero > .row.wrap:last-child > .btn { width: 100%; justify-content: center; }
  .hero > .row.wrap:last-child > .btn.primary, .hero > .row.wrap:last-child > .btn:only-child { grid-column: 1 / -1; }
  .hero > .row.wrap:last-child > .btn.icon { width: 100%; }
  .hero > .row.wrap:last-child > * { min-width: 0; width: 100%; } .hero > .row.wrap:last-child .btn { white-space: normal; text-align: center; width: 100%; justify-content: center; }
  .hero .more-menu .btn { justify-content: flex-start; text-align: start; }
  .modal footer { flex-wrap: wrap; } .modal footer .btn { flex: 1 1 auto; }
  .eod { flex-wrap: wrap; }
}

/* ---- upgrade 38 ---- */
.btn.delpill { color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border-radius: 999px; padding: 8px 16px; gap: 8px; aspect-ratio: auto; height: auto; width: auto; font-weight: 700; }
.btn.delpill svg.ic { width: 16px; height: 16px; }
.atlist { position: absolute; z-index: 5; left: 8px; right: 8px; top: calc(100% - 4px); max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); padding: 6px; }
.atlist button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.atlist button:hover, .atlist button:active { background: var(--surface-2); }
.taghelp > summary { cursor: pointer; font-size: 13.5px; } .taghelp b { color: var(--brand-text); }
@media (max-width: 820px) {
  .hero > .row.wrap:last-child > .btn.delpill { grid-column: 1 / -1; width: auto; justify-self: center; min-width: 140px; }
  .hero > .row.wrap:last-child > .btn.icon { aspect-ratio: auto; height: auto; min-height: 44px; }
}

/* ---- upgrade 39 ---- */
.wkrow { display: grid; grid-template-columns: minmax(210px, 1.6fr) 112px 84px minmax(120px, 1fr) minmax(110px, 1fr) auto; gap: 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wkrow.fixed { display: flex; align-items: center; flex-wrap: wrap; } .wkrow .f { margin: 0; min-width: 0; } .wkrow .f span { font-size: 11.5px; } .wkrow input, .wkrow select { width: 100%; min-width: 0; }
.wkdays { display: flex; flex-wrap: wrap; gap: 4px; align-self: center; } .wkdays button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.wkdays button.on { background: var(--hi); color: var(--hi-ink); border-color: transparent; } .wkacts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.payrow { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); } .payrow:first-of-type { border-top: 0; padding-top: 0; }
.paybar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 55%, var(--surface-2)); overflow: hidden; } .paybar i { display: block; height: 100%; background: var(--late); }
.stepbar { position: sticky; top: -1px; z-index: 4; display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 10px; margin: -4px 0 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.stepbar button { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; } .stepbar button.on { background: var(--hi); color: var(--hi-ink); border-color: transparent; }
@media (max-width: 900px) {
  .wkrow { grid-template-columns: 1fr 1fr; } .wkrow .wkdays, .wkrow .wkacts { grid-column: 1 / -1; } .wkrow .wkacts { justify-content: space-between; }
}

/* ---- upgrade 40 ---- */
.teacher { max-width: 760px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); height: 100%; overflow-y: auto; } .teacher header { gap: 8px; align-items: center; }

/* ---------- upgrade 41: staff accounts as rows that fit a phone, roles that open on tap, instructor access window */
.stafflist { padding: 4px 0; }
.staffrow { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.staffrow:last-child { border-bottom: 0; }
.staffrow > .row { flex-wrap: wrap; gap: 8px 10px; }
.staffrow .grow { min-width: 120px; display: grid; }
.staffrow .grow b, .staffrow .grow span { overflow-wrap: anywhere; }
.staffbtns { gap: 8px; }
.roleinfo { border-top: 1px solid var(--line); padding: 10px 0; }
.roleinfo summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; list-style: none; }
.roleinfo summary::-webkit-details-marker { display: none; }
.roleinfo summary::after { content: '+'; margin-inline-start: auto; color: var(--muted); font-weight: 700; }
.roleinfo[open] summary::after { content: '–'; }
.roleinfo ul { margin: 8px 0 2px; padding-inline-start: 20px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.accbox { display: grid; gap: 12px; } .accbox p { margin: 0; }
.acclink { overflow-wrap: anywhere; font-size: 13px; min-width: 0; }
.okbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .35); }
.okbox svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.howto { margin: 0; padding-inline-start: 22px; display: grid; gap: 10px; }
.howto li b { display: block; } .howto li span { display: block; color: var(--muted); font-size: 13.5px; }

/* ---------- upgrade 42: the instructor's own app, and the office's files-to-print list */
.mine { display: grid; gap: 4px; }
body:has(.teacher) #langpill { display: none; }
.minetabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 2px; position: sticky; top: 0; z-index: 5; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.minetabs button { display: grid; justify-items: center; gap: 3px; padding: 8px 2px; border: 0; border-radius: 13px; background: none; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; min-width: 0; }
.minetabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minetabs button svg { width: 19px; height: 19px; }
.minetabs button.on { background: var(--brand); color: #0a1128; }
.mine .daybar { flex-wrap: wrap; } .mine .daybar b { display: block; min-width: 0; font-size: 14.5px; }
.minemore { gap: 8px; padding: 0 16px 12px; }
.minenote { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 11px; background: var(--surface-2); font-size: 13.5px; overflow-wrap: anywhere; }
.minenote svg { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--muted); }
.minegrid { overflow: hidden; }
.mg-head, .mg-body { display: grid; grid-template-columns: 44px repeat(var(--cols), minmax(0, 1fr)); }
.mg-head > * { padding: 8px 2px; text-align: center; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); display: grid; min-width: 0; }
.mg-head > span { border-inline-start: 0; }
.mg-head b { font-size: 13px; } .mg-head span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.mg-head .now { background: var(--surface-2); } .mg-head .now b { color: var(--brand); }
.mg-body { position: relative; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--h); }
.mg-time { display: grid; grid-auto-rows: var(--h); } .mg-time span { font-size: 10.5px; color: var(--muted); padding: 2px 4px; }
.mg-col { position: relative; border-inline-start: 1px solid var(--line); min-width: 0; } .mg-col.now { background: rgba(245, 197, 24, .05); }
.mg-box { position: absolute; inset-inline: 2px; display: grid; align-content: start; gap: 1px; padding: 4px 5px; border: 0; border-inline-start: 3px solid #7c6cf0; border-radius: 8px; background: rgba(124, 108, 240, .22); color: var(--text); font: inherit; text-align: start; cursor: pointer; overflow: hidden; }
.mg-box b { font-size: 11.5px; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .mg-box span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.mg-box.done { border-color: #22c55e; background: rgba(34, 197, 94, .2); }
.mg-box.off { border-color: var(--muted); background: repeating-linear-gradient(135deg, rgba(148, 163, 184, .22) 0 6px, rgba(148, 163, 184, .08) 6px 12px); }
.mg-box.away { border-color: var(--bad); background: rgba(239, 68, 68, .16); }
.minekey { gap: 6px 14px; margin: 10px 2px; } .minekey span { display: inline-flex; align-items: center; gap: 6px; }
.minekey .k { width: 12px; height: 12px; border-radius: 4px; background: rgba(124, 108, 240, .5); display: inline-block; } .minekey .k.done { background: #22c55e; } .minekey .k.off { background: #94a3b8; } .minekey .k.away { background: var(--bad); }
.minestreak { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.minestreak.hot { background: linear-gradient(135deg, rgba(245, 197, 24, .22), rgba(239, 68, 68, .12)); border-color: rgba(245, 197, 24, .45); }
.minestreak .flame { font-size: 40px; line-height: 1; }
.minestreak .grow { display: grid; min-width: 0; } .minestreak .grow b { font-size: 34px; line-height: 1; } .minestreak .grow span { font-weight: 650; } .minestreak small { color: var(--muted); margin-top: 4px; }
.minestreak .best { display: grid; justify-items: center; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); } .minestreak .best b { font-size: 22px; } .minestreak .best span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.minetiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
@media (min-width: 720px) { .minetiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.minetile { display: grid; gap: 2px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.minetile b { font-size: 24px; } .minetile span { font-weight: 600; font-size: 13px; } .minetile small { color: var(--muted); font-size: 11.5px; }
.minebars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.minebars > div { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; height: 100%; gap: 3px; min-width: 0; }
.minebars i { align-self: end; width: 70%; min-height: 3px; border-radius: 7px 7px 3px 3px; background: var(--brand); }
.minebars b { font-size: 12px; } .minebars span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.minerules { margin: 0 0 8px; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 13.5px; }
.minepick { justify-self: start; cursor: pointer; }
.mine .card + .card { margin-top: 12px; }
.printrow { flex-wrap: wrap; gap: 8px 10px; } .printrow .grow { min-width: 160px; overflow-wrap: anywhere; } .printrow.done { opacity: .6; }
.printbox { margin-bottom: 16px; }
.printdot { margin-inline-start: 6px; min-width: 18px; text-align: center; }
.bottom-nav .printdot { position: absolute; top: 4px; inset-inline-end: 8px; margin: 0; font-size: 10px; padding: 1px 5px; } .bottom-nav a { position: relative; }

/* ---------- upgrade 43: instructors' comments in the office */
.insnote { display: flex; gap: 7px; align-items: flex-start; margin-top: 6px; padding: 7px 10px; border-radius: 11px; background: var(--surface-2); font-size: 13px; overflow-wrap: anywhere; width: 100%; }
.insnote svg { flex: none; width: 14px; height: 14px; margin-top: 3px; color: var(--muted); }
.notebox { margin-bottom: 16px; } .notebox summary { cursor: pointer; list-style: none; } .notebox summary::-webkit-details-marker { display: none; }
.notebox summary h2 { margin: 0; } .notebox[open] summary h2 { margin-bottom: 10px; }
.notebox summary h2::after { content: '+'; margin-inline-start: auto; color: var(--muted); } .notebox[open] summary h2::after { content: '–'; }
.noterow { flex-wrap: wrap; gap: 8px 10px; align-items: flex-start; } .noterow .grow { min-width: 180px; } .noterow.new b { color: var(--brand); }

/* ---------- upgrade 44: instructors' access on the Staff page */
.teamrow { flex-wrap: wrap; gap: 8px 10px; } .teamrow .grow { min-width: 140px; overflow-wrap: anywhere; }

/* ---- upgrade 46: the School National look (clay and night). These values replace the navy and yellow of upgrade 27. ---- */
:root { font-family: Cairo, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Arabic", sans-serif; }
:root {
  --hi: #B8471F; --hi2: #D4572F; --hi-ink: #ffffff;
  --bg: #F3F1EE; --surface: #ffffff; --surface-2: #F6F4F1; --line: #E6E2DC; --text: #16121D; --muted: #5E5470; --faint: #9E978E;
  --brand: #211A2B; --brand-2: #2E253B; --brand-soft: #FBE5DA; --brand-text: #A23C1D;
  --ok: #1E8456; --late: #935F05; --bad: #C2362B;
  --shadow: 0 1px 2px rgba(22,18,29,.05), 0 8px 24px rgba(22,18,29,.07); --shadow-lg: 0 24px 60px rgba(22,18,29,.24);
  --ambient: color-mix(in srgb, #D4572F 12%, transparent);
  --hero-bg: linear-gradient(135deg, #211A2B 0%, #2E253B 62%, #5a2d22 100%); --hero-text: #ffffff; --hero-soft: rgba(255,255,255,.74); --hero-chip: rgba(255,255,255,.14);
  --hero-btn: rgba(255,255,255,.14); --hero-btn-text: #ffffff; --gauge-a: #D4572F; --gauge-b: #F2B544;
}
:root[data-theme="dark"] {
  --hi: #D4572F; --hi2: #F08A65; --hi-ink: #16121D;
  --bg: #16121D; --surface: #211A2B; --surface-2: #2A2236; --line: #3A3048; --text: #FFF7F0; --muted: #A49BB3; --faint: #6E6480;
  --brand: #D4572F; --brand-2: #F08A65; --brand-soft: #3a2420; --brand-text: #F6A385;
  --ok: #4FC48A; --late: #F2B544; --bad: #F07A6E;
  --ok-soft: #12352a; --late-soft: #3d2e12; --bad-soft: #43201f; --exc-soft: #2b2448;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px rgba(8,4,12,.45); --shadow-lg: 0 30px 70px rgba(8,4,12,.75);
  --card-bg: linear-gradient(180deg, color-mix(in srgb, #fff 3.5%, var(--surface)), var(--surface) 55%);
  --ambient: color-mix(in srgb, #D4572F 12%, transparent);
  --hero-bg: radial-gradient(130% 150% at 0% 108%, #D4572F 0%, #9c3a1f 14%, #3b2533 42%, #241c2e 70%, #211A2B 100%);
  --hero-text: #ffffff; --hero-soft: rgba(255,255,255,.72); --hero-chip: rgba(255,255,255,.13); --hero-btn: #16121D; --hero-btn-text: #ffffff; --gauge-a: var(--hi2); --gauge-b: #F2B544;
}
.btn.primary { background: linear-gradient(110deg, var(--hi) 42%, color-mix(in srgb, var(--hi) 55%, #fff) 50%, var(--hi) 58%); background-size: 260% 100%; background-position: 100% 0; color: var(--hi-ink); }
:root:not([data-theme="dark"]) .btn.primary { box-shadow: 0 6px 16px rgba(162,60,29,.18); border-color: transparent; }
:root[data-theme="dark"] .calpill.present, :root[data-theme="dark"] .calpill.late, :root[data-theme="dark"] .calpill.absent, :root[data-theme="dark"] .calpill.excused { color: #16121D; }
:root[data-theme="dark"] .chip.on, :root[data-theme="dark"] .mark.on { color: #16121D; }
.brand .logo.snmark { background: none; box-shadow: 0 6px 18px rgba(162,60,29,.28); padding: 0; overflow: hidden; }
.brand .logo.snmark svg { width: 100%; height: 100%; stroke-width: 0; }
.auth .brand .logo.snmark { width: 52px; height: 52px; }
:root:not([data-theme="dark"]) .rolefx { background: #16121D; color: #F08A65; }

/* ---- upgrade 47: School National v2 — black, off-white, one signal red; system fonts. Replaces the clay look of upgrade 46. ---- */
:root { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Noto Sans Arabic", sans-serif; }
:root {
  --hi: #C8180F; --hi2: #E8261C; --hi-ink: #ffffff;
  --bg: #F5F5F2; --surface: #ffffff; --surface-2: #F0F0EC; --line: #E3E3DE; --text: #0A0A0A; --muted: #6E6E69; --faint: #A3A39D;
  --brand: #0A0A0A; --brand-2: #2A2A28; --brand-soft: #F0F0EC; --brand-text: #0A0A0A;
  --ok: #1D7A46; --late: #8A5A00; --bad: #C8180F;
  --shadow: 0 1px 2px rgba(10,10,10,.04), 0 6px 20px rgba(10,10,10,.05); --shadow-lg: 0 24px 60px rgba(10,10,10,.22);
  --ambient: transparent; --card-bg: var(--surface);
  --hero-bg: #0A0A0A radial-gradient(#262624 1px, transparent 1.2px) 0 0 / 18px 18px; --hero-text: #F5F5F2; --hero-soft: rgba(245,245,242,.7); --hero-chip: rgba(255,255,255,.1);
  --hero-btn: rgba(255,255,255,.12); --hero-btn-text: #ffffff; --gauge-a: #E8261C; --gauge-b: #F5F5F2;
}
:root[data-theme="dark"] {
  --hi: #E8261C; --hi2: #FF4A3D; --hi-ink: #ffffff;
  --bg: #0A0A0A; --surface: #161615; --surface-2: #1E1E1C; --line: #2A2A28; --text: #F5F5F2; --muted: #A3A39D; --faint: #6E6E69;
  --brand: #F5F5F2; --brand-2: #D8D8D2; --brand-soft: #1E1E1C; --brand-text: #F5F5F2;
  --ok: #4CC488; --late: #E7B04A; --bad: #FF5A4E;
  --ok-soft: #10301f; --late-soft: #33280f; --bad-soft: #3a1513; --exc-soft: #1d2433;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.45); --shadow-lg: 0 30px 70px rgba(0,0,0,.75);
  --card-bg: var(--surface); --ambient: transparent;
  --hero-bg: #161615 radial-gradient(#2a2a28 1px, transparent 1.2px) 0 0 / 18px 18px;
  --hero-text: #F5F5F2; --hero-soft: rgba(245,245,242,.7); --hero-chip: rgba(255,255,255,.1); --hero-btn: #0A0A0A; --hero-btn-text: #ffffff; --gauge-a: #E8261C; --gauge-b: #F5F5F2;
}
.btn.primary { background: var(--hi); background-size: auto; color: var(--hi-ink); box-shadow: none; border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--hi) 86%, #000); }
:root:not([data-theme="dark"]) .btn.primary { box-shadow: none; }
.auth { background: radial-gradient(#dcdcd6 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg); }
:root[data-theme="dark"] .auth { background: radial-gradient(#222220 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg); }
:root[data-theme="dark"] .calpill.present, :root[data-theme="dark"] .calpill.late, :root[data-theme="dark"] .calpill.absent, :root[data-theme="dark"] .calpill.excused { color: #0A0A0A; }
:root[data-theme="dark"] .chip.on, :root[data-theme="dark"] .mark.on { color: #ffffff; }
.brand .logo.snmark { background: none; box-shadow: none; padding: 0; overflow: hidden; border-radius: 10px; }
:root:not([data-theme="dark"]) .rolefx { background: #0A0A0A; color: #ffffff; }
.kpis > .kpi:first-child:not(.bad):not(.late) { box-shadow: none; }
