/* St. John's School — prototype design system (login, portals, proposal).
   Same brick and hedge as the public site. Fills and text have separate
   steps so dark mode keeps fills deep and text light. */
:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --sunken: #F1F2F4;
  --ink: #1D2025;
  --muted: #5A6069;
  --line: #E2E4E8;
  --accent: #B33A2E;
  --accent-text: #A9362B;
  --accent-soft: #FBECE9;
  --accent-ink: #FFFFFF;
  --green: #2E7D52;
  --green-text: #23704A;
  --green-soft: #E3F3EA;
  --warn: #A86F1A;
  --warn-soft: #FAF0DC;
  --on-warn: #FFFFFF;
  --danger: #B5402F;
  --success: #2C7A4B;
  --royal: #2F539E; --royal-text: #2B4C93; --gold: #C98A12; --gold-text: #8A5800; --teal: #23807A; --teal-text: #1D6B66; --slate: #5A6069;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(25,28,34,.06);
  --shadow-md: 0 18px 40px -12px rgba(25,28,34,.16);
  --ease: cubic-bezier(.16,1,.3,1);
  --serif: "Figtree", system-ui, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, sans-serif;
  --mono: "Figtree", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141519; --surface: #1B1D22; --sunken: #17181C; --ink: #ECEDF0; --muted: #A3A7AF; --line: #2A2D33;
    --accent: #C2463A; --accent-text: #F29C90; --accent-soft: #241D1D; --accent-ink: #FFFFFF;
    --green: #2E7D52; --green-text: #86D3A6; --green-soft: #172620; --warn: #D9AE5F; --warn-soft: #2B2414; --on-warn: #1E1606;
    --danger: #E08476; --success: #7CC39A;
    --royal: #5A7FD0; --royal-text: #A3BDF5; --gold: #E0A93A; --gold-text: #F3C66E; --teal: #3FA39B; --teal-text: #7FD1C9; --slate: #8A9099;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5); --shadow-md: 0 16px 40px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
