/* Ms. Bee: white glass panels over a soft wash of sky, sun and mint.
   Navy ink and the sunbeam yellow come from the logo; bluebell is the action colour. */
:root {
  --paper: #f7f8fc; --ink: #18224a; --text: #3a4466; --muted: #6b7393; --faint: #9aa1bb; --line: #e6e9f2;
  --blue: #3f5bd8; --blue-deep: #2f47b8; --blue-tint: #eef1ff;
  --sun: #ffc93c; --sun-tint: #fff6db; --sun-ink: #8a5a00;
  --leaf: #1a8f61; --leaf-tint: #e6f6ef; --rose: #d9344a; --rose-tint: #fdecee; --amber: #a86400; --amber-tint: #fff3dc;
  --violet: #6d4fd0; --violet-tint: #f1edff;
  --glass: rgba(255, 255, 255, .64); --glass-strong: rgba(255, 255, 255, .8); --glass-edge: rgba(255, 255, 255, .9);
  --shadow: 0 1px 2px rgba(24, 34, 74, .04), 0 10px 30px rgba(24, 34, 74, .07);
  --shadow-up: 0 2px 4px rgba(24, 34, 74, .05), 0 16px 40px rgba(24, 34, 74, .11);
  --side-w: 260px; --gap: 16px;
  --display: Fredoka, "Figtree", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 400 15.5px/1.55 Figtree, "Noto Sans Ethiopic", system-ui, sans-serif;
  background:
    radial-gradient(42vw 42vw at -6% -8%, rgba(99, 125, 255, .16), transparent 65%),
    radial-gradient(36vw 36vw at 104% -4%, rgba(255, 201, 60, .2), transparent 62%),
    radial-gradient(46vw 46vw at 92% 108%, rgba(52, 199, 150, .12), transparent 62%),
    var(--paper);
  background-attachment: fixed;
}
a { color: var(--blue); }
h1, h2 { color: var(--ink); font-family: var(--display); font-weight: 600; letter-spacing: -.005em; }
h1 { margin: 6px 0 16px; font-size: 1.7rem; line-height: 1.15; }
h2 { margin: 0 0 14px; font-size: 1.15rem; line-height: 1.25; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 2px; }

