/* EduLayer portal. Tokens follow docs/UX-STRATEGY.md: one accent per kind of institution, status = icon + word + colour,
   two densities, light and dark themes, system fonts, 44px touch targets, visible focus. No framework.
   Layout: a sidebar of jobs (collapsible groups with icons) beside a column holding a slim top bar and the page; on
   tablets the sidebar slides in, and on phones a bottom dock keeps Home, Search, Menu and the account in thumb reach. */
:root {
  --ink: #151b2c; --muted: #596275; --line: #e2e6ee; --line-strong: #cdd3de; --field: #838c9d; --canvas: #f3f5f9; --surface: #ffffff; --raised: #f6f7fa;
  --accent: #3a54d6; --accent-ink: #2b40a8; --accent-soft: #e9edfd; --on-accent: #ffffff;
  --ai: #6234c4; --ai-bg: #f0eafd;
  --good: #17683f; --good-bg: #e2f4ea; --warn: #8a4f00; --warn-bg: #fcefd8; --crit: #b0241c; --crit-bg: #fde6e4;
  --info: #2547b3; --info-bg: #e8eefc; --neutral: #465063; --neutral-bg: #edf0f5;
  --brand: #1c2766; --brand-ink: #ffffff; --brand-soft: #c9d1f5;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 4px 8px -2px rgba(16, 24, 40, .08), 0 12px 32px -4px rgba(16, 24, 40, .14);
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px;
  --row: 46px; --pad: 18px; --fs: 14px; --nav-w: 268px; --top-h: 60px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --mono: ui-monospace, "Cascadia Code", SFMono-Regular, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-density="compact"] { --row: 36px; --pad: 13px; --fs: 13px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8ebf2; --muted: #a2abbd; --line: #252c3a; --line-strong: #353d4e; --field: #6f7a8e; --canvas: #0d1017; --surface: #151a24; --raised: #1b2130;
    --accent: #8fa4ff; --accent-ink: #b8c5ff; --accent-soft: #1d2546; --on-accent: #0a0f22;
    --ai: #c7b3ff; --ai-bg: #2a2147; --good: #7fd6a6; --good-bg: #13342a; --warn: #f3c06a; --warn-bg: #3a2b10;
    --crit: #ff9d94; --crit-bg: #43201d; --info: #a9bdff; --info-bg: #1d2546; --neutral: #c4cad6; --neutral-bg: #262d3b;
    --brand: #141a3d; --brand-ink: #f2f4ff; --brand-soft: #b9c3ee;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 4px 8px -2px rgba(0, 0, 0, .5), 0 16px 40px -6px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e8ebf2; --muted: #a2abbd; --line: #252c3a; --line-strong: #353d4e; --field: #6f7a8e; --canvas: #0d1017; --surface: #151a24; --raised: #1b2130;
  --accent: #8fa4ff; --accent-ink: #b8c5ff; --accent-soft: #1d2546; --on-accent: #0a0f22;
  --ai: #c7b3ff; --ai-bg: #2a2147; --good: #7fd6a6; --good-bg: #13342a; --warn: #f3c06a; --warn-bg: #3a2b10;
  --crit: #ff9d94; --crit-bg: #43201d; --info: #a9bdff; --info-bg: #1d2546; --neutral: #c4cad6; --neutral-bg: #262d3b;
  --brand: #141a3d; --brand-ink: #f2f4ff; --brand-soft: #b9c3ee;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 4px 8px -2px rgba(0, 0, 0, .5), 0 16px 40px -6px rgba(0, 0, 0, .6); color-scheme: dark;
}
/* Accent per kind of institution (light, then dark) */
:root[data-kind="college"] { --accent: #0b6b9e; --accent-ink: #08547c; --accent-soft: #e2f1f9; }
:root[data-kind="school"] { --accent: #25773f; --accent-ink: #1b5c30; --accent-soft: #e3f3e7; }
:root[data-kind="tuition"] { --accent: #0f7566; --accent-ink: #0a5a4e; --accent-soft: #ddf2ee; }
:root[data-kind="exam-body"] { --accent: #a12a5a; --accent-ink: #7f1f46; --accent-soft: #fbe7ef; }
:root[data-kind="training"] { --accent: #99520a; --accent-ink: #7a4006; --accent-soft: #fcefdf; }
@media (prefers-color-scheme: dark) {
  :root[data-kind="college"]:not([data-theme="light"]) { --accent: #6cc4f0; --accent-ink: #9fd8f5; --accent-soft: #13303f; }
  :root[data-kind="school"]:not([data-theme="light"]) { --accent: #7fd394; --accent-ink: #a8e3b6; --accent-soft: #15331f; }
  :root[data-kind="tuition"]:not([data-theme="light"]) { --accent: #5fd0bf; --accent-ink: #8ee0d3; --accent-soft: #14332f; }
  :root[data-kind="exam-body"]:not([data-theme="light"]) { --accent: #f59fc0; --accent-ink: #f8c3d7; --accent-soft: #3d1b2a; }
  :root[data-kind="training"]:not([data-theme="light"]) { --accent: #f2b277; --accent-ink: #f7cfa6; --accent-soft: #3a2a17; }
}
:root[data-kind="college"][data-theme="dark"] { --accent: #6cc4f0; --accent-ink: #9fd8f5; --accent-soft: #13303f; }
:root[data-kind="school"][data-theme="dark"] { --accent: #7fd394; --accent-ink: #a8e3b6; --accent-soft: #15331f; }
:root[data-kind="tuition"][data-theme="dark"] { --accent: #5fd0bf; --accent-ink: #8ee0d3; --accent-soft: #14332f; }
:root[data-kind="exam-body"][data-theme="dark"] { --accent: #f59fc0; --accent-ink: #f8c3d7; --accent-soft: #3d1b2a; }
:root[data-kind="training"][data-theme="dark"] { --accent: #f2b277; --accent-ink: #f7cfa6; --accent-soft: #3a2a17; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body, #root { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: var(--fs); line-height: 1.5; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* A page heading receives focus after each navigation so screen readers announce the new page; it shows an accent
   underline instead of a box, and the next Tab moves on from it as usual. */
h1[tabindex="-1"], h2[tabindex="-1"] { width: fit-content; max-width: 100%; }
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline: none; box-shadow: 0 3px 0 -1px var(--accent); border-radius: 0; }
main[tabindex="-1"]:focus-visible, section[tabindex="-1"]:focus-visible { outline-offset: -3px; }
::selection { background: var(--accent-soft); color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 600; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.hide, [hidden] { display: none !important; }
kbd { font: inherit; font-size: 11px; font-weight: 600; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--surface); }
.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 22px; height: 22px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, transform .12s; }
.btn:hover { background: var(--raised); border-color: var(--field); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.pri:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn.danger { color: var(--crit); border-color: var(--crit); }
.btn.danger:hover { background: var(--crit-bg); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--raised); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.ib { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; transition: background .12s; }
.ib:hover { background: var(--raised); }
.ib.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.ib.ghost:hover { background: var(--raised); color: var(--ink); }
@media (pointer: coarse) { .btn, .ib { min-height: 44px; min-width: 44px; } .chip { min-height: 44px; } .nv, .ng { min-height: 44px; } }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 13px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--field); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--canvas); }
.chip .x { font-weight: 700; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; line-height: 1.5; }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.good::before { content: "✓"; }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.warn::before { content: "!"; font-weight: 800; }
.pill.crit { background: var(--crit-bg); color: var(--crit); } .pill.crit::before { content: "✕"; }
.pill.info { background: var(--info-bg); color: var(--info); } .pill.info::before { content: "i"; font-style: italic; font-family: Georgia, serif; }
.pill.ai { background: var(--ai-bg); color: var(--ai); } .pill.ai::before { content: "✦"; }
.pill.neutral { background: var(--neutral-bg); color: var(--neutral); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: var(--pad); }

label.f { display: block; }
label.f > span.l { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
label.f > span.l .req { color: var(--crit); margin-left: 2px; }
.in, select.in, textarea.in { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--field); border-radius: 9px; background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s; }
textarea.in { min-height: 100px; resize: vertical; font-family: inherit; }
textarea.in.code { font-family: var(--mono); font-size: 12.5px; min-height: 160px; }
.in:hover { border-color: var(--muted); }
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.in[aria-invalid="true"] { border-color: var(--crit); }
.in::placeholder { color: var(--muted); opacity: .85; }
.help { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.err-text { display: block; font-size: 12.5px; color: var(--crit); margin-top: 5px; font-weight: 500; }
.check { display: flex; align-items: center; gap: 10px; min-height: 38px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; }
.form { display: grid; gap: 16px; }
.form .actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; flex-wrap: wrap; }
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 280px; overflow: auto; padding: 4px; }
.picker-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.picker-list button:hover, .picker-list button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- sign-in ---------- */
.gate { min-height: 100%; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--canvas); }
.gate-brand { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 48px; background: var(--brand); color: var(--brand-ink); }
.gate-brand::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(circle at 20% 10%, #000 0, transparent 70%); pointer-events: none; }
.gate-brand > * { position: relative; }
.gate-brand .logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.gate-brand .logo-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; background: var(--brand-ink); color: var(--brand); }
.gate-statement { font-family: var(--font-display); font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; margin: 0; max-width: 16ch; text-wrap: balance; }
.gate-sub { color: var(--brand-soft); font-size: 15.5px; max-width: 44ch; margin-top: 14px; }
.gate-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; max-width: 46ch; }
.gate-points li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.gate-points .icon-wrap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.gate-points b { display: block; font-weight: 650; }
.gate-points span.t { color: var(--brand-soft); font-size: 13.5px; }
.gate-foot { color: var(--brand-soft); font-size: 12.5px; }
.gate-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.gate .card { width: 100%; max-width: 460px; padding: 32px; box-shadow: var(--shadow); border-radius: var(--radius-lg); }
.gate .card h1 { font-size: 24px; }
.gate .card > p.muted { margin-top: 6px; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 13.5px; letter-spacing: -.02em; flex: none; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin: 20px 0 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs button, .tabs a { min-height: 42px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: color .12s, border-color .12s; }
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.demo { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.demo-head h2 { font-size: 14.5px; }
.demo-pw { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.demo-pw code { font-family: var(--mono); color: var(--ink); background: var(--raised); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.demo-list { display: grid; gap: 4px; max-height: 360px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.demo-list .grp { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 8px 2px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.demo-list button { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; min-height: 48px; padding: 7px 10px; border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; }
.demo-list button:hover { background: var(--raised); border-color: var(--line); }
.demo-list button .avatar { width: 34px; height: 34px; font-size: 12px; }
.demo-list button b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-list button .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-list button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.demo-list button[aria-pressed="true"] b { color: var(--accent-ink); }
.demo-filter { margin-bottom: 8px; }
@media (max-width: 960px) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-brand { position: relative; height: auto; padding: 28px 20px 24px; gap: 12px; }
  .gate-points, .gate-foot { display: none; }
  .gate-statement { font-size: 24px; max-width: none; }
  .gate-sub { font-size: 14px; margin-top: 6px; }
  .gate-side { padding: 20px 16px 40px; align-items: flex-start; }
  .gate .card { padding: 22px 18px; }
}

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); height: 100%; }
.side { display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--surface); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 11px; min-height: var(--top-h); padding: 0 18px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); flex: none; }
.side-brand:hover { color: var(--ink); }
.side-brand .nm { min-width: 0; display: grid; line-height: 1.25; }
.side-brand b { font-family: var(--font-display); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-brand .k { font-size: 12px; color: var(--muted); }
.side nav { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 10px 10px 20px; scrollbar-width: thin; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.top { flex: none; display: flex; align-items: center; gap: 12px; height: var(--top-h); padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; position: relative; z-index: 20; }
.top-brand { display: none; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 700; }
.top-brand b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-btn { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; flex: 0 1 420px; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raised); color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s; }
.search-btn:hover { border-color: var(--field); background: var(--surface); }
.search-btn span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip { display: flex; gap: 6px; align-items: center; overflow: hidden; min-width: 0; flex: 1; }
.strip .lbl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.strip a.pill { cursor: pointer; flex: none; }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.acct { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 22px; background: none; cursor: pointer; color: var(--ink); }
.acct:hover { background: var(--raised); }
.acct .who { display: grid; text-align: left; line-height: 1.2; max-width: 160px; }
.acct .who b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .who span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background .12s; }
.nv .icon { color: var(--muted); }
.nv .lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv:hover { background: var(--raised); color: var(--ink); }
.nv[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.nv[aria-current="page"] .icon { color: var(--accent-ink); }
.nv .cnt { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--neutral-bg); color: var(--neutral); }
.nv .cnt.crit { background: var(--crit-bg); color: var(--crit); }
.ng { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; margin-top: 8px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.ng:hover { background: var(--raised); color: var(--ink); }
.ng .lb { flex: 1; min-width: 0; }
.ng .chev { transition: transform .15s var(--ease); }
.ng[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.ng-items { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 2px 0 4px; }
.ng-items .nv { padding-left: 38px; font-weight: 450; }
.ng-items .nv[aria-current="page"] { font-weight: 650; }
.ng-sec + .ng-sec .ng { margin-top: 2px; }
.ng-badge { display: inline-flex; }
.ng-badge .cnt { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--neutral-bg); color: var(--neutral); }
.ng-badge .cnt.crit { background: var(--crit-bg); color: var(--crit); }
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-weight: 600; text-decoration: none; margin-bottom: 4px; }
.boot { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.boot > * { width: min(440px, 100%); }
.col > main { flex: 1; overflow-y: auto; min-width: 0; scroll-padding-top: 16px; }
.page { padding: 28px 32px 64px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.page-head .grow p { margin: 6px 0 0; color: var(--muted); max-width: 78ch; font-size: 14.5px; }
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }
.crumb .sep { opacity: .6; }
.menu-btn { display: none; }
.scrim { display: none; }
.dock { display: none; }

@media (max-width: 1560px) { .strip .pill:nth-of-type(n+3) { display: none; } }
@media (max-width: 1280px) { .strip .lbl { display: none; } .acct .who { display: none; } }
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .top-brand { display: flex; }
  .side { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); visibility: hidden; transition: transform .2s var(--ease), visibility 0s linear .2s; box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; visibility: visible; transition: transform .2s var(--ease); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(9, 12, 20, .45); }
  .strip { display: none; }
  .search-btn { flex: 0 1 300px; margin-left: auto; }
  .top { padding: 0 16px; }
  .page { padding: 22px 20px 72px; }
}
@media (max-width: 760px) {
  .top { gap: 6px; padding: 0 10px; }
  .menu-btn, .search-btn, .top-actions .acct { display: none; }
  .top-brand { flex: 1; }
  .page { padding: 16px 16px 168px; }
  h1 { font-size: 23px; }
  .hero { padding: 18px 16px; gap: 14px; margin-bottom: 16px; }
  .hero > .row { width: 100%; }
  .hero-stats { flex: 1; }
  .stat { flex: 1; min-width: 0; padding: 8px 12px; }
  .stat .n { font-size: 21px; }
  .dock { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 6px env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
  .dock a, .dock button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
  .dock [aria-current="page"] { color: var(--accent-ink); }
  .dock [aria-current="page"] .icon { background: var(--accent-soft); border-radius: 13px; padding: 4px 15px; width: 52px; height: 28px; }
}

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 26px; margin-bottom: 20px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(120deg, var(--accent-soft) 0%, var(--surface) 62%); box-shadow: var(--shadow-sm); }
.hero p { margin: 6px 0 0; color: var(--muted); }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { min-width: 128px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
button.stat { font: inherit; text-align: left; cursor: pointer; }
.stat:hover { border-color: var(--accent); color: var(--ink); }
.stat .n { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .n.crit { color: var(--crit); }
.stat .l { font-size: 12.5px; color: var(--muted); }
#mywork { scroll-margin-top: 16px; }
.quick { display: grid; gap: 2px; padding: 8px; }
.quick button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.quick button:hover { background: var(--raised); }
.quick .qi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.quick b { display: block; font-weight: 600; }
.quick .small { display: block; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1180px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.work { list-style: none; margin: 0; padding: 0; }
.work li { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px var(--pad); border-top: 1px solid var(--line); }
.work li:first-child { border-top: 0; }
.work .bar { align-self: stretch; border-radius: 4px; background: var(--neutral-bg); }
.work .bar.crit { background: var(--crit); } .work .bar.warn { background: var(--warn); } .work .bar.info { background: var(--info); } .work .bar.good { background: var(--good); }
.work .what { font-weight: 600; }
.work .why { color: var(--muted); font-size: 13px; }
.card > h3 { padding: 12px var(--pad) 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px var(--pad); border-bottom: 1px solid var(--line); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 104px; display: flex; flex-direction: column; gap: 4px; position: relative; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s, transform .12s; }
.tile .k { font-size: 13px; color: var(--muted); padding-right: 4px; }
.tile .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.tile .h { font-size: 12.5px; color: var(--muted); }
.tile.green { box-shadow: inset 3px 0 0 var(--good), var(--shadow-sm); } .tile.amber { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm); } .tile.red { box-shadow: inset 3px 0 0 var(--crit), var(--shadow-sm); } .tile.info { box-shadow: inset 3px 0 0 var(--info), var(--shadow-sm); }
.tile .st { margin-top: auto; padding-top: 6px; }
a.tile { color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); color: inherit; transform: translateY(-1px); }
.mod-block + .mod-block { margin-top: 22px; }
.mod-block h3 { margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.mod-block h3 .icon { color: var(--muted); }
.mod-block h3 a { color: var(--ink); text-decoration: none; }
.mod-block h3 a:hover { color: var(--accent); text-decoration: underline; }
.section-h { margin: 26px 0 12px; }

/* ---------- tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 12px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.toolbar .search input { padding-left: 36px; }
.toolbar .search::before { content: ""; position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--muted); -webkit-mask: var(--i-search) center / contain no-repeat; mask: var(--i-search) center / contain no-repeat; pointer-events: none; }
:root { --i-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips .lbl { font-size: 12.5px; color: var(--muted); align-self: center; margin-right: 2px; }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.t th, table.t td { text-align: left; padding: 0 14px; height: var(--row); border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
table.t th { font-size: 12px; font-weight: 650; color: var(--muted); background: var(--raised); position: sticky; top: 0; z-index: 1; letter-spacing: .01em; }
table.t th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; min-height: 24px; }
table.t th button:hover { color: var(--ink); }
table.t th button:focus-visible { outline: 3px solid var(--accent); }
table.t td.num, table.t th.num { text-align: right; }
table.t tbody tr { cursor: pointer; transition: background .08s; }
table.t tbody tr:hover td { background: var(--raised); }
table.t tbody tr[aria-selected="true"] td { background: var(--accent-soft); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.sel, table.t th.sel { width: 44px; padding-right: 0; }
table.t td.acts { text-align: right; width: 1%; }
table.t input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.bulk { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--ink); color: var(--canvas); box-shadow: var(--shadow); }
.bulk .btn { background: transparent; color: var(--canvas); border-color: rgba(255, 255, 255, .35); box-shadow: none; }
:root[data-theme="dark"] .bulk .btn { border-color: rgba(0, 0, 0, .3); }
.more-row { display: flex; justify-content: center; padding: 12px; }
.menu { position: fixed; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--raised); }
.menu button .icon { color: var(--muted); }
.menu-head { display: grid; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-head span { font-size: 12px; color: var(--muted); }
.subtabs { margin: 14px 0 0; }
.views { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.views .vx { min-width: 26px; min-height: 26px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }

/* ---------- states ---------- */
.state { padding: 44px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 4px; }
.state h3 { color: var(--ink); margin-bottom: 2px; }
.state p { max-width: 52ch; margin: 0 0 10px; }
.state .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 10px; background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.skel { background: linear-gradient(90deg, var(--raised), var(--line), var(--raised)); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 6px; height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin: 12px 0; }
.banner.warn { background: var(--warn-bg); color: var(--warn); } .banner.crit { background: var(--crit-bg); color: var(--crit); } .banner.info { background: var(--info-bg); color: var(--info); } .banner.good { background: var(--good-bg); color: var(--good); } .banner.ai { background: var(--ai-bg); color: var(--ai); }
.offline { position: fixed; left: 50%; transform: translateX(-50%); top: 70px; z-index: 70; box-shadow: var(--shadow); }

/* ---------- drawer, sheet, dialog, toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(9, 12, 20, .42); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer { position: fixed; z-index: 51; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .2s var(--ease); border-left: 1px solid var(--line); }
@keyframes slide { from { transform: translateX(28px); opacity: .3; } to { transform: none; opacity: 1; } }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer header h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 18px; }
.drawer .body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer footer { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--raised); }
dl.kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 0; margin: 0; }
dl.kv dt, dl.kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
dl.kv dt { color: var(--muted); font-size: 13px; padding-right: 12px; }
dl.kv dd { overflow-wrap: anywhere; }
.dialog { position: fixed; z-index: 61; left: 50%; top: 12vh; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: 80vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
.dialog .body { padding: 20px; overflow-y: auto; }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; background: var(--raised); border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm { border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 10px; }
.confirm .row .btn { color: var(--ink); }
.toasts { position: fixed; z-index: 80; right: 20px; bottom: 20px; display: grid; gap: 8px; max-width: min(420px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: var(--radius); background: var(--ink); color: var(--canvas); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: slide .2s var(--ease); font-weight: 500; }
.toast.crit { background: var(--crit); color: #fff; }
@media (max-width: 760px) { .toasts { left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: none; } }
/* The SupportLens help assistant's chat button (in its own shadow root) reads --sl-bottom, so it sits above the
   bottom bars; toasts move above it. */
:root:has(.self-tabs) { --sl-bottom: calc(80px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { :root:has(.self-tabs) { --sl-bottom: 92px; } }
@media (max-width: 760px) { :root:has(.dock) { --sl-bottom: calc(80px + env(safe-area-inset-bottom)); } }
:root:has([data-supportlens]) .toasts { bottom: calc(var(--sl-bottom, 20px) + 70px); }
/* While a menu, record panel or dialog is open the chat button steps aside, so it never covers their buttons. */
body:has(> .overlay, > .menu-scrim) > [data-supportlens] { visibility: hidden; }
.secret-once { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 12px; }
.secret-once code { display: block; margin-top: 6px; padding: 8px; background: var(--surface); color: var(--ink); border-radius: 6px; overflow-wrap: anywhere; font-family: var(--mono); }

/* ---------- command palette ---------- */
.palette { position: fixed; z-index: 61; left: 50%; top: 10vh; transform: translateX(-50%); width: min(660px, calc(100% - 24px)); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); animation: pop .18s var(--ease); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px 18px 50px; font-size: 16px; background: var(--surface); }
.palette::before { content: ""; position: absolute; left: 20px; top: 21px; width: 18px; height: 18px; background: var(--muted); -webkit-mask: var(--i-search) center / contain no-repeat; mask: var(--i-search) center / contain no-repeat; }
.palette input:focus-visible { outline-offset: -3px; border-radius: 0; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 56vh; overflow-y: auto; }
.palette li button { display: flex; width: 100%; gap: 10px; align-items: center; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.palette li button .icon { color: var(--muted); }
.palette li button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.palette li button[aria-selected="true"] .icon { color: var(--accent-ink); }
.palette .grp { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.palette .hint { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; background: var(--raised); }

/* ---------- grid entry (register, marks, check-in) ---------- */
.grid-list { display: grid; gap: 0; }
.grid-row { display: flex; align-items: center; gap: 12px; padding: 10px var(--pad); border-top: 1px solid var(--line); min-height: 60px; flex-wrap: wrap; }
.grid-row:first-child { border-top: 0; }
.grid-row .who { flex: 1; min-width: 160px; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; flex-wrap: wrap; background: var(--surface); }
.seg button { min-height: 44px; min-width: 64px; padding: 0 12px; border: 0; border-left: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 12.5px; text-transform: capitalize; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--raised); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.seg button[data-v="absent"][aria-checked="true"], .seg button[data-v="no_show"][aria-checked="true"] { background: var(--crit); color: #fff; }
.seg button[data-v="late"][aria-checked="true"] { background: var(--warn); color: #fff; }
:root[data-theme="dark"] .seg button[data-v="late"][aria-checked="true"] { color: #1b1300; }
.grid-row input.in { width: 110px; text-align: right; }
.sticky-foot { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px var(--pad); background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- module marketplace ---------- */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mod { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.mod .row h3 { flex: 1; }
.mod p { color: var(--muted); font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mod .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 13px; border: 0; background: var(--field); cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { left: 21px; }
.switch[disabled] { opacity: .5; cursor: not-allowed; }
.perm-grid { overflow-x: auto; }
.perm-grid table.t td, .perm-grid table.t th { max-width: none; }

/* ---------- self-service (students, parents, agents) ---------- */
.self { min-height: 100%; display: flex; flex-direction: column; }
.self-top { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px max(16px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.self-top b { font-family: var(--font-display); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.self-main { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 22px 16px 112px; }
.self-main > div > h1 { margin-bottom: 4px; }
.self-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 6px env(safe-area-inset-bottom); }
.self-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.self-tabs a:hover { color: var(--ink); }
.self-tabs a .i { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 15px; }
.self-tabs a[aria-current="page"] { color: var(--accent-ink); }
.self-tabs a[aria-current="page"] .i { background: var(--accent-soft); }
@media (min-width: 900px) { .self-tabs { left: 50%; transform: translateX(-50%); max-width: 780px; width: calc(100% - 32px); bottom: 14px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding-bottom: 4px; } }
/* Students and parents get larger text and 44 px targets everywhere, set in rem so a phone's own text size applies. */
.self-main { font-size: 1rem; }
.self .btn, .self .chip, .self .see, .self .back-link, .self .lang-btn, .self .who { min-height: 44px; }
.self .ib { min-height: 44px; min-width: 44px; }
.self .btn { font-size: .9375rem; }
/* Drawers, menus and messages open outside the shell: the same 44 px targets and 14 px floor for pupils and parents. */
.self-ui :is([role="dialog"], [role="menu"], .toast) :is(.small, small, .s, .help, .hint, .l, .req) { font-size: .875rem; }
.self-ui :is([role="dialog"], [role="menu"]) .btn { min-height: 44px; font-size: .9375rem; }
.self-ui :is([role="dialog"], [role="menu"]) .ib { min-height: 44px; min-width: 44px; }
.self-ui [role="menuitem"] { min-height: 44px; }
.self .btn.sm { min-height: 44px; font-size: .875rem; }
.self .rw .tx .s { font-size: .875rem; }
.self .rw .tx .s.wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.self .rw .tx .s.fact { color: var(--ink); }
/* Today's tasks: the due date and amount are the point, so they wrap instead of being cut off; on a phone the button sits under the words. */
.self .tasks .rw .tx .s { white-space: normal; }
@media (max-width: 520px) {
  .self .tasks div.rw { flex-wrap: wrap; }
  .self .tasks div.rw .tx { flex-basis: calc(100% - 50px); }
  .self .tasks div.rw .acts { width: 100%; padding-left: 48px; }
  .self .tasks div.rw .acts .btn { flex: 1; }
}
.self-tabs a { font-size: .875rem; }
.self-top .who { display: inline-flex; align-items: center; gap: 4px; max-width: 38vw; padding: 0 12px; border: 0; border-radius: 22px; background: var(--accent-soft); color: var(--accent-ink); font: inherit; font-size: .875rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
span.who { cursor: default; }
.self-top .who-name { overflow: hidden; text-overflow: ellipsis; }
.lang-btn { padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lang-btn:hover { background: var(--raised); }
.hello p { margin: 2px 0 0; }
.self .note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: .9375rem; }
.self-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 18px; }
.self-quick .btn { white-space: normal; text-align: center; line-height: 1.25; padding: 8px 12px; }
.find-link { margin: 18px 0 0; }
.find-link a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
.next-card { display: grid; gap: 2px; margin-bottom: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); text-decoration: none; }
.next-card:hover { color: var(--on-accent); filter: brightness(1.06); }
.next-card small { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .92; }
.next-card b { font-size: 1.25rem; }
.self .rows + .rows { margin-top: 10px; }
.day-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.day-stat { display: grid; align-content: start; gap: 2px; min-height: 64px; padding: 12px; color: var(--ink); text-decoration: none; }
.day-stat + .day-stat { border-left: 1px solid var(--line); }
a.day-stat:hover { background: var(--raised); color: var(--ink); }
.day-stat b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.day-stat span { font-size: .875rem; color: var(--muted); line-height: 1.3; }
.reg-figure { max-width: 240px; margin-bottom: 12px; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.times .time { min-height: 48px; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.times .taken { display: grid; place-items: center; min-height: 48px; padding: 4px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--raised); color: var(--muted); line-height: 1.15; text-align: center; }
.day-chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 10px; scrollbar-width: none; }
.more-pages { margin-top: 12px; }
.more-pages > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; color: var(--accent-ink); cursor: pointer; }
.more-pages[open] > summary { margin-bottom: 8px; }
.find { margin-top: 12px; }
.pay-sheet .amount-box { display: grid; gap: 2px; }
.pay-sheet .amount { font-family: var(--font-display); font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.choices { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.choices legend { margin-bottom: 6px; padding: 0; font-weight: 600; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border: 2px solid var(--accent); }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.btn.lg { width: 100%; min-height: 52px; font-size: 1rem; }
.linkish { min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-align: left; text-decoration: underline; cursor: pointer; }
.link-word { flex: none; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.journey { display: flex; gap: 0; overflow-x: auto; padding: 6px 0 16px; scrollbar-width: thin; }
.journey .s { flex: 1; min-width: 80px; text-align: center; font-size: 12px; color: var(--muted); position: relative; padding-top: 28px; }
.journey .s::before { content: ""; position: absolute; top: 8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); z-index: 1; }
.journey .s::after { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.journey .s:first-child::after { display: none; }
.journey .s.done::before { background: var(--good); border-color: var(--good); }
.journey .s.done::after, .journey .s.now::after { background: var(--good); }
.journey .s.now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.journey .s.now { color: var(--ink); font-weight: 700; }
.task { display: flex; gap: 12px; align-items: center; padding: 14px var(--pad); flex-wrap: wrap; }
.task + .task { border-top: 1px solid var(--line); }
.task .what { font-weight: 600; }
.svc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.svc-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; min-height: 58px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; box-shadow: var(--shadow-sm); transition: border-color .12s, transform .12s; }
.svc-list a:hover { border-color: var(--accent); transform: translateY(-1px); }
.svc-list a .icon { color: var(--muted); }

/* ---------- person 360 (people/ui.js) ---------- */
.p360-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.p360-head .avatar { width: 56px; height: 56px; font-size: 19px; }
.p360 { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; margin-top: 18px; align-items: start; }
@media (max-width: 1000px) { .p360 { grid-template-columns: minmax(0, 1fr); } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px var(--pad); border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .when { font-size: 12.5px; color: var(--muted); }
.timeline .src { font-size: 12px; color: var(--muted); }
.timeline li.restricted .txt { color: var(--muted); font-style: italic; }
@media (max-width: 560px) { .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; } dl.kv { grid-template-columns: minmax(0, 1fr); } dl.kv dt { border-bottom: 0; padding-bottom: 0; } }

/* ---------- tap-first building blocks (docs/UX-STRATEGY.md, phone redesign) ----------
   Every screen is built from four pieces: a section heading with "See all", a list of rows (icon, two lines, value,
   chevron: the whole row is the target), a grid of tiles (icon and a short name, with a count badge) and figure cards.
   Explanations sit behind an (i) button instead of filling the screen. */
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 22px 0 10px; }
.sec-h h2 { font-size: 16px; }
.sec-h h3 { font-size: 13px; color: var(--muted); font-weight: 650; }
.sec-h .see { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; font-size: 13.5px; font-weight: 600; text-decoration: none; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0 2px; }
.page > .sec-h:first-child, .self-main .sec-h:first-child { margin-top: 4px; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.rows > li + li { border-top: 1px solid var(--line); }
.rows + .sec-h h3 { margin-top: 4px; }
.rw { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 14px; border: 0; background: none; color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
a.rw:hover, button.rw:hover { background: var(--raised); color: var(--ink); }
div.rw { cursor: default; }
.rw .ti { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--neutral-bg); color: var(--neutral); }
.rw .ti.crit { background: var(--crit-bg); color: var(--crit); } .rw .ti.warn { background: var(--warn-bg); color: var(--warn); }
.rw .ti.good { background: var(--good-bg); color: var(--good); } .rw .ti.info, .rw .ti.acc { background: var(--accent-soft); color: var(--accent-ink); }
.rw .tx { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.3; }
.rw .tx b { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.rw .tx .s { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rw .val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.rw .val.crit { color: var(--crit); } .rw .val.warn { color: var(--warn); }
.rw > .icon.chev { color: var(--muted); }
.rw .pill { flex: none; }
.rw .acts { display: flex; gap: 6px; align-items: center; flex: none; }
.rw .ti.time { width: 54px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rw-hit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rw:has(> .rw-hit:hover) { background: var(--raised); }
.qt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.qt[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 6px; left: 8px; font-weight: 800; color: var(--accent-ink); }
.today-now .small { display: block; }
.qtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.qt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px; min-height: 92px; padding: 12px 6px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .12s, transform .12s; }
.qt:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
.qt .qi { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.qt .ql { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.qt .bd { position: absolute; top: 6px; right: 6px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-size: 11px; font-weight: 750; background: var(--warn-bg); color: var(--warn); }
.qt .bd.crit { background: var(--crit); color: var(--surface); }
.qt.add .qi { background: var(--raised); color: var(--muted); border: 1px dashed var(--line-strong); }
.qt.editing { border-style: dashed; }
.qt .unpin { position: absolute; top: -6px; left: -6px; width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; background: var(--ink); color: var(--canvas); border: 2px solid var(--surface); }
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.fig { display: flex; flex-direction: column; gap: 2px; min-height: 78px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
a.fig:hover { border-color: var(--accent); color: var(--ink); }
.fig .v { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.fig .k { font-size: 12.5px; color: var(--muted); }
.fig.red .v { color: var(--crit); } .fig.amber .v { color: var(--warn); }
.area-search { margin: 4px 0 6px; }
.bell { position: relative; }
.bell .cnt { position: absolute; top: 1px; right: -1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font-size: 10.5px; font-weight: 750; background: var(--crit); color: var(--surface); }
.bell .cnt.warn { background: var(--warn); }
.page-head .info-btn { display: none; }
.today-now { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink); }
.today-now b { display: block; font-size: 16px; }
.today-now .grow { min-width: 160px; }
.steps-bar { display: flex; gap: 4px; margin: 8px 0 2px; }
.steps-bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--line-strong); }
.steps-bar span.done { background: var(--good); } .steps-bar span.now { background: var(--accent); }
.kid-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.rec-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius); background: var(--raised); border: 1px solid var(--line); }
.rec-sum .amt { font-family: var(--font-display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tb-more { display: none; }
/* Menus: a list beside the button on a computer; on a phone a sheet that rises from the bottom, with Cancel. */
.menu-scrim { display: none; }
.menu button.danger, .menu button.danger .icon { color: var(--crit); }
.menu .hint { font-size: 12px; color: var(--muted); }
.menu .menu-cancel { display: none; }
.help-btn { display: none; }
.fab { display: none; }
@keyframes rise { from { transform: translateY(28px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 761px) { .phone-only { display: none !important; } }
@media (max-width: 760px) {
  .wide-only { display: none !important; }
  .crumb, .subtabs, .page-head .grow p:not(.open) { display: none; }
  .page-head { align-items: center; gap: 8px; margin-bottom: 2px; }
  .page-head .info-btn { display: inline-flex; }
  .hero { display: none; }
  .qtiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 6px; }
  .qt { min-height: 86px; padding: 10px 2px 8px; font-size: 11.5px; gap: 6px; }
  .qt .qi { width: 40px; height: 40px; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fig { min-height: 70px; padding: 10px 12px; }
  .fig .v { font-size: 20px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 84px; padding: 10px 12px; }
  .tile .v { font-size: 20px; }
  .tile .h { display: none; }
  .rw { padding: 10px 12px; gap: 10px; }
  .toolbar { flex-wrap: nowrap; margin: 10px 0 8px; }
  .toolbar .search { min-width: 0; max-width: none; }
  .toolbar > .btn, .toolbar > .ib:not(.tb-more), .toolbar > .muted, .toolbar > .grow { display: none; }
  .toolbar > .tb-more { display: inline-flex; }
  .chips, .views { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips > *, .views > * { flex: none; }
  .menu-scrim { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(9, 12, 20, .42); animation: fade .16s ease-out; }
  .menu { left: 0; right: 0; bottom: 0; top: auto; min-width: 0; max-height: 82vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); animation: rise .2s var(--ease); }
  .menu::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 8px; }
  .menu button { min-height: 52px; font-size: 15px; padding: 0 12px; }
  .menu .menu-cancel { display: flex; justify-content: center; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; font-weight: 650; color: var(--accent-ink); }
  [data-field] { position: relative; }
  [data-field] > label.f { padding-right: 40px; }
  [data-field] > .help-btn { display: inline-flex; position: absolute; top: -10px; right: -6px; }
  [data-field] > .help:not(.open) { display: none; }
  .fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 25; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); min-height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 26px; background: var(--accent); color: var(--on-accent); font: inherit; font-size: 15px; font-weight: 650; box-shadow: var(--shadow); cursor: pointer; }
  :root:has([data-supportlens]) .fab { bottom: calc(var(--sl-bottom, 20px) + 70px); }
  .drawer { top: auto; left: 0; width: 100%; max-height: 92vh; border-left: 0; border-radius: 18px 18px 0 0; animation: rise .2s var(--ease); }
  .drawer footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .drawer footer .btn { flex: 1; }
  .dock .dock-new .icon { background: var(--accent); color: var(--on-accent); border-radius: 13px; padding: 4px 15px; width: 52px; height: 28px; }
  .self-top .viewing { display: none; }
}

/* ---------- accessibility preferences ---------- */
@media (prefers-contrast: more) {
  .card, .tbl-wrap, .tile, .stat, .side, .top, .search-btn, .chip, .btn { border-color: var(--field); }
  .muted, .help, .crumb, .nv .icon { color: var(--ink); }
}
@media (forced-colors: active) {
  .pill, .btn, .chip, .stat, .tile { border: 1px solid CanvasText; }
  .nv[aria-current="page"], .tabs [aria-current="page"], .tabs [aria-selected="true"], .self-tabs a[aria-current="page"], .dock [aria-current="page"] { outline: 2px solid Highlight; }
  .icon { forced-color-adjust: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .side, .top, .toolbar, .bulk, .self-tabs, .dock, .skip { display: none !important; } .app { display: block; } .col { height: auto; } .col > main { overflow: visible; } }

/* Platform console (/platform) */
.platform > main { padding: 16px; max-width: 1240px; margin: 0 auto; display: grid; gap: 12px; }
.platform > header { flex-wrap: wrap; }
.platform-signin { max-width: 440px; margin: 8vh auto; padding: 0 16px; }

/* A button that reads as a link (Forgot your password?, Back to sign in). */
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
button.link:hover { color: var(--accent); }
button.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