/* Photos fade in once loaded instead of popping in. */
img { transition: opacity .6s ease; }
.js img:not(.is-loaded):not([src$=".svg"]) { opacity: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.eyebrow { font: 600 13.5px/1 var(--mono); color: var(--accent-text); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .25s var(--ease), background .2s, border-color .2s, color .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-green { background: var(--green); color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- Prototype ribbon ---------- */
.proto-bar { background: var(--ink); color: var(--bg); font: 500 12.5px/1.4 var(--sans); text-align: center; padding: 8px 16px; }
.proto-bar a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.proto-bar b { color: #F2C14E; font-weight: 600; }

/* ---------- Site nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.site-nav .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 40px; height: 40px; flex: none; }
.brand-name { font: 600 18px/1.1 var(--serif); letter-spacing: -.01em; }
.brand-sub { display: block; white-space: nowrap; font: 600 12px/1.3 var(--mono); color: var(--muted); margin-top: 3px; }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; white-space: nowrap; padding: 8px 11px; border-radius: 999px; text-decoration: none; font-size: 14.5px; color: var(--muted); transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--ink); background: var(--sunken); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }
@media (max-width: 1180px) {
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 18px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 16px; color: var(--ink); }
  .nav-toggle { display: inline-grid; }
  .nav-actions .btn span { display: none; }
}
@media (max-width: 520px) { .brand-sub { display: none; } .brand-name { font-size: 16px; } .nav-actions .btn { padding: 0 12px; } }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; position: relative; }
.hero .wrap { display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border: 1px solid var(--line); border-radius: 999px; font: 500 12.5px/1 var(--mono); letter-spacing: .04em; color: var(--muted); background: var(--surface); }
.hero-kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.hero h1 { font-size: clamp(40px, 6.2vw, 74px); margin: 22px 0 20px; font-weight: 600; }
.hero h1 em { font-style: italic; color: var(--accent-text); font-weight: 500; }
.hero-sub { font-size: 18.5px; color: var(--muted); max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.hero-facts div { font: 600 26px/1 var(--serif); }
.hero-facts span { display: block; font: 600 13px/1.3 var(--mono); color: var(--muted); margin-top: 8px; }
.hero-visual { position: relative; aspect-ratio: 4 / 4.4; }
.hero-photo { position: absolute; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); background: var(--sunken); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo--a { inset: 0 18% 22% 0; }
.hero-photo--a img { object-position: 30% 50%; }
.hero-photo--b { right: 0; bottom: 0; width: 52%; height: 44%; border: 6px solid var(--bg); }
.hero-photo--b img { object-position: 60% 40%; }
.hero-note { position: absolute; left: -22px; bottom: 9%; width: min(300px, 70%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-md); display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; animation: float 6s ease-in-out infinite; }
.hero-note b { display: block; font-size: 14px; font-weight: 600; }
.hero-note span { font-size: 12.5px; color: var(--muted); }
.hero-note .dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-text); }
.hero-note .dot svg { width: 18px; height: 18px; }
.hero-badge { position: absolute; top: 7%; right: 2%; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 10px 16px; font: 500 12.5px/1 var(--mono); letter-spacing: .05em; box-shadow: var(--shadow-md); animation: float 7s ease-in-out -2s infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (max-width: 900px) {
  .hero { padding-top: 36px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { aspect-ratio: 4 / 3.6; }
  .hero-note { left: 8px; }
}

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0; background: var(--surface); }
.marquee-track { display: flex; width: max-content; gap: 34px; animation: marq 38s linear infinite; }
.marquee-track span { font: 500 italic 26px/1 var(--serif); white-space: nowrap; display: inline-flex; align-items: center; gap: 34px; }
.marquee-track span::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.marquee-track span:nth-child(even) { color: var(--muted); font-style: normal; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
section.block { padding: 104px 0; }
section.block.tint { background: var(--sunken); }
.sec-head { max-width: 680px; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(32px, 4.4vw, 50px); margin-top: 16px; }
.sec-head p { color: var(--muted); font-size: 17.5px; margin-top: 16px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head.center .eyebrow::after { content: ""; width: 22px; height: 1.5px; background: currentColor; }
@media (max-width: 700px) { section.block { padding: 72px 0; } }

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-photo { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); position: relative; }
.about-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.about-photo figcaption { position: absolute; left: 14px; bottom: 14px; background: rgba(0,0,0,.55); color: #fff; font: 500 12px/1 var(--mono); padding: 8px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.quote { font: 500 italic clamp(24px, 2.6vw, 32px)/1.3 var(--serif); margin: 28px 0 0; padding-left: 22px; border-left: 3px solid var(--accent); }
.quote cite { display: block; font: 600 13.5px/1.4 var(--mono); color: var(--muted); font-style: normal; margin-top: 12px; }
.pillars { display: grid; gap: 14px; margin-top: 8px; }
.pillar { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pillar .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.pillar .ic svg { width: 22px; height: 22px; }
.pillar h3 { font-size: 20px; margin-bottom: 6px; }
.pillar p { color: var(--muted); font-size: 15px; }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; gap: 36px; } }

/* Stages */
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 24px; position: relative; overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.stage:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stage .grades { font: 600 13.5px/1 var(--mono); color: var(--accent-text); }
.stage h3 { font-size: 22px; margin: 14px 0 10px; }
.stage p { font-size: 14.5px; color: var(--muted); }
.stage .n { position: absolute; right: 14px; top: 10px; font: 600 54px/1 var(--serif); color: var(--sunken); z-index: 0; }
.stage > *:not(.n) { position: relative; z-index: 1; }
@media (max-width: 1000px) { .stages { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stages { grid-template-columns: 1fr; } }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 180px; gap: 12px; }
.gallery button { padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; position: relative; background: var(--sunken); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.gallery button:hover img { transform: scale(1.05); }
.gallery button span { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.55); color: #fff; font: 500 11.5px/1 var(--mono); padding: 7px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.gallery .g-wide { grid-column: span 2; }
.gallery .g-tall { grid-row: span 2; }
@media (max-width: 800px) { .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; } }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8,6,6,.9); display: none; place-items: center; padding: 24px; }
.lightbox.open { display: grid; }
.lightbox img { max-height: 82vh; border-radius: 12px; }
.lightbox p { color: #ddd; text-align: center; margin-top: 12px; font-size: 14px; }
.lightbox .icon-btn { position: absolute; top: 18px; right: 18px; }

/* Roles / app teaser */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.role { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 16px; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.role:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.role .tag { font: 600 13.5px/1 var(--mono); color: var(--muted); }
.role h3 { font-size: 25px; }
.role ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 15px; }
.role li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; }
.role li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 9px; }
.role .btn { margin-top: auto; align-self: flex-start; }
.mini { background: var(--sunken); border-radius: 14px; padding: 14px; display: grid; gap: 8px; font-size: 13px; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border-radius: 10px; padding: 9px 12px; border: 1px solid var(--line); }
@media (max-width: 960px) { .roles { grid-template-columns: 1fr; } }

/* AI band */
.ai-band { background: #1C1F24; color: #EEF0F3; border-radius: 28px; padding: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; position: relative; overflow: hidden; }
.ai-band::before { content: ""; position: absolute; width: 520px; height: 520px; right: -140px; top: -200px; background: radial-gradient(circle, rgba(178,31,45,.55), transparent 65%); }
.ai-band > * { position: relative; }
.ai-band .eyebrow { color: #F2C14E; }
.ai-band h2 { font-size: clamp(30px, 4vw, 46px); margin: 16px 0; color: #fff; }
.ai-band p { color: #C5C9D1; }
.ai-qs { display: grid; gap: 10px; }
.ai-q { text-align: left; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; border-radius: 14px; padding: 14px 16px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 15px; transition: background .2s, transform .3s var(--ease); }
.ai-q:hover { background: rgba(255,255,255,.12); transform: translateX(4px); }
.ai-q small { font: 600 12.5px/1 var(--mono); color: #F2C14E; flex: none; }
@media (max-width: 900px) { .ai-band { grid-template-columns: 1fr; padding: 34px 22px; border-radius: 22px; } }

/* News */
.news { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.news-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; grid-template-columns: 62px 1fr; gap: 16px; align-items: start; }
.date-chip { border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); text-align: center; padding: 9px 0 10px; }
.date-chip b { display: block; font: 600 24px/1 var(--serif); }
.date-chip span { font: 600 12.5px/1 var(--mono); }
.news-card h3 { font: 600 17px/1.3 var(--sans); letter-spacing: 0; margin-bottom: 6px; }
.news-card p { font-size: 14.5px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--mono); padding: 6px 9px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.pill.green { background: var(--green-soft); color: var(--green-text); }
.pill.red { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 960px) { .news { grid-template-columns: 1fr; } }

/* Admissions */
.adm { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding-bottom: 22px; position: relative; }
.steps li::before { content: counter(s); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--accent); color: var(--accent-text); font: 600 18px/1 var(--serif); position: relative; z-index: 1; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 21.5px; top: 44px; bottom: 0; width: 1.5px; background: var(--line); }
.steps b { display: block; font-weight: 600; margin-top: 3px; }
.steps span { color: var(--muted); font-size: 15px; }
.docs { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.docs h3 { font: 600 16px/1.3 var(--sans); letter-spacing: 0; margin-bottom: 12px; }
.docs ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14.5px; display: grid; gap: 6px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-md); }
.form-card h3 { font-size: 26px; margin-bottom: 6px; }
.field { display: grid; gap: 6px; margin-top: 16px; }
.field label, .lbl { font: 600 13.5px/1.3 var(--sans); color: var(--ink); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 10px 14px; font-size: 15.5px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 96px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-ok { display: none; text-align: center; padding: 26px 6px; }
.form-ok.show { display: block; }
.form-ok .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green-text); display: grid; place-items: center; margin: 0 auto 16px; }
.form-ok .tick svg { width: 30px; height: 30px; }
@media (max-width: 900px) { .adm { grid-template-columns: 1fr; } .form-card { padding: 22px; } }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

/* Contact + footer */
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.contact > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.contact h3 { font: 600 16px/1.3 var(--sans); letter-spacing: 0; margin: 12px 0 6px; }
.contact p { color: var(--muted); font-size: 15px; }
.contact a { color: var(--accent-text); text-underline-offset: 3px; }
.todo { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 1px 7px; font-size: 13px; font-family: var(--mono); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
footer.site-foot { border-top: 1px solid var(--line); padding: 44px 0 56px; font-size: 14px; color: var(--muted); }
footer.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
footer.site-foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer.site-foot a { text-decoration: none; }
footer.site-foot a:hover { color: var(--ink); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .9s ease, transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- AI assistant ---------- */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 90; height: 54px; padding: 0 20px 0 16px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; cursor: pointer; box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 40%, transparent); transition: transform .3s var(--ease); }
.ai-fab:hover { transform: translateY(-2px); }
.ai-fab svg { width: 22px; height: 22px; }
.ai-fab.hide { transform: scale(.6); opacity: 0; pointer-events: none; }
.ai-panel { position: fixed; right: 22px; bottom: 22px; z-index: 100; width: min(400px, calc(100vw - 24px)); height: min(620px, calc(100dvh - 44px)); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; transform: scale(.96) translateY(12px); opacity: 0; pointer-events: none; transition: transform .45s var(--ease), opacity .3s ease; }
.ai-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.ai-head .av { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.ai-head .av svg { width: 20px; height: 20px; }
.ai-head b { display: block; font-size: 15px; }
.ai-head span { font-size: 12px; color: var(--muted); }
.ai-head .icon-btn { margin-left: auto; width: 34px; height: 34px; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; animation: msg-in .4s var(--ease) backwards; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg.bot { background: var(--sunken); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; align-self: flex-end; }
.msg b { font-weight: 600; }
.msg .src { display: block; margin-top: 8px; font: 600 12px/1.3 var(--mono); color: var(--muted); }
.typing { display: inline-flex; gap: 4px; padding: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }
.ai-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.ai-chips button { flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.ai-chips button:hover { border-color: var(--accent); color: var(--accent-text); }
.ai-form { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.ai-form input { flex: 1; min-width: 0; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 16px; outline: none; font-size: 15px; }
.ai-form input:focus { border-color: var(--accent); }
.ai-form button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.ai-form button svg { width: 18px; height: 18px; }
.ai-foot { font-size: 12px; color: var(--muted); text-align: center; padding: 0 14px 10px; }
.ai-foot button { border: 0; background: none; padding: 2px 0; font: inherit; color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ai-foot .seg { white-space: nowrap; }
.ai-live { color: var(--green-text); } .ai-live i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.ai-key { display: flex; gap: 6px; margin-bottom: 6px; }
.ai-key input { flex: 1; min-width: 0; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 13px; outline: none; }
.ai-key input:focus { border-color: var(--accent); }
.ai-key button { text-decoration: none; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); }
.ai-key button[type=submit] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ai-form .ai-mic { background: transparent; border: 1px solid var(--line); color: var(--muted); transition: color .25s, border-color .25s; }
.ai-form .ai-mic:hover { color: var(--accent-text); border-color: var(--accent); }
.ai-form .ai-mic.rec { color: var(--accent-text); border-color: var(--accent); animation: mic-rec 1.6s ease-in-out infinite; }
@keyframes mic-rec { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent); } }
.msg .note { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .ai-panel { right: 12px; bottom: 12px; } .ai-fab { right: 14px; bottom: 14px; } .ai-fab span { display: none; } .ai-fab { padding: 0; width: 54px; justify-content: center; } }

/* ---------- Portal (app) ---------- */
body.app { background: var(--sunken); }
.proto-bar { background: #1C1F24 !important; color: #E8EAEE !important; }
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px; }
.side .brand { margin: 0 6px 18px; }
.side-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; font-size: 15px; color: var(--muted); text-align: left; position: relative; text-decoration: none; }
.side-btn svg { width: 20px; height: 20px; flex: none; }
.side-btn:hover { background: var(--sunken); color: var(--ink); }
.side-btn.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.side-btn .count { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 11px/20px var(--sans); text-align: center; padding: 0 6px; }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--sunken); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--sans); background: var(--accent); color: var(--accent-ink); flex: none; }
.avatar.green { background: var(--green); color: #fff; }
.avatar.soft { background: var(--sunken); color: var(--ink); border: 1px solid var(--line); }
.who b { display: block; font-size: 14px; line-height: 1.2; }
.who > div > span { font-size: 12px; color: var(--muted); }
.main { padding: 26px 32px 120px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar h1 { font-size: clamp(26px, 3vw, 34px); }
.topbar .sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
[data-view] { display: none; animation: viewIn .4s ease; }
[data-view].active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 16px 16px 110px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav .side-btn { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 7px 4px; width: auto; flex: 1; align-items: center; text-align: center; }
  .bottom-nav .side-btn.active { background: transparent; }
  .bottom-nav .side-btn .count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 17px; height: 17px; line-height: 17px; font-size: 10px; padding: 0 4px; }
  body.app .ai-fab { bottom: 84px; }
  body.app .ai-panel { bottom: 12px; }
  .mobile-head { display: flex !important; }
}
.mobile-head { display: none; align-items: center; gap: 10px; margin: -4px 0 14px; }
.mobile-head img { width: 32px; height: 32px; }
.mobile-head b { font: 600 15.5px/1.15 var(--serif); }
.mobile-head b small { display: block; font: 500 12px/1.3 var(--sans); color: var(--muted); }
.mobile-head .right { margin-left: auto; display: flex; gap: 8px; }