/* ---------- Motion: soft page changes, content rising in, tactile buttons ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
.side { view-transition-name: side; }
.top { view-transition-name: top; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes glow { from { box-shadow: 0 0 0 0 rgba(63, 91, 216, .35); } to { box-shadow: 0 0 0 14px rgba(63, 91, 216, 0); } }
main > * { animation: rise .28s cubic-bezier(.2, .8, .2, 1) both; } /* short, so pages feel instant: all in by .35s */
main > :nth-child(2) { animation-delay: .02s; }
main > :nth-child(3) { animation-delay: .04s; }
main > :nth-child(4) { animation-delay: .06s; }
main > :nth-child(n+5) { animation-delay: .07s; }
html { scroll-behavior: smooth; }
button, .btn, .icon-btn, .tile, .quick a, a.card { transition: transform .18s ease, box-shadow .2s ease, background .2s, border-color .2s, color .2s; }
.tile:hover, .quick a:hover, a.card:hover { transform: translateY(-2px); }
button:active, .btn:active, .icon-btn:active { transform: scale(.97); }
.side nav a .i { transition: transform .2s ease, color .2s; }
.side nav a:hover .i { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .flash { animation: toast-off 5.5s step-end forwards !important; } /* no slide or fade, but the toast must still go away */
  html { scroll-behavior: auto; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { flex: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--sun-tint), var(--shadow); }
.brand b { display: block; font-family: var(--display); font-size: 1.3rem; font-weight: 600; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Side menu: a floating glass panel ---------- */
.side {
  position: fixed; top: var(--gap); bottom: var(--gap); left: var(--gap); z-index: 20; display: flex; flex-direction: column;
  width: var(--side-w); padding: 18px 14px 14px; background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 26px;
  box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.side > .brand { padding: 2px 8px 18px; border-bottom: 1px solid rgba(24, 34, 74, .07); }
.side nav { flex: 1; margin: 0 -6px; padding: 12px 6px; overflow-y: auto; scrollbar-width: thin; }
.nav-label { margin: 18px 12px 6px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.side nav a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 2px 0; padding: 9px 12px;
  border-radius: 14px; color: var(--text); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s;
}
.side nav a .i { width: 19px; height: 19px; color: var(--faint); }
.side nav a:hover { background: rgba(63, 91, 216, .06); color: var(--ink); }
.side nav a.on { background: #fff; color: var(--ink); box-shadow: 0 6px 18px rgba(24, 34, 74, .08); }
.side nav a.on .i { color: var(--blue); }
/* The current page is marked with a small honeycomb cell, the one nod to the bee. */
.side nav a.on::after { content: ""; position: absolute; right: 14px; width: 9px; height: 10px; background: var(--sun); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
/* Signed-in person, top right: avatar, name and role, log out. */
.me { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 5px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(24, 34, 74, .05); }
.me a { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.me .who { min-width: 0; max-width: 160px; padding-right: 4px; line-height: 1.3; }
.me b, .me small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me b { font-size: 14px; }
.me small { color: var(--muted); font-size: 12px; }
.me form { margin: 0; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #6f87f2, var(--blue)); color: #fff; font: 600 14px var(--display); }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; min-height: 0; flex: none; padding: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(24, 34, 74, .05); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: #fff; border-color: #cfd6f5; color: var(--blue); }
.me .icon-btn { width: 38px; height: 38px; border-radius: 13px; box-shadow: none; }
@media (max-width: 1280px) { .me .who { display: none; } }
@media (max-width: 1200px) { .search { display: none; } } /* small laptops: avatar only, so the page title keeps its room */
.scrim, .menu-btn, .top-brand { display: none; }

/* ---------- Top bar: page title with today's date in both calendars ---------- */
.shell { margin-left: calc(var(--side-w) + var(--gap) * 2); padding: var(--gap) 28px 0 0; }
.top {
  position: sticky; top: var(--gap); z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 26px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); border-radius: 26px; box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
}
/* A strip of page background stuck under the floating bar, from the top of the screen to the bar's middle, so text
   scrolling up is hidden in the gap above and beside the bar. Same fixed background as the body, so it is invisible. */
.app .shell::before {
  content: ""; position: sticky; top: 0; z-index: 9; display: block; height: calc(var(--gap) + 44px); margin: calc(-1 * var(--gap)) 0 calc(-44px); pointer-events: none;
  background:
    radial-gradient(42vw 42vw at -6% -8%, rgba(99, 125, 255, .16), transparent 65%),
    radial-gradient(36vw 36vw at 104% -4%, rgba(255, 201, 60, .2), transparent 62%),
    radial-gradient(46vw 46vw at 92% 108%, rgba(52, 199, 150, .12), transparent 62%),
    var(--paper);
  background-attachment: fixed;
}
.top .title { flex: 1; min-width: 0; }
.top h1 { margin: 0; overflow: hidden; font-size: 1.55rem; text-overflow: ellipsis; white-space: nowrap; }
.top h1 .muted { font-family: Figtree, system-ui, sans-serif; font-size: 15px; font-weight: 600; }
/* Ethiopian time over the Ethiopian date, set like a desk clock: no box, just type. */
.clock { display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 0 18px 0 4px; border-right: 1px solid var(--line); line-height: 1.15; white-space: nowrap; }
.clock b { color: var(--ink); font: 600 1.3rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.clock b small { margin-left: 5px; color: var(--sun-ink); font: 700 12px Figtree, system-ui, sans-serif; letter-spacing: .02em; }
.clock span { margin-top: 3px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.clock.on-phone { display: none; }
.tools { display: flex; align-items: center; gap: 10px; }
.search { position: relative; width: clamp(160px, 15vw, 220px); margin: 0; }
.search .i { position: absolute; top: 13px; left: 14px; width: 18px; height: 18px; color: var(--faint); }
.search input { margin: 0; padding: 12px 16px 12px 42px; border-radius: 14px; }
.bell i { position: absolute; top: -5px; right: -5px; min-width: 20px; padding: 0 5px; border: 2px solid #fff; border-radius: 10px; background: var(--rose); color: #fff; font: 700 11px/16px Figtree, system-ui; font-style: normal; text-align: center; }
main { max-width: 1520px; padding: 24px 0 28px; } /* wide enough to line up with the top bar on big screens */
footer { padding: 0 0 26px; color: var(--faint); font-size: 12.5px; }

@media (max-width: 960px) {
  .side { transform: translateX(calc(-100% - 2 * var(--gap))); transition: transform .25s ease; box-shadow: var(--shadow-up); background: rgba(255, 255, 255, .9); }
  .menu-state:checked ~ .side { transform: none; }
  .menu-state:checked ~ .scrim { position: fixed; inset: 0; z-index: 15; display: block; background: rgba(24, 34, 74, .22); }
  .shell { margin: 0; padding: 10px 12px 0; }
  .top { top: 10px; flex-wrap: wrap; gap: 10px 12px; min-height: 0; padding: 12px 12px 14px; border-radius: 22px; }
  .menu-btn { display: grid; }
  .top-brand { display: flex; flex: 1; align-items: center; gap: 8px; color: var(--ink); font: 600 1.05rem var(--display); text-decoration: none; }
  .top-brand img { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--sun-tint); }
  .top .title { order: 3; flex-basis: 100%; padding: 0 4px; }
  .top h1 { margin-bottom: 8px; font-size: 1.35rem; white-space: normal; }
  .clock.on-wide { display: none; }
  .clock.on-phone { display: flex; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 10px; padding: 0; border: 0; }
  .clock.on-phone b { font-size: 1.05rem; }
  .clock.on-phone span { margin: 0; }
  .search { display: none; }
  main { padding: 16px 0 24px; }
}

/* ---------- Sign-in and other pages without the menu ---------- */
.plain .plain-top { display: flex; align-items: center; justify-content: space-between; max-width: 960px; margin: 0 auto; padding: 20px 16px 0; }
.plain main { max-width: 960px; margin: 0 auto; padding: 16px; }
.plain footer { padding: 0 16px 24px; text-align: center; }

/* ---------- Cards ---------- */
.card {
  display: block; margin-bottom: 18px; padding: 22px 24px; background: rgba(255, 255, 255, .78); border: 1px solid var(--glass-edge);
  border-radius: 22px; box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
@media (min-width: 961px) { .card, .tile, .quick a { backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); } }
a.card:hover, a.tile:hover { box-shadow: var(--shadow-up); }
.narrow { max-width: 440px; margin: 28px auto; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* Colour chips around icons; the tone says what kind of thing it is. */
.chip-icon { display: grid; place-items: center; width: 50px; height: 50px; flex: none; border-radius: 16px; }
.chip-icon .i { width: 22px; height: 22px; }
.t-blue { background: var(--blue-tint); color: var(--blue); }
.t-green { background: var(--leaf-tint); color: var(--leaf); }
.t-amber { background: var(--amber-tint); color: var(--amber); }
.t-rose { background: var(--rose-tint); color: var(--rose); }
.t-violet { background: var(--violet-tint); color: var(--violet); }
.t-sun { background: var(--sun-tint); color: var(--sun-ink); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 18px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 124px; padding: 18px 20px; background: rgba(255, 255, 255, .78); border: 1px solid var(--glass-edge); border-radius: 22px; box-shadow: var(--shadow); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.tile .chip-icon { width: 44px; height: 44px; border-radius: 14px; }
.tile b { margin-bottom: -10px; font: 600 1.6rem/1.1 var(--display); }

/* ---------- Staff dashboard ---------- */
.hero { display: grid; grid-template-columns: 190px minmax(0, 1fr) 210px; gap: 28px; align-items: center; padding: 26px 28px; }
.ring { position: relative; width: 180px; height: 180px; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: #eef0f6; }
.ring .present { stroke: #2bb07f; }
.ring .late { stroke: #f2b23a; }
.ring .absent { stroke: #e5566a; }
.ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring b { color: var(--ink); font: 600 2.4rem/1 var(--display); }
.ring small { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.hero-main .sub { margin-top: 0; }
.lead { margin: 0 0 6px; color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.tally { display: flex; flex-wrap: wrap; gap: 26px; margin: 0 0 4px; padding: 0; list-style: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.tally b { display: block; font: 600 1.8rem/1.1 var(--display); }
.tally .present b { color: var(--leaf); }
.tally .late b { color: var(--amber); }
.tally .absent b { color: var(--rose); }
.class-bars { display: grid; gap: 4px; margin: 16px 0 12px; }
.class-bars a { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(80px, 1.6fr) 74px; gap: 16px; align-items: center; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.class-bars a:hover { background: rgba(63, 91, 216, .05); }
.class-bars b { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.class-bars small { display: block; color: var(--muted); font-size: 12.5px; }
.class-bars a > small { text-align: right; font-weight: 600; }
.class-bars i { display: block; height: 8px; overflow: hidden; background: #eef0f6; border-radius: 99px; }
.class-bars em { display: block; height: 100%; background: linear-gradient(90deg, #7b90f4, var(--blue)); border-radius: 99px; }
.hero-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; align-self: stretch; justify-content: center; padding: 22px; border-radius: 20px; font-size: 14px; font-weight: 600; text-decoration: none; }
.hero-side b { font: 600 2rem/1.1 var(--display); }
.hero-side.busy { background: var(--amber-tint); color: #7a4a00; }
.hero-side.calm { background: var(--leaf-tint); color: var(--leaf); }
.hero-side:hover { box-shadow: var(--shadow); }
.hero-side .chip-icon { background: #fff; }
.grid2.single { grid-template-columns: minmax(0, 1fr); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .78); border: 1px solid var(--glass-edge); border-radius: 18px; box-shadow: var(--shadow); color: var(--ink); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.quick a:hover { box-shadow: var(--shadow-up); }
.quick .chip-icon { width: 40px; height: 40px; border-radius: 13px; }
.chip-icon.small { width: 36px; height: 36px; border-radius: 12px; }
.chip-icon.small .i { width: 18px; height: 18px; }
.grow { flex: 1; min-width: 0; }
.week { display: flex; justify-content: space-between; gap: 14px; padding-top: 6px; }
.week > div { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 8px; }
.week i { display: flex; align-items: flex-end; width: min(46px, 100%); height: 130px; overflow: hidden; background: #f1f3f9; border-radius: 12px; }
.week em { display: block; width: 100%; background: #c9d3fb; border-radius: 12px; }
.week .now em { background: linear-gradient(180deg, #7b90f4, var(--blue)); }
.week small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.week span { color: var(--text); font-size: 13px; font-weight: 600; }
.week .now span { color: var(--blue); }
.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.feed li:last-child { border-bottom: 0; }
.feed b { color: var(--ink); font-weight: 600; }
.feed small { display: block; color: var(--muted); font-size: 13px; }
.feed .when { flex: none; color: var(--faint); font-size: 12px; white-space: nowrap; }
.avatar.small { width: 34px; height: 34px; font-size: 12.5px; }
@media (max-width: 1100px) {
  .hero { grid-template-columns: 170px minmax(0, 1fr); }
  .hero-side { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 16px 18px; }
  .hero-side b { font-size: 1.45rem; white-space: nowrap; }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px 18px; }
  .hero-ring { display: flex; justify-content: center; }
  .ring { width: 160px; height: 160px; }
  .tally { justify-content: space-around; text-align: center; }
  .class-bars a { grid-template-columns: minmax(0, 1fr) 70px; }
  .class-bars i { grid-column: 1 / -1; grid-row: 2; }
  .quick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .quick a { flex-direction: column; align-items: flex-start; gap: 10px; font-size: 14px; }
}

/* Simple rows for dashboard lists */
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows b { color: var(--ink); font-weight: 600; }
.rows small { display: block; color: var(--muted); font-size: 13px; }
.rows a { text-decoration: none; }
.sub { margin: 18px 0 10px; color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 18px; background: var(--leaf-tint); border-radius: 16px; color: var(--leaf); font-weight: 600; }
.kid { display: flex; align-items: center; gap: 16px; }
.kid .avatar { width: 52px; height: 52px; font-size: 18px; }
.kid h2 { margin: 0 0 2px; }
.kid p { margin: 0 0 8px; color: var(--muted); }
.kid > .i { color: var(--faint); }
.kid > div { flex: 1; min-width: 0; }

/* ---------- Forms and buttons ---------- */
label { display: block; margin-bottom: 16px; color: var(--ink); font-size: 14px; font-weight: 600; }
input, select, textarea {
  display: block; width: 100%; margin-top: 7px; padding: 12px 14px; background: #fbfcfe; border: 1.5px solid #e3e7f0; border-radius: 13px;
  color: var(--ink); font: inherit; font-weight: 400; transition: border-color .15s, box-shadow .2s, background .15s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { min-height: 48px; }
input::placeholder, textarea::placeholder { color: #a7adc4; }
input:hover, select:hover, textarea:hover { border-color: #cdd4e8; }
textarea { min-height: 112px; line-height: 1.55; resize: vertical; field-sizing: content; }
select {
  padding-right: 42px; appearance: none; cursor: pointer;
  background: #fbfcfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7393' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 17px no-repeat;
}
input[type="file"] { padding: 10px; background: #fbfcfe; border-style: dashed; cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; background: var(--blue-tint); border: 0; border-radius: 10px; color: var(--blue); font: 600 13.5px Figtree, system-ui, sans-serif; cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: none; background-color: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(63, 91, 216, .14); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 5px; accent-color: var(--blue); }
fieldset { margin: 0 0 14px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; }
legend { padding: 0 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; background: var(--blue); border: 0;
  border-radius: 14px; box-shadow: 0 6px 16px rgba(63, 91, 216, .22); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s;
}
button:hover, .btn:hover { background: var(--blue-deep); }
button:disabled { opacity: .5; }
.btn .i, button .i { width: 18px; height: 18px; }
.secondary { background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(24, 34, 74, .05); color: var(--ink); }
.secondary:hover { background: #fff; border-color: #cfd6f5; color: var(--blue); }
.danger { background: var(--rose-tint); box-shadow: none; color: var(--rose); }
.danger:hover { background: #fbd9de; }
.btn.small { min-height: 34px; padding: 6px 12px; border-radius: 11px; font-size: 13.5px; }
button.link { min-height: 0; padding: 0; background: none; box-shadow: none; color: var(--blue); font-weight: 600; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.filters, .inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.filters label, .inline label { flex: 1 1 160px; margin: 0; }
.inline-btn { display: inline; margin-left: 8px; }

/* ---------- Tables, lists, badges ---------- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; text-decoration: none; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list small { display: block; }
.list li.new a { font-weight: 700; }
.muted, small { color: var(--muted); font-size: 13px; }
.badge, .chip { display: inline-block; margin: 1px 0; padding: 4px 11px; border-radius: 999px; background: #eef0f6; color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.badge.approved, .badge.present, .chip.present { background: var(--leaf-tint); color: var(--leaf); }
.badge.pending, .badge.late, .chip.late { background: var(--amber-tint); color: var(--amber); }
.badge.returned, .badge.absent, .chip.absent { background: var(--rose-tint); color: var(--rose); }
/* Messages like "Saved." slide in as a toast and fade away by themselves. */
.flash {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: min(440px, calc(100vw - 32px)); margin: 0; padding: 14px 18px;
  background: var(--ink); border-radius: 16px; box-shadow: var(--shadow-up); color: #fff; font-weight: 600;
  animation: toast 5.5s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes toast { 0% { opacity: 0; transform: translateY(18px); } 6% { opacity: 1; transform: none; } 90% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(8px); visibility: hidden; } }
@keyframes toast-off { to { visibility: hidden; } }
@media (max-width: 760px) { .flash { right: 16px; bottom: 16px; left: 16px; } }
.alert { padding: 12px 16px; background: var(--rose-tint); border-radius: 14px; color: #8c1d2c; }

/* ---------- People: avatars, student list, student profile ---------- */
.av-0 { background: linear-gradient(135deg, #6f87f2, #3f5bd8); }
.av-1 { background: linear-gradient(135deg, #a28cf0, #6d4fd0); }
.av-2 { background: linear-gradient(135deg, #4cc597, #1a8f61); }
.av-3 { background: linear-gradient(135deg, #f6c45f, #c97f00); }
.av-4 { background: linear-gradient(135deg, #f08a98, #d9344a); }
.av-5 { background: linear-gradient(135deg, #5cc5d6, #1f8fa5); }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; box-shadow: 0 8px 22px rgba(24, 34, 74, .16); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; }
.toolbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.search-big { position: relative; flex: 1 1 240px; max-width: 360px; margin: 0; }
.search-big .i { position: absolute; top: 50%; left: 14px; width: 19px; height: 19px; color: var(--faint); transform: translateY(-50%); pointer-events: none; }
.search-big input { margin: 0; padding-left: 44px; border-radius: 14px; }
.count { margin: 2px 4px 12px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.stu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card.stu { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 18px; }
.stu-top { display: flex; align-items: center; gap: 12px; }
.stu-top b { display: block; color: var(--ink); font-size: 1.02rem; font-weight: 600; }
.stu-top small { color: var(--muted); }
.stu-meta { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.stu-meta span { display: flex; align-items: center; gap: 8px; }
.stu-meta .i { width: 15px; height: 15px; color: var(--faint); }
.stu-meta .warn, .stu-meta .warn .i { color: var(--rose); }
.profile-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 22px; padding: 24px 26px; }
.profile-hero h2 { margin: 0 0 10px; font-size: 1.7rem; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; background: #f1f3f9; color: var(--text); }
.chips .chip .i { width: 15px; height: 15px; color: var(--faint); }
.profile-hero .actions { margin: 0; }
.profile-hero .grow { min-width: min(260px, calc(100% - 110px)); } /* push the buttons to their own line before the name has to wrap */
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.mini-stats > * { padding: 16px 18px; background: rgba(255, 255, 255, .78); border: 1px solid var(--glass-edge); border-radius: 18px; box-shadow: var(--shadow); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; transition: transform .18s, box-shadow .2s; }
.mini-stats a:hover { box-shadow: var(--shadow-up); transform: translateY(-2px); }
.mini-stats b { display: block; color: var(--ink); font: 600 1.6rem/1.15 var(--display); }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.profile-grid.solo { grid-template-columns: minmax(0, 1fr); }
.days30 { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 5px; max-width: 520px; }
.days30 i, .legend i { display: block; aspect-ratio: 1; background: #2bb07f; border-radius: 5px; }
.days30 i.late, .legend i.late { background: #f2b23a; }
.days30 i.absent, .legend i.absent { background: #e5566a; }
.days30 i.none, .legend i.none { background: #eef0f6; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; color: var(--muted); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.thumbs a { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 12.5px; text-decoration: none; }
.thumbs img, .thumbs .ph { display: grid; place-items: center; width: 100%; aspect-ratio: 1; object-fit: cover; background: #eef0f6; border-radius: 14px; color: var(--faint); transition: transform .2s; }
.thumbs a:hover img { transform: scale(1.03); }
.thumbs small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 600; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.person b { display: block; color: var(--ink); font-weight: 600; }
.person small { color: var(--muted); }
.person form { margin: 0; }
.person .icon-btn { width: 38px; height: 38px; }
.link-parent { display: flex; gap: 8px; margin-top: 10px; }
.link-parent select { margin: 0; }
.small-note { margin: 12px 0 0; }
.form-body > .switch { display: flex; margin-top: 14px; }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .search-big { max-width: none; flex-basis: auto; }
  .toolbar .pills { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar .pills a { flex: 1 0 auto; white-space: nowrap; text-align: center; }
  .toolbar-end { margin-left: 0; }
  .toolbar-end .btn { flex: 1; justify-content: center; white-space: nowrap; }
  .stu-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .profile-hero { padding: 20px 18px; }
  .profile-hero .avatar.xl { width: 64px; height: 64px; font-size: 22px; }
  .profile-hero h2 { font-size: 1.35rem; }
  .profile-hero .actions { width: 100%; }
  .profile-hero .actions .btn { flex: 1; justify-content: center; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .days30 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}

/* ---------- Attendance roll call ---------- */
.roll-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; }
.roll-head h2 { margin: 0 0 0 6px; }
.pills { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: #eef0f6; border-radius: 14px; }
.pills a { white-space: nowrap; padding: 8px 16px; border-radius: 11px; color: var(--muted); font-weight: 600; text-decoration: none; transition: background .2s, color .2s, box-shadow .2s; }
.pills a:hover { color: var(--ink); }
.pills a.on, .pills a.on:hover { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(63, 91, 216, .32); }
.day-nav { display: flex; align-items: center; gap: 8px; }
.day-nav .day { min-width: 160px; line-height: 1.25; text-align: center; }
.day-nav .day b { display: block; color: var(--ink); font-weight: 600; }
.day-nav .day small { color: var(--muted); font-size: 12.5px; }
.icon-btn.off { opacity: .4; pointer-events: none; }
.date-pick { margin: 0; cursor: pointer; }
.date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.card.roll { padding: 0; }
.roll-summary {
  position: sticky; top: 98px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 16px 20px;
  background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); border-radius: 22px 22px 0 0; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.roll-progress { margin: 0; color: var(--muted); font-weight: 600; }
.roll-progress b { color: var(--ink); font: 600 1.4rem var(--display); }
.roll.complete .roll-progress b { color: var(--leaf); }
.roll-summary ul { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; }
.roll-summary li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; }
.roll-summary li b { font: 600 1.05rem var(--display); }
.roll-summary li.present { background: var(--leaf-tint); color: var(--leaf); }
.roll-summary li.late { background: var(--amber-tint); color: var(--amber); }
.roll-summary li.absent { background: var(--rose-tint); color: var(--rose); }
.roll-summary [data-all] { margin-left: auto; }
.roll-list { margin: 0; padding: 4px 0; list-style: none; }
.roll-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 16px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; transition: background .25s, border-color .25s; }
.roll-row:last-child { border-bottom: 0; }
.roll-row.is-present { border-left-color: #2bb07f; }
.roll-row.is-late { border-left-color: #f0a92e; background: rgba(255, 243, 220, .45); }
.roll-row.is-absent { border-left-color: var(--rose); background: rgba(253, 236, 238, .55); }
.roll-row .avatar { transition: background .25s; }
.roll-row.is-none .avatar { background: #CBD5E1; }
.roll-row.is-late .avatar { background: linear-gradient(135deg, #f6c45f, #d68a00); }
.roll-row.is-absent .avatar { background: linear-gradient(135deg, #f08a98, var(--rose)); }
.roll-row a { text-decoration: none; }
.roll-row b { color: var(--ink); font-weight: 600; }
.roll-row small { display: block; color: var(--muted); font-size: 12.5px; }
.roll-row .todo { display: none; margin-left: 8px; padding: 1px 8px; background: var(--amber-tint); border-radius: 99px; color: var(--amber); font-size: 11.5px; font-style: normal; font-weight: 700; vertical-align: 2px; }
.roll-row.is-none .todo { display: inline-block; }
.strip { display: inline-flex; gap: 3px; margin-top: 6px; }
.strip i { width: 9px; height: 9px; background: #2bb07f; border-radius: 3px; opacity: .85; }
.strip i.late { background: #f2b23a; }
.strip i.absent { background: #e5566a; }
/* Three joined buttons; the chosen one fills with its colour. */
.marks { display: grid; flex: none; grid-template-columns: repeat(3, 1fr); gap: 3px; width: 330px; padding: 3px; background: #F1F5F9; border-radius: 14px; }
.mark { position: relative; margin: 0; }
.mark input { position: absolute; opacity: 0; pointer-events: none; }
.mark span {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 10px; border-radius: 11px;
  color: #64748B; font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; transition: background .15s, color .15s, transform .1s, box-shadow .15s;
}
.mark span .i { width: 17px; height: 17px; }
.mark em { font-style: normal; }
.mark span:hover { background: #fff; color: var(--ink); }
.mark span:active { transform: scale(.96); }
.mark input:checked + span { color: #fff; box-shadow: 0 3px 10px rgba(24, 34, 74, .15); }
.mark.present input:checked + span { background: #2bb07f; }
.mark.late input:checked + span { background: #f0a92e; }
.mark.absent input:checked + span { background: var(--rose); }
.mark input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 1px; }
.done-who.warn { color: var(--amber); }
.roll .form-actions { border-radius: 0 0 22px 22px; }
.roll-save .state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.roll-save .state .i { width: 17px; height: 17px; }
.roll-save .state.saved { color: var(--leaf); }
.roll-save button { white-space: nowrap; }
.roll-save .unsaved { display: none; color: var(--amber); }
.roll.dirty .roll-save .unsaved { display: inline-flex; }
.roll.dirty .roll-save .state:not(.unsaved) { display: none; }
@media (max-width: 960px) {
  .roll-head { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .pills { display: flex; }
  .pills a { flex: 1; text-align: center; }
  .day-nav .day { flex: 1; min-width: 0; }
  .roll-summary { position: static; gap: 12px 18px; padding: 14px 16px; }
  .roll-summary [data-all] { width: 100%; margin-left: 0; }
  .roll-row { flex-wrap: wrap; padding: 12px 16px 12px 12px; }
  .marks { width: 100%; }
}

/* ---------- Portfolio, messages, progress, calendar ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.gallery .card { margin: 0; }
.media { display: block; width: 100%; max-height: 70vh; margin-bottom: 12px; border-radius: 14px; background: #eef0f6; object-fit: contain; }
.gallery img.media { aspect-ratio: 4 / 3; object-fit: cover; }
.body { white-space: pre-wrap; }
.area { padding: 12px 0; border-bottom: 1px solid var(--line); }
.area > b { display: inline-block; min-width: 190px; color: var(--ink); }
meter { width: 120px; height: 14px; vertical-align: middle; }
/* Messages: conversation list beside the open chat */
.chat-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.inbox { margin: 0; padding: 0; overflow: hidden; }
.inbox-head { display: grid; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.inbox-head h2 { margin: 0; }
.new-chat { display: flex; gap: 8px; }
.new-chat select { margin: 0; }
.threads { max-height: calc(100vh - 290px); margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.threads a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; color: var(--text); text-decoration: none; transition: background .2s; }
.threads a:hover { background: rgba(63, 91, 216, .05); }
.threads a.on { background: var(--blue-tint); }
.t-top { display: flex; justify-content: space-between; gap: 8px; }
.t-top b { overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.t-top small { flex: none; color: var(--faint); font-size: 12px; }
.t-last { display: block; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dot-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; background: var(--blue); border-radius: 11px; color: #fff; font: 700 12px Figtree, system-ui; font-style: normal; }
.card-head h2 .dot-count { display: inline-grid; margin-left: 6px; vertical-align: 3px; }
.chat-empty { display: grid; place-content: center; justify-items: center; gap: 10px; min-height: 420px; margin: 0; color: var(--muted); }
.chat-empty .i { width: 46px; height: 46px; color: #c3c9db; stroke-width: 1.5; }
.chat-empty p { margin: 0; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; margin: 0; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head b { display: block; color: var(--ink); font-weight: 600; }
.chat-head small { color: var(--muted); }
.chat-head .back { display: none; }
.chat-body { flex: 1; padding: 18px; overflow-y: auto; background: rgba(247, 248, 252, .5); }
.chat-day { margin: 10px 0; text-align: center; }
.chat-day span { padding: 4px 12px; background: #eef0f6; border-radius: 99px; color: var(--muted); font-size: 12px; font-weight: 600; }
.bubble { width: fit-content; max-width: 78%; margin: 6px 0; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; box-shadow: 0 1px 2px rgba(24, 34, 74, .04); animation: rise .3s ease both; }
.bubble.mine { margin-left: auto; background: var(--blue); border-color: var(--blue); border-radius: 18px 18px 6px 18px; color: #fff; }
.bubble small { display: block; margin-top: 4px; color: var(--faint); font-size: 11.5px; text-align: right; }
.bubble.mine small { color: rgba(255, 255, 255, .75); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fff; }
.composer textarea { min-height: 46px; max-height: 160px; margin: 0; border-radius: 16px; resize: none; }
.send { width: 46px; height: 46px; min-height: 0; flex: none; padding: 0; border-radius: 50%; }
.chat-note { margin: 12px 4px 0; }
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-layout:not(.list-only) .inbox, .chat-empty { display: none; }
  .threads { max-height: none; }
  .chat { height: calc(100dvh - 200px); }
  .chat-head .back { display: grid; }
  .bubble { max-width: 88%; }
}
.center { text-align: center; }
.code { padding: 2px 8px; background: var(--sun-tint); border-radius: 6px; font-family: ui-monospace, Consolas, monospace; font-size: 1.2em; letter-spacing: 1px; }
details summary { cursor: pointer; }
details.card[open] summary { margin-bottom: 14px; }
.logo { display: block; width: 240px; max-width: 70%; height: auto; margin: 0 auto 8px; mix-blend-mode: multiply; }
.logo.small { width: 140px; }
/* Colour per calendar type: --k is the strong colour, --kt its tint. */
.tone-blue { --k: var(--blue); --kt: var(--blue-tint); }
.tone-green { --k: var(--leaf); --kt: var(--leaf-tint); }
.tone-amber { --k: var(--amber); --kt: var(--amber-tint); }
.tone-rose { --k: var(--rose); --kt: var(--rose-tint); }
.tone-violet { --k: var(--violet); --kt: var(--violet-tint); }
.tone-sun { --k: var(--sun-ink); --kt: var(--sun-tint); }

/* Month grid */
.card.cal { padding: 0; overflow: hidden; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.cal-head h2 { margin: 0; font-size: 1.55rem; }
.cal-head small { color: var(--muted); font-size: 13px; font-weight: 600; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid > * { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-grid > :nth-child(7n) { border-right: 0; }
.dow { padding: 10px 12px; color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 112px; padding: 8px; transition: background .2s; }
.cell:hover { background: rgba(63, 91, 216, .03); }
.cell.out { background: rgba(240, 242, 248, .6); }
.cell .num { display: flex; align-items: center; justify-content: space-between; }
.cell .num b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.cell .num small { padding-right: 2px; color: var(--faint); font-size: 11px; }
.cell.out .num b { color: var(--faint); }
.cell.now .num b { background: var(--blue); box-shadow: 0 4px 10px rgba(63, 91, 216, .35); color: #fff; }
.pill { display: block; overflow: hidden; padding: 3px 8px; background: var(--kt); border-left: 3px solid var(--k); border-radius: 7px; color: var(--k); font-size: 12px; font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; transition: transform .15s, box-shadow .15s; }
.pill:hover { box-shadow: 0 2px 8px rgba(24, 34, 74, .1); transform: translateY(-1px); }
.more { padding-left: 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; }
.dots { display: none; }

/* Agenda list (calendar page and dashboards) */
.agenda { display: grid; margin: 0; padding: 0; list-style: none; }
.ev { position: relative; display: flex; align-items: flex-start; gap: 16px; padding: 14px 10px; margin: 0 -10px; border-radius: 16px; transition: background .2s; }
.ev + .ev { border-top: 1px solid var(--line); }
.ev:hover { background: rgba(63, 91, 216, .035); }
.ev-date { flex: 0 0 54px; padding: 7px 0 8px; background: var(--kt); border-radius: 14px; color: var(--k); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-align: center; text-transform: uppercase; }
.ev-date b { display: block; color: var(--ink); font: 600 1.35rem/1.1 var(--display); letter-spacing: 0; }
.ev-kind { display: inline-flex; align-items: center; gap: 6px; color: var(--k); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ev-kind .i { width: 14px; height: 14px; }
.ev-title { display: block; margin: 2px 0 2px; color: var(--ink); font-size: 1.02rem; font-weight: 600; }
.ev small { display: block; color: var(--muted); }
.ev-details { margin: 8px 0 0; color: var(--text); font-size: 14.5px; white-space: pre-wrap; }
.ev .icon-btn { width: 38px; height: 38px; }
@media (hover: hover) { .ev .icon-btn { opacity: 0; transition: opacity .2s; } .ev:hover .icon-btn, .ev .icon-btn:focus-visible { opacity: 1; } }
.ev:target { background: var(--blue-tint); animation: glow 1.1s ease-out 2; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 34px 16px; color: var(--muted); text-align: center; }
.empty-state > .i { width: 42px; height: 42px; color: #c3c9db; stroke-width: 1.5; }
.empty-state p { margin: 0; }
@media (max-width: 760px) {
  .cal-head { padding: 16px; }
  .cal-head h2 { font-size: 1.3rem; }
  .dow { padding: 8px 0; font-size: 10.5px; letter-spacing: .04em; text-align: center; }
  .cell { align-items: center; min-height: 54px; padding: 6px 2px; }
  .cell .num small, .pill, .more { display: none; }
  .dots { display: flex; gap: 3px; }
  .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--k); }
}

/* ---------- Form layout: titled sections, sticky actions ---------- */
.form-card { overflow: hidden; background: rgba(255, 255, 255, .82); border: 1px solid var(--glass-edge); border-radius: 24px; box-shadow: var(--shadow); }
.form-section { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; padding: 26px 28px; border-bottom: 1px solid var(--line); }
.form-intro h2 { margin: 0 0 4px; font-size: 1.08rem; }
.form-intro p { margin: 0; color: var(--muted); font-size: 13.5px; }
.form-body > :last-child, .form-body > fieldset:last-child { margin-bottom: 0; }
.form-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 28px; background: rgba(247, 248, 252, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
input.big { min-height: 56px; font-size: 1.1rem; font-weight: 600; }
fieldset:not(.card) { margin: 0 0 16px; padding: 0; border: 0; }
fieldset:not(.card) > legend { margin-bottom: 8px; padding: 0; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.pick-tile { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 10px 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 15px; cursor: pointer; transition: border-color .15s, box-shadow .2s, transform .15s; }
@media (max-width: 420px) { .pick-tile { flex-direction: column; align-items: flex-start; } } /* room for long labels such as "Announcement" */
.pick-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pick-tile .chip-icon { width: 36px; height: 36px; border-radius: 11px; }
.pick-tile .chip-icon .i { width: 18px; height: 18px; }
.pick-tile:hover { border-color: #cdd4e8; transform: translateY(-1px); }
.pick-tile:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(63, 91, 216, .12); }
.pick-tile:has(input:checked)::after {
  content: ""; position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border: 2px solid #fff; border-radius: 50%; animation: pop .25s cubic-bezier(.3, .7, .4, 1.5);
  background: var(--blue) 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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.pick-tile:has(input:focus-visible) { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 2px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: #eef0f6; border-radius: 14px; }
.segmented label { position: relative; margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 9px 16px; border-radius: 11px; color: var(--muted); font-weight: 600; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.segmented span:hover { color: var(--ink); }
.segmented input:checked + span, .segmented input:checked + span:hover { background: var(--blue); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(63, 91, 216, .32); }
.segmented input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); }
label.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; margin: 2px 0 0; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; flex: none; width: 44px; height: 26px; background: #dde1ec; border-radius: 99px; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(24, 34, 74, .25); transition: transform .25s cubic-bezier(.3, .7, .4, 1.4); }
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 2px; }
/* Content that slides open when a switch before it in the same form is on. */
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s ease, opacity .25s, margin .3s; }
.reveal > div { min-height: 0; overflow: hidden; }
form:has(.switch input:checked) .reveal { grid-template-rows: 1fr; margin-top: 16px; opacity: 1; }
.reveal label { margin-bottom: 2px; }
.ghost-danger { background: transparent; box-shadow: none; color: var(--rose); }
.ghost-danger:hover { background: var(--rose-tint); }
@media (max-width: 760px) {
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 18px; }
  .form-actions { padding: 14px 18px; }
  .form-actions .btn, .form-actions button:not(.ghost-danger) { flex: 1; }
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented { display: flex; width: 100%; }
  .segmented label { flex: 1; }
  .segmented span { height: 100%; padding: 9px 8px; text-align: center; }
}
.lv { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.lv1 { background: var(--rose-tint); color: var(--rose); }
.lv2 { background: var(--amber-tint); color: var(--amber); }
.lv3 { background: var(--blue-tint); color: var(--blue); }
.lv4 { background: var(--leaf-tint); color: var(--leaf); }
tr.total td { background: #f4f6fb; font-weight: 600; }

/* ---------- Sign-in page ---------- */
img.mark { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; pointer-events: none; } /* logo can't be dragged or saved by right-click */
.bare { display: flex; flex-direction: column; justify-content: center; }
.login { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 430px); gap: 26px; width: 100%; max-width: 1140px; margin: 0 auto; padding: 32px 24px 14px; }
.login-brand {
  position: relative; isolation: isolate; display: flex; flex-direction: column; padding: 40px 44px 30px; overflow: hidden;
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 32px; box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
}
/* A faint honeycomb that fades out from the top left corner. */
.login-brand::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='27.71'%20height='48'%20viewBox='0%200%2027.71%2048'%3E%3Cpath%20d='M13.86%200L27.71%208L27.71%2024L13.86%2032L0%2024L0%208ZM0%2024L13.86%2032L13.86%2048L0%2056L-13.86%2048L-13.86%2032ZM27.71%2024L41.57%2032L41.57%2048L27.71%2056L13.86%2048L13.86%2032ZM0%20-24L13.86%20-16L13.86%200L0%208L-13.86%200L-13.86%20-16ZM27.71%20-24L41.57%20-16L41.57%200L27.71%208L13.86%200L13.86%20-16ZM13.86%2048L27.71%2056L27.71%2072L13.86%2080L0%2072L0%2056Z'%20fill='none'%20stroke='%233f5bd8'%20stroke-opacity='.09'%20stroke-width='1'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(160deg, #000, transparent 62%); mask-image: linear-gradient(160deg, #000, transparent 62%);
}
.login-logo { width: 150px; height: auto; margin: -10px 0 4px -12px; mix-blend-mode: multiply; }
.login-brand h1 { margin: 4px 0 12px; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1.08; }
.login-brand h1 span { padding: 0 4px; background: linear-gradient(transparent 60%, rgba(255, 201, 60, .55) 60% 90%, transparent 90%); }
.lede { max-width: 38ch; margin: 0 0 28px; color: var(--muted); font-size: 1.05rem; }
.perks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; margin: 0 0 28px; padding: 0; list-style: none; }
.perks li { display: flex; align-items: flex-start; gap: 12px; }
.perks .chip-icon { width: 42px; height: 42px; border-radius: 13px; }
.perks b { display: block; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.perks small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.clock.on-login { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 12px; margin-top: auto; padding: 16px 0 0; border: 0; border-top: 1px solid rgba(24, 34, 74, .07); }
.login-card {
  display: flex; flex-direction: column; justify-content: center; padding: 38px 34px; background: var(--glass-strong); border: 1px solid var(--glass-edge);
  border-radius: 32px; box-shadow: var(--shadow-up); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
}
.login-head { display: none; }
.login-card h2 { margin: 0 0 4px; font-size: 1.85rem; }
.login-card > .muted { margin: 0 0 24px; }
.login-card .alert { margin: 0 0 16px; }
.field { position: relative; display: block; margin-top: 6px; }
.field > .i { position: absolute; top: 50%; left: 15px; width: 19px; height: 19px; color: var(--faint); transform: translateY(-50%); pointer-events: none; }
.field input { height: 52px; margin: 0; padding: 0 52px 0 46px; border-radius: 15px; }
.peek { position: absolute; top: calc(50% - 20px); right: 6px; width: 40px; height: 40px; min-height: 0; padding: 0; background: transparent; border-radius: 11px; box-shadow: none; color: var(--faint); }
.peek:hover { background: var(--blue-tint); color: var(--blue); }
.peek:active { transform: scale(.94); } /* centred with top, not transform, so no press or hover effect can move it (iPhone) */
.caps { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px; color: var(--amber); font-size: 13px; font-weight: 600; }
.caps .i { width: 16px; height: 16px; }
.go { width: 100%; height: 54px; margin-top: 8px; background: var(--blue); border-radius: 15px; font-size: 16px; }
.go .i { transition: transform .15s; }
.go:hover .i { transform: translateX(3px); }
.help { margin-top: 18px; }
.help summary { color: var(--blue); font-weight: 600; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.secure { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.secure .i { width: 18px; height: 18px; color: var(--leaf); }
.login-foot { margin: 0; padding: 10px 16px 22px; color: var(--faint); font-size: 12.5px; text-align: center; }
@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px 12px 6px; }
  .login-card { order: 1; padding: 26px 22px; border-radius: 26px; }
  .login-brand { order: 2; padding: 26px 22px 22px; border-radius: 26px; }
  .login-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
  .login-head img { flex: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--sun-tint), var(--shadow); }
  .login-head b { display: block; color: var(--ink); font: 600 1.25rem/1.1 var(--display); }
  .login-head small { display: block; color: var(--muted); font-size: 12px; }
  .login-logo { display: none; }
  .login-brand h1 { font-size: 1.7rem; }
  .perks { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* Phones: tighter cards (kept after the base rules so they win). */
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 108px; padding: 14px; font-size: 14.5px; }
  .card { padding: 18px; border-radius: 20px; }
  .kid .avatar { width: 46px; height: 46px; font-size: 16px; }
  .seg span { padding: 8px 10px; }
  th, td { padding: 10px 6px; }
}

@media print {
  .side, .top, .scrim, footer, .noprint, .flash { display: none !important; }
  body { background: #fff; }
  .shell { margin: 0; padding: 0; }
  main { padding: 0; }
  .card { padding: 0; border: 0; box-shadow: none; backdrop-filter: none; }
}

/* ---------- Materials, documents, approvals ---------- */
.pills a { display: inline-flex; align-items: center; gap: 6px; }
.pills a .i { width: 16px; height: 16px; }
.toolbar .pills.kinds { flex-basis: 100%; }
.mini-form { margin: 0; }
.mini-form select { min-width: 170px; margin: 0; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card.doc { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 18px; }
.doc-top { display: flex; align-items: center; gap: 10px; }
.doc-top .badge { margin-left: auto; }
.doc-kind { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.doc-title { color: var(--ink); font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
.doc-snip { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: 14px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.doc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.doc-foot small { color: var(--faint); }
.doc-has { display: inline-flex; gap: 6px; color: var(--faint); }
.doc-has .i { width: 16px; height: 16px; }
.doc-view h2 { margin: 12px 0 14px; font-size: 1.6rem; }
.prose { max-width: 68ch; margin-bottom: 16px; color: var(--text); font-size: 15.5px; line-height: 1.7; }
.link-card { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .18s; }
.link-card:hover { border-color: #cdd4e8; box-shadow: var(--shadow); transform: translateY(-1px); }
.link-card b { display: block; color: var(--ink); }
.link-card small { color: var(--muted); }
.btn.wide { width: 100%; justify-content: center; margin-top: 16px; }
.alert { display: flex; align-items: center; gap: 8px; }
.alert .i { flex: none; width: 18px; height: 18px; }
.approve { background: #23a26f; box-shadow: 0 6px 16px rgba(35, 162, 111, .25); }
.approve:hover { background: #1a8f61; }
.review-box { border: 1.5px solid #f3dca4; background: rgba(255, 249, 235, .85); }
.review-box textarea { min-height: 70px; }
.ack-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
.ack-row b { display: block; color: var(--ink); }
.ack-row small { color: var(--muted); }
.ack-box .empty { margin: 0; }
.inline-composer { margin: 16px -24px -22px; border-radius: 0 0 22px 22px; }
.read-count { color: var(--ink); font: 600 1.5rem var(--display); }
.read-count small { color: var(--faint); font-size: 1rem; }
.read-bar { height: 8px; margin: 0 0 12px; overflow: hidden; background: #eef0f6; border-radius: 99px; }
.read-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4cc597, #1a8f61); border-radius: 99px; }
.feedback { display: flex; align-items: center; gap: 6px; color: var(--rose) !important; }
.feedback .i { width: 14px; height: 14px; }
.only-announcement, .only-student, .only-family, .only-staff-days { display: none; }
form:has(input[name="role"]:is([value="teacher"], [value="coordinator"]):checked) .only-staff-days { display: block; }
.day-pick { flex-wrap: wrap; }
.day-pick + small { display: block; margin-top: 6px; }
.off-note { margin: -4px 4px 14px; font-size: 14px; }
.off-note a { margin-left: 6px; font-weight: 600; }
form:has(input[name="role"][value="student"]:checked) .only-student,
form:has(input[name="role"]:is([value="student"], [value="parent"]):checked) .only-family { display: block; }
form:has(input[name="kind"][value="announcement"]:checked) .only-announcement { display: block; }
@media (max-width: 760px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mini-form { flex: 1; }
  .mini-form select { min-width: 0; }
  .inline-composer { margin: 14px -18px -18px; }
}

/* ---------- Progress and assessments ---------- */
.toolbar-title { margin: 0 6px; }
.fine { margin: -8px 4px 18px; font-size: 12.5px; }
.note-card h2 { display: flex; align-items: center; gap: 8px; }
.note-card h2 .i { width: 18px; height: 18px; }
.t-green-soft { background: linear-gradient(160deg, rgba(230, 246, 239, .9), rgba(255, 255, 255, .85)); }
.t-green-soft h2 { color: var(--leaf); }
.t-amber-soft { background: linear-gradient(160deg, rgba(255, 243, 220, .9), rgba(255, 255, 255, .85)); }
.t-amber-soft h2 { color: var(--amber); }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.area-card { margin: 0; }
.area-card h2 { font-size: 1.05rem; }
.steps { display: grid; grid-auto-flow: column; gap: 5px; margin: 2px 0 12px; }
.steps i { height: 8px; background: #eef0f6; border-radius: 99px; }
.steps.lvl1 i.on { background: #e5566a; }
.steps.lvl2 i.on { background: #f2b23a; }
.steps.lvl3 i.on { background: #6f87f2; }
.steps.lvl4 i.on { background: #2bb07f; }
.area-note { margin: 0 0 8px; color: var(--text); font-style: italic; }
.history summary { margin-top: 6px; color: var(--blue); font-size: 13.5px; font-weight: 600; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.timeline { margin: 10px 0 0; padding: 0; list-style: none; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li .lv { flex: none; }
.timeline small { display: block; color: var(--muted); }
.timeline p { margin: 2px 0 0; font-size: 14px; }
.roll-summary.static { position: static; }
.roll-summary.static > .grow { min-width: 200px; } /* the date drops below the hint on phones */
.assess-area { display: block; color: var(--ink); font: 600 1.15rem var(--display); }
.roll-summary small { display: block; color: var(--muted); font-size: 13px; }
.date-inline { display: flex; align-items: center; gap: 10px; margin: 0; }
.date-inline .field { margin: 0; }
.date-inline input { height: 44px; min-height: 0; }
.segmented.levels span { padding: 8px 12px; font-size: 13.5px; }
/* Fade-in used by the date picker backdrop */
@keyframes wheel-fade { from { opacity: 0; } }
/* Record assessments: one toolbar (class + learning area), even columns per child, notes tucked behind a link */
.assess-bar { position: relative; z-index: 5; padding: 0; }
.assess-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; }
.class-switch { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; }
.class-switch label { position: relative; display: grid; min-width: 0; margin: 0; }
.class-switch small { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.class-switch b, .class-switch select { color: var(--ink); font: 600 1.05rem var(--display); }
.class-switch select {
  width: auto; max-width: 100%; min-height: 0; height: auto; margin: 0; padding: 0 26px 0 0; border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer;
  appearance: none; -webkit-appearance: none; text-overflow: ellipsis;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f5bd8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 2px center / 16px no-repeat;
}
/* Honeycomb class picker (built by app.js): flat-top hexagons stacked in a zigzag, each half a cell lower than the last */
.class-switch { position: relative; }
.card:has(.class-switch) { position: relative; z-index: 5; }
.hex-trigger, .class-switch .hex-trigger:hover {
  display: inline-flex; align-items: center; gap: 8px; min-height: 0; margin: 0; padding: 0 24px 0 0; border: 0; border-radius: 6px; background: none; box-shadow: none;
  color: var(--ink); font: 600 1.05rem var(--display); cursor: pointer; text-align: left;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f5bd8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 2px center / 16px no-repeat;
}
.hex-trigger:hover { color: var(--blue); transform: none; }
.hex-trigger[aria-expanded="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f5bd8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 15-6-6-6 6'/%3E%3C/svg%3E"); }
.hive {
  --w: 132px; --h: calc(var(--w) * .866); --gap: 6px;
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  width: calc(var(--w) * 1.75 + var(--gap) + 24px); height: calc(var(--h) / 2 * (var(--rows) + 1) + var(--gap) * var(--rows) / 2 + 24px);
  padding: 12px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 2px 6px rgba(24, 34, 74, .08), 0 24px 60px rgba(24, 34, 74, .22);
  animation: rise .18s ease-out;
}
.hex {
  position: absolute; top: calc(12px + var(--i) * (var(--h) / 2 + var(--gap) / 2)); left: calc(12px + (var(--w) * .75 + var(--gap)) * var(--col));
  width: var(--w); height: var(--h); min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: #f2c94c; cursor: pointer;
  animation: hex-in .28s calc(var(--i) * 45ms) both cubic-bezier(.2, 1.3, .4, 1); transition: background .15s, transform .15s;
}
.hex span {
  position: absolute; inset: 2.5px; display: grid; place-items: center; padding: 0 22px; clip-path: inherit;
  background: #fffaf0; color: var(--ink); font: 600 13.5px/1.25 Figtree, system-ui, sans-serif; text-align: center; transition: background .15s, color .15s;
}
.hex:hover span, .hex:focus-visible span { background: var(--sun-tint); }
.hex:hover { transform: scale(1.04); }
.hex:focus-visible { outline: none; background: var(--blue); }
.hex.on { background: var(--blue-deep); }
.hex.on span { background: var(--blue); color: #fff; }
@keyframes hex-in { from { opacity: 0; transform: scale(.6); } }
@media (prefers-reduced-motion: reduce) { .hive, .hex { animation: none; } }
.class-switch select:focus-visible { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 4px; border-radius: 6px; }
.assess-bar-meta { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
/* Learning areas as small cards in one scrolling row: icon, name and how many children are done today */
.area-tabs { display: flex; gap: 10px; padding: 4px 18px 16px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 18px; scrollbar-width: none; }
.area-tabs::-webkit-scrollbar { display: none; }
.area-tabs a {
  flex: 1 0 128px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .6); color: var(--text); text-decoration: none; scroll-snap-align: start;
  transition: border-color .15s, background .15s, box-shadow .2s, transform .15s;
}
.area-tabs a:hover { border-color: #cdd4e8; background: #fff; transform: translateY(-1px); }
.area-tabs a { position: relative; isolation: isolate; }
.area-tabs a > :not(.area-hl) { position: relative; }
.area-tabs a.on { border-color: transparent; background: transparent; }
/* The highlight is its own element so a page change can slide it from the old card to the new one */
.area-hl { position: absolute; inset: -1.5px; z-index: 0; border: 1.5px solid var(--blue); border-radius: 16px; background: #fff; box-shadow: 0 0 0 4px rgba(63, 91, 216, .1), var(--shadow); view-transition-name: area-hl; }
.area-tabs a.on .area-ico { view-transition-name: area-ico; }
.assess-bar { view-transition-name: assess-bar; }
.assess-form { view-transition-name: assess-form; }
/* Switching learning area: the highlight snaps across like a band-aid pulled off (slow start, fast yank, small overshoot)
   while the list slides out one way and the new list slides in from the other. */
::view-transition-group(area-hl), ::view-transition-group(area-ico) { animation-duration: .5s; animation-timing-function: cubic-bezier(.8, -.15, .15, 1.2); }
::view-transition-old(area-ico), ::view-transition-new(area-ico) { animation-duration: .5s; }
::view-transition-group(assess-form) { animation-duration: .45s; }
html:active-view-transition-type(area-next) ::view-transition-old(assess-form) { animation: area-out .3s cubic-bezier(.7, 0, .8, .4) both; --dx: -60px; }
html:active-view-transition-type(area-next) ::view-transition-new(assess-form) { animation: area-in .45s .08s cubic-bezier(.15, .9, .25, 1.05) both; --dx: 80px; }
html:active-view-transition-type(area-prev) ::view-transition-old(assess-form) { animation: area-out .3s cubic-bezier(.7, 0, .8, .4) both; --dx: 60px; }
html:active-view-transition-type(area-prev) ::view-transition-new(assess-form) { animation: area-in .45s .08s cubic-bezier(.15, .9, .25, 1.05) both; --dx: -80px; }
@keyframes area-out { to { opacity: 0; transform: translateX(var(--dx)); filter: blur(2px); } }
@keyframes area-in { from { opacity: 0; transform: translateX(var(--dx)); filter: blur(2px); } }
.area-ico { display: grid; margin-bottom: 6px; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eef0f6; color: var(--muted); }
.area-ico .i { width: 18px; height: 18px; }
.area-tabs a.on .area-ico { background: var(--blue); color: #fff; }
.area-name { color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.25; }
.area-tabs small { color: var(--faint); font-size: 12px; white-space: nowrap; }
.area-tabs small.all { color: var(--leaf); font-weight: 600; }
@media (max-width: 560px) { .assess-bar-top { padding: 12px 16px; } .area-tabs { padding: 4px 16px 14px; scroll-padding-inline: 16px; } .area-tabs a { flex-basis: 132px; } }
.assess-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.assess-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0 6px 0 12px; background: #eef0f6; border-radius: 999px; color: var(--muted); }
.date-chip input { width: auto; height: 36px; min-height: 0; padding: 0 6px; border: 0; background: none; box-shadow: none; color: var(--ink); font-size: 14px; font-weight: 600; }
.date-chip .i { width: 17px; height: 17px; }
.assess-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 190px minmax(190px, 260px); align-items: center; gap: 10px 16px; }
.assess-row .who { min-width: 0; }
.assess-row .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assess-row .last { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.assess-row .last .lv, .assess-row .last .badge { padding: 1px 9px; font-size: 12px; }
.note-box { min-width: 0; }
.note-box summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; list-style: none; }
.note-box summary::-webkit-details-marker { display: none; }
.note-box summary:hover { color: var(--blue); }
.note-box summary .i { width: 16px; height: 16px; }
.note-box[open] summary { display: none; }
.note-in { width: 100%; min-height: 40px !important; margin: 0; padding: 8px 12px; font-size: 14px; }
.assess-count { color: var(--muted); font-size: 14px; }
.assess-count b { color: var(--blue); }
@media (max-width: 1100px) { .assess-row { grid-template-columns: auto minmax(0, 1fr) 190px; } .note-box { grid-column: 2 / -1; } }
@media (max-width: 560px) {
  .assess-row { grid-template-columns: auto minmax(0, 1fr); }
  .assess-row .note-box { grid-column: 1 / -1; }
  .assess-head { padding: 12px 16px; }
}
.table-card { padding-bottom: 8px; }
.table-card .legend { margin: 0 0 14px; }
.grid-table th:first-child, .grid-table td:first-child { position: sticky; left: 0; z-index: 1; background: rgba(255, 255, 255, .96); }
.grid-table tbody tr:hover td { background: rgba(63, 91, 216, .03); }
.grid-table tfoot td { border-top: 2px solid var(--line); }
.who-link { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.dash { color: #c3c9db; font-weight: 700; }
@media (max-width: 760px) {
  .area-grid { grid-template-columns: minmax(0, 1fr); }
  .segmented.levels { width: 100%; }
  .segmented.levels span { padding: 8px 10px; white-space: nowrap; }
}

/* ---------- Report cards ---------- */
.fine-top { margin: 0 0 8px; font-size: 13px; }
.row-actions { display: flex; gap: 6px; }
.level-picks fieldset { margin-bottom: 14px; }
@media (max-width: 1100px) { /* five levels in an even 3 + 2 grid instead of a ragged wrap */
  .level-picks .segmented.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .level-picks .segmented.levels span { text-align: center; }
}
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.note-card { padding: 16px 18px; border-radius: 18px; }
.report-sheet .note-card h3 { margin-top: 0; }
.quote { padding: 14px 18px; background: #f6f7fb; border-left: 4px solid var(--blue); border-radius: 0 14px 14px 0; font-style: italic; }
@media (max-width: 760px) {
  .rows li:has(.row-actions) { flex-wrap: wrap; }
}

/* ---------- Portfolio ---------- */
.gallery { columns: 3 260px; column-gap: 14px; display: block; }
.card.moment { position: relative; display: inline-block; width: 100%; margin: 0 0 14px; padding: 0; overflow: hidden; break-inside: avoid; }
.moment .media { margin: 0; border-radius: 0; max-height: none; }
.gallery img.media { aspect-ratio: auto; }
.moment-ph { display: grid; place-items: center; height: 140px; background: #eef0f6; color: #c3c9db; }
.moment-ph .i { width: 40px; height: 40px; }
.moment figcaption { padding: 14px 16px 16px; }
.moment figcaption b { display: block; color: var(--ink); font-weight: 600; }
.moment figcaption p { margin: 4px 0 6px; color: var(--text); font-size: 14px; }
.moment figcaption small { color: var(--faint); }
.moment-del { position: absolute; top: 10px; right: 10px; margin: 0; opacity: 0; transition: opacity .2s; }
.moment:hover .moment-del, .moment-del:focus-within { opacity: 1; }
@media (hover: none) { .moment-del { opacity: 1; } }
.moment-del .icon-btn { width: 36px; height: 36px; background: rgba(255, 255, 255, .92); }
.drop { position: relative; display: grid; justify-items: center; gap: 4px; margin: 0; padding: 30px 16px; overflow: hidden; background: #fbfcfe; border: 2px dashed #d5dbea; border-radius: 18px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover { border-color: var(--blue); background: var(--blue-tint); }
.drop > .i { width: 34px; height: 34px; color: var(--blue); }
.drop small { color: var(--muted); font-weight: 400; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.drop img { max-height: 220px; margin-top: 10px; border-radius: 12px; }
.kid-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 12px; }
.kid-pick { position: relative; display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, box-shadow .2s; }
.kid-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kid-pick b { display: block; font-size: 14px; font-weight: 600; }
.kid-pick small { color: var(--rose); font-size: 12px; font-weight: 600; }
.kid-pick:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(63, 91, 216, .12); }
.kid-pick:has(input:focus-visible) { outline: 3px solid rgba(63, 91, 216, .45); }
.kid-pick.no-consent:has(input:checked) { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(217, 52, 74, .1); }

/* ---------- Manage pages ---------- */
.lead-note { margin: -4px 4px 14px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fact { padding: 10px 12px; background: #f6f7fb; border-radius: 12px; }
.fact small { display: block; color: var(--muted); font-size: 12px; }
.fact b { color: var(--ink); font-size: 14px; font-weight: 600; }
.fact.stale { background: var(--rose-tint); }
.fact.stale b { color: var(--rose); }
.card.teacher { display: grid; gap: 14px; margin: 0; }
.backup { display: flex; align-items: center; gap: 14px; }
.backup b { display: block; color: var(--ink); }
.backup small { color: var(--muted); }
.slip { display: grid; justify-items: start; gap: 6px; }
.slip h2 { margin: 6px 0 0; }
.slip .facts { width: 100%; margin: 10px 0; }
.badge.role { padding: 4px 11px; }
.rows li.acct > .i { color: var(--faint); }
.rows li.acct { position: relative; }
/* Classes page: one card per class with its teachers in view; editing happens in a pop-up. */
.cls-bar { display: flex; align-items: center; gap: 12px; }
.cls-sum { margin: 0; color: var(--muted); font-weight: 600; }
.cls-sum b { color: var(--ink); font: 600 1.15rem var(--display); }
.cls-sum .warn, .cls-teach .warn { color: var(--amber); }
.cls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.cls-card { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 18px; }
.cls-top { display: flex; align-items: center; gap: 12px; }
.cls-top h2 { margin: 0; font-size: 1.1rem; line-height: 1.25; }
.cls-top small { color: var(--muted); font-size: 13px; }
.cls-badge { display: grid; flex: none; place-items: center; width: 46px; height: 46px; border-radius: 14px; font: 700 1rem var(--display); }
.cls-count { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #F8FAFC; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; }
.cls-count b { color: var(--ink); font: 600 1.4rem var(--display); }
.cls-count .i { width: 16px; height: 16px; margin-left: auto; }
.cls-count:hover { background: #EEF2FF; color: var(--blue); }
.cls-teach { display: grid; justify-items: start; gap: 8px; }
.cls-teach > small { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cls-teach ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cls-teach li { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.cls-teach li .avatar { width: 28px; height: 28px; font-size: 11px; }
.cls-teach em { padding: 1px 7px; background: var(--blue-tint); border-radius: 99px; color: var(--blue); font-size: 11px; font-style: normal; }
.cls-teach p { margin: 0; font-weight: 600; }
.cls-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.cls-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.cls-links a:hover { color: var(--blue); }
.cls-links .i { width: 15px; height: 15px; }
.class-card { margin: 0; padding: 0; }
.class-card summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; list-style: none; cursor: pointer; }
.class-card summary::-webkit-details-marker { display: none; }
.class-card summary b { display: block; color: var(--ink); }
.class-card summary small { color: var(--muted); }
.class-card form { padding: 4px 18px 16px; border-top: 1px solid var(--line); }
.class-card[open] summary { background: rgba(63, 91, 216, .04); }
/* Tick-chips for picking several, e.g. a class's teachers: the tick shows on the chosen ones. */
.pick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-chips label { position: relative; margin: 0; }
.pick-chips input { position: absolute; opacity: 0; pointer-events: none; }
.pick-chips span { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 99px; color: var(--muted); font-weight: 600; cursor: pointer; }
.pick-chips .i { display: none; width: 15px; height: 15px; }
.pick-chips input:checked + span { background: var(--blue-tint); border-color: var(--blue); color: var(--blue-deep); }
.pick-chips input:checked + span .i { display: block; }
.pick-chips input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); }
.class-card form.class-delete { display: flex; justify-content: flex-end; padding-top: 0; border-top: 0; }
.new-class { margin-top: 18px; }
.flows { display: grid; gap: 10px; }
.flow-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.3fr); align-items: center; gap: 12px; margin: 0; }
.flow-row select { margin: 0; }
.form-body > .switch { align-items: flex-start; }
.switch .hint { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.mini-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline-field { display: flex; align-items: center; gap: 12px; margin: 0; }
.inline-field .field { flex: 1; margin: 0; }
.feed-day { padding: 14px 0 6px !important; border: 0 !important; color: var(--faint); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.wide-btn { width: 100%; justify-content: center; }
@media (max-width: 760px) {
  .flow-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mini-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inline-field { flex-direction: column; align-items: stretch; }
}

/* ---------- Notifications, password, problems ---------- */
.notes { margin: 0; padding: 0; list-style: none; }
.notes a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; margin: 0 -10px; border-radius: 14px; color: var(--text); text-decoration: none; transition: background .2s; }
.notes a:hover { background: rgba(63, 91, 216, .05); }
.notes li + li a { border-top: 1px solid var(--line); border-radius: 0; }
.notes small { display: block; color: var(--faint); font-size: 12.5px; }
.notes li.new .grow { color: var(--ink); font-weight: 600; }
.new-dot { width: 9px; height: 9px; flex: none; background: var(--blue); border-radius: 50%; }
.pw-card { display: grid; gap: 4px; }
.pw-card h2 { margin: 10px 0 0; }
.pw-card .muted { margin: 0 0 14px; }
.problem { display: grid; justify-items: center; gap: 10px; text-align: center; }
.problem p { margin: 0; color: var(--text); font-size: 1.05rem; }
.problem .chip-icon { width: 60px; height: 60px; border-radius: 20px; }
.problem .chip-icon .i { width: 28px; height: 28px; }

/* Phones: let card headings and list rows wrap instead of squeezing their text. */
@media (max-width: 560px) {
  .card-head { flex-wrap: wrap; align-items: center; }
  .rows li:has(.row-actions) { flex-wrap: wrap; }
  .rows li:has(.row-actions) > .grow { min-width: 150px; }
  .rows li > .row-actions { margin-left: auto; }
}
/* Portfolio header: keep the avatar beside the name on phones; the add button takes its own row. */
@media (max-width: 760px) {
  .toolbar.portfolio-head { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .toolbar.portfolio-head .btn { flex-basis: 100%; justify-content: center; }
}

/* ---------- Phone bottom bar, docked to the bottom edge ----------
   Two shortcuts, Home in the middle, one more, then Menu. The open tab rises into a blue circle that sits in a
   wave cut into the top of the bar; --i (0-4) places both, and app.js slides them over from the previous tab. */
@property --i { syntax: "<number>"; inherits: true; initial-value: 0; }
.tabbar { display: none; }
@media (max-width: 760px) {
  /* Space under the bar: the phone's home-indicator inset, and never less than 12px, so labels clear the indicator
     even where the browser reports no inset (some in-app browsers and Safari while its toolbar is hidden). */
  :root { --safe-b: max(10px, calc(env(safe-area-inset-bottom, 0px) - 16px)); } /* the home indicator sits in the bottom ~16px of the inset, so the bar may overlap that part */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(66px + var(--safe-b)); padding: 6px 4px var(--safe-b); background: #fff; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
    box-shadow: 0 -6px 22px rgba(24, 34, 74, .07); view-transition-name: tabbar;
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; margin: 0;
    color: #8c93ad; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
  }
  /* The pill behind the open tab's icon. It only animates when a tab is tapped (a class change), never as a page loads. */
  .tab-ico { position: relative; z-index: 0; display: grid; place-items: center; width: 58px; height: 32px; transition: transform .15s ease-out; }
  .tab-ico::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 16px; background: var(--blue-tint);
    opacity: 0; transform: scaleX(.45); transition: opacity .18s ease-out, transform .28s cubic-bezier(.3, 1.35, .5, 1);
  }
  .tab-ico .i { width: 24px; height: 24px; stroke-width: 1.85; }
  .tab-label { max-width: 100%; overflow: hidden; font-size: 11.5px; font-weight: 600; line-height: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .tab:active .tab-ico { transform: scale(.9); }
  .tab.on { color: var(--blue); }
  .tab.on .tab-ico::before { opacity: 1; transform: none; }
  .tab.on .tab-ico .i { stroke-width: 2.2; }
  .tab.on .tab-label { font-weight: 700; }
  .tab-n { position: absolute; top: -3px; right: 9px; min-width: 18px; padding: 0 4px; border: 2px solid #fff; border-radius: 9px; background: var(--rose); color: #fff; font: 700 10px/14px Figtree, system-ui; font-style: normal; text-align: center; }
  ::view-transition-old(tabbar), ::view-transition-new(tabbar) { animation: none; }
  /* Room for the bar: the hamburger moves into it, page and save bars sit above it. */
  .menu-btn { display: none; }
  .shell { padding-bottom: calc(76px + var(--safe-b)); }
  .form-actions { bottom: calc(66px + var(--safe-b)); }
  .flash { bottom: calc(84px + var(--safe-b)); }
}
@media print { .tabbar { display: none !important; } }

/* ---------- Date picker (built by app.js): month grid with the Ethiopian date under each day ---------- */
.dp-native { position: absolute !important; bottom: 0; left: 50%; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.date-pick input[data-dp] { pointer-events: none; }
.dp-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; width: 100%; min-height: 52px; margin: 0; padding: 6px 16px 6px 46px;
  background: #fbfcfe; border: 1.5px solid #e3e7f0; border-radius: 15px; box-shadow: none; color: var(--ink); font-weight: 400; text-align: left; line-height: 1.25;
}
.dp-btn:hover { background: #fff; border-color: #cdd4e8; }
.dp-btn[aria-expanded="true"], .dp-btn:focus-visible { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(63, 91, 216, .14); }
.dp-btn b { font-weight: 600; font-size: 15px; }
.dp-btn small { color: var(--muted); font-size: 12.5px; }
.dp-empty { color: #a7adc4; }
.field .dp-btn { margin-top: 0; }
.date-chip .dp-btn { min-height: 36px; padding: 2px 10px 2px 2px; background: none; border: 0; flex-direction: row; align-items: baseline; gap: 6px; }
.date-chip .dp-btn b { font-size: 14px; }
.date-chip .dp-btn small { font-size: 12px; }
.date-chip { position: relative; }
.dp {
  position: fixed; z-index: 90; width: 320px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 2px 6px rgba(24, 34, 74, .08), 0 24px 60px rgba(24, 34, 74, .22); animation: dp-in .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes dp-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.dp button { min-height: 0; margin: 0; box-shadow: none; }
.dp-nav { width: 38px; height: 38px; flex: none; padding: 0; background: #f2f4fa; border-radius: 12px; color: var(--ink); font-size: 22px; line-height: 1; }
.dp-nav:hover { background: var(--blue-tint); color: var(--blue); }
.dp-title { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 0; padding: 4px; background: none; border-radius: 12px; color: var(--ink); line-height: 1.2; }
.dp-title:hover { background: #f5f7fc; }
.dp-title b { font: 600 1.05rem var(--display); }
.dp-title small { color: var(--sun-ink); font-size: 12px; font-weight: 600; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.dp-week span { padding: 4px 0; color: var(--faint); font-size: 11.5px; font-weight: 700; text-align: center; }
.dp-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; height: 42px; padding: 0; background: none; border-radius: 12px; color: var(--ink); line-height: 1.1; }
.dp-grid button b { font-size: 14.5px; font-weight: 600; }
.dp-grid button small { color: var(--faint); font-size: 10px; font-weight: 600; }
.dp-grid button:hover { background: var(--blue-tint); }
.dp-grid button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.dp-grid button.now { box-shadow: inset 0 0 0 1.5px var(--sun); }
.dp-grid button.on { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(63, 91, 216, .3); }
.dp-grid button.on small { color: rgba(255, 255, 255, .8); }
.dp-grid button:disabled { opacity: .3; cursor: default; background: none; }
.dp-years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dp-years button { height: 46px; background: #f5f7fc; border-radius: 12px; color: var(--ink); font-weight: 600; }
.dp-years button:hover { background: var(--blue-tint); color: var(--blue); }
.dp-years button.on { background: var(--blue); color: #fff; }
.dp-years button.off { opacity: .35; pointer-events: none; }
.dp-foot { display: flex; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-foot span { flex: 1; }
.dp-link { padding: 8px 10px; background: none; color: var(--muted); font-weight: 600; }
.dp-link:hover { background: #f5f7fc; color: var(--rose); }
.dp-today { padding: 8px 16px; background: var(--blue-tint); border-radius: 12px; color: var(--blue); font-weight: 700; }
.dp-today:hover { background: var(--blue); color: #fff; }
.dp-scrim { display: none; }
/* Phones: the calendar rises from the bottom as a sheet, above the bottom bar. */
.dp.sheet { left: 0; right: 0; bottom: 0; width: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; animation: dp-sheet .3s cubic-bezier(.2, .9, .25, 1); }
.dp.sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: -6px auto 12px; background: #dfe3ee; border-radius: 4px; }
.dp.sheet .dp-grid button { height: 48px; }
.dp-scrim.on { position: fixed; inset: 0; z-index: 89; display: block; background: rgba(24, 34, 74, .3); animation: wheel-fade .2s; }
@keyframes dp-sheet { from { transform: translateY(100%); } }

/* ---------- Sign-in page, demo only: one-tap test accounts ---------- */
.demo-pick { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); }
.demo-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--ink); font-weight: 700; font-size: 14px; }
.demo-title .i { width: 16px; height: 16px; color: var(--sun-ink); }
.demo-title small { padding: 2px 8px; border-radius: 99px; background: var(--sun-tint); color: var(--sun-ink); font-size: 11px; font-weight: 700; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.demo-grid form { margin: 0; }
.demo-user { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 0; margin: 0; padding: 8px 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: none; color: var(--ink); text-align: left; cursor: pointer; }
.demo-user:hover { border-color: #cfd6f5; background: var(--blue-tint); transform: none; }
.demo-user span { min-width: 0; }
.demo-user b, .demo-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-user b { font-size: 13.5px; }
.demo-user small { color: var(--muted); font-size: 12px; }

/* ---------- Language switch (English / Amharic) ---------- */
.lang-switch { margin: 0; }
.lang-switch .icon-btn { width: auto; min-width: 42px; padding: 0 10px; font: 700 13px/1 Figtree, "Noto Sans Ethiopic", sans-serif; letter-spacing: .02em; }
.login-head .lang-switch { margin-left: auto; }
.plain .plain-top .grow { flex: 1; }
.plain .plain-top { gap: 10px; }
:root:lang(am) { --display: Fredoka, "Noto Sans Ethiopic", Figtree, system-ui, sans-serif; }
:lang(am) .nav-label { letter-spacing: .04em; }

/* ---------- Phone notifications ---------- */
.push-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(120deg, rgba(255, 246, 219, .9), rgba(255, 255, 255, .82)); }
.push-card b { display: block; color: var(--ink); }
.push-card small { display: block; color: var(--muted); font-size: 13.5px; }
@media (max-width: 560px) { .push-card { flex-wrap: wrap; } .push-card .grow { flex: 1 1 200px; } .push-card button { flex: 1 1 100%; } }
.my-settings { max-width: 640px; }
.lang-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.lang-card b { display: block; color: var(--ink); }
.lang-card small { display: block; color: var(--muted); font-size: 13.5px; }
.lang-card form { margin: 0; }
.forgot-form { display: flex; gap: 8px; margin-top: 10px; }
.forgot-form .field { flex: 1; }
@media (max-width: 420px) { .forgot-form { flex-direction: column; } }

/* ---------- Fees ---------- */
.fee-hero, .fee-head, .fee-due { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fee-hero small, .fee-due small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fee-hero b { display: block; color: var(--leaf); font: 600 2.2rem/1.1 var(--display); }
.fee-hero.owe b { color: var(--amber); }
.fee-hero p { flex-basis: 100%; margin: 0; }
.fee-due b { display: block; color: var(--amber); font: 600 1.4rem/1.2 var(--display); }
.fee-due > .i { color: var(--faint); }
.fee-head .grow small { display: block; color: var(--muted); }
.fee-amount { display: block; color: var(--ink); font: 600 1.6rem/1.2 var(--display); }
.fee-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fee-head form { margin: 0; }
.fee-count { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.fee-count b { color: var(--ink); font: 600 1.1rem var(--display); }
.rows li .read-bar { margin: 8px 0 0; height: 6px; }
.read-bar.big { height: 14px; }
.fee-row form { margin: 0; }
.badge .i { width: 13px; height: 13px; margin: -2px 4px 0 0; vertical-align: middle; }
.pay-box summary { list-style: none; cursor: pointer; }
.pay-box summary::-webkit-details-marker { display: none; }
.pay-box[open] summary { display: none; }
.pin-form { display: flex; gap: 6px; margin: 0; }
.pin-form input { width: 92px; min-height: 34px; padding: 6px 10px; letter-spacing: .3em; text-align: center; }
.pin-form button { min-height: 34px; padding: 6px 14px; border-radius: 11px; font-size: 13.5px; }
@media (max-width: 560px) { .fee-row { flex-wrap: wrap; } .fee-row > .grow { min-width: 140px; } }

/* ---------- Exercises ---------- */
.ex-card { display: flex; flex-direction: column; gap: 10px; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.ex-meta b { color: var(--ink); }
.ex-card .read-bar { margin: 0; }
.ex-kids { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.ex-kids .btn { gap: 6px; }
.stars { display: inline-flex; gap: 1px; font-size: 15px; line-height: 1; }
.stars i { color: #dfe3ee; font-style: normal; }
.stars i.on { color: var(--sun); text-shadow: 0 1px 0 #e0a800; }
.score { color: var(--ink); font: 600 1rem var(--display); white-space: nowrap; }
.q-slots { gap: 14px; }
.q-slot { display: grid; gap: 10px; margin: 0; padding: 14px; background: #fafbfe; border: 1px solid var(--line); border-radius: 16px; }
.q-slot legend { padding: 0 6px; color: var(--ink); font-weight: 600; }
.choice-edit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-edit label { display: flex; align-items: center; gap: 8px; margin: 0; }
.choice-edit input[type=radio] { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--leaf); }
@media (max-width: 640px) { .choice-edit { grid-template-columns: minmax(0, 1fr); } }
.q-type { justify-self: start; }
.tf-edit { display: none; gap: 8px; }
.q-slot:has(.q-type input[value=tf]:checked) .tf-edit { display: flex; }
.q-slot:has(.q-type input[value=tf]:checked) .choice-edit { display: none; }
.tf-edit label { position: relative; margin: 0; }
.tf-edit input { position: absolute; opacity: 0; pointer-events: none; }
.tf-edit span { display: flex; align-items: center; gap: 6px; padding: 9px 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; color: var(--muted); font-weight: 600; cursor: pointer; }
.tf-edit .i { width: 16px; height: 16px; }
.tf-edit input:checked + span { background: var(--leaf-tint); border-color: var(--leaf); color: var(--leaf); }
.tf-edit input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); }
.ex-q { margin: 0 0 14px; }
.ex-q legend { display: flex; align-items: center; gap: 12px; float: left; width: 100%; margin-bottom: 14px; padding: 0; color: var(--ink); font: 600 1.25rem/1.3 var(--display); }
.ex-q legend + * { clear: both; }
.ex-n { display: grid; place-items: center; width: 34px; height: 34px; flex: none; background: var(--violet-tint); border-radius: 50%; color: var(--violet); font-size: 1rem; }
.ex-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ex-choice { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; min-height: 64px; padding: 12px; background: #fff;
  border: 2px solid var(--line); border-radius: 18px; color: var(--ink); font: 600 1.1rem/1.25 var(--display); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
label.ex-choice:hover { border-color: #cfd6f5; transform: translateY(-1px); }
.ex-choices.tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ex-choices.tf .ex-choice { min-height: 88px; font-size: 1.3rem; }
.ex-choices.tf .ex-choice .i { width: 26px; height: 26px; }
.ex-choices.tf .ex-choice:first-child:has(input:checked) { background: var(--leaf-tint); border-color: var(--leaf); color: var(--leaf); }
.ex-choices.tf .ex-choice:last-child:has(input:checked) { background: var(--rose-tint); border-color: var(--rose); color: var(--rose); }
.ex-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ex-choice:has(input:checked) { background: var(--blue-tint); border-color: var(--blue); color: var(--blue-deep); }
.ex-choice:has(input:focus-visible) { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 2px; }
.ex-choice.right { background: var(--leaf-tint); border-color: var(--leaf); color: var(--leaf); }
.ex-choice.wrong { background: var(--rose-tint); border-color: var(--rose); color: var(--rose); }
.ex-result { display: grid; justify-items: center; gap: 8px; text-align: center; }
.ex-result .stars { font-size: 34px; gap: 4px; }
.ex-result .score { font-size: 2rem; }
.ex-result p { margin: 0 0 6px; color: var(--text); }
.ex-review { margin: 0; padding: 0; list-style: none; }
.ex-review li { border-left: 5px solid var(--leaf); }
.ex-review li.wrong { border-left-color: var(--rose); }
.ex-review b { display: block; margin-bottom: 10px; color: var(--ink); font: 600 1.1rem var(--display); }
.ex-review .ex-choice { min-height: 48px; cursor: default; }
.q-key { margin: 0; padding-left: 20px; }
.q-key > li { margin-bottom: 12px; }
.q-key ul { margin: 4px 0 0; padding: 0; list-style: none; color: var(--muted); }
.q-key li.right { color: var(--leaf); font-weight: 600; }
.q-key .i { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
@media (max-width: 560px) { .ex-go button { width: 100%; justify-content: center; } }

/* ---------- Automatic summary ---------- */
.summary-card { background: linear-gradient(120deg, rgba(241, 237, 255, .85), rgba(255, 255, 255, .8)); }
.summary-card h2 { display: flex; align-items: center; gap: 8px; }
.summary-card h2 .i { color: var(--violet); }
.summary-card .card-head small { color: var(--muted); font-size: 12.5px; }
.summary { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.summary li { position: relative; padding-left: 20px; color: var(--ink); }
.summary li::before { content: ""; position: absolute; top: .62em; left: 4px; width: 7px; height: 7px; background: var(--violet); border-radius: 50%; }

/* ---------- Analytics ---------- */
.heat { display: inline-block; min-width: 52px; padding: 4px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, #4cc597 calc(max(0, var(--p) - 60) * 2.5%), var(--rose-tint)); }
.heat-table td, .heat-table th { text-align: center; }
.heat-table td:first-child, .heat-table th:first-child { text-align: left; }
.dist { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.dist li { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 12px; }
.dist-name { color: var(--ink); font-size: 14px; font-weight: 600; }
.dist-bar { display: flex; height: 26px; overflow: hidden; background: #eef0f6; border-radius: 9px; }
.dist-bar i { display: grid; place-items: center; min-width: 22px; font: 600 12px/1 Figtree, sans-serif; font-style: normal; }
.dist-bar em { padding: 4px 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .dist li { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* ==========================================================================
   Crisp theme: slate canvas, solid white cards and menu, clear borders, honey amber for the active menu item,
   badges, form focus and the main form button. Placed last so it settles the colours set above.
   ========================================================================== */
:root {
  --paper: #F8FAFC; --ink: #0F172A; --text: #334155; --muted: #475569; --faint: #94A3B8; --line: #E2E8F0; --input: #CBD5E1;
  --amber: #92400E; --amber-tint: #FEF3C7; --accent: #F59E0B; --accent-deep: #D97706;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-up: 0 4px 12px rgba(15, 23, 42, .08);
}
body, .app .shell::before { background: var(--paper); }
.card, .tile, .quick a, .mini-stats > *, .form-card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.side { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.side nav a:hover { background: #F8FAFC; }
.side nav a.on { background: #FFFBEB; color: #78350F; box-shadow: none; border-radius: 10px; font-weight: 600; }
.side nav a.on .i { color: var(--accent-deep); }
.side nav a.on::after { content: none; }
.top { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }

/* Inputs: white, a clear 1px border, a soft inner shadow, an amber focus ring. */
input, select, textarea, .dp-btn { background-color: #fff; border: 1px solid var(--input); box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05); }
input::placeholder, textarea::placeholder, .dp-empty { color: var(--faint); }
input:hover, select:hover, textarea:hover, .dp-btn:hover { border-color: #94A3B8; }
input:focus, select:focus, textarea:focus, .dp-btn:focus-visible, .dp-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(251, 191, 36, .45); }
.search input { border-color: var(--input); }
.search .i { color: var(--muted); }
.segmented { background: #F1F5F9; }
.segmented span { color: var(--muted); }
.segmented input:checked + span, .segmented input:checked + span:hover { background: var(--blue); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(63, 91, 216, .32); }

/* Top bar clock on one line: "7:37 afternoon • Tue, 17 Tikimt 2019". */
.clock.on-wide { flex-direction: row; align-items: baseline; gap: 10px; }
.clock span { margin: 0; color: var(--muted); }
.clock span::before { content: "•"; margin-right: 10px; color: var(--faint); }

/* ---------- Forms built from separate cards (student registration) ---------- */
.form-stack { display: grid; gap: 16px; max-width: 980px; }
.form-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.box-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.box-head h2 { margin: 0; font-size: 1.05rem; }
.box-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.box-body { padding: 20px 22px 6px; }
.box-body > .switch { display: flex; margin: 0 0 16px; }
.child-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: start; }
.photo-pick { position: relative; display: grid; justify-items: center; gap: 2px; margin: 0; padding: 14px 8px; border: 1.5px dashed var(--input); border-radius: 12px; text-align: center; cursor: pointer; }
.photo-pick:hover { border-color: var(--accent); background: #FFFBEB; }
.photo-pick .ph { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 6px; background: #F1F5F9; border-radius: 50%; color: var(--faint); }
.photo-pick .ph .i { width: 30px; height: 30px; }
.photo-pick img { width: 84px; height: 84px; margin-bottom: 6px; object-fit: cover; border-radius: 50%; }
.photo-pick:has(img:not([hidden])) .ph { display: none; }
.photo-pick b { max-width: 100%; overflow: hidden; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.photo-pick small { color: var(--faint); font-weight: 400; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.form-stack .switch input:checked + .track { background: var(--accent); }
.cta-bar { margin: 0 -2px; border-radius: 12px; background: rgba(248, 250, 252, .92); border: 1px solid var(--line); }
button.cta { padding: 10px 20px; background: var(--accent); border-radius: 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); color: #fff; font-weight: 600; }
button.cta:hover { background: var(--accent-deep); }
@media (max-width: 640px) {
  .child-grid { grid-template-columns: minmax(0, 1fr); }
  .box-head, .box-body { padding-left: 16px; padding-right: 16px; }
}
img.avatar.photo { object-fit: cover; padding: 0; }

/* ---------- Students: grid or list ---------- */
.view-toggle { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; background: #F1F5F9; border-radius: 12px; }
.view-toggle a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.view-toggle a .i { width: 16px; height: 16px; }
.view-toggle a.on, .view-toggle a.on:hover { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(63, 91, 216, .32); }
.stu-list { padding: 6px 0; overflow: hidden; }
.stu-list-head, .stu-row { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(120px, 1.2fr) minmax(150px, 1.4fr) 150px 130px; align-items: center; gap: 14px; padding: 10px 20px; }
.stu-list-head { color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.stu-row { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); transition: background .15s; }
.stu-row:last-child { border-bottom: 0; }
.stu-row:hover { background: #F8FAFC; }
.stu-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stu-who b { display: block; color: var(--ink); font-weight: 600; }
.stu-who small, .stu-guard small { display: block; color: var(--muted); font-size: 12.5px; }
.stu-who .warn { color: var(--rose); }
.stu-who small .warn::before { content: "· "; }
.stu-cls, .stu-guard span { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.stu-abs { color: var(--muted); font-weight: 600; text-align: center; }
.stu-abs.some { color: var(--rose); }
@media (max-width: 860px) {
  .stu-list-head { display: none; }
  .stu-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  .stu-cls, .stu-guard, .stu-abs { display: none; }
}

.box-body > [data-add-row] { display: flex; margin: 8px auto 14px; }

/* Clean theme: honey cream canvas with honeycomb, white elevated cards, slate text, amber accents. */
:root { --paper: #FBF9F5; --ink: #1E293B; --text: #1E293B; --muted: #475569; --line: #E2E8F0; --input: #E2E8F0; }
body, .app .shell::before { background: #FBF9F5; }
.card, .tile, .quick a, .mini-stats > *, .form-card, .side, .form-box, .top, .me { background: #fff; }
.card, .form-box, .side, .top { box-shadow: 0 1px 2px rgba(30, 41, 59, .05), 0 4px 14px rgba(30, 41, 59, .06); }
.side, .top { backdrop-filter: none; -webkit-backdrop-filter: none; }
input, select, textarea { border-color: #E2E8F0; }
input:focus, select:focus, textarea:focus { border-color: #D97706; box-shadow: 0 0 0 4px rgba(245, 158, 11, .25); }
a { color: #B45309; }

/* Side menu: active item is an amber pill; collapses to icons. */
.side nav a.on { background: #FEF3C7; color: #78350F; box-shadow: none; }
.side nav a.on .i { color: #D97706; }
.side nav a.on::after { right: auto; left: -14px; width: 4px; height: 22px; background: #F59E0B; border-radius: 0 4px 4px 0; clip-path: none; }
.side nav a:hover { background: #F1F5F9; }
@media (min-width: 961px) {
  .side-collapsed { --side-w: 76px; }
  .side-collapsed .side { padding-left: 10px; padding-right: 10px; }
  .side-collapsed .side nav a span, .side-collapsed .nav-label, .side-collapsed .brand span { display: none; }
  .side-collapsed .side nav a { justify-content: center; padding: 9px 0; }
  .side-collapsed .side > .brand { justify-content: center; }
}

/* Form cards: numbered header, guardian cards, amber actions. */
.form-stack { max-width: 1000px; gap: 20px; }
.form-box { border-radius: 16px; }
.box-head { padding: 18px 24px; }
.box-head > div { flex: 1; }
.box-head h2 { font-size: 1.15rem; }
.box-head p { color: #475569; }
.step { display: grid; place-items: center; width: 34px; height: 34px; flex: none; background: #F59E0B; border-radius: 50%; color: #1E293B; font: 700 16px var(--display); }
.box-body { padding: 22px 24px 10px; }
label small.hint { display: block; margin-top: 6px; color: #475569; font-size: 12.5px; font-weight: 400; }
textarea { min-height: 92px; resize: vertical; }
.guardian, .addr { margin: 0 0 16px; padding: 16px 18px 2px; border: 1px solid #E2E8F0; border-radius: 12px; background: #FFFDF8; }
.guardian { counter-increment: g; }
[data-rows] { counter-reset: g; }
.g-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; float: left; margin-bottom: 12px; }
.g-head + .row { clear: both; }
.g-title::before { content: "Guardian " counter(g); color: #1E293B; font-weight: 700; font-size: 14px; }
.addr legend { padding: 0 6px; color: #1E293B; font-weight: 700; font-size: 14px; }
.row.four { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.add-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin: 0 0 20px; padding: 0 16px; background: #fff; border: 1.5px dashed #D97706; border-radius: 12px; color: #92400E; font: 700 14.5px Figtree, system-ui, sans-serif; cursor: pointer; }
.add-btn:hover { background: #FEF3C7; }
.add-btn .i { width: 18px; height: 18px; }
.ghost { background: transparent; border: 0; box-shadow: none; color: #334155; font-weight: 600; cursor: pointer; }
.ghost:hover { background: #F1F5F9; color: #1E293B; }
button.ghost.small { min-height: 32px; padding: 4px 10px; border-radius: 8px; font-size: 13px; color: #B91C1C; }
.consent { margin: 4px 0 16px; padding: 16px 18px; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 12px; }
.consent .switch { align-items: flex-start; }
.consent .hint { max-width: 62ch; margin-top: 4px; color: #475569; }
.form-stack .switch input:checked + .track { background: #D97706; }
.form-actions { background: rgba(251, 249, 245, .92); border-top: 1px solid #E2E8F0; }
.form-actions .cta { background: #F59E0B; border: 0; box-shadow: 0 1px 2px rgba(30, 41, 59, .15); color: #1E293B; font-weight: 700; }
.form-actions .cta:hover { background: #D97706; color: #fff; }
.btn.ghost { padding: 12px 18px; border-radius: 12px; text-decoration: none; }
.photo-pick:hover { border-color: #D97706; background: #FFFBEB; }

/* Brand: the logo emblem, and the name in the logo's navy and honey. */
.brand img, .top-brand img, .login-head img { border-radius: 0; background: none; box-shadow: none; object-fit: contain; }
.brand img { width: 56px; height: 56px; }
.brand b, .top-brand b, .login-head b { font-family: "Baloo 2", Fredoka, var(--display); font-weight: 700; letter-spacing: .01em; color: #14286b; }
.brand b i, .top-brand b i, .login-head b i { font-style: normal; color: #F5B312; }
.brand small, .login-head small { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6b5a2e; }
.top-brand img { width: 46px; height: 46px; }
.top-brand b { font-size: 1.3rem; }
fieldset.guardian, fieldset.addr { min-width: 0; border: 1px solid #E2E8F0; }
.add-btn { box-shadow: none; border: 1.5px dashed #D97706; }
.brand img, .top-brand img, .login-head img { aspect-ratio: 1; max-width: none; object-fit: contain; object-position: center; overflow: visible; }

/* Side menu brand: a large logo on top, name under it, menu pushed down. */
.side > .brand { flex-direction: column; gap: 8px; padding: 6px 8px 18px; text-align: center; }
.side > .brand img { width: 112px; height: 112px; }
.side > .brand b { font-size: 1.5rem; }
.side > .brand small { max-width: 190px; margin: 2px auto 0; line-height: 1.35; }
@media (min-width: 961px) {
  .side-collapsed .side > .brand img { width: 52px; height: 52px; }
}
@media (max-height: 760px) and (min-width: 961px) { .side > .brand img { width: 84px; height: 84px; } }

/* Teams-style app rail: icon over label, left of the side menu on wide screens. Phones keep these in the side menu. */
.rail { display: none; }
@media (min-width: 961px) {
  :root { --rail-w: 72px; }
  .rail { position: fixed; top: var(--gap); bottom: var(--gap); left: var(--gap); z-index: 21; display: flex; flex-direction: column; align-items: center; gap: 6px; width: var(--rail-w); padding: 14px 6px; overflow-y: auto; background: #fff; border: 1px solid #E2E8F0; border-radius: 22px; box-shadow: 0 1px 2px rgba(30, 41, 59, .05), 0 4px 14px rgba(30, 41, 59, .06); scrollbar-width: none; }
  .rail a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; padding: 8px 2px; border-radius: 14px; color: #475569; font-size: 11px; font-weight: 600; text-align: center; text-decoration: none; }
  .rail a .i { width: 22px; height: 22px; }
  .rail a:hover { background: #F1F5F9; color: #1E293B; }
  .rail a.on { background: #FEF3C7; color: #78350F; }
  .rail a.on .i { color: #D97706; }
  .rail a.on::before { content: ""; position: absolute; left: -6px; top: 14px; bottom: 14px; width: 4px; background: #F59E0B; border-radius: 0 4px 4px 0; }
  .rail a i { position: absolute; top: 2px; right: 10px; min-width: 18px; padding: 0 4px; background: #D9344A; border-radius: 9px; color: #fff; font: 700 10.5px/16px Figtree, system-ui; font-style: normal; }
  .side { left: calc(var(--gap) * 2 + var(--rail-w)); }
  .shell { margin-left: calc(var(--side-w) + var(--gap) * 3 + var(--rail-w)); }
  .side nav a.mv { display: none; }
  /* Small blue collapse button pinned to the bottom of the rail. */
  .collapse-btn { position: absolute; bottom: 14px; left: 50%; translate: -50% 0; display: grid; place-items: center; width: 34px; height: 26px; padding: 0; background: var(--blue); color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
  .collapse-btn:hover { background: var(--blue-deep); }
  .collapse-btn .i { width: 16px; height: 16px; }
}

/* Rail and side menu read as one card: flush, no gap, icons centred in the rail. */
@media (min-width: 961px) {
  .rail { justify-content: center; border-radius: 22px 0 0 22px; border-right: 0; }
  /* Collapsed menu: icons centred top to bottom like the rail beside it, groups split by thin lines. */
  .side-collapsed .side nav { display: flex; flex-direction: column; justify-content: safe center; }
  .side-collapsed .side nav .nav-label { display: block; flex: none; height: 1px; margin: 10px 14px; padding: 0; overflow: hidden; background: var(--line); font-size: 0; }
  .side { left: calc(var(--gap) + var(--rail-w)); border-radius: 0 26px 26px 0; border-left: 1px solid #E2E8F0; }
  .shell { margin-left: calc(var(--side-w) + var(--gap) * 2 + var(--rail-w)); }
}

/* ---------- Programs, timetable, daily routine ---------- */
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; gap: 16px; margin-bottom: 16px; }
.prog-card { position: relative; margin: 0; overflow: hidden; }
.prog-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: currentColor; opacity: .7; }
.prog-card.tone-blue::before { color: var(--blue); } .prog-card.tone-violet::before { color: var(--violet); } .prog-card.tone-amber::before { color: var(--sun); }
.prog-card.tone-green::before { color: var(--leaf); } .prog-card.tone-rose::before { color: var(--rose); }
.prog-head { display: flex; align-items: center; gap: 14px; }
.prog-head h2 { margin: 0; }
.prog-head small { color: var(--muted); font-size: 13.5px; }
.prog-head small b { color: var(--ink); }
.prog-note { margin: 12px 0 0; padding: 10px 12px; background: #f7f8fc; border-radius: 12px; color: var(--text); font-size: 14px; }
.prog-part { margin: 18px 0 8px; color: var(--muted); font: 700 12px Figtree, system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.prog-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.prog-part + .prog-plans { margin-top: 0; }
.prog-plans li { display: grid; gap: 4px; padding: 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; }
.prog-plan { color: var(--text); font-size: 14px; font-weight: 600; }
.prog-price b { color: var(--ink); font: 600 1.6rem/1.1 var(--display); }
.prog-price small { color: var(--muted); font-size: 12.5px; }
.prog-n { color: var(--faint); font-size: 12.5px; }
.price { color: #B45309; white-space: nowrap; }
.prog-row { display: grid; grid-template-columns: 1fr 1.6fr .8fr 1.4fr auto; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid #E2E8F0; }
.contact-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 14px; }
.contact-card .grow small { display: block; }
.phones { display: flex; flex-wrap: wrap; gap: 6px; }
.phones .chip { display: inline-flex; align-items: center; gap: 6px; }
.phones .i { width: 14px; height: 14px; }
.subj { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 9px; border-radius: 8px; background: #FEF3C7; color: #78350F; font-size: 12.5px; font-weight: 600; }
.subj b { margin-right: 4px; }
.subj.s-0 { background: var(--blue-tint); color: var(--blue-deep); }
.subj.s-1 { background: var(--violet-tint); color: var(--violet); }
.subj.s-2 { background: var(--leaf-tint); color: var(--leaf); }
.subj.s-3 { background: var(--amber-tint); color: var(--amber); }
.subj.s-4 { background: var(--rose-tint); color: var(--rose); }
.subj.s-5 { background: #e3f6f9; color: #1f7f93; }
/* Timetable: a row per child under a class band, a column per day; the student column and header stay put on scroll. */
.tt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tt-top p { margin: 0; }
.tt-card { padding: 0; overflow: hidden; }
.tt-scroll { overflow-x: auto; }
.tt-table { width: 100%; min-width: calc(230px + var(--n) * 128px); border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tt-table th, .tt-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tt-table td { border-left: 1px solid var(--line); }
.tt-table thead th { background: #fbfcfe; color: var(--ink); font-weight: 700; white-space: nowrap; }
.tt-table thead th + th { border-left: 1px solid var(--line); }
.tt-table thead th small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.tt-table thead th.today { background: var(--sun-tint); box-shadow: inset 0 3px 0 var(--sun); }
.tt-table thead th.today small { color: var(--sun-ink); font-weight: 700; }
.tt-table thead th:first-child, .tt-table tbody th[scope=row] { position: sticky; left: 0; z-index: 1; min-width: 230px; box-shadow: 1px 0 0 var(--line); }
.tt-table tbody th[scope=row] { background: #fff; font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.tt-table thead th small { letter-spacing: 0; text-transform: none; }
.tt-table:has(input) { min-width: calc(230px + var(--n) * 165px); }
.tt-table td.today { background: #fffcf0; }
.tt-table tbody tr:not(.tt-class):hover > * { background: #f5f7ff; }
.tt-class th { padding: 16px 14px 8px; background: #f7f8fc; color: var(--sun-ink); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tt-class th span { position: sticky; left: 14px; }
.tt-class small { margin-left: 8px; color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }
.tt-person { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.tt-person b { display: block; color: var(--ink); font-weight: 600; }
.tt-person small { display: block; color: var(--muted); font-size: 12px; }
.tt-person:hover b { color: var(--blue); }
.tt-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tt-chips .subj { margin: 0; }
.tt-none { color: var(--faint); }
.tt-table td input { width: 100%; min-width: 110px; padding: 7px 9px; font-size: 13.5px; }
.tt-table tbody:last-of-type tr:last-child > * { border-bottom: 0; }
.tt-actions { margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  .tt-table { min-width: calc(150px + var(--n) * 116px); }
  .tt-table thead th:first-child, .tt-table tbody th[scope=row] { min-width: 150px; }
  .tt-person small { display: none; }
}
.routine { margin: 0; padding: 0; list-style: none; }
.routine li { display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: center; padding: 14px 6px; border-bottom: 1px solid #E2E8F0; }
.routine li:last-child { border-bottom: 0; }
.routine time { color: #B45309; font-weight: 700; font-variant-numeric: tabular-nums; }
.routine small { display: block; }
.routine li.now { background: #FFFBEB; border-radius: 12px; box-shadow: inset 4px 0 #F59E0B; }
@media (max-width: 720px) {
  .prog-row { grid-template-columns: 1fr 1fr; }
  .routine li { grid-template-columns: 1fr auto; }
  .routine time { grid-column: 1 / -1; }
}

/* Sidebar: the whole logo, name included; the bee mark only when the menu is collapsed. */
.side > .brand img.logo-full { width: 190px; height: auto; aspect-ratio: 1.1; object-fit: cover; object-position: 50% 20%; }
.side > .brand img.mark { display: none; }
.side-collapsed .side > .brand img.logo-full { display: none; }
.side-collapsed .side > .brand img.mark { display: block; }
@media (max-height: 760px) and (min-width: 961px) { .side > .brand img.logo-full { width: 150px; height: auto; } }
/* Pages without the menu (password change, sign-in steps): the full logo only, whole, not cropped to a square. */
.plain-top .brand img.mark { display: none; }
.plain-top .brand img.logo-full { width: 112px; height: auto; aspect-ratio: auto; object-fit: contain; }
.clock.date-only span { margin: 0; color: var(--ink); font-size: 14px; }
.clock.date-only span::before { content: none; }

/* Pop-up forms (native <dialog>), e.g. New account. */
dialog.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 22px; background: transparent; overflow: auto; }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
dialog.modal .form-card { margin: 0; }
dialog.modal .form-section { grid-template-columns: 1fr; }
dialog.modal .form-actions { bottom: 0; } /* the phone tab bar lift is for pages, not pop-ups */
dialog.modal.crop .form-card > canvas { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto; background: #0f172a; cursor: grab; touch-action: none; }
dialog.modal.crop .form-card > p, dialog.modal.crop .form-card > input { display: block; width: calc(100% - 56px); margin: 12px 28px 0; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 24px 0; }
.modal-head > div { flex: 1; }
.modal-head h2 { margin: 0 0 4px; }
.modal-head p { margin: 0; }

/* ---------- Portfolio: saving, the "saved" burst, recently added ---------- */
button[data-idle]:disabled { position: relative; overflow: hidden; opacity: 1; cursor: progress; }
button[data-idle]:disabled::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: linear-gradient(90deg, transparent, #fff, transparent); animation: busy 1.1s linear infinite; }
@keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.saved-burst { display: flex; align-items: center; gap: 16px; border: 1px solid #FCD34D; background: #FFFBEB; animation: saved-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.saved-burst .grow small { display: block; }
.burst { position: relative; display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: #F59E0B; color: #fff; animation: pop .6s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.burst .i { width: 26px; height: 26px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .4s .5s ease-out forwards; }
.burst i { position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 2px; background: #F59E0B; opacity: 0; animation: fly .8s .35s ease-out forwards; }
.burst i:nth-child(odd) { background: #1E3A8A; border-radius: 50%; }
.burst i:nth-child(3n) { background: #FCD34D; }
.burst i:nth-child(2) { --a: 0deg; } .burst i:nth-child(3) { --a: 36deg; } .burst i:nth-child(4) { --a: 72deg; } .burst i:nth-child(5) { --a: 108deg; }
.burst i:nth-child(6) { --a: 144deg; } .burst i:nth-child(7) { --a: 180deg; } .burst i:nth-child(8) { --a: 216deg; } .burst i:nth-child(9) { --a: 252deg; }
.burst i:nth-child(10) { --a: 288deg; } .burst i:nth-child(11) { --a: 324deg; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fly { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(46px) rotate(120deg); } }
@keyframes saved-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
.saved-thumb img, .saved-thumb video, .saved-thumb .ph { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #FEF3C7; color: #B45309; }

.recent-uploads { margin-top: 18px; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 12px; }
.recent { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; border-radius: 14px; transition: transform .15s; }
.recent:hover { transform: translateY(-2px); }
.recent img, .recent video, .recent .ph { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; object-fit: cover; background: #FEF3C7; color: #B45309; }
.recent .ph .i { width: 28px; height: 28px; }
.recent b { font-size: 14px; }
.recent small { line-height: 1.3; }
.recent.just-added { animation: pop .5s .3s cubic-bezier(.2, 1.6, .4, 1) both; }
.recent.just-added img, .recent.just-added video, .recent.just-added .ph { box-shadow: 0 0 0 3px #F59E0B; }
@media (prefers-reduced-motion: reduce) { .saved-burst, .burst, .burst .i, .burst i, .recent.just-added, button[data-idle]:disabled::after { animation: none; stroke-dashoffset: 0; } }

/* Scrollbars stay invisible until the area is scrolled (app.js adds .scrolling) or, for inner areas, hovered. */
html, .side nav, .scroll, dialog.modal, textarea { scrollbar-width: thin; scrollbar-color: transparent transparent; }
html.scrolling, .side nav:hover, .side nav.scrolling, .scroll:hover, .scroll.scrolling, dialog.modal:hover, textarea:hover { scrollbar-color: rgba(30, 41, 59, .28) transparent; }

/* Materials: type filter as a single row of chips with counts. */
.kind-chips { display: flex; flex-basis: 100%; gap: 8px; margin: 0 -16px -2px; padding: 4px 16px 2px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 40px), transparent); }
.kind-chips::-webkit-scrollbar { display: none; }
.kc { display: inline-flex; flex: none; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border: 1px solid #E2E8F0; border-radius: 999px; background: #fff; color: #334155;
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; scroll-snap-align: start; transition: border-color .15s, background .15s, color .15s, transform .15s, box-shadow .15s; }
.kc:hover { border-color: #CBD5E1; box-shadow: 0 2px 8px rgba(30, 41, 59, .08); transform: translateY(-1px); }
.kc-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; transition: background .15s, color .15s; }
.kc-ico .i { width: 16px; height: 16px; }
.kc b { min-width: 24px; padding: 2px 8px; border-radius: 999px; background: #F1F5F9; color: #64748B; font-size: 12px; text-align: center; }
.kc.on { border-color: #1E293B; background: #1E293B; color: #fff; box-shadow: 0 4px 12px rgba(30, 41, 59, .22); }
.kc.on .kc-ico { background: #F59E0B; color: #1E293B; }
.kc.on b { background: rgba(255, 255, 255, .16); color: #fff; }
.kc:focus-visible { outline: 3px solid rgba(245, 158, 11, .5); outline-offset: 2px; }
@media (min-width: 761px) { .kind-chips { flex-wrap: wrap; margin: 0; padding: 2px 0 0; overflow: visible; -webkit-mask-image: none; mask-image: none; } }

/* Materials grouped by grade. */
.grade-group { margin-bottom: 22px; }
.grade-group:not(:has(.doc:not([hidden]))) { display: none; }
.grade-head { display: flex; align-items: baseline; gap: 10px; margin: 6px 2px 12px; font-size: 1.05rem; }
.grade-head a { color: #1E293B; text-decoration: none; }
.grade-head a:hover { color: #B45309; }
.grade-head::before { content: ""; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; }
.toolbar-end .mini-form { display: flex; gap: 10px; }
.toolbar-end .mini-form select { min-width: 150px; }
@media (max-width: 760px) { .toolbar-end .mini-form select { flex: 1; min-width: 0; } }

/* Materials: subjects inside each grade, the subject filter, and the director's Subjects page. */
.subj-group { margin: 0 0 16px; }
.subj-group:not(:has(.doc:not([hidden]))) { display: none; }
.subj-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 10px 18px; color: #475569; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.subj-head a { color: inherit; text-decoration: none; }
.subj-head a:hover { color: #B45309; }
.subj-head small { padding: 1px 7px; border-radius: 999px; background: #F1F5F9; font-size: 11px; letter-spacing: 0; }
.subj-chips { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid #E2E8F0; }
.subj-chips span { margin-right: 4px; color: #92400E; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.subj-chips a { padding: 5px 12px; border: 1px solid #E2E8F0; border-radius: 999px; color: #334155; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.subj-chips a:hover { border-color: #F59E0B; }
.subj-chips a.on { border-color: #F59E0B; background: #FEF3C7; color: #78350F; }
.subj-form { display: grid; gap: 4px; }

/* ---------- Dashboard: stat tiles and charts (inline SVG). Present/late/absent wear the app's status colours with labels. ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.card.stat { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 18px; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.card.stat:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(30, 41, 59, .1); }
.stat-top { display: flex; align-items: center; gap: 10px; color: #475569; font-size: 14px; font-weight: 600; }
.stat-value { color: #1E293B; font: 700 2rem/1 "Baloo 2", Fredoka, var(--display); letter-spacing: -.01em; }
.stat-value small { color: #64748B; font: 600 13px Figtree, system-ui, sans-serif; }
.stat-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 34px; }
.spark { width: 110px; height: 34px; flex: none; }
.spark polyline { fill: none; stroke: #16A34A; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.meter { flex: 1; max-width: 120px; height: 8px; border-radius: 999px; background: #F1F5F9; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: #9333EA; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.dash-grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid > .card { margin: 0; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #F1F5F9; stroke-width: 1; }
.chart .axis { stroke: #E2E8F0; stroke-width: 1; }
.chart .tick { fill: #94A3B8; font-size: 10.5px; text-anchor: middle; }
.chart .tick.y { text-anchor: end; }
.chart .hit { fill: transparent; }
.chart .col:hover .hit, .chart .col:focus .hit { fill: rgba(245, 158, 11, .08); }
.chart .col { outline: none; cursor: default; }
.seg.present, .legend i.present { fill: #16A34A; background: #16A34A; }
.seg.late, .legend i.late { fill: #D97706; background: #D97706; }
.seg.absent, .legend i.absent { fill: #E11D48; background: #E11D48; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: #475569; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.today-card .ring { margin: 4px auto 10px; }
.today-card .class-bars { margin-top: 6px; }
.hbars, .stack100 { display: grid; gap: 12px; margin: 6px 0 0; padding: 0; list-style: none; }
.hbars li, .stack100 li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.stack100 li { grid-template-columns: 130px minmax(0, 1fr); }
.hb-label { overflow: hidden; color: #334155; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 12px; border-radius: 999px; background: #F8FAFC; }
.hb-track i { display: block; height: 100%; border-radius: 4px; background: #F59E0B; }
.hbars b { min-width: 28px; color: #1E293B; font-size: 14px; text-align: right; }
.stack-bar { display: flex; gap: 2px; height: 14px; }
.stack-bar i { display: block; min-width: 4px; height: 100%; border-radius: 4px; }
i.lv0 { background: #FDE68A; } i.lv1 { background: #FBBF24; } i.lv2 { background: #D97706; } i.lv3 { background: #92400E; } /* chart bars and their legend, not the level badges */
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .stats { gap: 10px; } .card.stat { padding: 14px; } .stat-value { font-size: 1.6rem; } .spark { width: 70px; }
  .dash-grid.halves { grid-template-columns: minmax(0, 1fr); }
  .hbars li, .stack100 li { grid-template-columns: 96px minmax(0, 1fr) auto; } .stack100 li { grid-template-columns: 96px minmax(0, 1fr); }
}
/* Today card is narrow: class name and count on one line, the progress bar under them. */
.today-card .class-bars a { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
.today-card .class-bars i { grid-column: 1 / -1; grid-row: 2; }
.today-card .class-bars em { background: #16A34A; }

/* ---------- Futuristic charts: dark glass cards, glowing trend line, concentric rings ---------- */
.card.neo { position: relative; overflow: hidden; border: 1px solid rgba(148, 163, 184, .18); background: radial-gradient(120% 90% at 0% 0%, #1E293B 0%, #0F172A 55%, #0B1222 100%); color: #E2E8F0; box-shadow: 0 10px 30px rgba(15, 23, 42, .28); }
.card.neo::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 85% 0%, rgba(245, 158, 11, .16), transparent 70%); pointer-events: none; }
.card.neo h2 { color: #F8FAFC; }
.card.neo .card-head small { color: #94A3B8; }
.card.neo .card-head a { color: #FCD34D; }
.trend-wrap { position: relative; }
.trend-kpi { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 10px; align-items: baseline; margin: 4px 0 6px; }
.trend-kpi b { color: #F8FAFC; font: 700 1.6rem/1.1 "Baloo 2", Fredoka, sans-serif; }
.trend-kpi b + small { margin-right: 18px; color: #94A3B8; }
.trend-kpi { grid-template-columns: repeat(4, auto); }
.trend { display: block; width: 100%; height: auto; overflow: visible; cursor: crosshair; }
.trend .tg { stroke: rgba(148, 163, 184, .16); stroke-dasharray: 3 5; }
.trend .tt { fill: #64748B; font-size: 10.5px; text-anchor: middle; }
.trend .tt.y { text-anchor: end; }
.trend .t-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: t-draw 1.4s .2s cubic-bezier(.4, 0, .2, 1) forwards; }
.trend .t-area { opacity: 0; animation: t-fade 1s .9s ease forwards; }
.trend .t-dot { fill: #FCD34D; stroke: #0F172A; stroke-width: 2.5; }
.trend .t-pulse { fill: #F59E0B; opacity: .35; transform-box: fill-box; transform-origin: center; animation: t-pulse 2s ease-out infinite; }
.trend .t-cross { stroke: rgba(252, 211, 77, .5); stroke-width: 1; stroke-dasharray: 3 3; }
.t-tip { position: absolute; z-index: 2; margin: 0; padding: 7px 11px; border: 1px solid rgba(252, 211, 77, .35); border-radius: 10px; background: rgba(15, 23, 42, .92); color: #F8FAFC; font-size: 12.5px; font-weight: 600; white-space: nowrap; pointer-events: none; transform: translate(-50%, -120%); backdrop-filter: blur(6px); }
@keyframes t-draw { to { stroke-dashoffset: 0; } }
@keyframes t-fade { to { opacity: 1; } }
@keyframes t-pulse { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(2.2); opacity: 0; } }
.rings { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 6px 0 4px; }
.rings svg { width: 170px; height: 170px; }
.rg-track { fill: none; stroke: rgba(148, 163, 184, .14); }
.rg-arc { fill: none; stroke-linecap: round; animation: rg-in 1.3s .2s cubic-bezier(.4, 0, .2, 1) backwards; }
@keyframes rg-in { from { stroke-dasharray: 0 var(--c); } }
.rings ul { display: grid; gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; }
.rings li { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; color: #CBD5E1; font-size: 14px; }
.rings li i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.rings li b { color: #F8FAFC; }
.today-card.neo .class-bars { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, .16); }
.today-card.neo .class-bars a { color: #CBD5E1; }
.today-card.neo .class-bars a:hover { background: rgba(255, 255, 255, .04); }
.today-card.neo .class-bars b { color: #F8FAFC; }
.today-card.neo .class-bars small { color: #94A3B8; }
.today-card.neo .class-bars i { background: rgba(148, 163, 184, .16); }
.today-card.neo .class-bars em { background: linear-gradient(90deg, #22C55E, #86EFAC); box-shadow: 0 0 8px rgba(34, 197, 94, .6); }
.today-card.neo .chip { background: rgba(255, 255, 255, .06); color: #E2E8F0; }
@media (prefers-reduced-motion: reduce) { .trend .t-line, .trend .t-area, .trend .t-pulse, .rg-arc { animation: none; stroke-dashoffset: 0; opacity: 1; } }
.dash-grid { align-items: start; }

/* Light version of the chart cards: white glass with a honey glow, same glowing line and rings. */
.card.neo { border: 1px solid #FDE68A; background: radial-gradient(120% 90% at 0% 0%, #FFFBEB 0%, #FFFFFF 55%); color: #1E293B; box-shadow: 0 10px 30px rgba(217, 119, 6, .10); }
.card.neo::before { background: radial-gradient(55% 45% at 90% 0%, rgba(245, 158, 11, .12), transparent 70%); }
.card.neo h2, .trend-kpi b, .rings li b, .today-card.neo .class-bars b { color: #1E293B; }
.card.neo .card-head small, .trend-kpi b + small, .today-card.neo .class-bars small { color: #64748B; }
.card.neo .card-head a { color: #B45309; }
.trend .tg { stroke: rgba(148, 163, 184, .35); }
.trend .tt { fill: #94A3B8; }
.trend .t-dot { stroke: #FFFFFF; fill: #F59E0B; }
.trend .t-cross { stroke: rgba(217, 119, 6, .55); }
.t-tip { border-color: #FCD34D; background: rgba(255, 255, 255, .96); color: #1E293B; box-shadow: 0 6px 18px rgba(30, 41, 59, .12); }
.rg-track { stroke: #F1F5F9; }
.rings li { color: #475569; }
.today-card.neo .class-bars { border-top-color: #F1F5F9; }
.today-card.neo .class-bars a { color: #334155; }
.today-card.neo .class-bars a:hover { background: #FFFBEB; }
.today-card.neo .class-bars i { background: #F1F5F9; }
.today-card.neo .chip { background: #F8FAFC; color: #334155; }

/* Left dashboard column: trend chart, then the weekly sessions chart. */
.dash-col { display: grid; gap: 16px; }
.dash-col > .card { margin: 0; }
.week-load { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; align-items: end; height: 170px; margin-top: 8px; }
.week-load > div { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.week-load b { min-height: 18px; color: #1E293B; font-size: 13px; }
.wl-track { position: relative; display: flex; align-items: flex-end; flex: 1; width: 100%; max-width: 46px; border-radius: 12px; background: #F8FAFC; overflow: hidden; }
.wl-track i { display: block; width: 100%; border-radius: 12px; background: linear-gradient(180deg, #FCD34D, #F59E0B); animation: wl-grow .9s .2s cubic-bezier(.2, .9, .3, 1) backwards; transform-origin: bottom; }
.week-load small { color: #64748B; font-size: 12px; font-weight: 600; }
.week-load .now .wl-track i { background: linear-gradient(180deg, #FBBF24, #D97706); box-shadow: 0 0 16px rgba(245, 158, 11, .55); }
.week-load .now small { color: #B45309; }
@keyframes wl-grow { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .wl-track i { animation: none; } }

/* Date chip: the picker button sits flat and vertically centred inside the pill. */
.date-chip { height: 40px; padding: 0 4px 0 12px; }
.date-chip .dp-btn, .date-chip .dp-btn:hover, .date-chip .dp-btn[aria-expanded="true"] { align-self: center; align-items: center; height: 36px; min-height: 0; margin: 0; padding: 0 10px 0 2px; background: none; border: 0; box-shadow: none; line-height: 1; }
.date-chip:focus-within { box-shadow: 0 0 0 3px rgba(251, 191, 36, .45); }

/* Settings: one page with tabs (My account, Center, Subjects, Change log) for the director. */
.set-tabs { display: flex; gap: 4px; margin: 0 0 18px; padding: 5px; overflow-x: auto; background: #fff; border: 1px solid #E2E8F0; border-radius: 16px; scrollbar-width: none; }
.set-tabs a { display: inline-flex; flex: none; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; color: #64748B; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.set-tabs a:hover { background: #F8FAFC; color: #1E293B; }
.set-tabs a.on, .set-tabs a.on:hover { background: var(--blue); color: #fff; }
.set-tabs a .i { width: 18px; height: 18px; }
.set-head { display: flex; align-items: center; gap: 12px; }
.set-head h2 { margin: 0; font-size: 1.05rem; }
.set-head small { display: block; color: var(--muted); font-size: 13px; }
.set-profile { display: flex; align-items: center; gap: 16px; padding: 20px 24px; background: linear-gradient(120deg, #FFFBEB, #fff 60%); }
.set-profile b { display: block; color: #1E293B; font-size: 1.15rem; }
.set-profile small { color: var(--muted); }
.set-profile .avatar.big { width: 56px; height: 56px; font-size: 20px; }
.set-profile .role-pill { display: inline-block; margin-left: 8px; padding: 3px 10px; font-size: 12px; vertical-align: 3px; }
input::-ms-reveal, input::-ms-clear { display: none; } /* Edge adds its own eye; ours is the one that matches */
.role-pill { padding: 6px 14px; border-radius: 999px; background: #FEF3C7; color: #92400E; font-size: 13px; font-weight: 700; }
.set-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.set-col { display: grid; gap: 16px; }
.set-col > .card, .set-grid > .card { margin: 0; }
.lang-card { display: grid; gap: 16px; }
.lang-card .segmented { justify-self: start; }
.pw-card .set-head { margin-bottom: 10px; }
.form-intro > .i { width: 22px; height: 22px; margin-bottom: 10px; color: #D97706; }
.set-intro { padding: 22px 28px; border-bottom: 1px solid #E2E8F0; }
@media (max-width: 860px) { .set-grid, .subj-grid { grid-template-columns: 1fr; } }

/* Page intro line with its action button on the right (Programs and prices). */
.page-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; }
.page-bar > p { flex: 1; margin: 0; }
dialog.modal.wide { width: min(940px, calc(100vw - 32px)); }

/* Program picker on the student form: price cards grouped by program. */
.plan-grp { margin: 10px 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.plans > .plan-cards:last-child { margin-top: 12px; }
.plan { position: relative; margin: 0; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan span { display: grid; gap: 2px; height: 100%; padding: 10px 14px; border: 1.5px solid var(--input); border-radius: 12px; font-weight: 600; cursor: pointer; transition: border-color .2s, background .2s; }
.plan span b { font-size: 15px; }
.plan span:hover { border-color: var(--accent); }
.plan input:checked + span { border-color: var(--accent); background: #FFFBEB; box-shadow: 0 0 0 1px var(--accent); }
.plan input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); }

/* Scores: the entry boxes, each subject's progress, and what the class did today. */
.score-head { justify-content: flex-start; }
.score-head label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.score-topic input { width: 220px; }
.score-of input { width: 84px; }
.score-head .date-chip { margin-left: auto; }
.score-hint { margin: 0; padding: 10px 20px 0; font-size: 13.5px; }
.assess-row { grid-template-columns: auto minmax(0, 1fr) 150px minmax(190px, 260px); }
.score-in { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-weight: 600; white-space: nowrap; }
.score-in input { width: 84px; text-align: center; font-size: 17px; font-weight: 700; }
@media (max-width: 1100px) { .assess-row { grid-template-columns: auto minmax(0, 1fr) 150px; } }
@media (max-width: 560px) { .score-in { grid-column: 1 / -1; } .score-topic, .score-topic input { width: 100%; } .score-head .date-chip { margin-left: 0; } }
.delta { padding: 2px 9px; border-radius: 999px; background: #F1F5F9; color: var(--muted); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.delta.up { background: var(--leaf-tint); color: var(--leaf); }
.delta.down { background: var(--rose-tint); color: var(--rose); }
.rows .delta { margin-right: 6px; }
.move { margin-left: 4px; font-style: normal; font-weight: 700; }
.move.up { color: var(--leaf); }
.move.down { color: var(--rose); }
.subj-now { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 14px; margin: 6px 0 4px; }
.subj-pct { grid-row: span 2; color: var(--ink); font: 600 2.4rem/1 var(--display); }
.subj-now small { color: var(--muted); font-size: 13px; }
.subj-now .spark { width: 100%; max-width: 220px; height: 30px; }
.topic-bars { display: grid; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.topic-bars li { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 44px; align-items: center; gap: 10px; font-size: 13.5px; }
.topic-bars li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-bars b { color: var(--ink); text-align: right; }
.topic-bars .bar-lv1 { background: var(--rose); }
.topic-bars .bar-lv2 { background: #F59E0B; }
.topic-bars .bar-lv3 { background: var(--blue); }
.topic-bars .bar-lv4 { background: var(--leaf); }
.timeline .score { flex: none; min-width: 52px; color: var(--ink); }
.prog-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 0 0 12px; }
.mini-stats span small { display: block; color: var(--faint); }
.day-note { display: grid; gap: 6px; margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); font-weight: 600; }
.day-note small { color: var(--muted); font-weight: 400; }
.kid p.kid-today { display: -webkit-box; margin: 8px 0 0; overflow: hidden; color: var(--text); font-size: 14px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.day-text { margin: 0; white-space: pre-line; }
.today-card .rows { margin-top: 10px; }

/* Settings, subjects by grade: one card per grade with removable chips, grouped by stage. */
.subj-band { padding: 18px 28px 4px; }
.subj-band h3 { margin: 0 0 12px; color: var(--muted); font: 700 12px Figtree, system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.subj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.subj-card { display: grid; align-content: start; gap: 10px; padding: 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; }
.subj-card:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(63, 91, 216, .1); }
.subj-card header { display: flex; align-items: center; gap: 8px; }
.subj-card header b { color: var(--ink); font-size: 15px; }
.subj-card header small { min-width: 22px; padding: 1px 8px; background: var(--blue-tint); border-radius: 999px; color: var(--blue); font-size: 12px; font-weight: 700; text-align: center; }
.subj-card header { padding: 0; border: 0; }
.copy-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; margin-left: auto; padding: 0 9px; background: none; border: 0; border-radius: 8px; box-shadow: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.copy-btn:hover { background: var(--blue-tint); color: var(--blue); }
.copy-btn .i { width: 14px; height: 14px; }
.subj-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.subj-list:empty::before { content: "No subjects yet"; color: var(--faint); font-size: 13.5px; }
.subj-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 11px; background: #F1F5F9; border-radius: 999px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.chip-x { display: grid; place-items: center; width: 22px; height: 22px; min-height: 0; padding: 0; background: none; border: 0; border-radius: 50%; color: var(--faint); box-shadow: none; cursor: pointer; }
.chip-x:hover { background: var(--rose-tint); color: var(--rose); }
.chip-x .i { width: 13px; height: 13px; }
.subj-add { width: 100%; min-height: 38px; margin: 0; padding: 7px 12px; border-style: dashed; font-size: 14px; }
.subj-form .form-actions { margin-top: 18px; }
@media (max-width: 600px) { .subj-band { padding: 16px 16px 4px; } }
.doc-delete { margin-top: 10px; }
.doc-delete button { width: 100%; justify-content: center; }

/* Report card: a letterhead sheet (logo and contacts, title band, student details, tables, comments, signatures and a
   footer) that prints on one A4 page with the app around it hidden. */
.report-sheet { max-width: 880px; padding: 0; overflow: hidden; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.rs-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 34px 18px; border-bottom: 4px solid #F59E0B; }
.rs-logo { width: 190px; height: auto; margin: 0; }
.rs-contact { display: grid; gap: 2px; max-width: 360px; color: var(--muted); font-size: 12.5px; text-align: right; }
.rs-contact b { color: var(--ink); font-size: 14px; }
.rs-contact i { color: #B45309; font-weight: 600; }
.rs-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 34px; background: var(--blue); color: #fff; }
.rs-title h2 { margin: 0; color: #fff; font: 600 1.25rem var(--display); letter-spacing: .04em; text-transform: uppercase; }
.rs-title b { font-size: 15px; }
.rs-info { display: flex; align-items: center; gap: 20px; margin: 22px 34px 6px; padding: 16px 18px; background: #F8FAFC; border: 1px solid var(--line); border-radius: 16px; }
.rs-info dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; flex: 1; margin: 0; }
.rs-info dt { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.rs-info dd { margin: 2px 0 0; color: var(--ink); font-weight: 600; }
.report-sheet .rs-sec { display: flex; align-items: center; gap: 8px; margin: 20px 34px 8px; color: var(--ink); font: 600 1.05rem var(--display); }
.report-sheet .note-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 600 1rem var(--display); }
.report-sheet .note-card h3 .i { width: 17px; height: 17px; }
.rs-table { width: calc(100% - 68px); margin: 0 34px; border-collapse: collapse; font-size: 14px; }
.rs-table th { padding: 8px 10px; background: #F1F5F9; color: var(--muted); font-size: 11.5px; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.rs-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.rs-table .steps { margin: 0; max-width: 220px; }
.rs-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 34px 0; }
.rs-notes .note-card { margin: 0; border: 1px solid var(--line); }
.report-sheet .quote { margin: 0 34px; }
.rs-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 40px 34px 0; text-align: center; }
.rs-sign span { display: block; height: 36px; border-bottom: 1.5px solid #94A3B8; }
.rs-sign b { display: block; margin-top: 6px; color: var(--ink); font-size: 13.5px; }
.rs-sign small { color: var(--muted); font-size: 12px; }
.rs-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding: 12px 34px; background: #FEF3C7; border-top: 3px solid #F59E0B; color: #78350F; font-size: 12px; font-weight: 600; }
@media screen and (max-width: 760px) {
  .rs-head, .rs-info { flex-direction: column; align-items: flex-start; }
  .rs-contact { text-align: left; }
  .rs-info dl { grid-template-columns: 1fr 1fr; }
  .rs-notes, .rs-sign { grid-template-columns: 1fr; }
  .rs-foot { flex-direction: column; }
  .rs-head, .rs-title, .rs-foot { padding-left: 18px; padding-right: 18px; }
  .rs-info, .rs-notes, .report-sheet .rs-sec, .report-sheet .quote, .rs-sign { margin-left: 18px; margin-right: 18px; }
  .rs-table { width: calc(100% - 36px); margin: 0 18px; }
}
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff !important; }
  .app .shell::before { display: none !important; }
  .rail, .side, .top, .tabbar, .scrim, .noprint, .flash { display: none !important; }
  .shell, main { margin: 0 !important; padding: 0 !important; }
  main:has(.report-sheet) > :not(.report-sheet) { display: none !important; }
  .card.report-sheet { display: flex; flex-direction: column; zoom: .8; min-height: 345mm; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; animation: none; }
  .report-sheet .rs-foot { margin-top: auto; }
  .rs-head { padding-top: 6px; } .rs-logo { width: 150px; } .rs-info { margin-top: 14px; } .report-sheet .rs-sec { margin-top: 14px; } .rs-table td { padding: 6px 10px; } .rs-sign { margin-top: 30px; }
}
.rows small.marks { color: var(--muted); font-size: 12.5px; }

/* Pages printed with the letterhead (class progress): header and footer exist only on paper. */
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  main:has(.print-foot) { display: flex; flex-direction: column; min-height: 276mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  main:has(.print-foot) > .print-foot { margin-top: auto; padding-top: 16px; }
  .print-head .rs-head { padding: 0 0 14px; }
  .print-head .rs-title { padding: 10px 18px; }
  .print-meta { display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 10px 18px; margin: 14px 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; }
  .print-meta dt { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  .print-meta dd { margin: 2px 0 0; color: var(--ink); font-weight: 600; }
  .print-foot .rs-foot { padding: 10px 18px; }
  main:has(.print-foot) .table-card .card-head h2 { font-size: 1.05rem; }
  main:has(.print-foot) .scroll { overflow: visible; }
  main:has(.print-foot) .grid-table { font-size: 12.5px; }
  main:has(.print-foot) .grid-table tr { break-inside: avoid; }
}
@media print { main > *, main * { animation: none !important; } } /* entrance animations would print mid-fade */
@media print {
  .print-head .rs-head { padding: 0 6px 14px 0; }
  .print-foot .rs-foot { font-size: 11px; }
  main:has(.print-foot) .card { border: 0; box-shadow: none; }
}
@media print {
  /* Child progress report: the attendance stat is already in the details box; keep cards whole and side by side. */
  main:has(.print-foot) .mini-stats > * { box-shadow: none; border: 1px solid var(--line); }
  main:has(.print-foot) .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main:has(.print-foot) .area-card, main:has(.print-foot) .summary-card { break-inside: avoid; border: 1px solid var(--line); }
  main:has(.print-foot) details.history { display: none; }
}
@media print {
  main:has(.print-foot) .mini-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  main:has(.print-foot) .mini-stats > * { padding: 10px 12px; }
  main:has(.print-foot) .mini-stats b { font-size: 1.3rem; }
  main:has(.print-foot) .summary-card, main:has(.print-foot) .area-card { padding: 14px 16px; }
  main:has(.print-foot) .subj-pct { font-size: 2rem; }
}

/* Parent home: one calm family view. A child switcher (several children), Today, new scores, quick links. */
.fam { display: grid; gap: 14px; }
.kid-switch { display: flex; gap: 8px; margin: 0 -4px; padding: 2px 4px 4px; overflow-x: auto; scrollbar-width: none; }
.kid-switch button { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 40px; padding: 4px 14px 4px 5px; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; box-shadow: none; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.kid-switch button:first-child { padding-left: 12px; }
.kid-switch button .avatar { width: 30px; height: 30px; font-size: 12px; }
.kid-switch button .i { width: 18px; height: 18px; color: var(--muted); }
.kid-switch button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.kid-switch button[aria-pressed="true"] .i { color: #fff; }
.fam-today h2, .fam .card-head h2 { margin: 0 0 6px; font-size: 1.1rem; }
.fam-kids { display: grid; margin: 0; padding: 0; list-style: none; }
.fam-kids a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.fam-kids li:last-child a { border-bottom: 0; }
.fam-kids b { display: block; color: var(--ink); }
.fam-kids small { color: var(--muted); font-size: 13px; }
.fam-kids .badge { flex: none; }
.fam-note { margin-top: 10px; padding: 12px 14px; background: #F8FAFC; border-radius: 14px; }
.fam-note small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.fam-note small .i { width: 15px; height: 15px; }
.fam-note p { margin: 4px 0 0; color: var(--ink); white-space: pre-line; }
.fam-scores { display: grid; margin: 0; padding: 0; list-style: none; }
.fam-scores a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.fam-scores li:last-child a { border-bottom: 0; }
.fam-scores b { display: block; color: var(--ink); font-weight: 600; }
.fam-scores small { color: var(--muted); font-size: 12.5px; }
.fam-scores .score { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.fam-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fam-links a { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: center; text-decoration: none; }
.fam-links .chip-icon { width: 38px; height: 38px; }
@media (min-width: 761px) { .fam { max-width: 720px; } }

/* Messages: who each person is, and one-tap new conversations. */
.start-chat { display: grid; gap: 8px; }
.start-chat > small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.start-list { display: grid; gap: 6px; }
.start-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--text); text-decoration: none; }
.start-list a:hover { border-color: var(--blue); background: var(--blue-tint); }
.start-list b { display: block; color: var(--ink); font-size: 14.5px; }
.start-list small, .threads .t-who { display: block; color: var(--muted); font-size: 12.5px; }
.threads .t-who { margin: -1px 0 1px; }

/* Timetable on phones: day chips, then one card per child who comes that day. Wide screens keep the table. */
.tt-phone { display: none; }
@media (max-width: 760px) {
  .tt-phone { display: grid; gap: 12px; }
  .tt-wide { display: none; }
  .tt-days { display: flex; gap: 6px; margin: 0 -4px; padding: 2px 4px 6px; overflow-x: auto; scrollbar-width: none; }
  .tt-days label { position: relative; display: grid; justify-items: center; gap: 1px; flex: 1 0 48px; margin: 0; padding: 8px 4px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); cursor: pointer; }
  .tt-days input { position: absolute; opacity: 0; pointer-events: none; }
  .tt-days b { font-size: 14px; }
  .tt-days small { min-height: 14px; color: var(--muted); font-size: 11px; line-height: 14px; letter-spacing: 1px; }
  .tt-days label.today small { color: var(--blue); font-weight: 700; letter-spacing: 0; }
  .tt-days label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
  .tt-days label:has(input:checked) small { color: #cbd5e1; }
  .tt-days label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
  .tt-dayview { display: grid; gap: 8px; }
  .tt-dayview[hidden] { display: none; }
  .tt-group { margin: 6px 2px 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
  .tt-kid { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; color: var(--text); text-decoration: none; }
  .tt-kid b { display: block; margin-bottom: 6px; color: var(--ink); }
  .tt-free, .tt-away { margin: 0; color: var(--muted); font-size: 14px; }
  .tt-free { display: flex; align-items: center; gap: 10px; padding: 18px; background: #fff; border: 1px dashed var(--line); border-radius: 18px; }
  .tt-free .i { width: 22px; height: 22px; color: #F59E0B; }
  .tt-away { padding: 0 4px; font-size: 13px; }
}

.badge.off { background: transparent; color: var(--faint); }
.inbox-start { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .profile-hero .actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .profile-hero .actions .btn { min-width: 0; padding: 0 8px; font-size: 13px; }
  .profile-hero .actions .btn .i { width: 16px; height: 16px; }
  .profile-hero h2 { font-size: 1.4rem; }
}
@media (max-width: 760px) {
  /* A conversation fills the screen between the top card and the tab bar, so the message box stays above the bar. */
  .chat { height: calc(100dvh - 256px - var(--safe-b)); min-height: 320px; }
}
/* Parent home: each child as a small portrait card, not a dot. */
.fam-kids .avatar { width: 52px; height: 62px; border-radius: 14px; font-size: 18px; }
.fam-kids .avatar.photo { object-fit: cover; }
@media (max-width: 760px) {
  /* While typing (app.js sets .typing), the keyboard covers the bottom of the screen: no tab bar, and the save bar sits at the bottom. */
  .typing .tabbar { display: none; }
  .typing .form-actions { bottom: 0; }
  .typing .shell { padding-bottom: 16px; }
}
@media (max-width: 760px) {
  /* A conversation on a phone is the whole screen: no top bar, no tab bar; the back arrow returns to the list.
     app.js keeps its height to the visible area (--vvh), so the keyboard never covers the message box. */
  body:has(section.chat) { overflow: hidden; }
  body:has(section.chat) .top, body:has(section.chat) .tabbar, body:has(section.chat) main > .chat-note { display: none; }
  body:has(section.chat) .flash { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; }
  section.chat {
    position: fixed; top: var(--vvtop, 0px); left: 0; right: 0; z-index: 30; height: var(--vvh, 100dvh); min-height: 0; margin: 0;
    padding: 0; border: 0; border-radius: 0; box-shadow: none; animation: none;
  }
  section.chat .chat-head { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
  section.chat .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .typing section.chat .composer { padding-bottom: 10px; }
}
@media (max-width: 760px) {
  /* The page entrance animation keeps a transform on main's children, which would pin the full-screen chat inside them. */
  body:has(section.chat) main > :not(.flash) { animation: none; transform: none; } /* not the toast: its animation is what hides it */
}
/* Sideways rows with more beyond an edge (app.js sets data-more): that edge fades out as a hint to swipe. */
[data-more="right"] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
[data-more="left"] { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
[data-more="both"] { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
/* Sign-in: the full logo, background-free. Phones show it large at the top of the sign-in card (the app's first screen). */
.login-logo { width: 210px; margin: -6px 0 6px -8px; mix-blend-mode: normal; }
@media (max-width: 900px) {
  .login-head { position: relative; justify-content: center; margin-bottom: 14px; }
  .login-head .login-hero { width: min(220px, 62vw); height: auto; aspect-ratio: auto; border-radius: 0; box-shadow: none; background: none; }
  .login-head .lang-switch { position: absolute; top: 0; right: 0; }
}
.backup-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.backup-card .set-head { flex: 1 1 320px; }

/* Attendance: the check before saving and the confirmation after it. */
.done-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; padding: 0; list-style: none; }
.done-counts li { display: grid; justify-items: center; padding: 12px 6px; border-radius: 16px; font-size: 13px; font-weight: 600; }
.done-counts b { font: 600 1.7rem/1.1 var(--display); }
.done-counts .present { background: var(--leaf-tint); color: var(--leaf); }
.done-counts .late { background: var(--amber-tint); color: var(--amber); }
.done-counts .absent { background: var(--rose-tint); color: var(--rose); }
.done-who { margin: 6px 0 0; color: var(--ink); }
.confirm-roll { width: min(440px, calc(100vw - 32px)); }
.confirm-body { padding: 22px 22px 4px; }
.confirm-body h2 { margin: 0; }
.ask-sure .confirm-body { padding-bottom: 18px; }
.ask-sure .confirm-body h2 { font-size: 19px; line-height: 1.35; }
.roll-done { display: grid; justify-items: center; gap: 4px; max-width: 560px; margin: 0 auto; padding: 30px 24px; text-align: center; }
.roll-done h2 { margin: 6px 0 0; font-size: 1.5rem; }
.roll-done .done-counts { width: 100%; }
.roll-done .fam-note { width: 100%; margin-top: 12px; text-align: left; }
.done-check { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--leaf-tint); color: var(--leaf); animation: pop .4s cubic-bezier(.35, 1.5, .5, 1) both; }
.done-check .i { width: 32px; height: 32px; stroke-width: 2.6; }
.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.confirm-roll .form-actions { position: static; bottom: auto; margin: 0; }

/* Messages on wider screens: the conversation and the list reach the bottom of the window, with the message box at
   the very bottom; both follow the window when it is resized (dvh), and long lists scroll inside their card. */
@media (min-width: 761px) {
  body:has(.chat-layout) main { padding-bottom: 16px; }
  .chat-layout { align-items: stretch; }
  .chat-layout .inbox, .chat-layout .chat, .chat-layout .chat-empty { height: calc(100dvh - 140px - var(--crumbs-h, 0px)); min-height: 300px; }
  .chat-layout .inbox { display: flex; flex-direction: column; }
  .chat-layout .threads { flex: 0 1 auto; max-height: none; min-height: 0; }
  .chat-layout .inbox-start { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .chat-layout.list-only .inbox { height: auto; max-height: calc(100dvh - 140px - var(--crumbs-h, 0px)); }
}
@media (min-width: 761px) and (max-width: 900px) {
  .chat-layout .chat { height: calc(100dvh - 190px - var(--crumbs-h, 0px)); min-height: 300px; } /* the top bar is taller here */
}

/* Sign-in card: A6 (a quarter of A4), honey frame, the logo, and the details in large, easy-to-copy type. */
.slip-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 22px; }
.slip-wrap .slip { flex: 1 1 280px; max-width: 420px; margin: 0; }
.slip-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
article.pw-card { flex: none; width: 95mm; height: 138.5mm; max-width: 100%; padding: 3.2mm; background: #F5B312; border-radius: 7mm; box-shadow: var(--shadow); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.pw-in {
  display: flex; flex-direction: column; align-items: center; height: 100%; padding: 4mm 6mm 3.5mm; border: .5mm dashed #14286b; border-radius: 5mm;
  background: radial-gradient(circle at 6% 99%, #FFF1C2 0 8mm, transparent 8.2mm), radial-gradient(circle at 92% 8%, #FFF1C2 0 7mm, transparent 7.2mm), #FFFDF6;
  color: #14286b; text-align: center;
}
.pw-logo { width: 36mm; height: auto; margin: 0 0 1.5mm; }
.pw-hello { margin: 0; font: 700 6.2mm/1.15 "Baloo 2", Fredoka, sans-serif; }
.pw-hello b { color: #D99A00; }
.pw-role { margin: .4mm 0 3mm; color: #6b5a2e; font-size: 3.1mm; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pw-fields { display: grid; gap: 2mm; width: 100%; margin: 0; }
.pw-fields div { padding: 1.6mm 3mm; background: #fff; border: .35mm solid #F3D98A; border-radius: 3mm; }
.pw-fields dt { color: #6b5a2e; font-size: 2.6mm; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pw-fields dd { margin: .3mm 0 0; color: #14286b; font: 600 4.2mm/1.25 Figtree, system-ui, sans-serif; overflow-wrap: anywhere; }
.pw-pass { background: #FFF4D6 !important; border-color: #F5B312 !important; }
.pw-pass dd { font: 700 6.6mm/1.2 ui-monospace, Consolas, "Courier New", monospace; letter-spacing: .12em; }
.pw-steps { margin: 3mm 0 0; padding: 0 0 0 5mm; color: #33406b; font-size: 3.1mm; line-height: 1.5; text-align: left; align-self: stretch; }
.pw-foot { margin: auto 0 0; padding-top: 2mm; color: #8a7a4f; font-size: 2.5mm; }
.pw-site { display: flex; align-items: center; gap: 3mm; text-align: left; }
.pw-qr { flex: none; width: 17mm; height: 17mm; padding: 1.2mm; background: #fff; }
.pw-site small { display: block; color: #6b5a2e; font-size: 2.4mm; }
/* Which quarter of the A4 sheet the card prints on, laid out like the quadrants in maths: 2 | 1 over 3 | 4. */
.pw-where { margin: 10px 0 0; }
.pw-quads { display: grid; grid-template-columns: repeat(2, 56px); gap: 4px; margin-top: 6px; }
.pw-quads label { position: relative; display: grid; place-items: center; height: 70px; border: 2px dashed #CBD5E1; border-radius: 6px; cursor: pointer; font-weight: 700; color: #64748B; }
.pw-quads input { position: absolute; opacity: 0; }
.pw-quads label:has(:checked) { border: 2px solid var(--blue); background: #EEF2FF; color: var(--blue); }
.pw-quads label:has(:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.pw-sheet { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body:has(article.pw-card) main > :not(.slip-wrap), .slip-wrap > :not(article.pw-card, .pw-sheet) { display: none !important; }
  /* A quarter is 105 x 148.5 mm; the card sits 5 mm inside it, clear of the printer's edge and the cutting lines. */
  article.pw-card { position: fixed; top: 5mm; left: 110mm; box-shadow: none; }
  body:has(#pwq-2:checked) article.pw-card { left: 5mm; }
  body:has(#pwq-3:checked) article.pw-card { left: 5mm; top: 153.5mm; }
  body:has(#pwq-4:checked) article.pw-card { top: 153.5mm; }
  .pw-sheet { display: block; }
  .pw-qn { display: none; position: fixed; color: #9aa0b0; font: 600 3mm/1 Figtree, sans-serif; }
  .pw-qn.q1 { top: 144.5mm; left: 106.5mm; } .pw-qn.q2 { top: 144.5mm; right: 106.5mm; }
  .pw-qn.q3 { top: 150mm; right: 106.5mm; } .pw-qn.q4 { top: 150mm; left: 106.5mm; }
  body:has(#pwq-1:checked) .q1, body:has(#pwq-2:checked) .q2, body:has(#pwq-3:checked) .q3, body:has(#pwq-4:checked) .q4 { display: block; }
  .pw-cross { display: none; }
  body:has(#pwq-1:checked) .pw-cross { display: block; } /* first card on a fresh sheet: print the cutting cross */
  .pw-cross::before, .pw-cross::after { content: ""; position: fixed; border: 0 dashed #9aa0b0; }
  .pw-cross::before { top: 0; left: 105mm; height: 297mm; border-left-width: .3mm; }
  .pw-cross::after { left: 0; top: 148.5mm; width: 210mm; border-top-width: .3mm; }
  /* fixed means the sheet only if no wrapper around the card is transformed or filtered */
  *:has(article.pw-card) { transform: none !important; filter: none !important; backdrop-filter: none !important; contain: none !important; }
}

/* Account photos */
.set-profile { flex-wrap: wrap; }
.photo-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.photo-form label.btn { cursor: pointer; }
.me .avatar.photo { object-fit: cover; }
.form-body > .photo-pick { width: 150px; }

/* ---------- Materials: a catalogue on the left (grade board, classes, types), results on the right. ----------
   The grade board is the page's one bold idea: every grade is a tile, and its honey gets deeper the more
   materials that grade holds, so where the content lives shows before anything is read. */
.lib { display: grid; grid-template-columns: 284px minmax(0, 1fr); align-items: start; gap: 18px; }
.lib-side { position: sticky; top: 104px; display: grid; gap: 12px; max-height: calc(100dvh - 120px); overflow-y: auto; scrollbar-width: thin; }
.lib-side > summary { display: none; }
.lib-panel { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.lib-panel header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.lib-panel h2 { margin: 0; font: 600 1rem var(--display); }
.lib-panel header a, .lib-panel header span { color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.lib-panel header a:hover { color: var(--blue); }
.gb-band { margin: 12px 0 6px; color: #94A3B8; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.gb-band:first-of-type { margin-top: 0; }
.gb { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gb-tile {
  --heat: 0; position: relative; display: grid; justify-items: center; gap: 0; padding: 7px 4px 6px; border-radius: 14px; text-decoration: none;
  background: color-mix(in srgb, #F5B312 calc(var(--heat) * 72%), #FFF8E6); color: #5C3B00; border: 1.5px solid transparent;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.gb-tile small { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.gb-tile b { font: 700 1.45rem/1.05 var(--display); }
.gb-tile em { font-size: 11px; font-style: normal; font-weight: 700; opacity: .8; }
.gb-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(160, 105, 0, .18); }
.gb-tile:focus-visible { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 2px; }
.gb-tile.empty { background: #F8FAFC; color: #94A3B8; border: 1.5px dashed #E2E8F0; }
.gb-tile.empty:hover { box-shadow: none; }
.gb-tile.on { background: var(--ink); color: #fff; box-shadow: 0 6px 16px rgba(20, 40, 107, .28); }
.gb-tile.on small, .gb-tile.on em { opacity: .85; }
.lib-opts { display: grid; gap: 2px; }
.lib-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.lib-opt b { min-width: 26px; padding: 1px 7px; background: #F1F5F9; border-radius: 99px; color: var(--muted); font-size: 11.5px; text-align: center; }
.lib-opt:hover { background: #F8FAFC; }
.lib-opt.on { background: var(--blue-tint); color: var(--blue); }
.lib-opt.on b { background: var(--blue); color: #fff; }
.lib-opt .chip-icon { width: 28px; height: 28px; }
.lib-note { margin: 6px 10px 0; color: var(--muted); font-size: 12.5px; }

.lib-main { display: grid; gap: 14px; min-width: 0; }
.lib-bar { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px; }
.lib-bar .search-big { flex: 1 1 auto; max-width: none; }
.lib-bar .search-big input { min-width: 0; height: 48px; font-size: 15.5px; text-overflow: ellipsis; }
.view-toggle { display: inline-flex; flex: none; gap: 2px; padding: 3px; background: #F1F5F9; border-radius: 12px; }
.view-toggle .icon-btn { width: 40px; height: 40px; border: 0; background: none; box-shadow: none; }
.view-toggle .icon-btn[aria-pressed="true"] { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(24, 34, 74, .14); }
.lib-bar .btn { flex: none; height: 48px; }
.lib-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 2px; }
.lib-status p { margin: 0 6px 0 0; color: var(--muted); font-weight: 600; }
.lib-status p b { color: var(--ink); font: 600 1.2rem var(--display); }
.lib-filter { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; background: var(--ink); border-radius: 99px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.lib-filter .i { width: 14px; height: 14px; opacity: .75; }
.lib-filter:hover { background: var(--rose); }
.lib-filter:hover .i { opacity: 1; }
.lib-clear { color: var(--muted); font-size: 13px; font-weight: 600; }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.lib-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 12px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.lib-tabs a b { padding: 0 7px; background: #F1F5F9; border-radius: 99px; color: var(--muted); font-size: 11.5px; }
.lib-tabs a:hover { background: #FFF8E6; }
.lib-tabs a.on { background: #F5B312; color: #3D2600; }
.lib-tabs a.on b { background: rgba(255, 255, 255, .55); color: #3D2600; }
.lib-tabs a.empty:not(.on) { color: #94A3B8; }
.lib-main .grade-group { margin: 0; }
.lib-main .grade-head { margin: 4px 2px 12px; font-size: 1.3rem; }
.lib-main .subj-head { display: flex; align-items: center; gap: 10px; margin: 6px 2px 12px; color: var(--ink); font: 600 1.05rem var(--display); letter-spacing: 0; text-transform: none; }
.lib-main .subj-head::after { content: ""; flex: 1; height: 1px; background: #E2E8F0; }
.subj-dot { width: 10px; height: 10px; border-radius: 50%; background: #CBD5E1; }
.subj-dot.s-blue { background: #6B8AF2; } .subj-dot.s-green { background: #34B37E; } .subj-dot.s-violet { background: #9B7BF0; }
.subj-dot.s-amber { background: #F0B33E; } .subj-dot.s-rose { background: #EC6A80; }
.lib-main .doc-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.link-quiet { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.link-quiet:hover { background: #F1F5F9; color: var(--ink); }
.link-quiet .i { width: 14px; height: 14px; }

/* A unit of a study pack: a honey spine with its number, then Summary, Questions and Answers as rows. */
.card.unit-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; border-top: 0; }
.unit-spine { display: grid; align-content: center; justify-items: center; background: linear-gradient(180deg, #F8C548, #F0A91C); color: #4A2E00; }
.unit-spine small { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.unit-spine b { font: 700 1.7rem/1 var(--display); }
.unit-body { display: grid; gap: 8px; padding: 12px 12px 12px 14px; min-width: 0; }
.unit-top { display: flex; align-items: center; gap: 8px; }
.unit-subj { flex: 1; min-width: 0; overflow: hidden; color: var(--ink); font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.unit-subj span { color: var(--muted); font-weight: 600; }
.unit-files { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.unit-files li { display: flex; align-items: center; gap: 4px; }
.uf { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 5px 8px 5px 5px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.uf .chip-icon { width: 28px; height: 28px; }
.uf small { color: #94A3B8; font-size: 11px; font-weight: 700; }
.uf:hover { background: var(--blue-tint); color: var(--blue); }
.uf-dl { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); }
.uf-dl:hover { background: var(--blue-tint); color: var(--blue); }
.uf-dl .i { width: 17px; height: 17px; }

/* Any other material: a card with its subject colour along the top, type, title, tags and date. */
.card.doc { border-top: 4px solid #E2E8F0; }
.card.doc.s-blue { border-top-color: #6B8AF2; } .card.doc.s-green { border-top-color: #34B37E; } .card.doc.s-violet { border-top-color: #9B7BF0; }
.card.doc.s-amber { border-top-color: #F0B33E; } .card.doc.s-rose { border-top-color: #EC6A80; }
.doc-type { margin-left: auto; padding: 2px 8px; background: #F1F5F9; border-radius: 6px; color: #475569; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.doc-top .badge + .doc-type { margin-left: 0; }
.doc-main { display: grid; gap: 4px; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.doc-tags .tag { padding: 2px 9px; background: var(--amber-tint); border-radius: 99px; color: var(--amber); font-size: 12px; font-weight: 600; }
.doc-tags .tag.plain, .doc-tags .tag.t-none { background: #F1F5F9; color: #475569; }

/* List view: one row per unit or material inside a single card. */
.lib.as-list .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.lib.as-list .card.doc { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.lib.as-list .card.doc:last-child { border-bottom: 0; }
.lib.as-list .card.unit-card { grid-template-columns: 46px minmax(0, 1fr); }
.lib.as-list .unit-spine b { font-size: 1.3rem; }
.lib.as-list .unit-body { grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 12px; }
.lib.as-list .unit-files { display: flex; flex-wrap: wrap; gap: 4px 6px; justify-content: flex-start; }
.lib.as-list .unit-files li { flex: none; }
.lib.as-list .uf { flex: none; padding-right: 10px; background: #F8FAFC; }
.lib.as-list .card.doc:not(.unit-card) { display: grid; grid-template-columns: auto minmax(0, 1.5fr) minmax(0, 1fr) 92px; align-items: center; gap: 14px; padding: 10px 16px; border-left: 4px solid #E2E8F0; }
.lib.as-list .card.doc.s-blue { border-left-color: #6B8AF2; } .lib.as-list .card.doc.s-green { border-left-color: #34B37E; } .lib.as-list .card.doc.s-violet { border-left-color: #9B7BF0; }
.lib.as-list .card.doc.s-amber { border-left-color: #F0B33E; } .lib.as-list .card.doc.s-rose { border-left-color: #EC6A80; }
.lib.as-list .card.doc:not(.unit-card):hover { background: #F8FAFC; }
.lib.as-list .doc:not(.unit-card) .doc-top { display: contents; }
.lib.as-list .doc:not(.unit-card) .doc-top .chip-icon { grid-column: 1; grid-row: 1; }
.lib.as-list .doc:not(.unit-card) .doc-kind { display: none; }
.lib.as-list .doc:not(.unit-card) .doc-top .badge { grid-column: 3; grid-row: 2; justify-self: start; margin: -6px 0 0; }
.lib.as-list .doc:not(.unit-card) .doc-type { grid-column: 4; grid-row: 1; justify-self: end; margin: 0; }
.lib.as-list .doc:not(.unit-card) .doc-main { grid-column: 2; grid-row: 1; }
.lib.as-list .doc:not(.unit-card) .doc-title { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.lib.as-list .doc:not(.unit-card) .doc-snip { -webkit-line-clamp: 1; font-size: 13px; }
.lib.as-list .doc:not(.unit-card) .doc-tags { grid-column: 3; grid-row: 1; flex-wrap: nowrap; overflow: hidden; }
.lib.as-list .doc:not(.unit-card) .doc-foot { grid-column: 2 / -1; grid-row: 2; margin: -8px 0 0; padding: 0; border: 0; }

/* Narrower screens: the catalogue folds into a "Filters" panel above the results. */
@media (max-width: 1100px) {
  .lib { grid-template-columns: minmax(0, 1fr); }
  .lib-side { position: static; max-height: none; overflow: visible; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
  .lib-side > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
  .lib-side > summary::-webkit-details-marker { display: none; }
  .lib-side > summary .i { width: 18px; height: 18px; color: #B45309; }
  .lib-side > summary b { padding: 1px 8px; background: var(--ink); border-radius: 99px; color: #fff; font-size: 12px; }
  .lib-side[open] > summary { border-bottom: 1px solid var(--line); }
  .lib-side .lib-panel { border: 0; border-radius: 0; box-shadow: none; }
  .lib-side .lib-panel + .lib-panel { border-top: 1px solid var(--line); }
  .gb { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .gb { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lib-bar { flex-wrap: wrap; }
  .lib-bar .search-big { flex: 1 1 0; min-width: 0; } /* shares the row with the view switch */
  .lib-bar .btn { flex: 1 1 100%; }
  .lib.as-list .unit-body { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lib.as-list .card.doc:not(.unit-card) { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; }
  .lib.as-list .doc:not(.unit-card) .doc-type { grid-column: 3; }
  .lib.as-list .doc:not(.unit-card) .doc-tags { grid-column: 2 / -1; grid-row: 2; flex-wrap: wrap; }
  .lib.as-list .doc:not(.unit-card) .doc-foot { grid-row: 3; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .gb-tile { transition: none; } .gb-tile:hover { transform: none; } }

/* PDF reader on a material's page */
.pdf-view { margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #E9ECF3; }
.pdf-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.pdf-bar .icon-btn { width: 36px; height: 36px; font-size: 20px; font-weight: 600; }
.pdf-count { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.pdf-pages { --zoom: 1; display: grid; justify-items: center; gap: 12px; max-height: 78vh; padding: 12px; overflow: auto; }
.pdf-page { width: calc(100% * var(--zoom)); max-width: none; height: auto; background: #fff; border-radius: 4px; box-shadow: 0 2px 10px rgba(24, 34, 74, .15); }
.pdf-frame { display: block; width: 100%; height: 78vh; border: 0; background: #fff; }
.opened .card-head h2 { display: flex; align-items: center; gap: 8px; }
.opened .card-head h2 .i { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 760px) { .pdf-pages { max-height: none; padding: 8px; } }
.back-link { margin: 0 0 10px -6px; }

/* Learner progress report: the session table, printed on portrait A4 like the paper sheet. */
.log-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.log-bar .lib-tabs { flex: 1 1 auto; padding: 0; border: 0; }
.log-sheet { max-width: none; }
.log-scroll { overflow-x: auto; }
.log-table { min-width: 860px; }
.log-table td { vertical-align: top; border: 1px solid var(--line); }
.log-table th { background: #1E3A5F; color: #fff; border: 1px solid #1E3A5F; }
.log-table .nowrap { white-space: nowrap; }
.log-table tr.blank td { height: 22mm; }
.log-empty { margin: 14px 34px 0; }
@page log { size: A4 portrait; margin: 10mm; }
@media print {
  .log-sheet { page: log; }
  .log-scroll { overflow: visible; }
  .log-table { width: 100%; min-width: 0; margin: 0; table-layout: fixed; font-size: 9.5px; }
  .log-table th { padding: 5px 4px; font-size: 8px; letter-spacing: .02em; }
  .log-table td { padding: 5px 4px; overflow-wrap: anywhere; }
  .log-table th:first-child, .log-table td:first-child { width: 15mm; }
  .log-table .nowrap { white-space: normal; }
  .log-table tr.print-only { display: table-row; }
  .log-sheet .rs-info, .log-sheet .rs-title, .log-sheet .rs-head { margin-left: 0; margin-right: 0; }
}
.sess-rows li { align-items: center; }
.sess-subs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.sess-subs .tag { padding: 2px 9px; background: var(--leaf-tint); border-radius: 99px; color: var(--leaf); font-size: 12px; font-weight: 600; text-decoration: none; }
/* Class header: the class's colour badge, its name (opens the honeycomb) and a line on who is in it. */
.class-switch .cls-badge { width: 48px; height: 48px; }
.class-switch .cls-badge .i { width: 24px; height: 24px; }
.cs-text, .cs-text label { justify-items: start; }
.class-switch .hex-trigger { width: auto; max-width: 100%; box-shadow: none; }
.class-switch .hex-trigger:hover { color: var(--blue); }
.cs-text { display: grid; gap: 2px; min-width: 0; }
.cs-meta { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

/* Breadcrumbs: their own bar above every page, with a back button, a Home icon, and a menu on the section crumb. */
/* Height of the bar plus its gap, for pages sized to the window (Messages). */
body:has(main > .crumbs) { --crumbs-h: 62px; }
/* No transform, filter or backdrop-filter here: any of them would make the fixed menu below position itself inside the bar. */
main > .crumbs { animation: none; transform: none; } /* not part of the page's slide-in, for the same reason */
.crumbs { position: relative; z-index: 9; /* under the sticky header (10), above the page */ display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 0 14px; padding: 5px 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(24, 34, 74, .04); }
.crumb-back { display: inline-flex; flex: none; align-items: center; gap: 4px; height: 34px; padding: 0 12px 0 8px; background: #F1F5F9; border-radius: 11px;
  color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.crumb-back .i { width: 16px; height: 16px; transition: transform .15s; }
.crumb-back:hover { background: var(--ink); color: #fff; }
.crumb-back:hover .i { transform: translateX(-2px); }
.crumb-back:focus-visible, .crumbs li > a:focus-visible, .crumb-menu > summary:focus-visible { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 1px; }
.crumbs ol { display: flex; flex: 1; align-items: center; min-width: 0; margin: 0; padding: 0 4px; overflow-x: auto; list-style: none; scrollbar-width: none; }
.crumbs ol::-webkit-scrollbar { display: none; }
.crumbs li { display: inline-flex; flex: none; align-items: center; }
.crumbs li + li::before { content: ""; width: 6px; height: 6px; margin: 0 8px 0 6px; border-top: 1.5px solid #CBD5E1; border-right: 1.5px solid #CBD5E1; transform: rotate(45deg); }
.crumbs li > a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.crumbs li > a:hover { background: #F1F5F9; color: var(--ink); }
.crumb-home .i { width: 16px; height: 16px; }
.crumb-here span { display: block; max-width: 34ch; overflow: hidden; padding: 6px 11px; background: #FFF4D6; border-radius: 9px; color: #5C3B00; font-size: 13.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.crumb.has-menu > a { padding-right: 4px; border-radius: 9px 0 0 9px; }
.crumb-menu { position: relative; }
.crumb-menu > summary { display: grid; place-items: center; width: 24px; height: 30px; border-radius: 0 9px 9px 0; color: var(--muted); cursor: pointer; list-style: none; transition: background .15s; }
.crumb-menu > summary::-webkit-details-marker { display: none; }
.crumb-menu > summary .i { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
.crumb-menu > summary:hover, .crumb-menu[open] > summary { background: #F1F5F9; color: var(--ink); }
.crumb-menu[open] > summary .i { transform: rotate(-90deg); }
.crumb-pop { position: fixed; z-index: 70; display: grid; gap: 2px; min-width: 230px; margin-top: 6px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 2px 6px rgba(24, 34, 74, .08), 0 20px 48px rgba(24, 34, 74, .18); animation: rise .15s ease-out; }
.crumb-pop p { margin: 2px 8px 6px; color: #94A3B8; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.crumb-pop a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.crumb-pop a .i { width: 17px; height: 17px; color: var(--muted); }
.crumb-pop a:hover { background: #F8FAFC; color: var(--ink); }
.crumb-pop a.on { background: var(--blue-tint); color: var(--blue); }
.crumb-pop a.on .i { color: var(--blue); }
@media (max-width: 760px) {
  .crumb-back span, .crumb-home span { display: none; }
  .crumb-back { padding: 0 9px; }
  .crumb-here span { max-width: 22ch; }
}
@media (prefers-reduced-motion: reduce) { .crumb-pop { animation: none; } .crumb-back .i, .crumb-menu > summary .i { transition: none; } }

/* Report card form: who it is for, then one row per learning area with the levels as coloured choices. */
.rc-who { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.rc-who h2 { margin: 0; font-size: 1.3rem; }
.rc-who p { margin: 2px 0 0; }
.lv-rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
/* fieldset.lv-row, not .lv-row: the general "fieldset:not(.card)" reset above would otherwise win and strip the padding and dividers. */
fieldset.lv-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 12px; margin: 0; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); }
fieldset.lv-row:last-child { border-bottom: 0; }
fieldset.lv-row > legend { float: left; margin: 0; padding: 0; color: var(--ink); font-weight: 600; }
.lv-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-opt { position: relative; margin: 0; }
.lv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lv-opt span { display: block; padding: 7px 13px; border: 1.5px solid #E2E8F0; border-radius: 99px; color: #64748B; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.lv-opt span:hover { border-color: #CBD5E1; color: var(--ink); }
.lv-opt input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 1px; }
.lv-opt input:checked + span { color: #fff; border-color: transparent; }
.lv-o0 input:checked + span { background: #94A3B8; }
.lv-o1 input:checked + span { background: var(--rose); }
.lv-o2 input:checked + span { background: #E59A1A; }
.lv-o3 input:checked + span { background: var(--blue); }
.lv-o4 input:checked + span { background: #1F9D6B; }
.lv-row legend small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
/* Progress report ratings: three steps of weight. Plain = a choice, tinted = what was picked last session, solid = picked now. */
.lv-o1.was span { background: var(--rose-tint); border-color: var(--rose); color: var(--rose); }
.lv-o2.was span { background: var(--amber-tint); border-color: #E59A1A; color: #9A5B00; }
.lv-o3.was span { background: #EEF2FF; border-color: var(--blue); color: var(--blue); }
.lv-o4.was span { background: #E7F6EF; border-color: #1F9D6B; color: #14774F; }
.lv-opt.was input:checked + span { color: #fff; border-color: transparent; }
.lv-o1.was input:checked + span { background: var(--rose); } .lv-o2.was input:checked + span { background: #E59A1A; }
.lv-o3.was input:checked + span { background: var(--blue); } .lv-o4.was input:checked + span { background: #1F9D6B; }
@media (max-width: 760px) {
  /* The area name is a clear heading above its choices. Block + floated legend: as a grid item the legend sat on the box's top edge. */
  fieldset.lv-row { display: block; padding: 14px 14px 16px; }
  fieldset.lv-row > legend { width: 100%; margin-bottom: 10px; font-size: 16px; font-weight: 700; }
  .lv-opts { clear: both; }
  .rc-who { flex-wrap: wrap; }
  /* Session form: the four levels as big even buttons, two by two; "Not rated" small above them. */
  .log-form .lv-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .log-form .lv-opt span { padding: 11px 8px; border-radius: 12px; font-size: 14.5px; text-align: center; }
  .log-form .lv-opt b { margin-right: 2px; font-size: 16px; }
  .log-form .lv-o0 { grid-column: 1 / -1; justify-self: start; }
  .log-form .lv-o0 span { padding: 5px 12px; border-radius: 99px; font-size: 12.5px; }
}

/* Sign-in footer: contact line, then the rights line. */
.login-foot p { margin: 0; }
.login-foot .foot-rights { margin-top: 4px; font-size: 12px; }
/* Phones: one screen, no scrolling. Only the sign-in card shows (logo, form, help), with the rights line pinned to the
   bottom; the welcome panel and the contact line are for wider screens. Sizes shrink on short phones so it still fits. */
@media (max-width: 760px) {
  body.bare:has(.login) { height: 100dvh; min-height: 0; justify-content: space-between; overflow: hidden; }
  body.bare:has(.login) .login { display: flex; flex: 1; flex-direction: column; justify-content: center; min-height: 0; padding: max(10px, env(safe-area-inset-top)) 14px 0; }
  .login-brand, .login-foot .foot-info { display: none; }
  .login-card { padding: 18px 20px 16px; border-radius: 26px; }
  .login-head { margin-bottom: 8px; }
  .login-head .login-hero { width: min(150px, 40vw, 20dvh); }
  .login-card h2 { font-size: 1.5rem; }
  .login-card > .muted { margin: 0 0 14px; font-size: 14px; }
  .login-form label { margin-bottom: 10px; }
  .field input { height: 48px; }
  .go { height: 50px; margin-top: 4px; }
  .help { margin-top: 12px; text-align: center; }
  .help p, .help .forgot-form { text-align: left; }
  .secure { justify-content: center; margin-top: 12px; padding-top: 12px; font-size: 12.5px; }
  .login-foot { flex: none; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) and (max-height: 640px) {
  .login-head .login-hero { width: min(110px, 30vw, 16dvh); }
  .login-card > .muted { display: none; }
  .login-card h2 { margin-bottom: 10px; font-size: 1.35rem; }
  .secure { display: none; }
}
/* With the help panel open (or the keyboard up on a short phone) the card may be taller than the screen: then it scrolls inside itself. */
@media (max-width: 760px) { body.bare:has(.login) .login-card { max-height: 100%; overflow-y: auto; scrollbar-width: none; } }

/* Progress report: technique quick dates, the rubric chips in the table, due reviews. */
.log-date { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.rb-cell { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.rb-cell li { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; white-space: nowrap; }
.rb-cell b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; color: #fff; font-size: 11px; }
.rb-cell .rb1 b { background: var(--rose); } .rb-cell .rb2 b { background: #E59A1A; } .rb-cell .rb3 b { background: var(--blue); } .rb-cell .rb4 b { background: #1F9D6B; }
.log-table td.is-due { background: #FFF4D6; color: #7A4A00; font-weight: 700; }
.rb-key { margin: 10px 34px 0; color: var(--muted); font-size: 12px; }
.sess-subs .tag.due { background: #FFF4D6; color: #7A4A00; box-shadow: inset 0 0 0 1.5px #F5B312; }
@media print { .rb-key { margin: 6px 0 0; font-size: 9px; } .log-table td.is-due { background: none; } .rb-cell b { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }

/* Progress report on screen: quiz summary, a collapsible add form, one card per session (newest first). The table is for print. */
.sess-subs .tag b { color: inherit; }
.log-add { margin: 0 0 16px; }
.log-add > summary { display: inline-flex; list-style: none; }
.log-add > summary::-webkit-details-marker { display: none; }
.log-add[open] > summary { display: none; } /* the summary only opens the form; once open, Save session is the one button */
.log-cards { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.log-card { display: grid; gap: 12px; }
.log-card > header { display: flex; align-items: flex-start; gap: 12px; }
.log-card h3 { margin: 2px 0 0; color: var(--ink); font: 600 1.1rem var(--display); }
.log-card .log-date { white-space: normal; }
.log-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 0; padding: 12px 14px; background: var(--paper); border-radius: 12px; }
.log-fields dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.log-fields dd { margin: 2px 0 0; color: var(--text); font-size: 14px; }
.log-card > footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 0; }
.log-card .rb-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.log-card .rb-cell li { gap: 6px; padding: 3px 4px 3px 10px; background: #F1F5F9; border-radius: 99px; font-size: 12.5px; }
.log-card .icon-btn { margin: 0; }
.log-next { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 600; }
.log-next svg { width: 15px; height: 15px; }
.log-next.is-due { padding: 3px 10px; background: #FFF4D6; border-radius: 99px; color: #7A4A00; }
@media (max-width: 560px) { .log-card > header { flex-wrap: wrap; } }

/* Study skills guide: contents on the left, the guide in readable cards on the right. */
.sg { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 18px; }
.sg-toc { position: sticky; top: 104px; display: grid; gap: 2px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.sg-toc p { margin: 0 8px 6px; color: #94A3B8; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sg-toc a { padding: 7px 10px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.sg-toc a:hover { background: #FFF8E6; color: var(--ink); }
.sg-toc button { margin-top: 10px; }
.sg-body { display: grid; gap: 16px; min-width: 0; }
.sg-hero { padding: 26px 28px; background: linear-gradient(135deg, #FFF8E6, #fff 60%); border-left: 6px solid #F5B312; }
.sg-eyebrow { margin: 0 0 6px; color: #B45309; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sg-hero h2 { margin: 0 0 6px; font-size: 1.6rem; }
.sg-hero p { margin: 0; color: var(--muted); }
.sg-hint { display: flex; align-items: center; gap: 8px; margin-top: 14px !important; font-size: 14px; }
.sg-hint .i { width: 17px; height: 17px; color: var(--leaf); }
.sg-sec { padding: 22px 26px; scroll-margin-top: 110px; }
.sg-sec h2 { margin: 0 0 10px; font-size: 1.3rem; }
.sg-sec h3 { margin: 18px 0 8px; font-size: 1.05rem; }
.sg-sec p { color: var(--text); line-height: 1.6; }
.sg-facts { display: grid; gap: 0; margin: 14px 0 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sg-facts div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sg-facts div:last-child { border-bottom: 0; }
.sg-facts dt { color: var(--ink); font-weight: 700; }
.sg-facts dd { margin: 0; }
.sg-list { display: grid; gap: 6px; margin: 0; padding-left: 20px; line-height: 1.55; }
.sg-tech { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sg-tech-card { padding: 14px 16px; background: #FFFBF0; border: 1px solid #F6E3B0; border-radius: 16px; }
.sg-tech-card h3 { margin: 0 0 6px; }
.sg-tech-card p { margin: 0; font-size: 14px; }
.sg-ex { margin-top: 8px !important; color: var(--muted) !important; }
.sg-age { margin-top: 18px; }
.sg-age h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.sg-age h3 span { padding: 3px 10px; background: var(--ink); border-radius: 99px; color: #fff; font-size: 13px; }
.sg-say { padding: 10px 14px; background: #F1F5F9; border-radius: 12px; }
.sg-scroll { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; }
.sg-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.sg-table th, .sg-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sg-table thead th { background: #1E3A5F; color: #fff; font-size: 12.5px; }
.sg-table tbody th { color: var(--ink); font-weight: 700; }
.sg-table tbody tr:last-child > * { border-bottom: 0; }
#record .sg-table td, #record .sg-table th[scope] { height: 44px; }
.sg-check { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sg-check label { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 500; cursor: pointer; }
.sg-check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; }
.sg-refs { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
@media (max-width: 960px) { .sg { grid-template-columns: minmax(0, 1fr); } .sg-toc { position: static; display: flex; flex-wrap: wrap; } .sg-toc p { width: 100%; } .sg-facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.sg-body { grid-template-columns: minmax(0, 1fr); } /* without this one wide table stretches every card past the screen */
/* Phones: the contents list is one row to swipe, cards are tighter, and each table row becomes its own small card
   (column name above the value) instead of a wide table to scroll sideways. */
@media screen and (max-width: 760px) {
  .sg { gap: 12px; }
  .sg-toc { flex-wrap: nowrap; gap: 6px; padding: 8px; overflow-x: auto; border-radius: 16px; scrollbar-width: none; }
  .sg-toc::-webkit-scrollbar { display: none; }
  .sg-toc p, .sg-toc button { display: none; } /* printing the guide is a computer job */
  .sg-toc a { flex: none; padding: 7px 12px; background: #F1F5F9; border-radius: 99px; font-size: 13px; white-space: nowrap; }
  .sg-body { gap: 12px; }
  .sg-hero { padding: 16px 16px 16px 14px; border-left-width: 5px; }
  .sg-hero h2 { font-size: 1.25rem; line-height: 1.25; }
  .sg-hint { display: block; font-size: 13.5px; } /* as a flex row the link would become its own narrow column */
  .sg-hint .i { margin-right: 4px; vertical-align: -3px; }
  .sg-sec { padding: 16px; }
  .sg-sec h2 { font-size: 1.15rem; }
  .sg-tech { grid-template-columns: minmax(0, 1fr); }
  .sg-age h3 { flex-wrap: wrap; }
  .sg-scroll { overflow: visible; border: 0; border-radius: 0; }
  .sg-table, .sg-table tr, .sg-table tbody th, .sg-table td { display: block; }
  .sg-table { min-width: 0; }
  .sg-table thead { display: none; }
  .sg-table tbody { display: grid; gap: 10px; }
  .sg-table tr { padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
  .sg-table tbody th, .sg-table td { padding: 0; border: 0; }
  .sg-table tbody th { font-size: 15px; letter-spacing: 0; text-transform: none; }
  .sg-table td { margin-top: 10px; line-height: 1.5; }
  .sg-table tbody th::before, .sg-table td::before { content: attr(data-label); display: block; margin-bottom: 1px; color: #94A3B8; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  #record .sg-scroll { display: none; } /* the blank sheet is for printing */
}
@media print { .sg { display: block; } .sg-sec, .sg-hero { break-inside: avoid-page; box-shadow: none; } .sg-table { min-width: 0; font-size: 11px; } }

/* Materials: each grade is a card, each subject a panel inside it, so the grouping reads at a glance. */
.lib-main .grade-group { padding: 16px 18px 18px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.lib-main .grade-group > .grade-head { margin: -2px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.lib-main .grade-group > .grade-head::before { width: 10px; height: 10px; }
.lib-main .subj-group { margin: 0; padding: 12px; background: #F8FAFC; border: 1px solid #EEF2F7; border-radius: 16px; }
.lib-main .subj-group + .subj-group { margin-top: 12px; }
.lib-main .subj-group > .subj-head { margin: 0 2px 10px; }
.lib-main .subj-group > .subj-head::after { content: none; }
.lib-main .subj-head small { margin-left: auto; }
.lib.as-list .subj-group .doc-grid, .lib.as-list .grade-group > .doc-grid { box-shadow: none; }
@media (max-width: 640px) { .lib-main .grade-group { padding: 12px; } .lib-main .subj-group { padding: 8px; } }
/* List view: a unit's three parts sit side by side on one line where there is room. */
/* the subject is already the panel's heading and the unit number is on the spine, so the row is just the three parts */
.lib.as-list .unit-body { grid-template-columns: minmax(0, 1fr); }
.lib.as-list .unit-top { display: none; }
.lib.as-list .uf small { display: none; }
.lib.as-list .uf { gap: 6px; padding: 4px 10px 4px 4px; }
.lib.as-list .uf .chip-icon { width: 24px; height: 24px; }

.rc-sessions td { vertical-align: top; }

/* The card's own QR code (inline SVG), and the "continue as" page it opens. */
.pw-qr svg { display: block; width: 100%; height: 100%; }
.pw-qr svg path, .pw-qr svg rect[fill="black"] { fill: #14286b; }
.link-in { grid-template-columns: minmax(0, 430px); justify-content: center; }
.link-in .login-head { display: flex; justify-content: center; margin-bottom: 12px; }
.link-in .login-hero { width: min(170px, 46vw); height: auto; }
.link-copy { width: 100%; margin-top: 10px; }
.link-copy input { padding-right: 52px; font-size: 13px; }
.link-copy .peek.done { color: var(--leaf); }

/* Test scores, phone first: child list, subject list, then one subject's sheet (a compact table that fits 360px). */
.gr-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.gr-top .search-big { max-width: none; }
.gr-list { margin: 0; padding: 6px; list-style: none; }
.gr-list li + li { border-top: 1px solid var(--line); }
.gr-list a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 10px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.gr-list a:hover, .gr-list a:active { background: var(--paper); }
.gr-list a > .i:last-child { width: 18px; height: 18px; flex: none; color: var(--faint); }
.gr-list b { display: block; font-size: 15.5px; }
.gr-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.gr-list .grow { min-width: 0; }
.gr-list .lv { flex: none; }
.gr-ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 13px; background: var(--blue-tint); color: var(--blue); }
.gr-ico .i { width: 20px; height: 20px; }
.gr-none { margin-top: 12px; }
.gr-step { margin: 18px 4px 10px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.gr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.gr-head h1 { margin: 0; font-size: 1.45rem; }
.gr-head small { color: var(--muted); font-size: 13.5px; }
.gr-head .grow { min-width: 0; }
.gr-stats { display: flex; gap: 20px; margin: 0; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }
.gr-stats dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.gr-stats dd { margin: 4px 0 0; color: var(--ink); font: 600 1.15rem var(--display); }
.gr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .gr-actions { flex: 1 1 100%; } .gr-actions > * { flex: 1; } }
.gr-steprow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 4px 10px; }
.gr-steprow .gr-step { margin: 0; }
.gr-another { flex: none; }
.gr-picks { display: grid; gap: 6px; }
.gr-picks label { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); font-weight: 600; cursor: pointer; }
.gr-picks label:has(:checked) { border-color: var(--blue); background: var(--blue-tint); }
.gr-picks input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.gr-picks small { color: var(--muted); font-weight: 600; }

/* Grade a session: three big number boxes and a result strip of fixed size, so nothing moves while typing. */
.gr-entry { display: grid; gap: 14px; margin-top: 12px; padding: 16px; }
.gr-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.gr-entry-head b { color: var(--ink); font: 600 1.1rem var(--display); white-space: nowrap; }
.gr-entry-head span { color: var(--muted); font-size: 14px; font-weight: 600; }
.gr-entry-head input { width: auto; max-width: 60%; height: 40px; margin: 0; font-size: 14px; }
.gr-by { display: flex; align-items: center; gap: 5px; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.gr-by .i { width: 14px; height: 14px; }
.gr-table td small.gr-teacher { color: #3B5BDB; font-weight: 600; }
.gr-topic { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.gr-topic input { margin: 6px 0 0; }
.gr-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gr-num { display: grid; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }
.gr-num input { width: 100%; min-width: 0; height: 64px; margin: 0; padding: 0 4px; border: 2px solid var(--line); border-radius: 16px;
  color: var(--ink); font: 700 1.75rem var(--display); font-variant-numeric: tabular-nums; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.gr-num input::-webkit-inner-spin-button, .gr-num input::-webkit-outer-spin-button, .quiz-grid input::-webkit-inner-spin-button, .quiz-grid input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.quiz-grid input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.gr-num input::placeholder { color: var(--faint); }
.gr-num input:focus { border-color: var(--blue); }
.gr-num.is-ok span { color: #1F9D6B; }
.gr-num.is-ok input:focus { border-color: #1F9D6B; }
.gr-num.is-bad span { color: var(--rose); }
.gr-num.is-bad input:focus { border-color: var(--rose); }
.gr-entry.is-over .gr-num.is-bad input { border-color: var(--rose); background: var(--rose-tint); }
.gr-result { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--paper); }
.gr-bar { display: flex; height: 10px; overflow: hidden; border-radius: 99px; background: var(--line); }
.gr-bar i { display: block; width: 0; height: 100%; transition: width .2s ease; }
.gr-bar .r { background: #1F9D6B; }
.gr-bar .w { background: var(--rose); }
.gr-out { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.gr-out span { color: var(--muted); font-size: 14px; font-weight: 600; }
.gr-out span output { display: inline-block; min-width: 2.5ch; margin-left: 4px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.gr-out output.lv { min-width: 9.5em; padding: 6px 12px; font-size: 13.5px; text-align: center; white-space: nowrap; }
.gr-out output.lv.is-bad { background: var(--rose-tint); color: var(--rose); }
.gr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.gr-foot small { flex: 1 1 200px; }
.gr-foot button { flex: 0 0 auto; min-width: 140px; }

/* Graded sessions: read-only, fixed column widths so it never jumps. */
.gr-hist { padding: 0; overflow: hidden; }
.gr-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.gr-table col.n { width: 15%; }
.gr-table col.l { width: 30%; }
.gr-table th { padding: 10px 6px; background: #1E3A5F; color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-align: center; text-transform: uppercase; }
.gr-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); color: var(--ink); text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
.gr-table tr:last-child td { border-bottom: 0; }
.gr-table th:first-child, .gr-table td:first-child { padding-left: 14px; text-align: left; }
.gr-table td:first-child { overflow-wrap: anywhere; }
.gr-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.gr-table td b { font-weight: 700; white-space: nowrap; }
.gr-table td:first-child b { white-space: normal; } /* a long session name wraps in its own column instead of running over the numbers */
.gr-table td:last-child { position: relative; padding-right: 30px; }
.gr-table .lv { display: inline-block; max-width: 100%; padding: 3px 8px; overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.gr-ok { color: #1F9D6B !important; font-weight: 700; }
.gr-bad { color: var(--rose) !important; font-weight: 700; }
.gr-unsent { color: #B26A00 !important; font-weight: 700; }
.gr-del-form { position: absolute; top: 50%; right: 2px; margin: 0; transform: translateY(-50%); }
.gr-del { display: grid; place-items: center; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; background: transparent; border-radius: 9px; box-shadow: none; color: var(--faint); }
.gr-del:hover { background: var(--rose-tint); color: var(--rose); }
.gr-del .i { width: 15px; height: 15px; }
@media (max-width: 560px) {
  .gr-foot button { flex: 1 1 100%; }
  .gr-table th { padding: 8px 3px; font-size: 9.5px; }
  .gr-table td { padding: 9px 3px; }
  .gr-table th:first-child, .gr-table td:first-child { padding-left: 10px; }
  .gr-table col.n { width: 14%; }
  .gr-table col.l { width: 31%; }
}
.gr-name { display: block; color: var(--ink); font: 600 1.25rem var(--display); }

/* Printed test scores. */
.gr-print-bar { margin: 0 0 12px; }
.gr-print-sub { margin: 18px 0 0; break-inside: avoid-page; }
.gr-print-sub h2 { margin: 0 34px 8px; font-size: 1.05rem; }
.gr-print-sub h2 small { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.gr-print-sub > p { margin: 0 34px; }
.gr-print .rs-foot { margin-top: 24px; }
@media print { .gr-print-sub h2, .gr-print-sub > p { margin-left: 0; margin-right: 0; } .gr-print .rs-table { width: 100%; margin: 0; font-size: 11px; } }
/* Session quiz in the progress report: the form row and the chip on each session card. */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); align-items: end; gap: 12px; }
.quiz-grid label { margin: 0; }
.quiz-grid input, .quiz-grid select { height: 48px; font-size: 17px; text-align: center; }
.quiz-auto { display: grid; gap: 6px; }
.quiz-auto span { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.quiz-auto output { display: grid; place-items: center; height: 48px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--ink); font-weight: 700; }
.quiz-auto output.lv[class*="lv"] { padding: 0 8px; border-style: solid; border-color: transparent; border-radius: 12px; font-size: 13.5px; }
.quiz-auto output.lv:not([class*="lv1"]):not([class*="lv2"]):not([class*="lv3"]):not([class*="lv4"]) { background: none; border: 1.5px dashed var(--line); }
.quiz-chip { display: inline-flex; flex: none; align-items: baseline; gap: 2px; padding: 6px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.quiz-chip b { font: 600 1.3rem var(--display); }
.quiz-chip small { margin-left: 8px; font-size: 12px; font-weight: 700; }

/* Profile photo pop-up: the photo large, a summary beside it (below it on a phone), over a blurred page. */
img.avatar.photo { cursor: zoom-in; }
label img.avatar.photo, dialog img.avatar.photo { cursor: auto; }
dialog.pic-zoom { width: min(760px, calc(100vw - 32px)); }
dialog.pic-zoom::backdrop { background: rgba(15, 23, 42, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
dialog.pic-zoom[open] { animation: pz-in .18s ease-out; }
@keyframes pz-in { from { opacity: 0; transform: scale(.96); } }
.pz-card { padding: 14px 18px 20px; border-radius: 22px; background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .3); }
.pz-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: 0 0 12px -6px; padding: 0 12px 0 6px; background: transparent; border-radius: 12px; box-shadow: none; color: var(--ink); font-weight: 700; }
.pz-back:hover { background: var(--paper); }
.pz-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pz-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 22px; }
.pz-body > img { width: 100%; max-height: min(60dvh, 420px); aspect-ratio: 1; border-radius: 18px; object-fit: cover; background: var(--paper); }
.pz-info h2 { margin: 0 0 10px; font-size: 1.4rem; overflow-wrap: anywhere; }
.pz-info ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pz-info li { padding: 5px 10px; border-radius: 99px; background: var(--paper); color: var(--muted); font-size: 13px; font-weight: 600; }
.pz-info dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.pz-info dl div { padding: 10px 12px; border-radius: 14px; background: var(--paper); }
.pz-info dd { margin: 0; color: var(--ink); font: 700 1.2rem var(--display); }
.pz-info dt { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pz-info .btn { margin-top: 16px; }
@media (max-width: 560px) {
  .pz-body { grid-template-columns: 1fr; gap: 16px; }
  .pz-body > img { max-height: 45dvh; }
}

/* Ms. Bee AI: the mascot tucked into the right edge of every staff page, only a sliver of the bee showing so it never
   covers a button. Hover (or a first tap on a phone, see app.js) slides it out; clicking it then opens the chat. */
.ai-fab { position: fixed; right: 0; bottom: 22px; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 6px 18px 6px 6px; border-radius: 99px 0 0 99px;
  background: #fff; box-shadow: 0 10px 28px rgba(30, 41, 59, .22), 0 0 0 2px #F5B312; color: var(--ink); font-weight: 700; text-decoration: none;
  transform: translateX(calc(100% - 30px)); opacity: .9; transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s, box-shadow .15s ease; }
.ai-fab:hover, .ai-fab:focus-visible, .ai-fab.out { transform: none; opacity: 1; box-shadow: 0 14px 32px rgba(30, 41, 59, .26), 0 0 0 2px #F5B312; }
.ai-fab:active { transform: scale(.97); }
.ai-fab img { width: 40px; height: 40px; border-radius: 50%; background: #FFF8E6; object-fit: contain; }
@media (max-width: 760px) {
  .ai-fab { bottom: calc(122px + var(--safe-b, 0px)); padding: 5px 14px 5px 5px; transform: translateX(calc(100% - 26px)); } /* well clear of the bottom bar's Menu */
  .ai-fab img { width: 42px; height: 42px; }
  .ai-fab span { font-size: 14px; }
}
@media print { .ai-fab { display: none; } }

/* The chat screen. */
.ai-chat { display: flex; flex-direction: column; min-height: min(72dvh, 760px); padding: 0; overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #FFF8E6; }
.ai-head img { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: contain; }
.ai-head b { display: block; color: var(--ink); font: 600 1.1rem var(--display); }
.ai-head small { color: var(--muted); font-size: 13px; font-weight: 600; }
.ai-log { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; overflow-y: auto; }
.ai-hello { margin: auto 0; text-align: center; }
.ai-hello > p:first-child { max-width: 440px; margin: 0 auto 14px; color: var(--ink); font-size: 15.5px; }
.ai-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.ai-try .chip { max-width: 100%; white-space: normal; min-height: 40px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; box-shadow: none; color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.ai-try .chip:hover { border-color: var(--blue); background: var(--blue-tint); }
.ai-msg { display: flex; align-items: flex-end; gap: 8px; max-width: min(640px, 92%); }
.ai-msg.user { align-self: flex-end; }
.ai-msg img { width: 30px; height: 30px; flex: none; border-radius: 50%; background: #FFF8E6; object-fit: contain; }
.ai-text { position: relative; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg.user .ai-text { border-bottom-right-radius: 6px; background: var(--blue); color: #fff; white-space: pre-wrap; }
.ai-msg.assistant .ai-text { border-bottom-left-radius: 6px; background: var(--paper); color: var(--ink); }
.ai-text p { margin: 0 0 8px; }
.ai-text p:last-of-type { margin-bottom: 0; }
.ai-text ul { margin: 0 0 8px; padding-left: 20px; }
.ai-text li + li { margin-top: 3px; }
.ai-msg.is-wait .ai-text { color: var(--muted); animation: ai-pulse 1.2s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .5; } }
.ai-msg.is-error .ai-text { background: var(--rose-tint); color: var(--rose); }
.ai-copy { display: inline-block; min-height: 0; margin: 8px 0 0; padding: 3px 10px; border-radius: 8px; background: #fff; box-shadow: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.ai-copy:hover { color: var(--blue); }
.ai-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.ai-form textarea { flex: 1; min-height: 48px; max-height: 160px; margin: 0; padding: 12px 14px; border-radius: 16px; font-size: 16px; line-height: 1.4; resize: none; }
.ai-form button { display: grid; place-items: center; width: 48px; height: 48px; min-height: 0; flex: none; padding: 0; border-radius: 50%; }
.ai-form button .i { width: 20px; height: 20px; }
.ai-note { margin: 10px 4px 0; text-align: center; }
@media (max-width: 560px) {
  .ai-chat { min-height: calc(100dvh - 300px); margin-left: -6px; margin-right: -6px; }
  .ai-head .btn, .ai-head button { padding: 0 10px; }
  .ai-msg { max-width: 96%; }
}

/* Settings, AI usage. */
.ai-off { display: flex; align-items: center; gap: 10px; color: var(--rose); font-weight: 600; }
.ai-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0 12px; }
.ai-big div { padding: 12px 14px; border-radius: 14px; background: var(--paper); }
.ai-big b { display: block; color: var(--ink); font: 700 1.5rem var(--display); }
.ai-big div:first-child b { color: #1F9D6B; }
.ai-big span { color: var(--muted); font-size: 13px; font-weight: 600; }
.ai-meter { height: 8px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--line); }
.ai-meter i { display: block; height: 100%; border-radius: 99px; background: #1F9D6B; }
.ai-meter i.warn { background: #F5B312; }
.ai-meter i.full { background: var(--rose); }
.ai-rows { margin: 14px 0 0; padding: 0; list-style: none; }
.ai-rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ai-rows .grow { min-width: 0; }
.ai-rows b { display: block; }
.ai-rows small { display: block; color: var(--muted); font-size: 12.5px; }
.ai-left { min-width: 64px; text-align: right; }
.ai-left b { font: 700 1.05rem var(--display); }
.ai-rows form, .ai-reset-all { margin: 0; }
.ai-reset-all { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .ai-rows li { flex-wrap: wrap; }
  .ai-rows .grow { flex: 1 1 calc(100% - 120px); }
  .ai-rows form { margin-left: auto; }
}

/* Ms. Bee AI saved chats: a list on the left on wide screens, a drawer from the left on phones. */
.ai-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 16px; }
.ai-wrap > .card { margin: 0; }
main > .ai-wrap { animation: none; transform: none; } /* a transform here would pin the phone drawer to this box instead of the screen */
.ai-side { position: sticky; top: 16px; max-height: calc(100dvh - 150px); padding: 14px; overflow-y: auto; }
.ai-side-top { display: flex; align-items: center; gap: 8px; }
.ai-newchat { flex: 1; justify-content: center; }
.ai-side-close, .ai-histbtn { display: none; }
.ai-search { max-width: none; margin: 12px 0 4px; }
.ai-found { margin: 8px 4px 0; color: var(--muted); font-size: 13px; }
.ai-found a { margin-left: 6px; font-weight: 700; }
.ai-day { margin: 16px 6px 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.ai-list { margin: 0; padding: 0; list-style: none; }
.ai-list li { position: relative; display: flex; align-items: center; border-radius: 12px; }
.ai-list li:hover, .ai-list li.on { background: var(--paper); }
.ai-list li.on { box-shadow: inset 3px 0 0 var(--blue); }
.ai-list a { flex: 1; min-width: 0; padding: 9px 10px; color: var(--ink); text-decoration: none; }
.ai-list a span { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ai-list a small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.ai-list form { margin: 0 4px 0 0; }
.ai-list .icon-btn { width: 30px; height: 30px; min-height: 0; border: 0; background: transparent; box-shadow: none; color: var(--faint); opacity: 0; }
.ai-list li:hover .icon-btn, .ai-list li.on .icon-btn, .ai-list .icon-btn:focus-visible { opacity: 1; }
.ai-list .icon-btn:hover { background: var(--rose-tint); color: var(--rose); }
.ai-list .icon-btn .i { width: 15px; height: 15px; }
.ai-none { margin: 16px 6px 4px; font-size: 14px; }
.ai-head .ai-newbtn { display: none; }
@media (max-width: 900px) {
  .ai-wrap { display: block; }
  .ai-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: min(320px, 86vw); max-height: none; padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 20px;
    border-radius: 0 22px 22px 0; background: #fff; transform: translateX(-105%); transition: transform .22s ease; visibility: hidden; }
  .ai-wrap.show-side .ai-side { transform: none; visibility: visible; }
  .ai-wrap.show-side::after { content: ''; position: fixed; inset: 0; z-index: 69; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
  .ai-side-close, .ai-histbtn { display: grid; }
  .ai-histbtn { flex: none; }
  .ai-head .ai-newbtn { display: inline-flex; }
  .ai-list .icon-btn { opacity: 1; }
}
@media (max-width: 420px) { .ai-head .ai-newbtn span { display: none; } .ai-head img { width: 36px; height: 36px; } }

/* Ms. Bee AI tasks: buttons under an answer, the menu on a child's page, the dashboard cards. */
.ai-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ai-tools .ai-copy { margin: 0; }
.ai-act { min-height: 32px; padding: 0 12px; font-size: 13px; }
@media print {
  body.print-one * { visibility: hidden; }
  body.print-one .print-me, body.print-one .print-me * { visibility: visible; }
  body.print-one .print-me { position: absolute; top: 0; left: 0; max-width: none; width: 100%; }
  body.print-one .print-me img, body.print-one .print-me .ai-tools { display: none; }
  body.print-one .print-me .ai-text { background: none; padding: 0; font-size: 12pt; }
}
.ai-menu { position: relative; }
.ai-menu > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.card:has(.ai-menu[open]) { position: relative; z-index: 40; } /* above the cards below it, which animate in their own layers */
.ai-menu > summary::-webkit-details-marker { display: none; }
.ai-menu-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(300px, 86vw); padding: 6px; border-radius: 16px; background: #fff;
  box-shadow: 0 16px 40px rgba(30, 41, 59, .18), 0 0 0 1px var(--line); }
.ai-menu-pop a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.ai-menu-pop a:hover { background: var(--paper); }
.ai-menu-pop .i { width: 20px; height: 20px; flex: none; color: var(--blue); }
.ai-menu-pop b { display: block; font-size: 14.5px; }
.ai-menu-pop small { display: block; color: var(--muted); font-size: 12.5px; }
@media (max-width: 560px) { .ai-menu-pop { left: auto; right: 0; } }
.ai-fill { margin-top: 10px; }
.ai-fill-note { display: block; margin-top: 6px; }
.ai-weekly { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; border: 1.5px solid #F8E3A8; background: #FFF8E6; }
.ai-weekly img { width: 40px; height: 40px; flex: none; }
.ai-weekly .grow { flex: 1 1 220px; min-width: 0; }
.ai-weekly b { display: block; font: 600 1.05rem var(--display); }
.ai-weekly small { color: var(--muted); font-size: 13px; }
.attention .card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.attention .card-head h2 .i { width: 20px; height: 20px; color: #D97706; }
.att-list { margin: 8px 0 0; padding: 0; list-style: none; }
.att-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.att-list .grow { min-width: 0; color: var(--ink); text-decoration: none; }
.att-list b { display: block; }
.att-why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.att-why i { padding: 2px 8px; border-radius: 99px; background: #FFF1E6; color: #B45309; font-size: 12px; font-style: normal; font-weight: 600; }
@media (max-width: 560px) { .att-list .btn span { display: none; } .att-list .btn { padding: 0 10px; } }

/* Telegram page. */
.tg-btn .i { color: #229ED9; }
.tg-card small.muted { display: block; margin-top: 6px; }
.tg-steps { margin: 14px 0 0; padding-left: 22px; color: var(--ink); line-height: 1.6; }
.tg-steps li + li { margin-top: 6px; }
.tg-steps code { padding: 1px 6px; border-radius: 6px; background: var(--paper); font-size: 13px; }
.tg-head { display: flex; align-items: center; gap: 12px; }
.tg-head > .i { width: 34px; height: 34px; padding: 7px; flex: none; border-radius: 50%; background: #229ED9; color: #fff; }
.tg-head b { display: block; font: 600 1.1rem var(--display); }
.tg-head small { color: var(--muted); font-size: 13px; }
.tg-tabs a { position: relative; }
.tg-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #229ED9; color: #fff; font-size: 11.5px; font-style: normal; font-weight: 700; }
.tg-tabs .tg-n { margin-left: 4px; }
.tg-list { margin: 12px 0 0; padding: 0; list-style: none; }
.tg-list li + li { border-top: 1px solid var(--line); }
.tg-list a { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.tg-list a:hover { background: var(--paper); }
.tg-list .grow { min-width: 0; }
.tg-list b { display: block; }
.tg-list small { display: block; color: var(--muted); font-size: 12.5px; }
.tg-list .tg-last { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.tg-list a > .i:last-child { width: 18px; height: 18px; flex: none; color: var(--faint); }
.tg-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tg-h { margin: 0 0 8px; font-size: 1.05rem; }
.tg-log { margin: 0; padding: 0; list-style: none; }
.tg-log li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tg-log .grow { min-width: 0; }
.tg-log b { display: block; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tg-log small { color: var(--muted); font-size: 12.5px; }
.tg-count { flex: none; font-weight: 700; text-align: right; }
.tg-count small { display: block; color: var(--rose); }
.tg-row { display: flex; gap: 8px; margin-top: 12px; }
.tg-row input { flex: 1; margin: 0; }
.tg-cmds { display: grid; gap: 6px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.switch-row b { display: block; font-family: ui-monospace, monospace; }
.switch-row small { color: var(--muted); font-size: 12.5px; }
.switch-row input { width: 20px; height: 20px; margin: 0; accent-color: #229ED9; }
.switch-row:has(:checked) { border-color: #229ED9; background: #EEF8FD; }
.tg-reconnect { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.tg-chat .chat-head small a { color: var(--blue); }

/* Telegram card on My account: the button on its own row with room around it. */
.tg-card .set-head { margin-bottom: 16px; }
.tg-card .tg-btn, .tg-card form button { width: 100%; min-height: 48px; justify-content: center; }
.tg-card small.muted { margin-top: 10px; text-align: center; }
/* Phones: on a page with a save bar at the bottom (attendance, forms), the Ask AI bee sits above it, not on the Save button. */
@media (max-width: 760px) { body:has(main .form-actions) .ai-fab { bottom: calc(160px + var(--safe-b, 0px)); } } /* above a save bar even when tucked */
.tg-state.is-wait { color: #1C8CC2; font-weight: 600; animation: ai-pulse 1.4s ease-in-out infinite; }
.tg-state.is-bad { color: var(--rose); font-weight: 600; }
.tg-ok { color: #1F9D6B; }
.tg-card.just-linked { box-shadow: 0 0 0 2px #1F9D6B, var(--shadow); transition: box-shadow .4s; }
/* My account on phones: the name gets its own line next to the photo; the role and Add photo go underneath. */
.set-profile .grow { min-width: 0; }
.set-profile b { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .set-profile { gap: 12px 14px; }
  .set-profile .grow { flex: 1 1 calc(100% - 80px); }
  .set-profile .photo-form { margin-left: auto; }
}

/* Learning for parents and children: news, subject tiles, then a subject's units. */
.fam-news { padding: 6px 8px; }
.fam-news header { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 4px; }
.fam-news header h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.05rem; }
.fam-news header h2 .i { width: 20px; height: 20px; color: var(--violet, #7C3AED); }
.fam-news header a { font-size: 14px; font-weight: 700; }
.fam-news ul { margin: 0; padding: 0; list-style: none; }
.fam-news li + li { border-top: 1px solid var(--line); }
.fam-news li a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.fam-news li a:hover { background: var(--paper); }
.fam-news .grow { min-width: 0; }
.fam-news b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fam-news small { color: var(--muted); font-size: 12.5px; }
.fam-news li a > .i:last-child { width: 18px; height: 18px; flex: none; color: var(--faint); }
.fam-step { margin: 22px 4px 10px; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fam-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fam-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-height: 120px; margin: 0; padding: 18px; color: var(--ink); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease; }
.fam-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-up, var(--shadow)); }
.fam-tile b { font: 600 1.15rem var(--display); line-height: 1.2; }
.fam-ico { width: 48px; height: 48px; border-radius: 15px; }
.fam-ico .i { width: 24px; height: 24px; }
.fam-subj-head { display: flex; align-items: center; gap: 14px; }
.fam-subj-head b { display: block; font: 600 1.3rem var(--display); }
.fam-subj-head small { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.fam-units { position: relative; margin: 0; padding: 0; list-style: none; }
.fam-units::before { content: ''; position: absolute; top: 20px; bottom: 20px; left: 37px; width: 3px; border-radius: 3px; background: #F8E3A8; }
.fam-unit { position: relative; display: flex; align-items: center; gap: 16px; margin-bottom: 12px; padding: 14px 16px; }
.fam-unit-n { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: #F5B312; color: #1E293B; line-height: 1; box-shadow: 0 0 0 4px #FFF8E6; }
.fam-unit-n small { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fam-unit-n b { font: 700 1.2rem var(--display); }
.fam-parts { display: flex; flex-wrap: wrap; gap: 8px; }
.fam-part { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px; font-size: 14px; font-weight: 700; text-decoration: none; }
.fam-part .i { width: 17px; height: 17px; }
.fam-more { margin: 20px 4px 10px; font-size: 1.05rem; }
@media (max-width: 560px) {
  .fam-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fam-tile { min-height: 108px; padding: 14px; }
  .fam-units::before { left: 35px; }
  .fam-unit { padding: 12px; gap: 12px; }
  .fam-part { padding: 0 12px; font-size: 13.5px; }
}

/* Timetable on phones: day buttons with dates, the day as a heading, a card per child with numbered subjects. */
@media (max-width: 760px) {
  .tt-days label { gap: 0; padding: 8px 4px 7px; }
  .tt-days small { min-height: 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: uppercase; }
  .tt-days b { font: 700 1.25rem var(--display); line-height: 1.2; }
  .tt-days .tt-dot { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: #F5B312; }
  .tt-days label.free .tt-dot { background: transparent; }
  .tt-days label.today:not(:has(input:checked)) { border-color: var(--blue); }
  .tt-days label.today small { color: var(--blue); }
  .tt-days label:has(input:checked) .tt-dot { background: #F5B312; }
  .tt-days label.free:has(input:checked) .tt-dot { background: transparent; }
  .tt-dayhead { display: flex; align-items: center; gap: 10px; margin: 6px 4px 2px; font-size: 1.15rem; }
  .tt-kid-card { margin: 0; padding: 0; overflow: hidden; }
  .tt-kid-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
  .tt-kid-head .grow { min-width: 0; }
  .tt-kid-head b { display: block; font-size: 1.02rem; }
  .tt-kid-head small { color: var(--muted); font-size: 12.5px; }
  .tt-kid-head > .i:last-child { width: 18px; height: 18px; color: var(--faint); }
  .tt-lessons { margin: 0; padding: 4px 16px 12px; border-top: 1px solid var(--line); list-style: none; counter-reset: lesson; }
  .tt-lessons li { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--ink); font-weight: 600; counter-increment: lesson; }
  .tt-lessons li + li { border-top: 1px dashed var(--line); }
  .tt-lessons li::after { content: counter(lesson); margin-left: auto; color: var(--faint); font-size: 12px; font-weight: 700; }
  .tt-kid-card.is-off { background: #FAFAF7; box-shadow: none; }
  .tt-kid-card.is-off .tt-kid-head { opacity: .7; }
  .tt-rest { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
  .tt-rest .i { width: 18px; height: 18px; color: #F59E0B; }
  .tt-free { margin: 0; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { .tt-lessons li:only-child::after { content: none; } }

/* Notify parents: absent and late children, their parents and how each is reached, one message per status. */
.np-filter select { min-width: 170px; }
.np-counts { max-width: 560px; }
.np-group .card-head h2 { display: flex; align-items: center; gap: 8px; }
.np-pick { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; cursor: pointer; }
.np-pick input { flex: none; width: 20px; height: 20px; accent-color: var(--blue, #2563eb); }
.np-pick input:disabled + .avatar { opacity: .5; }
.np-pick .grow { min-width: 0; }
.np-parents { overflow-wrap: anywhere; }
.np-ok { color: var(--leaf); }
.np-weak { color: var(--amber); }
.np-none { color: var(--rose) !important; font-weight: 600; }
.np-msg label { display: grid; gap: 6px; margin: 10px 0 0; font-weight: 600; }
.np-msg textarea { width: 100%; resize: vertical; }
.np-msg p { margin: 0; }
@media (max-width: 760px) { .np-row { padding: 12px 14px; } .np-pick { gap: 10px; } }

/* Phone polish: one-line brand and a slimmer sticky header, every timetable day on screen. */
@media (max-width: 960px) {
  .top { padding: 10px 12px 12px; }
  .top-brand { min-width: 0; }
  .top-brand b { overflow: hidden; font-size: 1.15rem; white-space: nowrap; text-overflow: clip; }
  .top-brand img { width: 38px; height: 38px; }
  .top h1 { margin-bottom: 4px; font-size: 1.25rem; }
  .tt-days { overflow: visible; }
  .tt-days label { flex: 1 1 0; min-width: 0; padding: 8px 2px; }
}

/* Start-up card offering phone notifications: above the bottom tab bar on phones, bottom right on wider screens. */
.push-ask { position: fixed; z-index: 30; right: 12px; bottom: calc(104px + env(safe-area-inset-bottom)); left: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-up); animation: push-in .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.push-ask img { flex: none; object-fit: contain; }
.push-ask .grow { flex: 1; min-width: 0; }
.push-ask b { display: block; color: var(--ink); font-size: 15px; }
.push-ask p { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.push-ask-btns { display: flex; flex: 1 0 100%; gap: 8px; justify-content: flex-end; }
@media (min-width: 761px) { .push-ask { right: 24px; bottom: 24px; left: auto; width: 380px; } }
@keyframes push-in { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .push-ask { animation: none; } }

/* First visit: "Getting Ms. Bee ready", the one-time download of the app's own files, with a progress bar. */
.setup { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; transition: opacity .35s;
  background: radial-gradient(60vw 60vw at 10% 0%, rgba(255, 201, 60, .28), transparent 70%), radial-gradient(60vw 60vw at 100% 100%, rgba(99, 125, 255, .18), transparent 70%), var(--paper); }
.setup.done { opacity: 0; }
.setup-card { display: grid; justify-items: center; gap: 10px; width: min(340px, 100%); text-align: center; }
.setup-card img { object-fit: contain; animation: setup-bob 1.6s ease-in-out infinite; }
.setup-card h2 { margin: 6px 0 0; color: var(--ink); font: 700 1.45rem var(--display); }
.setup-card p { margin: 0 0 8px; color: var(--muted); }
.setup-bar { overflow: hidden; width: 100%; height: 10px; background: rgba(20, 40, 107, .08); border-radius: 99px; }
.setup-bar i { display: block; height: 100%; background: linear-gradient(90deg, #F5B312, #f59e0b 55%, #3f5bd8); border-radius: inherit; transform: scaleX(0); transform-origin: left; transition: transform .3s ease-out; }
.setup-pct { color: var(--ink); font: 600 1rem var(--display); font-variant-numeric: tabular-nums; }
@keyframes setup-bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

/* Tap feedback: a thin honey-to-blue bar along the top while the next page loads. Starts a moment late, so a page
   that was loaded ahead and opens at once never flashes it. */
html.leaving::before { content: ""; position: fixed; top: 0; left: 0; z-index: 300; width: 100%; height: 3px; background: linear-gradient(90deg, #F5B312, #3f5bd8);
  transform: scaleX(0); transform-origin: left; animation: leave-bar 3s cubic-bezier(.08, .8, .2, 1) .08s forwards; pointer-events: none; }
@keyframes leave-bar { to { transform: scaleX(.92); } }
@media (prefers-reduced-motion: reduce) { .setup-card img { animation: none; } }

/* No double-tap zoom anywhere (pinch is stopped in the viewport tag and app.js); panning and scrolling stay. The
   photo crop canvas keeps touch-action: none for its own drag and pinch. */
body, body * { touch-action: manipulation; }
.pdf-pages, .pdf-pages * { touch-action: pan-x pan-y; } /* two fingers zoom the PDF (app.js), never the page */

/* Teacher home. Each class: today's next job as one big button, the rest as four even tiles (4 across, 2 by 2 on a
   phone). Below: the teacher's submissions as numbers, then the three things to create. */
.class-main { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 12px; padding: 13px 16px; border-radius: 14px; font-size: 15px; }
.class-more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.class-more a { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 50px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.25; text-decoration: none; transition: background .15s, border-color .15s; }
.class-more a:hover { background: var(--blue-tint); border-color: transparent; }
.class-more .chip-icon { flex: none; }
a.badge { text-decoration: none; }
.home-label { margin: 22px 4px 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.subs-stats { margin-bottom: 6px; }
.subs-stats a.warn { border-color: #fecaca; }
.subs-stats a.warn b { color: var(--rose); }
.create-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.create-row a { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  color: var(--ink); font-size: 14px; font-weight: 600; text-align: center; text-decoration: none; transition: box-shadow .2s, transform .18s; }
.create-row a:hover { box-shadow: var(--shadow-up); transform: translateY(-2px); }
.create-row .chip-icon { width: 44px; height: 44px; border-radius: 14px; }
@media (min-width: 761px) { .class-main { display: inline-flex; width: auto; min-width: 240px; } }
@media (max-width: 760px) {
  .class-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-more a { font-size: 13.5px; }
  .create-row a { padding: 14px 6px 12px; font-size: 13px; }
}

/* Account menu: the avatar opens Settings and Log out, so the header keeps just three buttons. */
.me { position: relative; display: block; padding: 0; }
.me summary { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 5px; border-radius: 18px; color: var(--ink); cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.me summary::-webkit-details-marker { display: none; }
.me-caret { width: 15px; height: 15px; color: var(--faint); transform: rotate(90deg); transition: transform .2s; }
.me[open] .me-caret { transform: rotate(-90deg); }
.me-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; display: grid; gap: 2px; width: 250px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-up); }
.me-id { margin: 0 0 4px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); }
.me-id b, .me-id small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-id small { color: var(--muted); font-size: 12.5px; }
.me-menu a, .me-menu button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; margin: 0; padding: 11px 10px; background: none; border: 0; border-radius: 12px; box-shadow: none;
  color: var(--ink); font: 600 14px Figtree, system-ui, sans-serif; text-align: left; text-decoration: none; cursor: pointer; }
.me-menu .i { width: 18px; height: 18px; color: var(--faint); }
.me-menu a:hover { background: var(--paper); }
.me-menu form { margin: 0; }
.me-menu .me-out { color: var(--rose); }
.me-menu .me-out .i { color: var(--rose); }
.me-menu .me-out:hover { background: var(--rose-tint); }

/* Log out at the end of the side menu (the phone's Menu tab opens it). */
.nav-out-form { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.side nav .nav-out { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 42px; margin: 0; padding: 9px 12px; background: none; border: 0; border-radius: 14px; box-shadow: none;
  color: var(--rose); font: 600 14.5px Figtree, system-ui, sans-serif; text-align: left; cursor: pointer; }
.side nav .nav-out .i { width: 19px; height: 19px; color: var(--rose); }
.side nav .nav-out:hover { background: var(--rose-tint); }
.side-collapsed .side nav .nav-out { justify-content: center; padding: 9px 0; }
.side-collapsed .side nav .nav-out span { display: none; }

/* Roll call: a warning only for a child who has missed 2 or more days lately (no line for everyone else). */
.roll-row .roll-warn { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; color: var(--amber); font-weight: 600; }
.roll-row .roll-warn .i { width: 14px; height: 14px; }
/* Roll call on a phone: a compact top, one line per child with a small P | L | A switch on the right, and no
   floating bee over the list. */
@media (max-width: 760px) {
  body:has(form.roll) .crumbs, body:has(form.roll) .ai-fab { display: none; }
  body:has(form.roll) main { padding-top: 10px; }
  .roll-head { flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .roll-head .class-switch { gap: 10px; }
  .roll-head .cls-badge { width: 36px; height: 36px; border-radius: 11px; }
  .roll-head .cls-badge .i { width: 19px; height: 19px; }
  .roll-head .class-switch small { display: none; }
  .roll-head .day-nav { width: 100%; }
  .roll-summary { gap: 8px 10px; padding: 10px 12px; }
  .roll-progress b { font-size: 1.15rem; }
  .roll-summary li { padding: 3px 9px; }
  .roll-summary [data-all] { padding: 9px 12px; }
  .roll-row { flex-wrap: nowrap; gap: 10px; padding: 8px 10px 8px 8px; }
  .roll-row .avatar { flex: none; width: 34px; height: 34px; font-size: 12.5px; }
  .roll-row .grow { min-width: 0; }
  .roll-row b { display: block; overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
  .roll-row .strip { display: none; }
  .marks { width: auto; grid-template-columns: repeat(3, 44px); gap: 2px; padding: 2px; border-radius: 12px; }
  .mark span { height: 40px; padding: 0; border-radius: 10px; }
  .mark span .i { width: 19px; height: 19px; }
  .mark em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Messages list: title with a pencil to start a new message, a search box once there are a few conversations, and
   unread conversations in bold. On phones: a full-width list with dividers, the pencil as a round button above the
   bottom bar, no breadcrumbs or bee. */
.inbox-head .ih-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inbox-head .compose { flex: none; color: var(--blue); }
.inbox-search { margin: 0; }
.inbox-none { margin: 0; padding: 14px 18px; }
.threads a.unread b { font-weight: 800; }
.threads a.unread .t-last { color: var(--ink); font-weight: 600; }
.threads a.unread .t-top small { color: var(--blue); font-weight: 700; }
.compose-page { display: grid; gap: 14px; }
.compose-page .search-big { margin: 0; }
.compose-page .start-list a { border-style: solid; }
@media (max-width: 760px) {
  body:has(.chat-layout.list-only) .crumbs, body:has(.compose-page) .crumbs,
  body:has(.chat-layout.list-only) .ai-fab, body:has(.compose-page) .ai-fab { display: none; }
  body:has(.chat-layout.list-only) main, body:has(.compose-page) main { padding-top: 8px; }
  .chat-layout.list-only .inbox { margin: 0 -12px; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .chat-layout.list-only .inbox-head { padding: 12px 16px 10px; }
  .chat-layout.list-only .threads { padding: 0; }
  .chat-layout.list-only .threads li + li { border-top: 1px solid var(--line); }
  .chat-layout.list-only .threads a { padding: 12px 16px; border-radius: 0; }
  .chat-layout.list-only .inbox-head .compose { position: fixed; right: 16px; bottom: calc(66px + var(--safe-b, 0px) + 16px); z-index: 20; width: 56px; height: 56px;
    background: var(--blue); border: 0; border-radius: 18px; box-shadow: 0 10px 24px rgba(47, 71, 184, .35); color: #fff; }
  .chat-layout.list-only .inbox-head .compose .i { width: 24px; height: 24px; }
  body:has(.chat-layout.list-only) .shell { padding-bottom: calc(76px + var(--safe-b, 0px) + 72px); } /* the last row clears the round button, below the list, not inside it */
}
main > .chat-layout { animation: none; } /* a finished slide-in keeps a transform, which would pin the round pencil to the list instead of the screen */
@media (max-width: 760px) { body:has(.chat-layout.list-only) .top .clock, body:has(.compose-page) .top .clock { display: none; } }

/* Phones, every page: no "Home > page" breadcrumb on main pages (deeper pages keep theirs, with Back), and the AI bee
   only on Home (Ms. Bee AI is in the menu). */
@media (max-width: 760px) {
  .crumbs.top-level { display: none; }
  .ai-fab.off-home { display: none; }
}
/* Students: search and the Grid/List switch on one line on phones (icons only); list rows show the class under the
   name and a > to say they open. */
.stu-cls-m { display: none; }
.stu-today { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.stu-today > .i { display: none; width: 18px; height: 18px; color: var(--faint); }
@media (max-width: 760px) {
  .toolbar:has(.view-toggle) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .toolbar:has(.view-toggle) .search-big { flex: 1 1 0; min-width: 0; margin: 0; }
  .toolbar:has(.view-toggle) .class-switch, .toolbar:has(.view-toggle) .toolbar-end { flex-basis: 100%; order: 3; } /* search and switch stay on the first line */
  .toolbar .view-toggle { margin-left: 0; }
  .toolbar .view-toggle a { padding: 9px 10px; }
  .toolbar .view-toggle a span { display: none; }
  .stu-cls-m { display: inline; }
  .stu-today > .i { display: block; }
}

/* Header back arrow: phones only, on pages below a main page (it replaces the breadcrumb bar there). */
.top-back { display: none; }
@media (max-width: 760px) {
  .crumbs { display: none; }
  .top-back { display: grid; flex: none; }
  .top:has(.top-back) .top-brand { display: none; }
  .top:has(.top-back) .tools { margin-left: auto; }
}
/* Student profile. Phones: three tabs (Overview, Academics, Info & family) instead of one long page; the name is in
   the top bar, so the card under it skips it. Wider screens: everything at once, as before. */
.ptabs { display: none; }
.no-health { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; font-size: 13.5px; }
.no-health .i { flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--leaf); }
@media (max-width: 760px) {
  .ptabs { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 0 14px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
  .ptabs label { position: relative; margin: 0; } /* keeps the hidden radio inside, or the page scrolls sideways */
  .ptabs input { position: absolute; opacity: 0; pointer-events: none; }
  .ptabs span { display: block; padding: 10px 4px; border-radius: 12px; color: var(--muted); font-size: 13.5px; font-weight: 700; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .ptabs input:checked + span { background: var(--blue); color: #fff; }
  .ptabs input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); }
  body:has(#pt-o:checked) [data-panel]:not([data-panel="o"]),
  body:has(#pt-a:checked) [data-panel]:not([data-panel="a"]),
  body:has(#pt-i:checked) [data-panel]:not([data-panel="i"]) { display: none; }

}

/* Materials. Subjects open and close (the first in each grade starts open); each unit shows what it covers. */
.subj-group > summary { cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.subj-group > summary::-webkit-details-marker { display: none; }
.subj-group > summary > .i { flex: none; width: 17px; height: 17px; margin-left: 4px; color: var(--faint); transform: rotate(90deg); transition: transform .2s; }
.subj-group:not([open]) > summary > .i { transform: none; }
.lib-main .subj-group:not([open]) > .subj-head { margin-bottom: 0; }
.unit-topic { margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.lib-filter-btn, .grade-chips, .lib-fab { display: none; }
main > .lib { animation: none; } /* keeps the round New button fixed to the screen, not the list */
/* Phones: one row (search, filters, view), grade chips, flat sections, and New material as a round button. */
@media (max-width: 760px) {
  .lib-side > summary { display: none; }
  .lib-side:not([open]) { display: none; }
  .lib-bar { flex-wrap: nowrap; gap: 8px; padding: 8px; }
  .lib-bar .search-big input { height: 44px; font-size: 15px; }
  .lib-bar .lib-new { display: none; }
  .lib-filter-btn { position: relative; display: grid; flex: none; width: 44px; height: 44px; }
  .lib-filter-btn i { position: absolute; top: -4px; right: -4px; min-width: 18px; padding: 0 4px; border: 2px solid #fff; border-radius: 9px; background: var(--ink); color: #fff; font: 700 10px/14px Figtree, system-ui; font-style: normal; text-align: center; }
  .lib-bar .view-toggle .icon-btn { width: 36px; height: 38px; }
  .grade-chips { display: flex; gap: 8px; margin: 0 -12px; padding: 2px 12px 4px; overflow-x: auto; scrollbar-width: none; }
  .grade-chips::-webkit-scrollbar { display: none; }
  .grade-chips a { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 99px; color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .grade-chips a b { padding: 0 6px; background: #F1F5F9; border-radius: 99px; color: var(--muted); font-size: 11px; }
  .grade-chips a.on { background: #F5B312; border-color: #F5B312; color: #3D2600; }
  .grade-chips a.on b { background: rgba(255, 255, 255, .55); color: #3D2600; }
  .lib-main .grade-group { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .lib-main .grade-group > .grade-head { margin: 4px 2px 8px; padding: 0; border: 0; }
  .lib-main .subj-group { padding: 0; background: none; border: 0; border-radius: 0; }
  .lib-main .subj-group + .subj-group { margin-top: 0; }
  .lib-main .subj-group > .subj-head { margin: 0; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .lib-main .subj-group[open] > .subj-head { margin-bottom: 10px; }
  .lib-fab { position: fixed; right: 16px; bottom: calc(66px + var(--safe-b, 0px) + 16px); z-index: 20; display: grid; place-items: center; width: 56px; height: 56px;
    background: var(--blue); border-radius: 18px; box-shadow: 0 10px 24px rgba(47, 71, 184, .35); color: #fff; }
  .lib-fab .i { width: 26px; height: 26px; }
  body:has(.lib-fab) .shell { padding-bottom: calc(76px + var(--safe-b, 0px) + 72px); }
}

/* When a PDF can't be drawn in the page: a short note and a button to open it in the phone's own viewer. */
.pdf-fail { display: grid; justify-items: center; gap: 12px; padding: 36px 18px; text-align: center; }
.pdf-fail p { margin: 0; color: var(--muted); }

/* Forms: clip the rounded corners without making the card its own scroll box ("overflow: hidden" does), so the save
   bar sticks to the screen above the bottom bar instead of floating up inside the card. */
.form-card { overflow: clip; }
@media (max-width: 760px) {
  .form-actions { padding: 12px 16px; }
  .form-actions > a.btn.secondary { flex: 0 0 auto; } /* Cancel stays its own size; the main button gets the rest */
  .form-actions .btn, .form-actions button { white-space: nowrap; }
}

/* Ms. Bee AI. One bar on top (saved chats, the title, about, new chat), the conversation in the middle, the question
   box under it. Starter questions all the same shape. */
.ai-head { gap: 8px; padding: 10px 12px; background: #fff; }
.ai-head .ai-title { min-width: 0; overflow: hidden; color: var(--ink); font: 600 1.1rem var(--display); text-overflow: ellipsis; white-space: nowrap; }
.ai-head img { width: 36px; height: 36px; }
.ai-head .ai-newbtn { display: grid; }
.ai-info { position: relative; }
.ai-info > summary { list-style: none; cursor: pointer; }
.ai-info > summary::-webkit-details-marker { display: none; }
.ai-info > summary span { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 50%; font: 700 13px/1 Georgia, serif; }
.ai-info-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(300px, 80vw); padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-up); font-size: 13.5px; line-height: 1.45; }
.ai-info-pop p { margin: 0 0 8px; }
.ai-info-pop p:last-child { margin: 0; }
.ai-try { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); justify-content: stretch; }
.ai-try .chip { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; text-align: left; }
.ai-low { margin: 0 0 12px; padding: 10px 12px; background: var(--amber-tint); border-radius: 12px; color: var(--amber); font-size: 13.5px; font-weight: 600; text-align: left; }
.ai-low-bar { margin: 0; border-radius: 0; }
.ai-tools .ai-act { margin: 0; }
.ai-gauge { overflow: hidden; height: 10px; margin: 6px 0 8px; background: #EEF1F7; border-radius: 99px; }
.ai-gauge i { display: block; height: 100%; background: linear-gradient(90deg, #7b91f5, var(--blue)); border-radius: inherit; }
.ai-gauge.low i { background: var(--rose); }
/* Phones: the AI page fills the screen between the top and the bottom bar; only the conversation scrolls, and the
   question box stays pinned above the bottom bar (above the keyboard while typing). */
@media (max-width: 760px) {
  body:has(.ai-wrap) .top { display: none; }
  .ai-chat { position: fixed; top: 0; right: 0; bottom: calc(66px + var(--safe-b, 0px)); left: 0; z-index: 11; min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .ai-head { flex: none; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px; box-shadow: 0 1px 0 var(--line); }
  .ai-log { min-height: 0; padding: 16px 14px 20px; overscroll-behavior: contain; }
  .ai-hello { margin: 0; }
  .ai-try { grid-template-columns: minmax(0, 1fr); }
  .ai-form { flex: none; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(24, 34, 74, .06); }
  .typing .ai-chat { bottom: 0; }
}

/* AI answers: full width (no bee beside them), the answer key folded, and one tidy row of tools: Copy and Print as
   icons, then the buttons that take the answer somewhere, all the same height and never wrapping. */
.ai-msg.assistant { max-width: min(680px, 100%); }
.ai-msg.assistant img { display: none; }
.ai-key { margin: 10px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ai-key > summary { padding: 10px 12px; color: var(--ink); font-weight: 700; cursor: pointer; list-style: none; }
.ai-key > summary::-webkit-details-marker { display: none; }
.ai-key > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--muted); transition: transform .2s; }
.ai-key[open] > summary::before { transform: rotate(90deg); }
.ai-key > :not(summary) { margin: 0 12px 10px; }
.ai-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ai-tools .ai-icon { width: 38px; height: 38px; border-radius: 11px; }
.ai-tools .ai-icon .i { width: 17px; height: 17px; }
.ai-tools .ai-icon.done { color: var(--leaf); }
.ai-tools .ai-act { display: inline-flex; flex: 1 1 calc(50% - 4px); order: 1; align-items: center; justify-content: center; min-width: 0; height: 40px; margin: 0; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-tools .ai-icon { order: 2; } /* the ways to use the answer side by side on top, Copy and Print under them */
@media print { body.print-one .print-me .ai-key > summary { display: none; } body.print-one .print-me .ai-key { border: 0; } }

/* AI header: the fixed name on top, the session (chat) name under it. */
.ai-head .ai-titles { display: grid; min-width: 0; line-height: 1.15; }
.ai-head .ai-title { overflow: hidden; font: 600 1rem var(--display); text-overflow: ellipsis; white-space: nowrap; }
.ai-head .ai-session { overflow: hidden; color: var(--muted); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

/* Session form: subject as tappable tiles with an icon, instead of a long dropdown. */
.subj-pick { margin: 0 0 16px; padding: 0; border: 0; }
.subj-pick legend { margin-bottom: 8px; padding: 0; font-size: 13.5px; font-weight: 600; }
.subj-pick > div { display: flex; flex-wrap: wrap; gap: 8px; }
.subj-pick label { position: relative; margin: 0; }
.subj-pick input { position: absolute; opacity: 0; pointer-events: none; }
.subj-pick label > span { display: flex; align-items: center; gap: 7px; padding: 5px 14px 5px 5px; border: 1.5px solid var(--input); border-radius: 99px; font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.subj-pick label > span:hover { border-color: var(--accent); }
.subj-pick input:checked + span { border-color: var(--accent); background: #FFFBEB; box-shadow: 0 0 0 1px var(--accent); }
.subj-pick input:focus-visible + span { outline: 3px solid rgba(63, 91, 216, .45); }
.subj-pick .chip-icon { width: 28px; height: 28px; border-radius: 99px; }
/* Once a subject is picked the list folds to that one pill plus "Change" (app.js folds it again after the next pick). */
.subj-pick:has([name=subject]:checked):not(:has([data-subj-more]:checked)) label:not(:has(:checked)):not(.subj-more) { display: none; }
.subj-pick:not(:has([name=subject]:checked)) .subj-more { display: none; }
.subj-pick .subj-more > span, .subj-pick .subj-more input:checked + span { padding: 5px 14px; background: none; border-style: dashed; box-shadow: none; color: var(--muted); }
.subj-pick .subj-more .i { width: 15px; height: 15px; }

/* "i" buttons on the session form, and their popups (native popover: centred above the page, never cut off). */
.info-btn { display: inline-grid; place-items: center; width: 20px; height: 20px; min-height: 0; margin: 0 0 0 4px; padding: 0; background: none; border: 1.5px solid #94A3B8; border-radius: 50%; box-shadow: none; color: #64748B; font: italic 700 12px/1 Georgia, serif; vertical-align: 1px; }
.info-btn:hover { background: #FFFBEB; border-color: var(--accent); color: var(--ink); }
.info-btn::after { content: ''; position: absolute; inset: -12px; } /* a 44px tap area around the small circle */
.info-btn { position: relative; }
.tip-pop { width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 16px 18px 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 50px rgba(24, 34, 74, .25); color: var(--ink); font-size: 14.5px; line-height: 1.5; }
.tip-pop::backdrop { background: rgba(15, 23, 42, .28); }
.tip-pop header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.tip-pop h3 { margin: 0; font-size: 1.05rem; }
.tip-pop header .icon-btn { width: 36px; height: 36px; min-height: 0; padding: 0; }
.tip-pop p { margin: 0 0 8px; }
.tip-list { display: grid; gap: 2px 0; margin: 0 0 4px; }
.tip-list dt { margin-top: 6px; font-weight: 700; }
.tip-list dd { margin: 0; color: #475569; }
.tip-pop > a { display: inline-block; margin-top: 8px; color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Ms. Bee video player (app.js builds the controls). Dark frame, amber seek bar, controls fade while playing. */
.vp { position: relative; overflow: hidden; background: #0F172A; border-radius: 14px; outline: none; aspect-ratio: 16 / 9; max-height: 70vh; color: #fff; }
.vp:focus-visible { box-shadow: 0 0 0 3px rgba(245, 158, 11, .6); }
.vp video { display: block; width: 100%; height: 100%; object-fit: contain; background: #0F172A; }
.vp.full { max-height: none; border-radius: 0; aspect-ratio: auto; }
.vp button { min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; color: #fff; }
.vp button:hover { background: rgba(255, 255, 255, .14); }
.vp .i { width: 22px; height: 22px; }
.vp-big { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50% !important;
  background: rgba(245, 158, 11, .95) !important; color: #1E293B !important; box-shadow: 0 8px 24px rgba(0, 0, 0, .35) !important; transform: translate(-50%, -50%); transition: opacity .2s, transform .15s; }
.vp-big .i { width: 30px; height: 30px; margin-left: 4px; fill: currentColor; }
.vp-big:hover { transform: translate(-50%, -50%) scale(1.06); }
.vp.playing .vp-big { opacity: 0; pointer-events: none; }
.vp-bar { position: absolute; inset: auto 0 0; padding: 26px 12px 8px; background: linear-gradient(transparent, rgba(15, 23, 42, .85)); transition: opacity .25s; }
.vp.playing:not(.awake) .vp-bar { opacity: 0; }
.vp.playing:not(.awake) { cursor: none; }
.vp-row { display: flex; align-items: center; gap: 4px; }
.vp-row button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; }
.vp-row [data-vp="play"] .i { fill: currentColor; }
.vp-row small { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 1px; font-size: 7.5px; font-weight: 800; pointer-events: none; }
.vp-time { margin-left: 6px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-speed { width: auto !important; padding: 0 8px !important; font-size: 13px; font-weight: 700; }
.vp-seek { display: block; width: 100%; height: 18px; margin: 0 0 4px; padding: 0; background: none; border: 0; -webkit-appearance: none; appearance: none; cursor: pointer; }
.vp-seek::-webkit-slider-runnable-track { height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #F59E0B var(--played, 0%), rgba(255, 255, 255, .55) var(--played, 0%) var(--loaded, 0%), rgba(255, 255, 255, .25) var(--loaded, 0%)); }
.vp-seek::-moz-range-track { height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #F59E0B var(--played, 0%), rgba(255, 255, 255, .55) var(--played, 0%) var(--loaded, 0%), rgba(255, 255, 255, .25) var(--loaded, 0%)); }
.vp-seek::-webkit-slider-thumb { width: 15px; height: 15px; margin-top: -5px; background: #F59E0B; border: 2px solid #fff; border-radius: 50%; -webkit-appearance: none; appearance: none; }
.vp-seek::-moz-range-thumb { width: 13px; height: 13px; background: #F59E0B; border: 2px solid #fff; border-radius: 50%; }
.vp-spin { position: absolute; inset: 50% auto auto 50%; display: none; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #F59E0B; border-radius: 50%; animation: vp-spin .8s linear infinite; }
.vp.loading .vp-spin { display: block; }
@keyframes vp-spin { to { transform: rotate(360deg); } }
.vp-err { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; background: rgba(15, 23, 42, .9); font-size: 14px; text-align: center; }
.vp-err[hidden] { display: none; }
@media (max-width: 560px) {
  .vp-row { gap: 0; }
  .vp-row button { width: 36px; height: 36px; }
  .vp-time { font-size: 12px; margin-left: 2px; }
  .vp-big { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) { .vp-spin { animation-duration: 2.4s; } }

/* ---------- Student profile (2026-12): a navy "student card" header with a honeycomb weave, today's status as the
   ring round the photo, teachers as an avatar stack that opens into the full list, four equal action tiles with their
   counts, and the last 30 days as a honeycomb: one cell a day, honey for present. ---------- */
.card.sp-hero { margin-bottom: 16px; padding: 0; overflow: visible; border-radius: 24px; }
.sp-band { position: relative; display: flex; align-items: center; gap: 20px; padding: 24px 26px 22px; border-radius: 23px 23px 0 0; color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z' fill='%23ffffff' fill-opacity='.07' fill-rule='evenodd'/%3E%3C/svg%3E"),
    radial-gradient(circle at 94% -10%, rgba(255, 201, 60, .42), transparent 46%),
    linear-gradient(135deg, #22336f, #18224a 62%); }
.sp-photo { --ring: rgba(255, 255, 255, .35); position: relative; flex: none; padding: 4px; border-radius: 50%; background: var(--ring); box-shadow: 0 10px 26px rgba(6, 12, 40, .35); }
.sp-photo.st-present { --ring: #34d399; } .sp-photo.st-late { --ring: #fbbf24; } .sp-photo.st-absent { --ring: #fb7185; }
.sp-photo .avatar.xl { width: 92px; height: 92px; border: 3px solid #1b2856; box-shadow: none; font-size: 30px; }
.sp-id { min-width: 0; }
.sp-hero .sp-name { margin: 0; color: #fff; font: 700 1.85rem/1.08 "Baloo 2", var(--display); letter-spacing: .005em; overflow-wrap: anywhere; }
.sp-meta { margin: 4px 0 12px; color: rgba(255, 255, 255, .74); font-size: 14px; font-weight: 600; }
.sp-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-size: 12.5px; font-weight: 700; }
.sp-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.sp-status.st-present::before { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25); }
.sp-status.st-late::before { background: #fbbf24; } .sp-status.st-absent::before { background: #fb7185; }
.sp-status.st-gone { margin-left: 4px; background: rgba(251, 113, 133, .16); }
.sp-body { padding: 18px 22px 22px; }
.sp-roster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sp-cell { min-width: 0; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.sp-cell > small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.sp-classes { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sp-classes span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 14.5px; font-weight: 700; }
.sp-classes .i { width: 17px; height: 17px; color: var(--blue); }
.sp-teach > summary, .sp-teach.one { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sp-teach > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sp-teach > summary::-webkit-details-marker { display: none; }
.sp-teach b, .sp-teach small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-teach b { color: var(--ink); font-size: 14.5px; }
.sp-teach small { color: var(--muted); font-size: 12.5px; }
.sp-teach span:not(.sp-stack) { min-width: 0; }
.sp-teach > summary > .i { flex: none; width: 18px; height: 18px; color: var(--faint); transform: rotate(90deg); transition: transform .2s; }
.sp-teach[open] > summary > .i { transform: rotate(-90deg); }
.sp-stack { display: flex; flex: none; }
.sp-stack .avatar { width: 32px; height: 32px; border: 2px solid var(--paper); font-size: 10.5px; letter-spacing: -.02em; }
.sp-stack .avatar + .avatar { margin-left: -7px; }
.sp-teach ul { margin: 12px 0 0; padding: 0; list-style: none; }
.sp-teach li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.sp-teach li b { flex: 1; font-size: 14px; }
.sp-teach .tag { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--sun-tint); color: var(--sun-ink); font-size: 11.5px; font-weight: 700; }
.sp-none { margin: 0; font-size: 13.5px; }
.sp-actions { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.sp-act, .sp-ai > summary.sp-act { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 78px; height: 100%;
  padding: 12px 6px; background: #fff; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.2;
  text-align: center; text-decoration: none; white-space: normal; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .18s ease, box-shadow .2s, border-color .2s; }
.sp-act:hover { border-color: #cfd6f3; box-shadow: var(--shadow-up); transform: translateY(-2px); }
.sp-act:active { transform: scale(.97); }
.sp-act .i { width: 23px; height: 23px; color: var(--blue); }
.sp-act.primary { background: linear-gradient(160deg, #4d68e6, var(--blue-deep)); border-color: transparent; color: #fff; box-shadow: 0 10px 22px rgba(63, 91, 216, .3); }
.sp-act.primary .i { color: #fff; }
.sp-act em { position: absolute; top: 7px; right: 7px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--sun); color: #18224a; font: 700 11.5px/21px Figtree, system-ui, sans-serif; font-style: normal; }
.sp-ai { display: grid; }
.sp-ai[open] > summary.sp-act { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.sp-hero .ai-menu-pop { left: auto; right: 0; }

.sp-eyebrow { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.sp-today .card-head h2 { margin: 0; }
.sp-note { position: relative; margin: 2px 0 0; padding: 14px 16px 12px 46px; background: var(--sun-tint); border-radius: 16px; color: var(--ink); }
.sp-note::before { content: "\201C"; position: absolute; top: 2px; left: 14px; color: #e3a500; font: 700 46px/1 "Baloo 2", Georgia, serif; }
.sp-note p { margin: 0; font-size: 15px; line-height: 1.5; }
.sp-note small { display: block; margin-top: 8px; color: var(--sun-ink); font-size: 12px; font-weight: 700; }
.sp-empty { display: flex; align-items: center; gap: 9px; margin: 0; }
.sp-empty .i { width: 18px; height: 18px; color: var(--faint); }

.sp-month-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sp-month-head h2 { margin: 0 0 2px; }
.sp-month-head small { color: var(--muted); font-size: 12.5px; }
.sp-rate { flex: none; text-align: right; }
.sp-rate b { display: block; color: var(--ink); font: 700 2.1rem/1 "Baloo 2", var(--display); font-variant-numeric: tabular-nums; }
.sp-rate small { font-weight: 600; }
.comb { --g: 5px; --w: calc((100cqw - 9 * var(--g)) / 10.5); max-width: 470px; container-type: inline-size; }
.comb-row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: var(--g); }
.comb-row:nth-child(odd) { padding-right: calc(var(--w) / 2); }
.comb-row:nth-child(even) { padding-left: calc(var(--w) / 2); }
.comb-row + .comb-row { margin-top: calc(var(--w) * -.2887 + var(--g) * .866); }
.comb i, .sp-month-foot i { display: block; aspect-ratio: 1 / 1.1547; background: #eceff6; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.comb i { animation: comb-in .35s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(var(--i) * 14ms + .1s); }
.comb i.present, .sp-month-foot i.present { background: linear-gradient(160deg, #ffd65e, #f2ad00); }
.comb i.late, .sp-month-foot i.late { background: linear-gradient(160deg, #ffa25a, #e8701a); }
.comb i.absent, .sp-month-foot i.absent { background: linear-gradient(160deg, #f87189, #dc2f4f); }
.comb i.now { background-image: radial-gradient(circle, #18224a 0 17%, transparent 19%), linear-gradient(160deg, #ffd65e, #f2ad00); }
.comb i.now.none { background-image: radial-gradient(circle, #18224a 0 17%, transparent 19%); }
.comb i.now.late { background-image: radial-gradient(circle, #18224a 0 17%, transparent 19%), linear-gradient(160deg, #ffa25a, #e8701a); }
.comb i.now.absent { background-image: radial-gradient(circle, #fff 0 17%, transparent 19%), linear-gradient(160deg, #f87189, #dc2f4f); }
@keyframes comb-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.sp-month-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; color: var(--muted); font-size: 12.5px; }
.sp-month-foot span { display: inline-flex; align-items: center; gap: 6px; }
.sp-month-foot i { width: 11px; }
.sp-month-foot b { color: var(--ink); }

@media (min-width: 900px) {
  .sp-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
  .sp-roster { margin: 0; }
}
@media (max-width: 760px) {
  body:has(.sp-hero) .top h1 { display: none; }
  .sp-band { gap: 16px; padding: 20px 18px 18px; }
  .sp-photo .avatar.xl { width: 74px; height: 74px; font-size: 25px; }
  .sp-hero .sp-name { font-size: 1.5rem; }
  .sp-meta { margin-bottom: 10px; font-size: 13px; }
  .sp-body { padding: 14px 14px 16px; }
  .sp-roster { grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
  .sp-roster .sp-cell { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; padding: 11px 14px; background: none; border: 0; border-radius: 0; }
  .sp-roster .sp-cell + .sp-cell { border-top: 1px solid var(--line); }
  .sp-roster .sp-cell > small { margin: 0; }
  .sp-actions { gap: 8px; }
  .sp-act, .sp-ai > summary.sp-act { min-height: 72px; padding: 10px 4px; border-radius: 16px; font-size: 12px; }
  .sp-act .i { width: 21px; height: 21px; }
  .sp-rate b { font-size: 1.8rem; }
}

/* Notify parents (2026-12): one place for every way to reach families. */
.np-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.np-card { display: flex; flex-direction: column; gap: 12px; }
.np-card-body { flex: 1; }
.np-card .btn { align-self: flex-start; }
.np-big { margin: 0; color: var(--muted); }
.np-big b { font-size: 30px; color: var(--ink); margin-right: 4px; }
.np-days, .np-kids { margin: 8px 0 0; font-size: 14px; line-height: 1.7; }
.np-fees, .np-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.np-fees li, .np-recent li { display: grid; gap: 2px; }
.np-fees small, .np-recent small { color: var(--muted); }
.np-recent span { font-size: 13.5px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .np-low { grid-template-columns: 1fr; } }

/* ---------- UI audit, 3 Dec 2026 (PC 1440px and iPhone 13) ---------- */
/* One selected look everywhere: solid blue, white text. */
.kid-switch button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); }
.tt-days label:has(input:checked) { background: var(--blue); border-color: var(--blue); }
.tt-days label:has(input:checked) small { color: rgba(255, 255, 255, .85); }
.lib-tabs a.on { background: var(--blue); color: #fff; }
.lib-tabs a.on b { background: rgba(255, 255, 255, .22); color: #fff; }
.lib-opt.on { background: var(--blue); color: #fff; }
.lib-opt.on b { background: #fff; color: var(--blue); }
/* Lone words at the end of a line ("2026", "soon.", "month") pulled up with their neighbours. */
p, small, li, dd, h1, h2, h3, .stat-value { text-wrap: pretty; }
.prog-price small, .stat-value small, .form-actions > .muted { white-space: nowrap; }
/* Guardian and address boxes: fields sit inside the border, not on it. */
fieldset.guardian, fieldset.addr { padding: 12px 16px 16px; }
fieldset.guardian > legend, fieldset.addr > legend { padding: 0 6px; }
/* Analytics learning levels: the same colours as the legend above, numbers readable. */
.dist-bar i.lv1 { background: var(--rose-tint); color: var(--rose); }
.dist-bar i.lv2 { background: var(--amber-tint); color: var(--amber); }
.dist-bar i.lv3 { background: var(--blue-tint); color: var(--blue); }
.dist-bar i.lv4 { background: var(--leaf-tint); color: var(--leaf); }
.dist-bar i + i { border-left: 2px solid #fff; }
/* Materials: tags never squeeze into tall pills, and on phones the review status gets its own line. */
.doc-tags .tag { flex: none; white-space: nowrap; }
@media (max-width: 640px) {
  .lib.as-list .doc:not(.unit-card) .doc-top .badge { grid-column: 2 / -1; grid-row: 3; margin: 0; }
  .lib.as-list .doc:not(.unit-card) .doc-foot { grid-row: 4; }
}
/* Side menu on laptop screens: a smaller logo so more of the menu fits. */
@media (max-height: 960px) and (min-height: 761px) and (min-width: 961px) { .side > .brand img.logo-full { width: 150px; } }
/* Save bars on short forms stay in place instead of floating over the fields above them. */
.form-actions.in-flow { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
/* Three-figure rows (fees) on phones: one line each, label left and amount right, so "Birr" never wraps. */
@media (max-width: 480px) {
  .mini-stats.three { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mini-stats.three > * { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
  .mini-stats.three b { font-size: 1.3rem; white-space: nowrap; }
}
/* Attendance on phones: a short word under each icon, so Late is not just a clock. */
@media (max-width: 560px) {
  .roll-row .marks { grid-template-columns: repeat(3, 50px); }
  .roll-row .mark span { flex-direction: column; gap: 1px; height: 44px; }
  .roll-row .mark span .i { width: 17px; height: 17px; }
  .roll-row .mark em { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 10px; font-weight: 700; line-height: 1; }
}
/* Program choice on the student form: the same solid blue as every other selected option. */
.plan input:checked + span { border-color: var(--blue); background: var(--blue); box-shadow: 0 4px 12px rgba(63, 91, 216, .28); color: #fff; }
.plan input:checked + span b { color: #fff; }
/* Programs page: cards of different heights pack into columns, with no holes between them. */
.prog-grid { display: block; columns: 2 340px; column-gap: 16px; }
.prog-grid > * { margin: 0 0 16px; break-inside: avoid; }
/* Wide tables (analytics): the first column stays put while the rest scrolls sideways, and headings stay on one line. */
.heat-table th { white-space: nowrap; }
.heat-table td:first-child, .heat-table th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; white-space: nowrap; }
/* Phone forms: while a save bar is pinned to the bottom, the tab bar steps aside (Cancel and Back still lead out),
   so the form gets the screen. Attendance keeps the tab bar: it is where teachers move between classes. */
@media (max-width: 760px) {
  html:has(main .form-actions:not(.in-flow)):not(:has(.roll)) .tabbar { display: none; }
  html:has(main .form-actions:not(.in-flow)):not(:has(.roll)) main .form-actions { bottom: 0; }
  html:has(main .form-actions:not(.in-flow)):not(:has(.roll)) .shell { padding-bottom: 16px; }
}
/* Dashboard trend chart on phones: axis labels big enough to read once the chart is scaled down. */
@media (max-width: 560px) { .trend .tt { font-size: 19px; } }
.pick-chips label[hidden] { display: none; }
.form-actions > .grow.muted { flex: 1 0 auto; } /* the "0 of 41 ticked" counter keeps its full width; buttons wrap below if needed */

/* ---------- UI round 3, 3 Dec 2026 ---------- */
/* Phone header on inner pages: one slim row (back arrow or bee, the page title, then the icons) instead of a
   logo row over a title row. The home page keeps its two-row greeting. */
@media (max-width: 760px) {
  .top:not(:has(.clock.on-phone)) { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 8px 10px; }
  .top:not(:has(.clock.on-phone)) .top-brand { flex: none; }
  .top:not(:has(.clock.on-phone)) .top-brand b { display: none; }
  .top:not(:has(.clock.on-phone)) .title { order: 0; flex: 1 1 auto; flex-basis: auto; min-width: 0; padding: 0 2px; }
  .top:not(:has(.clock.on-phone)) h1 { margin: 0; overflow: hidden; font-size: 1.12rem; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
  .top:not(:has(.clock.on-phone)) .tools { flex: none; margin-left: 0; gap: 6px; }
  .top .me-caret { display: none; }
  .top .me summary { padding: 3px; }
}
/* Notify hub: switched-off actions and the reach warning */
.btn.is-off { opacity: .5; cursor: not-allowed; pointer-events: none; align-self: flex-start; }
.np-off { margin-top: -6px; color: var(--muted); font-size: 12.5px; }
.np-none { margin: 0; color: var(--muted); }
.np-warn { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 18px; border-color: #F5C2CA; background: #FFF6F7; }
.np-warn > svg { flex: none; width: 22px; height: 22px; color: var(--rose, #D9344A); }
.np-warn > span { flex: 1; }
@media (max-width: 560px) { .np-warn { flex-wrap: wrap; } .np-warn .btn { margin-left: 34px; } }
/* Dashboard Today card before attendance is taken */
.today-empty { display: grid; justify-items: start; gap: 12px; margin: 4px 0 14px; padding: 16px; background: var(--sun-tint); border-radius: 16px; }
.today-empty p { margin: 0; color: var(--text); }
/* Parent home: a fee past its due date */
.fee-due.late { border-color: #F5C2CA; }
.fee-due.late b, .fee-due.late small span:nth-child(2) { color: var(--rose); }
/* Older submissions folded away on Approvals */
.more-rows { margin-top: 6px; }
.more-rows > summary { padding: 10px 4px; color: var(--blue); font-weight: 600; cursor: pointer; }
/* Delete sits at the foot of the page, away from everyday buttons */
.page-foot-danger { display: flex; justify-content: flex-end; margin: 6px 0 16px; }
.unlink-btn { padding: 6px 10px; font-size: 13px; }
.gr-hint { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; font-size: 13.5px; }
.gr-hint svg { width: 16px; height: 16px; flex: none; }
/* Selected means solid blue everywhere: type tiles, grade tiles, grade chips */
.pick-tile:has(input:checked) { background: var(--blue); border-color: var(--blue); color: #fff; }
.pick-tile:has(input:checked) .chip-icon { background: rgba(255, 255, 255, .2); color: #fff; }
.gb-tile { background: color-mix(in srgb, #F5B312 calc(var(--heat) * 40%), #FFF8E6); }
.gb-tile.on { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(63, 91, 216, .3); }
@media (max-width: 760px) {
  .grade-chips a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
  .grade-chips a.on b { background: rgba(255, 255, 255, .25); color: #fff; }
}
/* Phone: type tiles as compact two-column pills, so the Title field shows on the first screen */
@media (max-width: 560px) {
  .pick-grid { gap: 8px; }
  .pick-tile { flex-direction: row; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 12px; font-size: 13.5px; }
  .pick-tile .chip-icon { width: 28px; height: 28px; border-radius: 9px; }
  .pick-tile .chip-icon .i { width: 15px; height: 15px; }
}
.np-card .np-none { color: var(--muted); font-size: 14.5px; }
@media (max-width: 760px) {
  .quick a { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.25; }
  .quick .chip-icon { flex: none; width: 34px; height: 34px; border-radius: 11px; }
}

/* Student page on the phone: the child's name sits in the header row beside the back arrow */
@media (max-width: 760px) { body:has(.sp-hero) .top h1 { display: block; } }
/* Long page titles on the phone wrap to a second line instead of being cut off */
@media (max-width: 760px) {
  .top:not(:has(.clock.on-phone)) h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; font-size: 1.05rem; line-height: 1.2; }
  .form-actions { background: rgba(251, 249, 245, .99); }
}
.prog-actions { justify-content: flex-start; }
.unlink-btn { border: 1px solid #F5C2CA; border-radius: 10px; }
.fee-due.late small span:not(:first-child) { color: var(--rose); }
@media (max-width: 560px) { .np-warn > span { flex-basis: calc(100% - 40px); } }
/* Fee page card: amount and class on top, buttons on their own row, the due date as a tag */
.fee-head > .grow { flex: 1 1 220px; min-width: 0; }
@media (max-width: 760px) { .fee-head > .actions { flex-basis: 100%; } }
.due-tag { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 99px; background: var(--amber-tint); color: var(--amber); font-weight: 700; white-space: nowrap; }
.due-tag.late { background: var(--rose-tint); color: var(--rose); }
/* Account card: the name, what they do here, and Message on one full-width row on the phone */
.hero-facts { margin: 10px 0 0; font-size: 14px; }
.hero-facts a { font-weight: 600; }
.hero-facts + .hero-facts { margin-top: 4px; }
@media (max-width: 760px) {
  .profile-hero { align-items: flex-start; gap: 14px 16px; }
  .profile-hero .grow > h2 { margin-bottom: 8px; font-size: 1.3rem; }
  .profile-hero > .btn { width: 100%; justify-content: center; }
}
/* Approvals: each waiting test opens to list every child's score; Notify and Discard sit together under the text */
.score-rows > li { align-items: flex-start; }
.score-rows .row-actions { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.score-rows .row-actions .mini-form { margin: 0; }
.score-rows .row-actions button, .score-rows .row-actions .btn { height: 36px; margin: 0; padding: 0 14px; font-size: 13.5px; }
.score-rows .row-actions .ghost-danger { border: 1px solid #F5C2CA; border-radius: 10px; background: #fff; }
.score-more > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.score-more > summary::-webkit-details-marker { display: none; }
.score-more > summary > span { flex: 1; min-width: 0; }
.score-more > summary > span > * { display: block; }
.score-more > summary .i { flex: none; width: 18px; height: 18px; color: var(--faint); transition: transform .15s; }
.score-more[open] > summary .i { transform: rotate(90deg); }
.score-kids { display: grid; gap: 6px; margin: 10px 0 6px; padding: 0; list-style: none; }
.score-kids li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px; background: #F8FAFC; border-radius: 10px; }
.score-kids a { flex: 1; font-weight: 600; }
.score-kids b small { color: var(--muted); font-weight: 500; }
.score-kids .score-note { flex-basis: 100%; color: var(--muted); }
.score-rows .row-actions > * { flex: none; width: auto; }
.score-rows .row-actions button.small { box-sizing: border-box; height: 40px; min-height: 40px; padding: 0 14px; line-height: 1; }
.score-kids b { white-space: nowrap; }
.score-kids b small { display: inline; }
/* Student page, Family card: one tidy block per person */
.fam-person { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fam-person:first-of-type { padding-top: 4px; }
.fam-top { display: flex; align-items: center; gap: 12px; }
.fam-top .grow { min-width: 0; }
.fam-top b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-top small { display: block; color: var(--muted); font-size: 13px; }
.fam-top .badge { flex: none; }
.fam-phones { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 14.5px; }
.fam-phones span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fam-phones .i { width: 15px; height: 15px; color: var(--muted); }
.fam-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fam-acts form { margin: 0 0 0 auto; }
.fam-acts .btn, .fam-acts button { height: 38px; min-height: 38px; padding: 0 12px; font-size: 13.5px; }
.fam-acts .unlink-btn { display: inline-flex; align-items: center; gap: 6px; }
.fam-add { margin-top: 14px; }
.fam-add > summary { list-style: none; cursor: pointer; }
.fam-add > summary::-webkit-details-marker { display: none; }
.fam-add[open] > summary { margin-bottom: 4px; }
.fam-add .small-note { margin: 8px 0 0; }
/* Fee page: Remind and Delete side by side; the totals as one card with a progress bar */
.fee-head .actions { flex-wrap: nowrap; align-items: center; }
.fee-head .actions form:last-child { margin-left: auto; }
@media (max-width: 420px) { .fee-head .actions button { padding-inline: 12px; font-size: 14px; } }
.fee-progress { display: grid; gap: 12px; }
.fp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.fp-head > div { display: flex; align-items: baseline; gap: 8px; }
.fp-head b { font: 700 1.9rem/1 var(--display); color: var(--leaf); }
.fp-head span { color: var(--muted); font-size: 14px; }
.fp-left b { font-size: 1.25rem; color: var(--rose); white-space: nowrap; }
.fp-bar { height: 12px; overflow: hidden; background: var(--rose-tint); border-radius: 99px; }
.fp-bar i { display: block; height: 100%; min-width: 6px; background: linear-gradient(90deg, #22C55E, var(--leaf)); border-radius: 99px; }
.fp-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.fp-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fp-legend b { color: var(--ink); }
.fp-legend i { width: 10px; height: 10px; border-radius: 50%; }
.fp-legend .paid i { background: var(--leaf); }
.fp-legend .unpaid i { background: var(--rose); opacity: .45; }
/* PC icon rail: the chosen page lights up its icon in a honey pill (no bar stuck to the edge), labels stay readable,
   and the collapse button is a quiet icon instead of the loudest thing in the menu. */
@media (min-width: 961px) {
  .rail { gap: 10px; }
  .rail a { gap: 4px; padding: 4px 2px; background: none !important; color: #64748B; font-size: 11.5px; letter-spacing: -.01em; }
  .rail a .i { box-sizing: content-box; width: 22px; height: 22px; padding: 6px 14px; border-radius: 99px; transition: background .15s, color .15s; }
  .rail a:hover { color: var(--ink); }
  .rail a:hover .i { background: #F1F5F9; }
  .rail a.on { color: var(--ink); font-weight: 700; }
  .rail a.on .i { background: #FDE9A8; color: #92400E; }
  .rail a.on::before { content: none; }
  .rail a:focus-visible { outline: none; }
  .rail a:focus-visible .i { outline: 3px solid rgba(63, 91, 216, .45); outline-offset: 1px; }
  .rail a i { top: 0; right: 8px; }
  .collapse-btn { background: transparent; color: #64748B; border: 1px solid var(--line); }
  .collapse-btn:hover { background: #F1F5F9; color: var(--ink); }
}
/* PC side menu as a whole: icons in the rail start at the top, a smaller logo, and tighter rows so the Manage
   group fits on a normal laptop screen instead of fading out at the bottom. */
@media (min-width: 961px) {
  .rail { justify-content: flex-start; padding-top: 22px; }
  .side > .brand { padding: 4px 8px 12px; }
  .side > .brand img.logo-full { width: 128px; }
  .side nav { padding-top: 6px; }
  .side nav a { min-height: 36px; margin: 1px 0; padding: 7px 12px; font-size: 14px; }
  .side nav a .i { width: 18px; height: 18px; }
  .nav-label { margin: 14px 12px 4px; }
}
@media (min-width: 961px) and (max-height: 960px) { .side > .brand img.logo-full { width: 116px; } }
/* Breadcrumbs: gone on pages one step from Home (the header title already says where you are); on deeper pages a
   slim line instead of a card, a round back arrow, and the current page as plain text, not a yellow pill. */
.crumbs.top-level { display: none; }
@media (min-width: 761px) {
  .crumbs { margin: -2px 0 14px; padding: 0; background: none; border: 0; box-shadow: none; }
  .crumbs ol { padding: 0 2px; }
  .crumb-back { justify-content: center; width: 32px; height: 32px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 50%; }
  .crumb-back span { display: none; }
  .crumb-back:hover { border-color: var(--ink); }
  .crumbs li > a { padding: 5px 8px; }
  .crumb-here span { padding: 5px 4px; background: none; color: var(--ink); }
}
/* PC: the back arrow sits in the header, left of the page title, as on the phone; breadcrumbs are links only. */
@media (min-width: 761px) {
  .top-back { display: grid; flex: none; width: 40px; height: 40px; margin-right: -4px; border-radius: 50%; }
  .top:has(.top-back) .top-brand { display: none; }
  .top-back:hover { border-color: var(--ink); }
  .crumbs { margin-top: -6px; }
}
/* PC rail: icons centred top to bottom again (the chosen page keeps the honey icon pill set above). */
@media (min-width: 961px) {
  .rail { justify-content: center; padding-top: 14px; }
}

/* ---------- Motion, 4 Dec 2026: short, purposeful, and off for anyone who asks for less motion ---------- */
.flash { display: flex; align-items: center; gap: 10px; }
.flash > .i { flex: none; width: 20px; height: 20px; stroke-width: 2.4; }
.flash.done > .i { color: #4ADE80; }
.flash.sent > .i { color: var(--sun); }
@keyframes tick-draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes nav-bounce { 0% { transform: scale(.8); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes mark-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes open-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  /* 1. Saved: the tick draws itself. Sent: the bell rings. */
  .flash.done > .i { stroke-dasharray: 30; stroke-dashoffset: 30; animation: tick-draw .45s .2s ease-out forwards; }
  .flash.sent > .i { transform-origin: 50% 10%; animation: ring .9s .2s ease-in-out; }
  /* 2. Unread notifications: one small wiggle of the bell when the page opens. */
  .top .bell:has(i) > .i { transform-origin: 50% 10%; animation: ring 1s .6s ease-in-out; }
  /* 3. Menus: the open page's icon bounces in; icons lift a little on hover (PC). */
  .rail a.on .i, .side nav a.on .i, .tabbar a.on .i { animation: nav-bounce .45s cubic-bezier(.3, .7, .4, 1.4); }
  .rail a .i, .side nav a .i { transition: transform .15s, background .15s, color .15s; }
  .rail a:hover .i, .side nav a:hover .i { transform: translateY(-2px); }
  /* 4. Attendance: the chosen mark pops and the totals bump when they change. */
  .marks label:has(input:checked) > span { animation: mark-pop .3s cubic-bezier(.3, .7, .4, 1.4); }
  .bump { display: inline-block; animation: bump .35s ease-out; }
  /* 5. Progress bars fill from the left. */
  .fp-bar i, .stat .meter i, .read-bar i { transform-origin: left center; animation: bar-fill .9s .15s cubic-bezier(.2, .8, .2, 1) both; }
  /* 6. Empty and all-caught-up screens: the icon floats gently. */
  .empty-state > .i, p.empty > .i { animation: float 3.2s ease-in-out infinite; }
  /* 7. Tap to open: the content slides down instead of jumping. */
  .score-more[open] > :not(summary), .fam-add[open] > :not(summary), .more-rows[open] > :not(summary) { animation: open-down .22s ease-out; }
}
/* Students: Enrolled / Left right beside the class picker, on one row on PC and phone */
.stu-filters { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stu-filters .class-switch { flex: 0 1 auto; min-width: 0; }
.stu-filters .pills { flex: none; }
@media (max-width: 760px) {
  .toolbar:has(.view-toggle) .stu-filters { flex-basis: 100%; order: 3; }
  .stu-filters .class-switch { flex: 1 1 0; }
}
@media (max-width: 760px) {
  .toolbar:has(.view-toggle) .stu-filters .class-switch { flex: 1 1 0; flex-basis: 0; order: 0; gap: 8px; }
  .stu-filters .class-switch b, .stu-filters .class-switch select { white-space: nowrap; font-size: 1rem; }
  .stu-filters .pills a { padding-inline: 12px; }
}

/* ---------- My attendance (teachers and coordinator) ---------- */
.ma-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; padding: 22px 24px; }
.ma-rate { display: grid; gap: 2px; }
.ma-rate b { font: 700 2.6rem/1 var(--display); color: var(--ink); }
.ma-rate span { color: var(--muted); font-size: 14px; }
.ma-counts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ma-counts li { display: grid; justify-items: center; min-width: 78px; padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.ma-counts b { font: 700 1.5rem/1.1 var(--display); }
.ma-counts .present { background: var(--leaf-tint); color: var(--leaf); }
.ma-counts .late { background: var(--amber-tint); color: var(--amber); }
.ma-counts .absent { background: var(--rose-tint); color: var(--rose); }
.ma-counts .missing { background: #F1F5F9; color: var(--muted); }
.ma-streak { display: flex; align-items: center; gap: 8px; flex-basis: 100%; margin: 0; padding: 10px 14px; border-radius: 12px; background: #FFF6DB; color: #7A4B00; font-size: 14px; }
.ma-streak .i { color: #D89A00; }
.ma-month { padding: 18px 20px 20px; }
.ma-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ma-head h2 { margin: 0; font-size: 1.15rem; }
.ma-head .is-off { opacity: .35; }
.ma-week, .ma-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.ma-week li { padding-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.ma-grid li { display: grid; place-items: center; height: 54px; border-radius: 12px; background: #F8FAFC; color: var(--ink); font-size: 14px; }
.ma-grid li.pad { background: none; }
.ma-grid li.present { background: var(--leaf-tint); color: var(--leaf); }
.ma-grid li.late { background: var(--amber-tint); color: var(--amber); }
.ma-grid li.absent { background: var(--rose-tint); color: var(--rose); }
.ma-grid li.missing { background: #fff; box-shadow: inset 0 0 0 1.5px #CBD5E1; color: var(--muted); }
.ma-grid li.off, .ma-grid li.future { background: none; color: #B6BDCC; }
.ma-grid li.today { box-shadow: inset 0 0 0 2px var(--blue, #3F5BD8); }
.ma-grid li b { font-weight: 700; }
.ma-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.ma-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ma-legend i { width: 12px; height: 12px; border-radius: 4px; background: #F8FAFC; }
.ma-legend .present i { background: var(--leaf); } .ma-legend .late i { background: var(--amber); } .ma-legend .absent i { background: var(--rose); }
.ma-legend .missing i { background: #fff; box-shadow: inset 0 0 0 1.5px #CBD5E1; } .ma-legend .off i { background: #E2E8F0; }
.ma-recent li { display: flex; align-items: center; gap: 12px; }
.ma-recent small { display: block; color: var(--muted); }
@media (max-width: 760px) {
  .ma-hero { padding: 18px; gap: 14px; }
  .ma-counts { width: 100%; }
  .ma-counts li { flex: 1; min-width: 0; padding: 8px 6px; }
  .ma-month { padding: 14px 12px 16px; }
  .ma-week, .ma-grid { gap: 4px; }
  .ma-grid li { height: 42px; border-radius: 9px; font-size: 13px; }
}
/* × to hide the weekly Ms. Bee AI suggestion */
.ai-weekly { position: relative; padding-right: 52px; }
.card-x { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--muted); cursor: pointer; }
.card-x:hover { background: rgba(24, 34, 74, .07); color: var(--ink); }
.card-x .i { width: 18px; height: 18px; }
@media (max-width: 760px) { .ai-weekly small { display: block; line-height: 1.45; } .ai-weekly img { width: 34px; height: 34px; } }

/* ---------- After School: sessions, teachers and rooms (4 Dec 2026) ---------- */
.tt-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.tt-crowded { display: flex; align-items: flex-start; gap: 10px; }
.tt-table th[scope="row"] { position: relative; }
.tt-week-edit { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -15px; border-radius: 50%; color: var(--muted); }
.tt-week-edit:hover { background: var(--blue-tint); color: var(--blue); }
.tt-week-edit .i { width: 16px; height: 16px; }
.tt-table th[scope="row"] .tt-person { padding-right: 34px; }
.tt-slot { display: grid; gap: 2px; }
.tt-slot small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tt-lessons li .grow small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tt-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.tt-day-edit { display: grid; gap: 12px; padding: 18px; }
.tt-day-edit h2 { margin: 0; font-size: 1.1rem; }
.tt-sess { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tt-sess .tt-time { grid-row: span 3; display: grid; align-content: start; gap: 2px; }
.tt-sess .tt-time small { color: var(--muted); font-size: 12.5px; }
.tt-sess label { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.tt-sess input, .tt-sess select { min-width: 0; margin: 0; }
.tt-weekend { margin: 18px 0 0; }
.tt-weekend > summary { cursor: pointer; margin-bottom: 14px; font-weight: 700; color: var(--blue); }
.tp-row { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0; cursor: pointer; }
.tp-row input { flex: none; width: 20px; height: 20px; margin: 0; }
.tp-row .grow small, .tp-plan small { display: block; color: var(--muted); font-size: 13px; }
.tp-plan { display: grid; justify-items: end; gap: 2px; text-align: right; }
.tp-plan b { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 14px; }
.tp-plan b .i { width: 16px; height: 16px; }
.my-sessions .card-head small { color: var(--muted); font-weight: 600; }
.ms-list li { display: flex; align-items: center; gap: 12px; }
.ms-list li.is-done { background: var(--leaf-tint); }
.ms-list li.is-away { opacity: .6; }
.ms-time { display: grid; justify-items: center; flex: none; width: 64px; }
.ms-time b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); font-size: 13px; }
.ms-time small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.ms-list .grow small { display: block; color: var(--muted); }
.ms-done { display: inline-flex; align-items: center; gap: 6px; color: var(--leaf); font-weight: 700; font-size: 13.5px; }
.ms-done .i { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .tt-week { grid-template-columns: 1fr; }
  .tt-sess { grid-template-columns: 1fr; }
  .tt-sess .tt-time { grid-row: auto; display: flex; align-items: baseline; gap: 8px; }
  .ms-list li { flex-wrap: wrap; }
  .ms-list li .grow { flex: 1 1 120px; }
  .ms-time { width: auto; }
  .ms-list .btn, .ms-done { margin-left: auto; }
  .tp-row { flex-wrap: wrap; }
  .tp-plan { flex-basis: 100%; justify-items: start; padding-left: 34px; text-align: left; }
}
/* compact sessions: subject across, teacher and room side by side, labels above */
.tt-sess { grid-template-columns: 92px 1fr 1fr; align-items: end; }
.tt-sess .tt-time { grid-row: span 2; align-self: start; }
.tt-sess label { grid-template-columns: 1fr; gap: 4px; }
.tt-sess label:first-of-type { grid-column: 2 / 4; }
.tt-sess label > span { font-size: 12px; font-weight: 600; }
.tt-sess input, .tt-sess select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
@media (max-width: 760px) {
  .tt-sess { grid-template-columns: 1fr 1fr; }
  .tt-sess .tt-time { grid-column: 1 / -1; grid-row: auto; }
  .tt-sess label:first-of-type { grid-column: 1 / -1; }
}
/* Exam prep days */
.tt-exam, .ms-exam { display: inline-flex; align-items: center; gap: 4px; width: max-content; padding: 2px 8px; border-radius: 99px; background: #FFF1D6; color: #8A4B00; font-size: 11.5px; font-weight: 700; }
.tt-exam .i, .ms-exam .i { width: 13px; height: 13px; }
.ms-exam { margin-right: 6px; }
.tt-exam-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px; background: #FFF6E5; color: #8A4B00; font-size: 13.5px; }
.tt-exam-note .i { width: 16px; height: 16px; }
.exam-card { margin-bottom: 18px; }
.exam-card h2 { display: flex; align-items: center; gap: 8px; }
.exam-card h2 .i { color: #D97706; }
.exam-card > .muted { margin: 0 0 12px; }
.exam-list li { display: flex; align-items: center; gap: 12px; }
.exam-list small { display: block; color: var(--muted); }
.exam-form { display: grid; grid-template-columns: 170px 1fr 1fr auto; align-items: end; gap: 12px; margin-top: 12px; }
.exam-form label { display: grid; gap: 4px; margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.exam-form input { margin: 0; }
@media (max-width: 760px) { .exam-form { grid-template-columns: 1fr; } .exam-form button { width: 100%; justify-content: center; } }
/* Phones: staff open any child's week from the Timetable */
.tt-pick-kid { padding: 0; overflow: hidden; }
.tt-pick-kid > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.tt-pick-kid > summary::-webkit-details-marker { display: none; }
.tt-pick-kid > summary > .i:first-child { color: var(--blue); }
.tt-pick-kid > summary small { display: block; color: var(--muted); font-size: 13px; }
.tt-pick-kid[open] > summary > .i:last-child { transform: rotate(90deg); }
.tt-pick-kid ul { margin: 0; border-top: 1px solid var(--line); }
.tt-pick-kid li a { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
/* Smart attendance: days this week, extra-day picker */
.roll-days { display: block; color: var(--muted); font-size: 12.5px; }
.roll-days.over { color: #B45309; font-weight: 700; }
.roll-add { display: grid; gap: 6px; padding: 14px 20px; border-top: 1px solid var(--line); background: #FAFBFF; }
.roll-add label { display: grid; gap: 6px; margin: 0; font-weight: 600; }
.roll-add select { max-width: 420px; margin: 0; }
.roll-add small { color: var(--muted); }
.roll-smart { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.roll-smart .i { width: 16px; height: 16px; color: var(--blue); }
.done-who.over { color: #B45309; }
/* Online dot: green when the person opened a page in the last 5 minutes */
.has-dot { position: relative; display: inline-flex; flex: none; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px #fff; }
.seen { color: var(--muted); }
.seen.on { color: #15803D; font-weight: 600; }
.acct small.seen { display: block; }
.acct-seen { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.acct-seen .i { width: 16px; height: 16px; color: var(--blue); }