/* Cards & grid */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g21 { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g21 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g3, .g2 { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .g4 { grid-template-columns: 1fr 1fr; gap: 10px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { font: 600 16.5px/1.3 var(--sans); letter-spacing: 0; }
.card-h .right { margin-left: auto; }
.link-btn { border: 0; background: none; color: var(--accent-text); cursor: pointer; font-size: 14px; font-weight: 500; padding: 4px 0; }
.stat .lbl { display: block; margin-bottom: 12px; }
.stat .num { font: 600 34px/1 var(--serif); letter-spacing: -.02em; }
.stat .num small { font: 500 15px var(--sans); color: var(--muted); letter-spacing: 0; }
.stat .foot { font-size: 13px; color: var(--muted); margin-top: 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat.hl { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stat.hl .lbl, .stat.hl .foot, .stat.hl .num small { color: color-mix(in srgb, var(--accent-ink) 78%, transparent); }
@media (max-width: 420px) { .stat .num { font-size: 27px; } .card { padding: 16px; } }

.list { display: grid; }
.li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; padding-top: 2px; }
.li .t { min-width: 0; flex: 1; }
.li .t b { display: block; font-size: 15px; font-weight: 500; }
.li .t span { font-size: 13px; color: var(--muted); }
.li .end { margin-left: auto; flex: none; text-align: right; }
.sq { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink); font: 600 13px/1 var(--sans); }
.sq svg { width: 19px; height: 19px; }
.sq.red { background: var(--accent-soft); color: var(--accent-text); }
.sq.green { background: var(--green-soft); color: var(--green-text); }
.sq.warn { background: var(--warn-soft); color: var(--warn); }

/* Status banner */
.status { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.status .sq { width: 46px; height: 46px; border-radius: 50%; }
.status b { display: block; font-size: 16px; }
.status span { font-size: 13.5px; color: var(--muted); }
.status.ok { background: var(--green-soft); border-color: transparent; }
.status.bad { background: var(--accent-soft); border-color: transparent; }
.status.wait { background: var(--warn-soft); border-color: transparent; }

/* AI card */
.ai-card { position: relative; border-radius: var(--radius); padding: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 60%); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.ai-tag { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--mono); color: var(--accent-text); }
.ai-tag svg { width: 14px; height: 14px; }
.ai-card .body { font-size: 15.5px; line-height: 1.7; margin-top: 12px; }
.ai-card .body b { font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--bg); }

/* Chips row */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px 7px 7px; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.chip .avatar { width: 28px; height: 28px; font-size: 11px; }
.chip.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font: 600 12.5px/1 var(--mono); color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal .d { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 13.5px; background: var(--sunken); color: var(--muted); position: relative; }
.cal .d.P { background: var(--green-soft); color: var(--green-text); font-weight: 500; }
.cal .d.A { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cal .d.L { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.cal .d.H { background: transparent; border: 1px dashed var(--line); }
.cal .d.T { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

/* Bars (single series + reference tick) */
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 48px; gap: 12px; align-items: center; font-size: 14px; }
.bar-row .track { height: 12px; position: relative; border-radius: 4px; background: var(--sunken); }
.bar-row .fill { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--accent); width: 0; transition: width 1s var(--ease); }
.bar-row .ref { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.bar-row .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row .track:hover .tip, .bar-row .track:focus .tip { opacity: 1; }
.tip { position: absolute; bottom: calc(100% + 8px); left: 0; background: var(--ink); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; }
@media (max-width: 480px) { .bar-row { grid-template-columns: 92px 1fr 40px; font-size: 13px; } }

/* Column chart */
.cols { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 22px; border-bottom: 1px solid var(--line); }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; min-width: 0; cursor: default; }
.col .c { width: 100%; max-width: 30px; border-radius: 4px 4px 0 0; background: var(--accent); height: 0; transition: height 1s var(--ease); }
.col.low .c { background: var(--warn); }
.col .c.pending { border: 1.5px dashed var(--line); background: transparent; transition: none; }
.col:hover .tip { opacity: 1; }
.col .tip { left: 50%; transform: translateX(-50%); bottom: auto; top: -8px; }
/* Tips at either end of a chart open inwards, so they never push past the screen edge. */
.col:nth-child(-n+2) .tip { left: 0; transform: none; }
.col:nth-last-child(-n+2) .tip { left: auto; right: 0; transform: none; }
.col-labels { display: flex; gap: 6px; margin-top: 8px; }
.col-labels span { flex: 1; text-align: center; font: 500 10.5px/1.2 var(--mono); color: var(--muted); min-width: 0; overflow: hidden; }

/* Table */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 600 12.5px/1 var(--mono); color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl input.mark { width: 64px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-align: center; font-size: 15px; }
.tbl input.mark:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Attendance grid */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left; transition: border-color .2s, background .2s, transform .2s var(--ease); min-width: 0; }
.att:active { transform: scale(.97); }
.att .roll { font: 500 11px/1 var(--mono); color: var(--muted); }
.att .nm { font-size: 14px; font-weight: 500; line-height: 1.25; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .st { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 600 13px/1 var(--sans); background: var(--green-soft); color: var(--green-text); flex: none; }
.att[data-s="A"] { border-color: var(--accent); background: var(--accent-soft); }
.att[data-s="A"] .st { background: var(--accent); color: var(--accent-ink); }
.att[data-s="L"] { border-color: var(--warn); background: var(--warn-soft); }
.att[data-s="L"] .st { background: var(--warn); color: var(--on-warn); }
.att > div { min-width: 0; }

/* Messages */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.thread .msg { max-width: 80%; }
.thread .msg .when { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }

/* Bus */
.route { display: flex; align-items: center; margin: 18px 0 8px; }
.route .stop { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); flex: none; position: relative; z-index: 1; }
.route .stop.done { background: var(--green); border-color: var(--green); }
.route .seg-l { flex: 1; height: 3px; background: var(--line); }
.route .seg-l.done { background: var(--green); }
.route .stop.home { border-color: var(--accent); width: 18px; height: 18px; }
.route-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); gap: 6px; }

/* Toast & modal */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14.5px; z-index: 300; opacity: 0; transition: opacity .3s, transform .4s var(--ease); max-width: calc(100vw - 32px); box-shadow: var(--shadow-md); display: flex; gap: 10px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; color: #6EE7A0; flex: none; }
@media (max-width: 900px) { body.app .toast { bottom: 96px; } }
.modal { position: fixed; inset: 0; z-index: 250; background: rgba(10,8,8,.5); display: none; place-items: center; padding: 16px; backdrop-filter: blur(4px); }
.modal.open { display: grid; }
.modal-card { background: var(--surface); border-radius: 22px; padding: 26px; width: min(460px, 100%); max-height: 90dvh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: viewIn .35s var(--ease); }
.modal-card h3 { font-size: 24px; margin-bottom: 6px; }

/* Login */
.login-wrap { min-height: calc(100dvh - 37px); display: grid; grid-template-columns: 1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: #1C1F24; color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: flex-end; }
.login-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(22,11,12,.92)); }
.login-art > *:not(img) { position: relative; z-index: 1; }
.login-art .brand { z-index: 2; gap: 12px; text-decoration: none; }
.login-art .brand img { width: 44px; height: 44px; }
.login-art .brand-name { color: #fff; font-size: 19px; }
.login-art h2 { font-size: clamp(30px, 3.6vw, 44px); color: #fff; max-width: 460px; }
.login-art p { color: #C5C9D1; margin-top: 12px; max-width: 420px; }
.login-panel { display: grid; place-items: center; padding: 40px 20px; }
.login-box { width: min(420px, 100%); }
.login-box h1 { font-size: 34px; margin: 22px 0 8px; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 8px; }
.role-tab { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 10px; cursor: pointer; display: grid; justify-items: center; gap: 8px; font-size: 14px; font-weight: 500; transition: border-color .2s, box-shadow .2s; }
.role-tab svg { width: 22px; height: 22px; color: var(--muted); }
.role-tab.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.role-tab.on svg { color: var(--accent-text); }
.otp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.otp input { text-align: center; font-size: 22px; font-weight: 600; height: 56px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-art { min-height: 0; padding: 92px 22px 24px; } .login-art .brand { top: 24px !important; left: 22px !important; } .login-art h2 { font-size: 26px; } }

/* Proposal page */
.prop-hero { padding: 80px 0 40px; }
.prop-hero h1 { font-size: clamp(38px, 5.6vw, 66px); max-width: 900px; margin-top: 18px; }
.prop-hero p { font-size: 19px; color: var(--muted); max-width: 680px; margin-top: 20px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare > div { border-radius: var(--radius-lg); padding: 28px; border: 1px solid var(--line); background: var(--surface); }
.compare h3 { font-size: 22px; margin-bottom: 14px; }
.compare ul { margin: 0; padding-left: 18px; display: grid; gap: 9px; font-size: 15.5px; }
.compare .before { background: var(--sunken); }
.compare .before li::marker { color: var(--muted); }
.compare .after { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.compare .after li::marker { color: var(--green-text); }
@media (max-width: 800px) { .compare { grid-template-columns: 1fr; } }
.day { display: grid; gap: 0; }
.day-row { display: grid; grid-template-columns: 92px 1fr 1fr; gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); align-items: start; }
.day-row .time { font: 600 22px/1 var(--serif); }
.day-row .who-l { font: 600 12.5px/1 var(--mono); color: var(--accent-text); margin-bottom: 6px; display: block; }
.day-row .who-l.g { color: var(--green-text); }
.day-row p { font-size: 15.5px; }
@media (max-width: 760px) { .day-row { grid-template-columns: 70px 1fr; } .day-row > div:last-child { grid-column: 2; } }
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feat h3 { font: 600 17px/1.3 var(--sans); letter-spacing: 0; margin: 14px 0 8px; }
.feat p { font-size: 14.5px; color: var(--muted); }
.feat .who-l { font: 600 12.5px/1 var(--mono); color: var(--accent-text); }
@media (max-width: 960px) { .feat { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feat { grid-template-columns: 1fr; } }
.phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: p; }
.phases > div { border-top: 3px solid var(--accent); padding-top: 16px; }
.phases > div:nth-child(n+3) { border-color: var(--green); }
.phases .wk { font: 600 13.5px/1 var(--mono); color: var(--muted); }
.phases h3 { font-size: 21px; margin: 10px 0 8px; }
.phases p { font-size: 14.5px; color: var(--muted); }
@media (max-width: 860px) { .phases { grid-template-columns: 1fr 1fr; gap: 26px 14px; } }
.checklist { columns: 2; column-gap: 32px; padding: 0; margin: 0; list-style: none; }
.checklist li { break-inside: avoid; padding: 10px 0 10px 30px; position: relative; border-bottom: 1px solid var(--line); font-size: 15px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 13px; width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; }
@media (max-width: 700px) { .checklist { columns: 1; } }
@media print { .proto-bar, .site-nav, .ai-fab, .ai-panel { display: none !important; } section.block { padding: 40px 0; } .reveal { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Add to home screen (parent app) */
.install { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.install[hidden] { display: none; }
.install img { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.install > div { flex: 1; min-width: 0; }
.install b { display: block; font-size: 15.5px; }
.install span { display: block; font-size: 13.5px; color: var(--muted); }
.install .icon-btn { width: 36px; height: 36px; flex: none; }
@media (max-width: 560px) { .install { gap: 10px; padding: 12px; } .install img { width: 38px; height: 38px; border-radius: 10px; } .install b { font-size: 14.5px; line-height: 1.3; } .install span { font-size: 12.5px; } }

/* ---------- Website tab (principal) ---------- */
.hint { font-size: 12.5px; color: var(--muted); }
.opt { font-weight: 400; color: var(--muted); }
.fs { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.fs legend { padding: 0; margin-bottom: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; cursor: pointer; background: var(--surface); }
.check:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.check input, .field .check input { accent-color: var(--green); margin: 0; width: 16px; height: 16px; min-height: 0; padding: 0; flex: none; }
.check.sm { padding: 5px 9px; font-size: 13px; }
.preview { display: grid; gap: 4px; margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--sunken); font-size: 14px; color: var(--muted); }
.preview b { color: var(--ink); font-size: 15.5px; font-weight: 600; }
.preview .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.facts-f { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.facts-f .field { margin-top: 12px; }
@media (max-width: 560px) { .facts-f { grid-template-columns: 1fr; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tile { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.tile.off .tile-ph img { opacity: .4; filter: grayscale(.6); }
.tile-ph { position: relative; aspect-ratio: 16 / 10; background: var(--sunken); }
.tile-ph img { width: 100%; height: 100%; object-fit: cover; }
.tile-n { position: absolute; left: 8px; top: 8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: rgba(20, 22, 26, .78); color: #fff; font: 600 12.5px/24px var(--sans); text-align: center; }
.tile figcaption { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 10px; }
.tile select { grid-column: 1 / -1; order: 3; width: 100%; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; padding: 0 6px; }
.tile-btns { display: flex; gap: 4px; margin-left: auto; }
.tile-btns button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font-size: 16px; line-height: 1; }
.tile-btns button:hover:not(:disabled) { border-color: var(--ink); }
.tile-btns button:disabled { opacity: .35; cursor: default; }
.upload { cursor: pointer; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; background: var(--sunken); }
.link-btn:disabled { color: var(--muted); opacity: .6; cursor: default; }

/* ---------- Parent home: timetable rail + main column ---------- */
.home-grid { display: grid; grid-template-columns: minmax(400px, 450px) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-main { display: grid; gap: 16px; min-width: 0; }
.tt-rail { padding: 16px; }
.topbar .kids { flex-wrap: nowrap; }
@media (max-width: 1180px) { .home-grid { grid-template-columns: 1fr; } .tt-rail { order: 2; } }
/* The week, spreadsheet-style: thin grid lines, a header row and column, cells tinted by subject. */
.pivot-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pivot { width: 100%; border-collapse: collapse; border-style: hidden; table-layout: fixed; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pivot th, .pivot td { border: 1px solid var(--line); height: 33px; padding: 0 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pivot thead th { height: 30px; background: var(--sunken); color: var(--muted); font-weight: 600; transition: background .2s, color .2s; }
.pivot thead th.corner { width: 78px; text-align: left; padding-left: 8px; font-weight: 500; }
.pivot thead th.today { color: var(--accent-text); background: var(--accent-soft); }
.pivot tbody th { background: var(--sunken); text-align: left; padding: 0 8px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; }
.pivot tbody th b { display: inline-block; min-width: 12px; margin-right: 6px; color: var(--ink); font-weight: 600; }
.pivot tbody th span { font-size: 11.5px; }
.pivot th.hl { background: color-mix(in srgb, var(--ink) 9%, var(--sunken)); color: var(--ink); }
.pivot td { --c: var(--slate); background: color-mix(in srgb, var(--c) 11%, var(--surface)); color: color-mix(in srgb, var(--c) 78%, var(--ink)); font-weight: 600; cursor: default; transition: background .15s; }
.pivot td.c-brick { --c: var(--accent); } .pivot td.c-green { --c: var(--green); } .pivot td.c-royal { --c: var(--royal); }
.pivot td.c-gold { --c: var(--gold); } .pivot td.c-teal { --c: var(--teal); }
.pivot td.c-none { background: var(--surface); color: var(--muted); font-weight: 500; }
.pivot td.today { background: color-mix(in srgb, var(--c) 19%, var(--surface)); }
.pivot td.c-none.today { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.pivot td.now { outline: 2px solid var(--accent); outline-offset: -2px; }
.pivot td:hover, .pivot td:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; background: color-mix(in srgb, var(--c) 26%, var(--surface)); }
.pivot td.off { background: repeating-linear-gradient(135deg, var(--sunken) 0 5px, var(--surface) 5px 10px); color: var(--muted); font-weight: 500; font-size: 11.5px; white-space: normal; line-height: 1.3; }
.pivot td.off:hover { outline: 0; }
.home-main .g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pivot tr.brk th, .pivot tr.brk td { height: 20px; font-size: 11px; font-weight: 500; color: var(--muted); background: repeating-linear-gradient(135deg, var(--sunken) 0 5px, var(--surface) 5px 10px); outline: 0; }
.tt-sum { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pivot-sum td, .pivot-sum th { text-align: left; padding: 0 9px; height: 30px; }
.pivot-sum th { width: auto; }
.pivot-sum th:first-child { width: 36%; } .pivot-sum .n { width: 68px; text-align: right; }
.pivot-sum td { background: var(--surface); color: var(--ink); font-weight: 400; }
.pivot-sum td:hover { outline: 0; background: var(--surface); }
.pivot-sum td.sw { font-weight: 600; color: color-mix(in srgb, var(--c) 78%, var(--ink)); box-shadow: inset 3px 0 0 var(--c); }
.pivot-sum td.c-none.sw { color: var(--ink); box-shadow: inset 3px 0 0 var(--line); }
.pivot-sum tr.tot td { background: var(--sunken); font-weight: 600; }
.tt-tip { position: fixed; z-index: 220; max-width: 250px; padding: 9px 12px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.4; pointer-events: none; box-shadow: var(--shadow-md); }
.tt-tip[hidden] { display: none; }
.tt-tip b { display: block; font-size: 14px; }
.tt-tip span { display: block; }
.tt-tip small { display: block; opacity: .7; font-size: 12px; margin-top: 2px; }

/* ---------- Notification centre ---------- */
.topbar > .bell-wrap { margin-left: 8px; }
.topbar > div:first-child + .bell-wrap { margin-left: auto; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -4px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 11px/18px var(--sans); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.bell .badge[hidden] { display: none; }
.notif { position: fixed; top: 72px; right: 28px; z-index: 150; width: min(400px, calc(100vw - 24px)); max-height: min(72vh, 640px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); overflow: hidden; animation: nf-in .25s var(--ease); }
.notif[hidden] { display: none; }
@keyframes nf-in { from { opacity: 0; transform: translateY(-6px); } }
.notif-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-h b { font-size: 16px; margin-right: auto; }
.notif-list { overflow-y: auto; overscroll-behavior: contain; }
.nf { position: relative; display: flex; gap: 12px; width: 100%; padding: 13px 34px 13px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.nf:last-child { border-bottom: 0; }
.nf:hover { background: var(--sunken); }
.nf.unread { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.nf.unread:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.nf.unread::after { content: ""; position: absolute; right: 16px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.nf .sq { width: 36px; height: 36px; border-radius: 10px; }
.nf .sq svg { width: 17px; height: 17px; }
.nf-t { min-width: 0; }
.nf-t b { display: block; font-size: 14.5px; font-weight: 600; }
.nf-t .tx { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--muted); }
.nf-t .wh { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.sq.royal { background: color-mix(in srgb, var(--royal) 14%, var(--surface)); color: var(--royal-text); }
.sq.gold { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); color: var(--gold-text); }
.sq.slate { background: var(--sunken); color: var(--muted); }
.notif-empty { padding: 34px 16px; text-align: center; color: var(--muted); }
@media (max-width: 900px) { .topbar > .bell-wrap { display: none; } .notif { top: 62px; right: 12px; } }

/* ---------- Staff page: one page, three roles ---------- */
.role-teacher [data-only]:not([data-only="teacher"]),
.role-principal [data-only]:not([data-only="principal"]),
.role-admin [data-only]:not([data-only="admin"]) { display: none !important; }
.li.todo { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; padding: 13px 4px; }
.li.todo:first-child { border-top: 0; }
.li.todo:hover { background: var(--sunken); }
.role-tabs:has(.role-tab:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
.form-err { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: 13.5px; }
.form-err[hidden] { display: none; }
.demo-ids { display: grid; gap: 8px; margin-top: 18px; }
.demo-ids > span { font-size: 13px; }
.demo-ids button { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; font-size: 13.5px; }
.demo-ids button:hover { border-color: var(--ink); }
.demo-ids b { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.demo-ids button span { color: var(--muted); }

/* ---------- Parent home, redesigned ---------- */
/* The child: who they are, then four numbers in one calm row. */
.kid { padding: 0; margin-bottom: 16px; overflow: hidden; }
.kid-id { display: flex; align-items: center; gap: 16px; padding: 20px 22px; flex-wrap: wrap; }
.kid-av { width: 52px; height: 52px; font-size: 17px; }
.kid-t { flex: 1; min-width: 220px; }
.kid-t h2 { font-size: 21px; letter-spacing: -.01em; }
.kid-t span { font-size: 14px; color: var(--muted); }
.kid-sw button { padding: 7px 14px; font-size: 13.5px; }
.kid-kpis { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--sunken) 55%, var(--surface)); }
.kid-kpis > div { padding: 16px 22px 18px; border-left: 1px solid var(--line); }
.kid-kpis > div:first-child { border-left: 0; }
.kid-kpis dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.kid-kpis dd { margin: 4px 0 2px; font: 700 26px/1.1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kid-kpis dd small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kid-kpis span { font-size: 12.5px; color: var(--muted); }
.kid-kpis .due dd { color: var(--accent-text); }
@media (max-width: 760px) { .kid-kpis { grid-template-columns: 1fr 1fr; } .kid-kpis > div:nth-child(3) { border-left: 0; } .kid-kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); } .kid-kpis > div { padding: 14px 16px; } .kid-id { padding: 16px; } }
/* Today: attendance, the class now or next, and the bus. */
.today-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.today-row > .status { align-items: flex-start; }
@media (max-width: 1100px) { .today-row { grid-template-columns: 1fr 1fr; } .today-row .bus-card { grid-column: 1 / -1; } }
@media (max-width: 640px) { .today-row { grid-template-columns: 1fr; } }
.now-card .card-h { margin-bottom: 10px; }
.now-sub { --c: var(--slate); display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c) 11%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
.now-sub b { font-size: 18px; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.now-sub span { font-size: 13.5px; color: var(--muted); }
.now-sub.c-brick { --c: var(--accent); } .now-sub.c-green { --c: var(--green); } .now-sub.c-royal { --c: var(--royal); } .now-sub.c-gold { --c: var(--gold); } .now-sub.c-teal { --c: var(--teal); }
.bus-card .route { margin-top: 14px; }
/* Due soon */
.due-li { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; padding: 12px 4px; }
div.due-li { cursor: default; }
.due-li:first-child { border-top: 0; }
button.due-li:hover { background: var(--sunken); }
.due-li .sq { width: 36px; height: 36px; border-radius: 10px; }
.due-li .sq svg { width: 17px; height: 17px; }
.due-d { display: grid; text-align: right; line-height: 1.2; }
.due-d b { font-size: 14px; font-weight: 600; }
.due-d small { font-size: 12px; color: var(--muted); }
.home-main .install { margin-bottom: 0; }

/* ---------- Charts and view toggles ---------- */
/* A view toggle sits in a card's header (or the page's top bar) and swaps panes in place. */
.vt { flex-wrap: wrap; }
.vt button { display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.vt button:not(.on):hover { color: var(--ink); background: var(--sunken); }
.vt svg { width: 14px; height: 14px; flex: none; }
.vp[hidden] { display: none !important; }
.vp { animation: vp-in .35s var(--ease); }
@keyframes vp-in { from { opacity: 0; transform: translateY(4px); } }
.card-h .vt { margin-left: auto; }
.card-h .right + .vt { margin-left: 0; }
.ctip { max-width: 260px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--sans); }
.chart text { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .ref-l { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .55; }
.chart .ref-t { fill: var(--ink); font-weight: 600; font-size: 11px; opacity: .75; }
.chart .hit { fill: transparent; cursor: default; outline: 0; }
.chart-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.chart-empty { padding: 34px 12px; text-align: center; color: var(--muted); font-size: 14.5px; border: 1px dashed var(--line); border-radius: 12px; }
.legend i.dot { border-radius: 50%; }
.legend i.ln { height: 3px; width: 16px; border-radius: 2px; vertical-align: 3px; }
.legend i.dash { height: 0; width: 16px; border-top: 2px dashed var(--ink); border-radius: 0; opacity: .6; vertical-align: 3px; }

/* Series colours: brick for the child or class in focus, royal blue for the comparison. */
.s1 { --s: var(--accent); } .s2 { --s: var(--royal); }

/* Ring gauge */
.ring { display: block; flex: none; }
.ring-bg { fill: none; stroke: var(--sunken); }
.ring-fg { fill: none; stroke-linecap: round; animation: ring-in 1.1s var(--ease) both; }
@keyframes ring-in { from { stroke-dashoffset: var(--len); } }
.ring-mark { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.stat-ring { display: flex; align-items: center; gap: 16px; }
.stat-ring .ring { width: 64px; height: 64px; }

/* Thin meter with a marker, and a stacked bar of one whole */
.meter { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--sunken); margin-top: 10px; }
.meter i { position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 3px; background: var(--t); animation: meter-in 1s var(--ease) both; }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
@keyframes meter-in { from { width: 0; } }
.stat.hl .meter { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); }
.stackbar { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; background: var(--sunken); }
.stackbar i { background: var(--t); min-width: 3px; animation: meter-in .9s var(--ease) both; }
.stackbar.lg { height: 14px; }

/* Radar */
.radar { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.rd-grid { fill: none; stroke: var(--line); }
.rd-grid:last-of-type { stroke: color-mix(in srgb, var(--ink) 18%, transparent); }
.rd-axis { stroke: var(--line); }
.rd-scale { fill: var(--muted); font-size: 10px; }
.rd-shape { fill: color-mix(in srgb, var(--s) 12%, transparent); stroke: var(--s); stroke-width: 2; stroke-linejoin: round; transform-origin: 50% 51%; animation: rd-in .8s var(--ease) both; }
.rd-shape.s2 { fill: none; stroke-dasharray: 5 4; }
@keyframes rd-in { from { transform: scale(.4); opacity: 0; } }
.rd-dot { fill: var(--s); stroke: var(--surface); stroke-width: 2; }
.rd-dot.s2 { r: 3.5px; }
.rd-label { fill: var(--muted); font-size: 12.5px; font-weight: 500; }
.rd-v { fill: var(--ink); font-weight: 700; }
.radar .hit { fill: transparent; }

/* Dumbbell: one exam to the next, per subject */
.dumb { display: grid; gap: 12px; }
.db-row { display: grid; grid-template-columns: 120px 1fr 56px; gap: 12px; align-items: center; font-size: 14px; }
.db-track { position: relative; height: 22px; outline: 0; }
.db-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.db-track .seg-b { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: color-mix(in srgb, var(--t) 45%, transparent); animation: vp-in .6s var(--ease) both; }
.db-track .p0, .db-track .p1 { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; }
.db-track .p0 { background: var(--surface); border: 2px solid var(--muted); }
.db-track .p1 { background: var(--t); box-shadow: 0 0 0 2px var(--surface); }
.db-row .d { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-row .d.up { color: var(--green-text); } .db-row .d.dn { color: var(--accent-text); }
.db-axis { display: grid; grid-template-columns: 120px 1fr 56px; gap: 12px; font-size: 11px; color: var(--muted); }
.db-axis div { display: flex; justify-content: space-between; }
@media (max-width: 480px) { .db-row, .db-axis { grid-template-columns: 84px 1fr 44px; font-size: 13px; gap: 8px; } }

/* Heatmaps (session calendar, register, week by class) */
.heat-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
.heat rect.c { rx: 3px; stroke: var(--surface); stroke-width: 0; }
.heat .P { fill: color-mix(in srgb, var(--green) 30%, var(--surface)); }
.heat .A { fill: var(--accent); }
.heat .L { fill: var(--warn); }
.heat .H { fill: none; stroke: var(--line) !important; stroke-width: 1 !important; stroke-dasharray: 2 2; }
.heat .N { fill: var(--sunken); }
.heat .T { stroke: var(--ink) !important; stroke-width: 2 !important; }
.heat rect.c[data-tip]:hover { stroke: var(--ink); stroke-width: 2; }
.heat text.nm { fill: var(--ink); font-size: 12px; }
.heat text.nm.flag { fill: var(--accent-text); font-weight: 600; }
.heat text.pc { fill: var(--ink); font-weight: 600; font-size: 12px; }
.heat text.pc.flag { fill: var(--accent-text); }
.heat .rowband { fill: var(--sunken); opacity: .55; }
.streaks { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.streaks b { display: block; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Week-by-class grid: numbers in every cell, a warm tint only where it needs follow-up. */
.wk { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; table-layout: fixed; }
.wk th { font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 0 0 4px; }
.wk th:first-child { width: 44px; text-align: left; }
.wk td { text-align: center; height: 26px; border-radius: 6px; background: color-mix(in srgb, var(--green) 10%, var(--surface)); color: var(--ink); }
.wk td.hi { background: color-mix(in srgb, var(--green) 22%, var(--surface)); }
.wk td.lo { background: var(--warn-soft); color: var(--warn); font-weight: 700; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent); }
.wk td.na { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.wk tbody th { text-align: left; color: var(--ink); font-weight: 600; font-size: 12px; }
.wk td:hover { outline: 2px solid var(--ink); outline-offset: -2px; }
@media (max-width: 560px) { .wk { font-size: 11px; border-spacing: 2px; } .wk td { height: 24px; } }

/* Column chart: a dashed target line across the plot */
.cols { position: relative; }
.cols .target { position: absolute; left: 0; right: 0; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); pointer-events: none; z-index: 1; }
.cols .target span { position: absolute; right: 0; top: -17px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface); padding: 0 4px; }

/* Line chart */
.ln-path { fill: none; stroke: var(--s); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1200; animation: draw 1.2s var(--ease) both; }
.ln-path.s2 { stroke-width: 2; }
.ln-area { fill: color-mix(in srgb, var(--s) 9%, transparent); animation: vp-in .9s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1200; } to { stroke-dashoffset: 0; } }
.ln-dot { fill: var(--s); stroke: var(--surface); stroke-width: 2.5; }
.ln-lab { font-weight: 700; font-size: 12px; }
.chart text.ln-lab.s1 { fill: var(--accent-text); } .chart text.ln-lab.s2 { fill: var(--royal-text); }

/* Scatter: the class at a glance */
.sc-dot { fill: color-mix(in srgb, var(--royal) 70%, var(--surface)); stroke: var(--surface); stroke-width: 2; transition: r .15s; }
.sc-dot.flag { fill: var(--accent); }
.sc-zone { fill: var(--accent-soft); }
.chart text.sc-name { fill: var(--accent-text); font-weight: 600; font-size: 11.5px; }
.chart text.zone-t { fill: var(--accent-text); font-weight: 600; font-size: 11px; }
.chart .hit:hover + .sc-dot, .chart .hit:focus + .sc-dot { r: 7px; }

/* Dot stack: every student's mark on one scale */
.ds-dot { fill: color-mix(in srgb, var(--royal) 75%, var(--surface)); stroke: var(--surface); stroke-width: 2; animation: ds-in .5s var(--ease) both; }
.ds-dot.low { fill: var(--accent); }
.ds-dot.me { stroke: var(--ink); stroke-width: 2; }
@keyframes ds-in { from { opacity: 0; transform: translateY(-10px); } }
.chart .ds-zone { fill: var(--accent-soft); }

/* Fee timeline: one node per instalment */
.fee-sum { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fee-sum b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.fee-sum span { font-size: 13px; color: var(--muted); }
.ftl { list-style: none; margin: 22px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.ftl::before { content: ""; position: absolute; top: 15px; left: 12.5%; right: 12.5%; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--green) 0 var(--done, 0%), var(--line) var(--done, 0%)); }
.ftl li { position: relative; display: grid; justify-items: center; text-align: center; gap: 2px; padding: 0 6px; font-size: 13px; }
.ftl .nd { width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); color: var(--muted); font-weight: 700; font-size: 12px; margin-bottom: 8px; position: relative; z-index: 1; }
.ftl .nd svg { width: 16px; height: 16px; }
.ftl .paid .nd { background: var(--green); border-color: var(--green); color: #fff; }
.ftl .due .nd { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 0 5px var(--accent-soft); }
.ftl b { font-size: 14px; }
.ftl span { color: var(--muted); }
.ftl .due span.when { color: var(--accent-text); font-weight: 600; }
@media (max-width: 560px) { .ftl { grid-template-columns: 1fr; gap: 14px; margin-top: 12px; } .ftl::before { top: 16px; bottom: 16px; left: 16px; right: auto; width: 3px; height: auto; background: linear-gradient(180deg, var(--green) 0 var(--done, 0%), var(--line) var(--done, 0%)); } .ftl li { grid-template-columns: 33px 1fr auto; justify-items: start; text-align: left; column-gap: 12px; align-items: center; } .ftl .nd { grid-row: span 2; margin: 0; } .ftl li > :nth-child(4) { grid-column: 3; grid-row: 1 / span 2; } }

/* Today's periods as a short agenda */
.agenda { display: grid; gap: 6px; }
.ag { --c: var(--slate); display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); font-size: 13.5px; }
.ag time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.ag b { font-weight: 600; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.ag span { color: var(--muted); font-size: 12.5px; text-align: right; }
.ag.past { opacity: .55; }
.ag.now { outline: 2px solid var(--accent); outline-offset: -2px; }
.ag.brk { background: repeating-linear-gradient(135deg, var(--sunken) 0 5px, var(--surface) 5px 10px); box-shadow: none; color: var(--muted); font-size: 12px; padding: 4px 10px; }
.ag.c-brick { --c: var(--accent); } .ag.c-green { --c: var(--green); } .ag.c-royal { --c: var(--royal); } .ag.c-gold { --c: var(--gold); } .ag.c-teal { --c: var(--teal); }

/* Homework progress */
.hw-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.hw-head .hw-prog { flex: 1; min-width: 220px; }
.hw-prog .lbl { display: flex; justify-content: space-between; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.hw-prog .lbl b { color: var(--ink); }

/* Admissions pipeline: one column per stage */
.pipe { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.pipe-col { background: var(--sunken); border-radius: 14px; padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.pipe-col h3 { display: flex; align-items: center; justify-content: space-between; font: 600 13.5px/1.2 var(--sans); padding: 4px 4px 6px; letter-spacing: 0; }
.pipe-col h3 span { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.pipe-col h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--t, var(--muted)); margin-right: 8px; flex: none; }
.pipe-col h3 em { font-style: normal; margin-right: auto; }
.pipe-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; font-size: 13px; display: grid; gap: 2px; animation: vp-in .35s var(--ease) both; }
.pipe-card b { font-size: 14px; font-weight: 600; }
.pipe-card span { color: var(--muted); }
.pipe-card button { justify-self: start; margin-top: 6px; border: 0; background: none; padding: 0; color: var(--accent-text); font: 600 12.5px var(--sans); cursor: pointer; }
.pipe-card button:hover { text-decoration: underline; }
.pipe-empty { font-size: 12.5px; color: var(--muted); padding: 6px 4px; }
.funnel { display: flex; gap: 3px; margin-bottom: 14px; }
.funnel > div { flex: var(--n); min-width: 46px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--t) 14%, var(--surface)); box-shadow: inset 0 3px 0 var(--t); font-size: 12px; color: var(--muted); }
.funnel b { display: block; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Fee by wing */
.wing { display: grid; gap: 12px; }
.wing-row { display: grid; grid-template-columns: 110px 1fr 46px; gap: 12px; align-items: center; font-size: 13.5px; }
.wing-row .meter { margin: 0; height: 10px; border-radius: 4px; }
.wing-row .meter i { border-radius: 4px; }
.wing-row b { text-align: right; font-variant-numeric: tabular-nums; }
.att-meter { margin: -6px 0 16px; max-width: 520px; }

@media (prefers-reduced-motion: reduce) {
  .vp, .ring-fg, .meter i, .stackbar i, .rd-shape, .ln-path, .ln-area, .ds-dot, .pipe-card, .db-track .seg-b { animation: none !important; }
}
.kid-kpis .meter-wrap { display: block; margin-top: 10px; }
.kid-kpis .stackbar { height: 6px; border-radius: 3px; }
.hw-prog .stackbar { height: 14px; margin-top: 8px; }
.legend[hidden] { display: none; }
.heat text { font-size: 9.5px; }
.vt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.vt-row .chips { margin: 0; }
.ai-card .card-h .vt { background: var(--surface); }
@media (max-width: 640px) { .wk { min-width: 600px; } }

/* ---------- Classes: one class and section at a time ---------- */
.gfit { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cls-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.cls-pick label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cls-pick select { min-height: 38px; padding: 4px 34px 4px 12px; font-size: 14.5px; font-weight: 600; width: auto; min-width: 120px; border-radius: 10px; }
.cls-card .kid-id { padding: 16px 20px; }
.cls-badge { width: auto; min-width: 52px; padding: 0 10px; border-radius: 14px; font-size: 15px; letter-spacing: -.01em; }
.cls-kpis { grid-template-columns: repeat(5, 1fr); }
.cls-kpis > div { padding: 14px 18px 16px; }
.cls-kpis dd { font-size: 24px; }
.cls-kpis .meter { margin-top: 8px; }
@media (max-width: 1100px) { .cls-kpis { grid-template-columns: repeat(3, 1fr); } .cls-kpis > div:nth-child(4) { border-left: 0; } .cls-kpis > div:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 760px) { .cls-kpis { grid-template-columns: 1fr 1fr; } .cls-kpis > div { border-left: 1px solid var(--line) !important; } .cls-kpis > div:nth-child(odd) { border-left: 0 !important; } .cls-kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); } .cls-kpis > div:last-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .topbar .cls-pick { width: 100%; } .cls-pick label { flex: 1; } .cls-pick select { width: 100%; } }

.sbj { display: grid; gap: 12px; }
.sbj-row { display: grid; grid-template-columns: 170px 1fr 64px; gap: 14px; align-items: center; }
.sbj-row .nm { display: grid; line-height: 1.25; min-width: 0; }
.sbj-row .nm b { font-size: 14px; font-weight: 600; }
.sbj-row .nm span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbj-row .track { height: 12px; position: relative; border-radius: 4px; background: var(--sunken); outline: 0; }
.sbj-row .track:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.sbj-row .fill { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--accent); animation: meter-in 1s var(--ease) both; }
.sbj-row .ref { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; }
.sbj-row .v { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; font-variant-numeric: tabular-nums; }
.sbj-row .v b { font-size: 15px; }
.sbj-row .v small, .tbl td.up, .tbl td.dn { font-size: 12px; font-weight: 700; }
.sbj-row .v small.up, .tbl td.up { color: var(--green-text); } .sbj-row .v small.dn, .tbl td.dn { color: var(--accent-text); }
@media (max-width: 480px) { .sbj-row { grid-template-columns: 104px 1fr 56px; gap: 10px; } }

.sec-tbl tbody tr { cursor: pointer; }
.sec-tbl tbody tr:hover td { background: var(--sunken); }
.sec-tbl tbody tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.sec-tbl tr.on td { background: var(--accent-soft); }
.sec-tbl tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sec-tbl td:first-child b { display: block; }
.sec-tbl td:first-child span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tbl td.lo { color: var(--warn); font-weight: 700; }
.roster { max-height: 380px; overflow-y: auto; }
.roster thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.stu-n { display: grid; text-align: right; line-height: 1.2; }
.stu-n b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.stu-n small { font-size: 12px; color: var(--muted); }
.sec-sq { width: auto; min-width: 46px; padding: 0 8px; font-size: 12.5px; }
#c-wk tbody th { font-size: 12px; }
.cols .col { cursor: pointer; }
@media (max-width: 640px) { #c-wk { min-width: 0; } }

/* ---------- Presenter controls (prototype bar) ---------- */
.demo-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin-top: 6px; }
.demo-ctl .dm { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.demo-ctl .dm span { opacity: .75; font-weight: 500; }
.demo-ctl select { max-width: min(380px, 70vw); height: 28px; padding: 0 26px 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.22); background: #2A2E35; color: #EEF0F3; font: 500 12.5px var(--sans); cursor: pointer; }
.demo-ctl select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.demo-ctl option, .demo-ctl optgroup { color: #1D2025; background: #fff; }
.demo-ctl a { color: inherit; }
@media (max-width: 560px) { .demo-ctl .dm { width: 100%; justify-content: space-between; } .demo-ctl select { flex: 1; max-width: none; } }

/* ---------- Stage cards: checklists, results ---------- */
.pill.royal { background: color-mix(in srgb, var(--royal) 14%, var(--surface)); color: var(--royal-text); text-decoration: none; }
.pill.gold { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); color: var(--gold-text); }
.phase-card .meter { margin: 0 0 6px; }
.chk { display: grid; gap: 2px; margin-top: 6px; }
.chk-i { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px 6px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); font: inherit; border-radius: 0; }
.chk-i:first-child { border-top: 0; }
button.chk-i { cursor: pointer; }
button.chk-i:hover { background: var(--sunken); }
.chk-i .box { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; margin-top: 1px; color: #fff; }
.chk-i .box svg { width: 14px; height: 14px; }
.chk-i.on .box { background: var(--green); border-color: var(--green); }
.chk-i .t { display: grid; gap: 1px; flex: 1; min-width: 0; }
.chk-i .t b { font-size: 14.5px; font-weight: 600; }
.chk-i.on .t b { color: var(--muted); }
.chk-i .t > span { font-size: 13px; color: var(--muted); }
.chk-i .t .meter { margin-top: 6px; max-width: 260px; }
#phase-card { margin-bottom: 0; }
.home-main #phase-card:not([hidden]) + .card { margin-top: 0; }

/* Exam calendar for a new session */
.xcal { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.xcal li { padding: 12px 14px; border-radius: 12px; background: var(--sunken); box-shadow: inset 3px 0 0 var(--royal); display: grid; gap: 2px; }
.xcal b { font-size: 14.5px; }
.xcal span { font-size: 13px; color: var(--muted); }
.xcal small { font-size: 12px; font-weight: 600; color: var(--royal-text); }

/* Report card and the year's result */
.rc-h { display: flex; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; align-items: flex-start; }
.rc-h h2 { font-size: 20px; margin: 4px 0 2px; }
.rc-h .lbl { font-size: 12.5px; color: var(--muted); }
.rc-h .muted { font-size: 13.5px; }
.rc-res { display: grid; justify-items: end; gap: 4px; }
.rc-res .pill { font-size: 13.5px; padding: 8px 12px; }
.rc-res small { font-size: 12px; color: var(--muted); }
.rc-k { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.rc-k > div { padding: 12px 14px; border-radius: 12px; background: var(--sunken); display: grid; }
.rc-k b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rc-k span { font-size: 12.5px; color: var(--muted); }
.rc-g { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rc-g > span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; outline: 0; }
.rc-g > span:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.rc-g b { min-width: 30px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-text); font-size: 12px; }
.rc-rm { margin-top: 14px; font-size: 14px; line-height: 1.55; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--royal) 6%, var(--surface)); }
@media (max-width: 640px) { .rc-k { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); } .rc-res { justify-items: start; } }
.result-hero .rh-top { display: flex; gap: 12px 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-bottom: 12px; }
.result-hero .lbl { font-size: 12.5px; color: var(--muted); }
.result-hero h2 { font-size: 22px; margin: 2px 0 2px; color: var(--green-text); }
.result-hero .muted { font-size: 13.5px; }

/* Teacher: section picker on Marks, and the parent threads */
.m-pick select { min-height: 36px; padding: 4px 30px 4px 12px; font-size: 14px; width: auto; border-radius: 10px; }
.threads .li.on { background: var(--accent-soft); border-radius: 12px; }
.res-row .meter b { background: var(--ink); }

/* ---------- Reading the numbers: reads, change chips, trend lines, class strips ---------- */
:root { --band: color-mix(in srgb, var(--ink) 5.5%, transparent); }
.read { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 16px; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.55; color: var(--ink); background: color-mix(in srgb, var(--royal) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--royal) 14%, var(--line)); }
.read svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--royal-text); }
.read b { font-weight: 600; }
#fee-read .read { margin: 0; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 6px; border-radius: 999px; font: 600 12px/1.5 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta svg { width: 8px; height: 8px; fill: currentColor; }
.delta.good { color: var(--green-text); background: var(--green-soft); }
.delta.bad { color: var(--accent-text); background: var(--accent-soft); }
.delta.eq { color: var(--muted); background: var(--sunken); }
.stat.hl .delta { color: var(--accent-ink); background: color-mix(in srgb, var(--accent-ink) 18%, transparent); }
.num-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.num-row .spark { margin-bottom: 3px; flex: none; }
.spark { display: block; overflow: visible; }
.spark .sp-line { fill: none; stroke: var(--s); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark .sp-area { fill: color-mix(in srgb, var(--s) 13%, transparent); }
.spark .sp-dot { fill: var(--s); stroke: var(--surface); stroke-width: 1.6; }
.spark .sp-ref { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: .35; }
.stat.hl .spark .sp-dot { stroke: var(--accent); }
.kid-kpis > div { position: relative; }
.kpi-sp { position: absolute; right: 20px; top: 14px; }
@media (max-width: 760px) { .kpi-sp { position: static; display: block; margin: 6px 0 2px; } }
.tr-sp { width: 64px; }
.tr-sp .spark { margin-left: auto; }

/* Class strip: one dot per student. */
.swarm .sw-dot { fill: color-mix(in srgb, var(--muted) 45%, var(--surface)); stroke: var(--surface); stroke-width: 1.5; animation: sw-in .5s var(--ease) both; transform-box: fill-box; transform-origin: center; }
.swarm .sw-dot.flag { fill: var(--accent); }
.swarm .sw-zone { fill: var(--warn-soft); }
.swarm .hit { cursor: default; }
@keyframes sw-in { from { opacity: 0; transform: scale(.4); } }
#c-swarm, #t-swarm { margin-bottom: 14px; }
#t-swarm .swarm { max-width: 100%; }

/* Attendance by class: a zoomed dot plot with each section. */
.cdots { margin-top: 2px; }
.cdots .cd-zone { fill: var(--warn-soft); opacity: .7; }
.cdots .cd-range { stroke: color-mix(in srgb, var(--muted) 45%, transparent); stroke-width: 2; stroke-linecap: round; }
.cdots .cd-sec { fill: var(--surface); stroke: var(--muted); stroke-width: 1.4; }
.cdots .cd-sec.lo { stroke: var(--warn); }
.cdots .cd-cls { fill: var(--green); stroke: var(--surface); stroke-width: 2; animation: sw-in .55s var(--ease) both; transform-box: fill-box; transform-origin: center; }
.cdots .cd-cls.lo { fill: var(--warn); }
.cdots .cd-wait { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 3 3; }
.cdots .cd-avg { stroke: var(--royal); stroke-width: 1.5; opacity: .8; }
.chart text.cd-avg-t { fill: var(--royal-text); font-weight: 600; font-size: 11px; }
.chart text.cd-x { font-size: 9px; letter-spacing: -.02em; }
.chart text.cd-lab { fill: var(--ink); font-weight: 700; font-size: 11.5px; }
.cdots .cd-col { cursor: pointer; }
.cdots .cd-col:hover, .cdots .cd-col:focus-visible { fill: color-mix(in srgb, var(--ink) 5%, transparent); outline: 0; }

/* Subjects against the other sections: bars either side of a centre line. */
.dv { position: relative; height: 22px; outline: 0; }
.dv::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.dv::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); opacity: .7; }
.dv:focus-visible { box-shadow: 0 0 0 2px var(--ink); border-radius: 4px; }
.dv-bar { position: absolute; top: 5px; bottom: 5px; border-radius: 3px; animation: vp-in .6s var(--ease) both; }
.dv-bar.up { background: var(--green); border-radius: 0 3px 3px 0; }
.dv-bar.dn { background: var(--warn); border-radius: 3px 0 0 3px; }
.dv-n { position: absolute; top: 50%; transform: translateY(-50%); font: 700 12px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.dv-n.eq { color: var(--muted); font-weight: 600; }
.dv-axis { display: grid; grid-template-columns: 170px 1fr 64px; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: -4px; }
.dv-axis div { display: flex; justify-content: space-between; }

/* Marks against the class, on CBSE grade bands. */
.gb-list .db-row { grid-template-columns: 120px 1fr 64px; }
.gb-list .db-axis { grid-template-columns: 120px 1fr 64px; }
.db-track.gb { border-radius: 4px; }
.gb-top div { position: relative; height: 14px; display: block; }
.gb-top div span { position: absolute; transform: translateX(-50%); font-weight: 600; }
.gb-bot div span { font-weight: 500; }
.gb-bot div span:first-child { transform: none; } .gb-bot div span:last-child { transform: translateX(-100%); }
.gb-d { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; }
.gb-d small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
@media (max-width: 480px) {
  .gb-list .db-row, .gb-list .db-axis { grid-template-columns: 84px 1fr 54px; }
  .dv-axis { grid-template-columns: 104px 1fr 56px; gap: 10px; }
}
.chart text.cd-lab.cd-x { font-size: 9.5px; }
