/*
 * VECT LMS: design tokens and components for the design prototype.
 *
 * Design language (from 18/11/2026, after the centre owner's review: "too much text, no colour coding,
 * hard to find your way"): a banking-app style in VECT's green.
 *   - A brand-green hero at the top of each home screen with today's main thing and its buttons; a grid of
 *     functions, each with its own colour; figures in large type; few words.
 *   - Every state has a colour: green done, orange waiting, red late / absent / missing, blue in progress,
 *     violet in review (.kit-tag, .tone-*, .todo).
 *   - White cards with 16px corners on a light grey page, lifted by a soft shadow; tonal secondary buttons.
 *   - One typeface, Inter (headings 700, tabular figures). JetBrains Mono only for codes.
 * Earlier looks: formal flat white cards with hairlines (17/11/2026), warm editorial (until 17/11/2026).
 * Light and dark: follows the system, or the sun/moon switch (data-theme on <html>,
 * saved as localStorage["vect-theme"], applied before paint by theme-init.js).
 * Colours are "R G B" triplets so Tailwind can add opacity: rgb(var(--x) / .5).
 */
:root {
  color-scheme: light;
  /* Page and cards: a cool light grey page; white cards float on a soft shadow (banking-app style) */
  --bg: 242 244 247;            /* #F2F4F7 page */
  --surface: 255 255 255;       /* #FFFFFF cards, sidebar, top bar, menus */
  --elevated: 236 239 243;      /* #ECEFF3 hover, chips */
  --inset: 247 248 250;         /* #F7F8FA a panel inside a card, table headers */
  --fg: 16 24 40;               /* #101828 text: 17.7:1 on cards */
  --fg-2: 71 84 103;            /* #475467 secondary text: 7.6:1 */
  --fg-3: 152 162 179;          /* #98A2B3 placeholders and faint marks only */
  --line: 234 236 240;          /* #EAECF0 */
  --line-strong: 208 213 221;   /* #D0D5DD fields */
  /* VECT's greens (brand guideline D1, D8): #008542 for buttons, links and text (white on it 4.74:1);
     the logo green #00A652 for large shapes (the hero, progress) */
  --brand: 0 166 82;            /* #00A652 */
  --accent: 0 133 66;           /* #008542 */
  --accent-hover: 0 112 56;     /* #007038 */
  --on-accent: 255 255 255;
  --accent-soft: 230 246 237;   /* #E6F6ED */
  --accent-soft-fg: 0 102 51;   /* #006633: 7.9:1 on the soft green */
  --accent-soft-line: 187 230 205; /* #BBE6CD */
  /* States, each with its colour: orange = waiting, red = late / absent / missing, blue = in progress,
     violet = in review, green = done */
  --warning: 247 144 9;         /* #F79009 */
  --warning-soft: 255 244 229;  /* #FFF4E5 */
  --warning-fg: 181 71 8;       /* #B54708: 5.2:1 on its soft tone */
  --warning-line: 254 223 179;  /* #FEDFB3 */
  --danger: 214 40 40;          /* #D62828, the brand red */
  --danger-fg: 180 35 24;       /* #B42318 */
  --on-danger: 255 255 255;
  --danger-soft: 254 240 239;   /* #FEF0EF */
  --danger-soft-fg: 180 35 24;  /* #B42318: 6.0:1 on its soft tone */
  --danger-line: 253 205 202;   /* #FDCDCA */
  --info: 21 112 239;           /* #1570EF */
  --info-soft: 235 243 255;     /* #EBF3FF */
  --info-fg: 23 92 211;         /* #175CD3: 5.6:1 on its soft tone */
  --info-line: 194 218 255;     /* #C2DAFF */
  --violet: 122 90 248;         /* #7A5AF8 */
  --violet-soft: 244 241 255;   /* #F4F1FF */
  --violet-fg: 89 37 220;       /* #5925DC: 6.9:1 on its soft tone */
  --violet-line: 217 210 255;   /* #D9D2FF */
  /* Roles of the tones */
  --field: var(--surface);
  --field-in-card: var(--surface);
  --table-head: var(--inset);
  --table-body: var(--surface);
  --scrim: 16 24 40;
  --toast-bg: 16 24 40;
  --toast-fg: 255 255 255;
  --toast-icon: 60 203 127;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05);
  --shadow: 0 1px 2px rgb(16 24 40 / .04), 0 4px 14px rgb(16 24 40 / .06);
  --shadow-lg: 0 12px 28px -6px rgb(16 24 40 / .16);
  --hero: linear-gradient(135deg, #00A652 0%, #008542 55%, #0B5E3A 100%);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23475467' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-sans);
  --font-serif: var(--font-sans);   /* kept as an alias */
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  /* Shape and motion: rounded, like a phone app */
  --r-control: 10px;
  --r-panel: 12px;
  --r-card: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 150ms;

  /* Layout: a plain top bar and a full-height sidebar */
  --navbar-top: 0px;
  --navbar-height: 3.75rem;
  --navbar-bottom: var(--navbar-height);
  --below-navbar: calc(var(--navbar-height) + 1.5rem);
}

/* Dark: deep blue-grey, the brighter green with dark text on it. Written twice: the system setting, and the switch. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: 12 17 23;               /* #0C1117 */
  --surface: 22 27 34;          /* #161B22 */
  --elevated: 33 40 49;         /* #212831 */
  --inset: 27 33 41;            /* #1B2129 */
  --fg: 242 244 247;            /* #F2F4F7 */
  --fg-2: 169 179 193;          /* #A9B3C1: 8.3:1 on cards */
  --fg-3: 107 118 133;          /* #6B7685 */
  --line: 38 45 55;             /* #262D37 */
  --line-strong: 52 60 72;      /* #343C48 */
  --brand: 0 166 82;
  --accent: 34 197 111;         /* #22C56F, with dark text on it (8.6:1) */
  --accent-hover: 64 214 135;   /* #40D687 */
  --on-accent: 5 20 12;         /* #05140C */
  --accent-soft: 14 42 28;      /* #0E2A1C */
  --accent-soft-fg: 98 224 156; /* #62E09C */
  --accent-soft-line: 24 70 46;
  --warning: 253 176 34;        /* #FDB022 */
  --warning-soft: 42 31 14;
  --warning-fg: 254 200 75;     /* #FEC84B */
  --warning-line: 74 52 16;
  --danger: 249 112 102;        /* #F97066 */
  --danger-fg: 253 162 155;
  --on-danger: 12 17 23;
  --danger-soft: 45 18 18;
  --danger-soft-fg: 253 162 155; /* #FDA29B */
  --danger-line: 85 30 28;
  --info: 83 177 253;           /* #53B1FD */
  --info-soft: 13 31 51;
  --info-fg: 132 202 255;
  --info-line: 22 55 90;
  --violet: 155 138 251;        /* #9B8AFB */
  --violet-soft: 30 23 54;
  --violet-fg: 189 180 254;
  --violet-line: 52 40 95;
  --field: var(--elevated);
  --field-in-card: var(--inset);
  --table-head: var(--elevated);
  --table-body: var(--surface);
  --scrim: 0 0 0;
  --toast-bg: 242 244 247;
  --toast-fg: 16 24 40;
  --toast-icon: 0 133 66;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .45);
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 6px 18px rgb(0 0 0 / .35);
  --shadow-lg: 0 16px 32px -8px rgb(0 0 0 / .6);
  --hero: linear-gradient(135deg, #0B8A4C 0%, #076B3C 55%, #064A2C 100%);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23A9B3C1' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: 12 17 23;               /* #0C1117 */
    --surface: 22 27 34;          /* #161B22 */
    --elevated: 33 40 49;         /* #212831 */
    --inset: 27 33 41;            /* #1B2129 */
    --fg: 242 244 247;            /* #F2F4F7 */
    --fg-2: 169 179 193;          /* #A9B3C1: 8.3:1 on cards */
    --fg-3: 107 118 133;          /* #6B7685 */
    --line: 38 45 55;             /* #262D37 */
    --line-strong: 52 60 72;      /* #343C48 */
    --brand: 0 166 82;
    --accent: 34 197 111;         /* #22C56F, with dark text on it (8.6:1) */
    --accent-hover: 64 214 135;   /* #40D687 */
    --on-accent: 5 20 12;         /* #05140C */
    --accent-soft: 14 42 28;      /* #0E2A1C */
    --accent-soft-fg: 98 224 156; /* #62E09C */
    --accent-soft-line: 24 70 46;
    --warning: 253 176 34;        /* #FDB022 */
    --warning-soft: 42 31 14;
    --warning-fg: 254 200 75;     /* #FEC84B */
    --warning-line: 74 52 16;
    --danger: 249 112 102;        /* #F97066 */
    --danger-fg: 253 162 155;
    --on-danger: 12 17 23;
    --danger-soft: 45 18 18;
    --danger-soft-fg: 253 162 155; /* #FDA29B */
    --danger-line: 85 30 28;
    --info: 83 177 253;           /* #53B1FD */
    --info-soft: 13 31 51;
    --info-fg: 132 202 255;
    --info-line: 22 55 90;
    --violet: 155 138 251;        /* #9B8AFB */
    --violet-soft: 30 23 54;
    --violet-fg: 189 180 254;
    --violet-line: 52 40 95;
    --field: var(--elevated);
    --field-in-card: var(--inset);
    --table-head: var(--elevated);
    --table-body: var(--surface);
    --scrim: 0 0 0;
    --toast-bg: 242 244 247;
    --toast-fg: 16 24 40;
    --toast-icon: 0 133 66;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .45);
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 6px 18px rgb(0 0 0 / .35);
    --shadow-lg: 0 16px 32px -8px rgb(0 0 0 / .6);
    --hero: linear-gradient(135deg, #0B8A4C 0%, #076B3C 55%, #064A2C 100%);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23A9B3C1' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: rgb(var(--line-strong)) transparent; }
body {
  margin: 0;
  font-optical-sizing: auto;
  background: rgb(var(--bg));
  color: rgb(var(--fg));
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* Headings: Inter semibold, slightly tight. (body + element beats Tailwind's preflight reset; utilities still win.) */
body :is(h1, h2, h3) { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; text-wrap: balance; }
body h1 { letter-spacing: -0.022em; }
.font-display { font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
::selection { background: rgb(var(--accent-soft)); color: rgb(var(--fg)); }
:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }
a.underline, .kit-link { color: rgb(var(--accent-soft-fg)); text-decoration-color: rgb(var(--accent-soft-line)); text-underline-offset: 3px; }
a.underline:hover, .kit-link:hover { text-decoration-color: currentColor; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Every interactive surface fades its colours the same way: quick, calm, no bounce, no scale. */
.kit-btn, .kit-pill, .kit-tab, .kit-field, .nav-item, .tabbar a, .tabbar button, .seg-status button, .lang-toggle button, a.kit-card, button.kit-card, .kit-table tbody td {
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), outline-color var(--dur) var(--ease);
}

/* ---------- surfaces ---------- */
.kit-border { border: 1px solid rgb(var(--line)); }
/* Card: white, 16px corners, lifted from the grey page by a soft shadow. */
.kit-card { border: 1px solid rgb(var(--line) / .6); border-radius: var(--r-card); background: rgb(var(--surface)); color: rgb(var(--fg)); box-shadow: var(--shadow); }
/* A panel inside a card: the faintest grey. */
.kit-card-flat { border: 1px solid transparent; border-radius: var(--r-panel); background: rgb(var(--inset)); }
/* What floats over the page (the attendance bar, menus): a card with a stronger line. */
.kit-surface { border: 1px solid rgb(var(--line)); border-radius: var(--r-card); background: rgb(var(--surface)); box-shadow: var(--shadow-lg); }
a.kit-card:hover, button.kit-card:hover { border-color: rgb(var(--accent-soft-line)); box-shadow: var(--shadow-lg); }
.kit-card .kit-field { --field: var(--field-in-card); }

/* A card's header: its title over a hairline. */
.kit-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid rgb(var(--line)); }
.kit-card-head h2, .kit-card-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }

/* ---------- text ---------- */
.kit-label { font-family: var(--font-sans); font-size: .8125rem; font-weight: 500; letter-spacing: .01em; }
.kit-caption { font-family: var(--font-sans); font-size: .8125rem; font-weight: 400; line-height: 1.45; }
/* Numbers that line up: Inter's tabular figures (tables, counts, times, money). */
.tabular { font-variant-numeric: tabular-nums; }
.font-mono { letter-spacing: -0.01em; }

/* ---------- fields ---------- */
.kit-field {
  width: 100%; border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-control); background: rgb(var(--field));
  padding: .55rem .8rem; font: inherit; font-size: .9375rem; color: inherit;
}
.kit-field::placeholder { color: rgb(var(--fg-3)); }
.kit-field:hover { border-color: rgb(var(--fg-3)); }
.kit-field:focus { outline: 2px solid rgb(var(--accent) / .35); outline-offset: 1px; border-color: rgb(var(--accent)); }
select.kit-field { appearance: none; padding-right: 2.2rem; background-image: var(--chevron); background-repeat: no-repeat; background-position: right .7rem center; }
/* Selects in the system's style (assets/select.js): a button in front of the hidden native select, and its list. */
.kit-select { display: flex; align-items: center; min-width: 0; max-width: 100%; text-align: left; cursor: pointer; padding-right: 2.2rem; background-image: var(--chevron); background-repeat: no-repeat; background-position: right .7rem center; }
.kit-select:hover { border-color: rgb(var(--fg-3)); }
.kit-select[aria-expanded="true"] { border-color: rgb(var(--accent)); outline: 2px solid rgb(var(--accent) / .35); outline-offset: 1px; }
.kit-select[disabled] { color: rgb(var(--fg-3)); cursor: not-allowed; }
.kit-select-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-select-native { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0 !important; opacity: 0; pointer-events: none; }
.kit-select-pop { position: fixed; z-index: 90; max-width: min(24rem, calc(100vw - 1rem)); overflow-y: auto; border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-panel); background: rgb(var(--surface)); padding: .3rem; color: rgb(var(--fg)); font-family: var(--font-sans); animation: fade-in var(--dur) var(--ease); }
.kit-select-opt { display: grid; grid-template-columns: 1rem minmax(0, 1fr); align-items: center; gap: .5rem; border-radius: var(--r-control); padding: .45rem .7rem .45rem .5rem; font-size: .875rem; line-height: 1.35; cursor: pointer; }
.kit-select-opt svg { visibility: hidden; color: rgb(var(--accent-soft-fg)); }
.kit-select-opt[aria-selected="true"] { color: rgb(var(--accent-soft-fg)); font-weight: 600; }
.kit-select-opt[aria-selected="true"] svg { visibility: visible; }
.kit-select-opt.is-active { background: rgb(var(--elevated)); }
.kit-select-opt[aria-selected="true"].is-active { background: rgb(var(--accent-soft)); }
.kit-select-opt[aria-disabled="true"] { color: rgb(var(--fg-3)); cursor: not-allowed; }

/* ---------- buttons ---------- */
/* Primary: the green, light text, 6px corners, medium weight. */
.kit-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.75rem; padding: 0 1.25rem;
  border: 1px solid transparent; border-radius: var(--r-control);
  background: rgb(var(--accent)); color: rgb(var(--on-accent)); font-family: var(--font-sans); font-size: .875rem; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.kit-btn:hover { background: rgb(var(--accent-hover)); }
.kit-btn:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }
/* Secondary: tonal, the soft green with green text (no outline). */
.kit-btn--outline { background: rgb(var(--accent-soft)); border-color: transparent; color: rgb(var(--accent-soft-fg)); }
.kit-btn--outline:hover, .kit-card .kit-btn--outline:hover, .kit-surface .kit-btn--outline:hover { background: rgb(var(--accent-soft-line) / .6); }
/* The old "featured" and "success" variants are the primary green now. */
.kit-btn--featured, .kit-btn--success { background: rgb(var(--accent)); color: rgb(var(--on-accent)); }
.kit-btn--danger { background: rgb(var(--danger)); color: rgb(var(--on-danger)); }
.kit-btn--danger:hover { background: rgb(var(--danger) / .9); }
.kit-btn--ghost { background: transparent; border-color: transparent; color: rgb(var(--fg-2)); }
.kit-btn--ghost:hover { background: rgb(var(--elevated)); color: rgb(var(--fg)); }
.kit-btn--sm { height: 2.25rem; padding: 0 .875rem; font-size: .8125rem; }
.kit-btn--lg { height: 3rem; padding: 0 1.5rem; font-size: .9375rem; }
.kit-btn--icon { width: 2.75rem; padding: 0; }
@media (max-width: 359px) { .kit-btn--icon { width: 2.5rem; height: 2.5rem; } }
.kit-btn[disabled] { border-color: transparent; background: rgb(var(--elevated)); color: rgb(var(--fg-3)); cursor: not-allowed; }
.kit-btn--ghost[disabled] { background: transparent; color: rgb(var(--fg-3) / .7); }

/* ---------- choices ---------- */
/* Filter pills: quiet until chosen; chosen is the soft green. */
.kit-pill {
  display: inline-flex; align-items: center; gap: .4rem; height: 2.25rem; border: 1px solid rgb(var(--line-strong)); border-radius: 9999px;
  background: transparent; padding: 0 .8rem; font-family: var(--font-sans); font-size: .8125rem; font-weight: 500;
  color: rgb(var(--fg-2)); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.kit-pill:hover { background: rgb(var(--elevated)); color: rgb(var(--fg)); }
.kit-card .kit-pill:hover { background: rgb(var(--elevated)); }
.kit-pill.is-on, .kit-pill[aria-pressed="true"], .kit-pill[aria-current="page"] { background: rgb(var(--accent)); border-color: transparent; color: rgb(var(--on-accent)); }
/* A pill that wraps a radio or checkbox: chosen when its input is. */
.kit-pill:has(input:checked) { background: rgb(var(--accent)); border-color: transparent; color: rgb(var(--on-accent)); }
.kit-pill .count { font-variant-numeric: tabular-nums; font-size: .75rem; font-weight: 500; opacity: .75; }

/* Tabs: a hairline track; the chosen tab is the soft green. Wraps on phones, never scrolls sideways. */
.kit-tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; max-width: 100%; border: 0; border-radius: var(--r-panel); background: rgb(var(--elevated)); padding: .25rem; }
.kit-tab { border: 1px solid transparent; border-radius: var(--r-control); background: none; padding: .45rem .9rem; font-family: var(--font-sans); font-size: .875rem; font-weight: 600; color: rgb(var(--fg-2)); cursor: pointer; text-decoration: none; }
.kit-tab:hover { color: rgb(var(--fg)); background: rgb(var(--surface) / .6); }
.kit-tab[aria-selected="true"], .kit-tab[aria-pressed="true"], a.kit-tab[aria-current="page"] { border-color: transparent; background: rgb(var(--surface)); color: rgb(var(--accent-soft-fg)); box-shadow: var(--shadow-sm); }

/* Attendance: three choices in a hairline track. Chosen = the state's soft tone with its colour as the line. */
.seg-status { display: inline-flex; border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-panel); background: rgb(var(--inset)); padding: 3px; gap: 3px; }
.seg-status button { border: 1px solid transparent; border-radius: var(--r-control); background: none; padding: .3rem .8rem; font-family: var(--font-sans); font-size: .8125rem; font-weight: 500; cursor: pointer; color: rgb(var(--fg-2)); }
.seg-status button:hover { background: rgb(var(--elevated)); color: rgb(var(--fg)); }
.seg-status button[aria-pressed="true"][data-v="present"] { background: rgb(var(--accent-soft)); border-color: rgb(var(--accent)); color: rgb(var(--accent-soft-fg)); }
.seg-status button[aria-pressed="true"][data-v="late"] { background: rgb(var(--warning-soft)); border-color: rgb(var(--warning)); color: rgb(var(--warning-fg)); }
.seg-status button[aria-pressed="true"][data-v="absent"] { background: rgb(var(--danger-soft)); border-color: rgb(var(--danger)); color: rgb(var(--danger-soft-fg)); }
/* Phones: the switch sits under the name and fills the row, three equal touch targets. */
@media (max-width: 639px) { .seg-status--row { display: flex; } .seg-status--row button { flex: 1 1 0; padding-block: .5rem; } }

/* Language switch (assets/i18n.js). */
.lang-toggle { display: inline-flex; gap: 2px; border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-control); background: transparent; padding: 2px; }
.lang-toggle button { border: 0; border-radius: 4px; background: none; padding: .2rem .5rem; font-family: var(--font-sans); font-size: .6875rem; font-weight: 600; letter-spacing: .04em; color: rgb(var(--fg-2)); cursor: pointer; }
.lang-toggle button:hover { color: rgb(var(--fg)); background: rgb(var(--elevated)); }
.lang-toggle button[aria-pressed="true"] { background: rgb(var(--accent-soft)); color: rgb(var(--accent-soft-fg)); }

/* ---------- small facts ---------- */
/* Chip: a small fact (level, size, room, time); figures line up. Codes add .font-mono. */
.kit-chip {
  display: inline-flex; align-items: center; gap: .3rem; border: 1px solid transparent; border-radius: 9999px;
  background: rgb(var(--elevated)); padding: .1rem .55rem; font-family: var(--font-sans); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.5; white-space: nowrap; color: rgb(var(--fg));
}
/* Tag: a state. Default = good (soft green); then quiet, warning, danger, neutral, attention. */
.kit-tag {
  display: inline-flex; align-items: center; gap: .25rem; border: 1px solid transparent; border-radius: 9999px;
  padding: .1rem .55rem; font-family: var(--font-sans); font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: rgb(var(--accent-soft)); color: rgb(var(--accent-soft-fg));
}
.kit-tag--soft { background: transparent; border-color: rgb(var(--accent-soft-line)); }
.kit-tag--yellow, .kit-tag--coral { background: rgb(var(--warning-soft)); color: rgb(var(--warning-fg)); }
.kit-tag--red { background: rgb(var(--danger-soft)); color: rgb(var(--danger-soft-fg)); }
.kit-tag--blue { background: rgb(var(--info-soft)); color: rgb(var(--info-fg)); }
.kit-tag--violet { background: rgb(var(--violet-soft)); color: rgb(var(--violet-fg)); }
.kit-tag--muted { background: rgb(var(--elevated)); color: rgb(var(--fg-2)); }

/* A few words of a title on the soft green, once per page. */
.kit-highlight { border-radius: 4px; background: rgb(var(--accent-soft)); padding: 0 .2em; color: rgb(var(--accent-soft-fg)); -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Avatars: initials on the soft green. */
.kit-avatar { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; border: 1px solid rgb(var(--accent-soft-line)); border-radius: 9999px; background: rgb(var(--accent-soft)); font-family: var(--font-sans); font-weight: 600; font-size: .75rem; letter-spacing: .02em; color: rgb(var(--accent-soft-fg)); }
.kit-avatar--sm { width: 1.75rem; height: 1.75rem; font-size: .625rem; }
.kit-avatar[class*="tone-"] { border-color: rgb(var(--tone) / .3); background: rgb(var(--tone) / .14); color: rgb(var(--tone)); }
.kit-avatar--xl { width: 6rem; height: 6rem; font-size: 1.75rem; }
.kit-avatar--lg { width: 4rem; height: 4rem; font-size: 1.125rem; }

/* Notes: opaque, a hairline in the note's tone. */
.kit-note { border: 0; border-left: 4px solid rgb(var(--brand)); border-radius: var(--r-panel); background: rgb(var(--accent-soft)); padding: .8rem 1rem; font-size: .9375rem; color: rgb(var(--fg)); }
.kit-note--warn { background: rgb(var(--warning-soft)); border-left-color: rgb(var(--warning)); }
.kit-note--error { background: rgb(var(--danger-soft)); border-left-color: rgb(var(--danger)); color: rgb(var(--danger-soft-fg)); }
.kit-note--info { background: rgb(var(--info-soft)); border-left-color: rgb(var(--info)); }

/* Progress: a quiet track, a green fill; amber when nearly out, brick when full. */
.kit-progress { height: .5rem; border-radius: 9999px; background: rgb(var(--elevated)); overflow: hidden; }
.kit-card .kit-progress { background: rgb(var(--line-strong) / .7); }
.kit-progress > span { display: block; height: 100%; border-radius: 9999px; background: rgb(var(--brand)); }
.kit-progress.is-warn > span { background: rgb(var(--warning)); }
.kit-progress.is-full > span { background: rgb(var(--danger)); }

/* ---------- tables ---------- */
/* Header on the faint grey in small capitals; rows on white; hover is the faintest green. */
.kit-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.kit-table thead th { text-align: left; background: rgb(var(--table-head)); font-family: var(--font-sans); font-size: .8125rem; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.4; color: rgb(var(--fg-2)); padding: .75rem 1rem; border-bottom: 1px solid rgb(var(--line)); white-space: nowrap; }
.kit-table tbody td { background: rgb(var(--table-body)); padding: .875rem 1rem; border-bottom: 1px solid rgb(var(--line)); vertical-align: middle; }
.kit-table tbody tr:last-child td { border-bottom: 0; }
.kit-table tbody tr:hover td { background: rgb(var(--inset)); }

/* ---------- journey (student profile): steps joined by a hairline ---------- */
.node-flow { --node-line: 1px; --node-gap: 2.5rem; --node-rise: 1rem; --node-spine-x: 1.25rem; display: flex; flex-direction: column; gap: var(--node-rise); }
.node-flow-step { position: relative; }
.node-flow-step + .node-flow-step::before { content: ""; position: absolute; left: calc(var(--node-spine-x) - var(--node-line) / 2); top: calc(-1 * var(--node-rise)); height: var(--node-rise); border-left: var(--node-line) solid rgb(var(--line-strong)); }
.node-port { position: absolute; z-index: 1; width: .5rem; height: .5rem; border: 1px solid rgb(var(--accent)); border-radius: 9999px; background: rgb(var(--surface)); transform: translate(-50%, -50%); pointer-events: none; }
.node-flow-step > .node-port-in { left: var(--node-spine-x); top: 0; }
.node-flow-step > .node-port-out { left: var(--node-spine-x); top: 100%; }
.node-flow-step:first-child > .node-port-in, .node-flow-step:last-child > .node-port-out { display: none; }
@media (min-width: 768px) {
  .node-flow-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: var(--node-gap); align-items: stretch; }
  .node-flow-row > .node-flow-step > :first-child { height: 100%; }
  .node-flow-row > .node-flow-step + .node-flow-step::before { left: calc(-1 * var(--node-gap)); top: calc(50% - var(--node-line) / 2); width: var(--node-gap); height: 0; border-left: 0; border-top: var(--node-line) solid rgb(var(--line-strong)); }
  .node-flow-row > .node-flow-step > .node-port-in { left: 0; top: 50%; }
  .node-flow-row > .node-flow-step > .node-port-out { left: 100%; top: 50%; }
}

/* ---------- shell: top bar, sidebar, phone tab bar, sheet, toast ---------- */
/* VECT's logo (website/brand): the V-symbol beside the name, and the full logo on a white plate. The logo keeps
   its official colours, and its black lines need white behind them, so the plate stays white in dark mode too.
   Clear space is the diameter of the V's dot; the full logo is at least 120px wide, the symbol at least 24px. */
.vect-mark { width: 2rem; height: 1.75rem; flex-shrink: 0; }
.brand-plate { display: inline-flex; border-radius: 8px; background: #FFFFFF; }
:root[data-theme="dark"] .brand-plate { padding: 0.375rem 0.625rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-plate { padding: 0.375rem 0.625rem; } }
.brand-plate img { display: block; }
/* The sidebar as a rail of icons (html.is-rail, desktop only): labels, counts and sub-items hide;
   a dot marks a count; the page's own view switcher (.rail-show) appears instead of the sub-items. */
@media (min-width: 768px) {
  .app-sidebar, .app-header--with-side, .md\:pl-\[16rem\] { transition: width var(--dur) var(--ease), margin var(--dur) var(--ease), padding var(--dur) var(--ease); }
  html.is-rail .app-sidebar { width: 4.5rem; }
  html.is-rail .app-header--with-side { margin-left: 4.5rem !important; }
  html.is-rail .md\:pl-\[16rem\] { padding-left: 4.5rem; }
  html.is-rail .app-sidebar .side-head { justify-content: center; padding-inline: 0; }
  html.is-rail .app-sidebar .side-head a > :not(.vect-mark), html.is-rail .app-sidebar .nav-sub { display: none; }
  html.is-rail .app-sidebar .nav-item { justify-content: center; gap: 0; padding-inline: 0; }
  html.is-rail .app-sidebar .nav-item > :not(.nav-ico) { display: none; }
  html.is-rail .app-sidebar .nav-item[data-count]::after { content: ''; position: absolute; top: .3rem; right: 1.05rem; width: .5rem; height: .5rem; border-radius: 9999px; background: rgb(var(--danger)); box-shadow: 0 0 0 2px rgb(var(--surface)); }
  html.is-rail .rail-show { display: inline-flex !important; }
}
.app-header { position: sticky; top: 0; z-index: 40; height: var(--navbar-height); border-bottom: 1px solid rgb(var(--line) / .7); background: rgb(var(--surface)); box-shadow: var(--shadow-sm); }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 16rem; border-right: 1px solid rgb(var(--line)); background: rgb(var(--surface)); }
@media (min-width: 768px) { .app-header--with-side { margin-left: 16rem; } }

.nav-item { position: relative; margin: 1px 0; display: flex; align-items: center; gap: .75rem; border-radius: var(--r-control); padding: .5rem .75rem; font-size: .875rem; font-weight: 500; color: rgb(var(--fg-2)); text-decoration: none; }
.nav-item:hover { background: rgb(var(--elevated)); color: rgb(var(--fg)); }
.nav-item[aria-current="page"] { background: rgb(var(--accent-soft)); color: rgb(var(--accent-soft-fg)); font-weight: 600; }
/* Each section's icon sits in a chip of its own colour (NAV tone). */
.nav-ico { display: inline-grid; place-items: center; width: 1.875rem; height: 1.875rem; flex: none; border-radius: 9px; background: rgb(var(--tone, var(--accent)) / .12); color: rgb(var(--tone, var(--accent))); }
.nav-ico svg { width: 1rem; height: 1rem; }
.nav-item svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
/* An on/off switch (role="switch", aria-checked): the course page's edit mode, users' permissions. */
.switch-btn { display: inline-flex; align-items: center; gap: .55rem; border: 0; background: none; padding: .25rem; font-size: .875rem; font-weight: 500; color: rgb(var(--fg)); cursor: pointer; }
.switch-btn .track { position: relative; width: 2.25rem; height: 1.25rem; border-radius: 999px; background: rgb(var(--line-strong)); transition: background-color var(--dur) var(--ease); }
.switch-btn .thumb { position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 999px; background: rgb(var(--surface)); transition: transform var(--dur) var(--ease); }
.switch-btn[aria-checked="true"] .track { background: rgb(var(--accent)); }
.switch-btn[aria-checked="true"] .thumb { transform: translateX(1rem); }
.switch-btn:disabled { cursor: not-allowed; opacity: .5; }
.nav-sub { margin: 0 0 .25rem 1.65rem; border-left: 1px solid rgb(var(--line)); padding-left: .375rem; }
.nav-item--sub { padding-top: .375rem; padding-bottom: .375rem; font-size: .8125rem; }
.nav-item .nav-caret { width: .875rem; height: .875rem; margin-left: .25rem; color: rgb(var(--fg-3)); }
.nav-count { margin-left: auto; min-width: 1.375rem; height: 1.25rem; display: inline-grid; place-items: center; padding: 0 .35rem; border-radius: var(--r-control); background: rgb(var(--elevated)); font-variant-numeric: tabular-nums; font-size: .6875rem; font-weight: 600; color: rgb(var(--fg-2)); }
.nav-item[aria-current="page"] .nav-count { background: rgb(var(--surface) / .8); color: rgb(var(--accent-soft-fg)); }
/* The unread count on the bell: the one solid green mark in the bar. */
.dot-count { position: absolute; top: .3rem; right: .25rem; min-width: 1rem; height: 1rem; display: inline-grid; place-items: center; padding: 0 .25rem; border-radius: 9999px; background: rgb(var(--danger)); font-variant-numeric: tabular-nums; font-size: .625rem; font-weight: 700; line-height: 1; color: rgb(var(--on-danger)); }

/* Phone tab bar: attached to the bottom edge, a hairline on top. */
.tabbar { border-top: 1px solid rgb(var(--line)); background: rgb(var(--surface)); padding: .375rem .5rem calc(.375rem + env(safe-area-inset-bottom)); }
.tabbar a, .tabbar button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .4rem .1rem; border: 0; border-radius: var(--r-panel); background: none; font-family: var(--font-sans); font-size: .6875rem; font-weight: 500; color: rgb(var(--fg-2)); text-decoration: none; cursor: pointer; min-width: auto; }
/* Equal tabs, but no tab shrinks below its own label (e.g. "Attendance"); very narrow phones fall back to ellipsis. */
@media (max-width: 359px) { .tabbar a, .tabbar button { min-width: 0; } }
.tabbar a span, .tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a:hover, .tabbar button:hover { color: rgb(var(--fg)); }
.tabbar a[aria-current="page"] { background: transparent; color: rgb(var(--accent)); font-weight: 600; }
.tabbar svg { width: 1.25rem; height: 1.25rem; }

/* The menu sheet: a bottom sheet on phones, a panel under the account button from md up. */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgb(var(--scrim) / .4); animation: fade-in var(--dur) var(--ease); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 80vh; overflow: auto; border: 1px solid rgb(var(--line)); border-bottom: 0; border-radius: var(--r-card) var(--r-card) 0 0; background: rgb(var(--surface)); padding-bottom: env(safe-area-inset-bottom); animation: sheet-in calc(var(--dur) * 1.5) var(--ease); }
@media (min-width: 768px) { .sheet { left: auto; right: 1rem; top: calc(var(--navbar-height) + .5rem); bottom: auto; width: 21rem; border-bottom: 1px solid rgb(var(--line)); border-radius: var(--r-card); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Toast: inverted (dark on light becomes light on dark), so it reads over anything without a shadow. */
.toast { position: fixed; z-index: 70; right: 1.5rem; bottom: 1.5rem; max-width: min(26rem, calc(100vw - 2rem)); padding: .875rem 1rem; display: flex; gap: .65rem; align-items: flex-start; border-radius: var(--r-panel); background: rgb(var(--toast-bg)); color: rgb(var(--toast-fg)); box-shadow: var(--shadow-lg); animation: sheet-in calc(var(--dur) * 1.5) var(--ease); }
.toast svg { color: rgb(var(--toast-icon)); }
@media (max-width: 767px) { .toast { left: 1rem; right: 1rem; bottom: 5.5rem; } }

/* A phone mock (reports: what the parent sees). */
.phone-frame { border: 1px solid rgb(var(--line-strong)); border-radius: 1.5rem; background: rgb(var(--bg)); overflow: hidden; }
/* The VietQR code stays dark-on-white in both themes, so it can be scanned. */
.qr-paper { background: #FFFFFF; color: #17201B; }

.scrollbar-none { scrollbar-width: none; }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* ---------- student practice (practice.html and the players) ---------- */
/* A card that works as a choice (skill tiles): chosen = the soft green. */
.kit-card[aria-pressed="true"] { border-color: rgb(var(--accent-soft-line)); background: rgb(var(--accent-soft)); }
.kit-card[aria-pressed="true"] .app-tile-icon { background: rgb(var(--accent)); border-color: transparent; color: rgb(var(--on-accent)); }
/* A filter row: a checkbox, its label, and a count; values with nothing are greyed out. */
.kit-check { display: flex; align-items: center; gap: .6rem; border-radius: var(--r-control); padding: .3rem .4rem; font-size: .875rem; cursor: pointer; }
.kit-check:hover { background: rgb(var(--elevated)); }
.kit-check input { width: 1rem; height: 1rem; accent-color: rgb(var(--accent)); }
.kit-check .count { margin-left: auto; font-variant-numeric: tabular-nums; font-size: .75rem; color: rgb(var(--fg-2)); }
.kit-check.is-empty { color: rgb(var(--fg-3)); cursor: default; }
.kit-check.is-empty:hover { background: none; }
/* Transcript words you can tap to look up. */
.word { border-radius: 3px; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.word:hover, .word.is-on { background: rgb(var(--accent-soft)); color: rgb(var(--accent-soft-fg)); }
/* Marking: dictation differences and shadowing scores. */
.mark-ok { color: rgb(var(--accent-soft-fg)); }
.mark-mid { background: rgb(var(--warning-soft)); color: rgb(var(--warning-fg)); border-radius: 3px; padding: 0 .1em; }
.mark-bad { background: rgb(var(--danger-soft)); color: rgb(var(--danger-soft-fg)); border-radius: 3px; padding: 0 .1em; text-decoration: line-through; text-decoration-thickness: 1px; }
.mark-miss { background: rgb(var(--warning-soft)); color: rgb(var(--warning-fg)); border-radius: 3px; padding: 0 .15em; }
.mark-fix { color: rgb(var(--accent-soft-fg)); font-weight: 600; }
/* The record button: one round green control; while recording it turns brick and breathes slowly. */
.rec-btn { display: inline-grid; place-items: center; width: 4.5rem; height: 4.5rem; border-radius: 9999px; border: 0; background: rgb(var(--accent)); color: rgb(var(--on-accent)); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.rec-btn:hover { background: rgb(var(--accent-hover)); }
.rec-btn[aria-pressed="true"] { background: rgb(var(--danger)); animation: rec-breathe 1.8s var(--ease) infinite; }
@keyframes rec-breathe { 50% { opacity: .7; } }
/* A reading passage: a little larger, a comfortable measure. */
.reading { font-family: var(--font-sans); font-size: 1.0625rem; line-height: 1.8; max-width: 68ch; }
.reading p + p { margin-top: .9em; }
/* Mock test: the question palette. */
.q-cell { display: inline-grid; place-items: center; width: 2.125rem; height: 2.125rem; border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-control); background: rgb(var(--surface)); font-variant-numeric: tabular-nums; font-size: .75rem; font-weight: 500; color: rgb(var(--fg-2)); cursor: pointer; position: relative; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.q-cell:hover { border-color: rgb(var(--fg-3)); }
.q-cell.is-answered { background: rgb(var(--accent-soft)); border-color: rgb(var(--accent-soft-line)); color: rgb(var(--accent-soft-fg)); }
.q-cell[aria-current="true"] { outline: 2px solid rgb(var(--accent)); outline-offset: 1px; }
.q-cell.is-flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 9999px; background: rgb(var(--warning)); }
.q-cell.is-right { background: rgb(var(--accent-soft)); border-color: rgb(var(--accent)); color: rgb(var(--accent-soft-fg)); }
.q-cell.is-wrong { background: rgb(var(--danger-soft)); border-color: rgb(var(--danger)); color: rgb(var(--danger-soft-fg)); }

/* ---------- banking-app pieces: tones, icon chips, the hero, function tiles, figures, to-do rows ---------- */
/* Tones: each section and state has its colour (tiles, sidebar icons, figures, to-do rows). */
.tone-green { --tone: 0 166 82; } .tone-blue { --tone: 21 112 239; } .tone-orange { --tone: 247 144 9; } .tone-red { --tone: 214 40 40; }
.tone-violet { --tone: 122 90 248; } .tone-teal { --tone: 14 147 132; } .tone-pink { --tone: 221 37 112; } .tone-indigo { --tone: 68 76 231; }
.tone-amber { --tone: 220 104 3; } .tone-cyan { --tone: 6 174 212; } .tone-slate { --tone: 102 112 133; }
/* An icon in a rounded chip of its tone. */
.ico { display: inline-grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: 14px; background: rgb(var(--tone, var(--brand)) / .12); color: rgb(var(--tone, var(--brand))); }
.ico svg { width: 1.375rem; height: 1.375rem; }
.ico--sm { width: 2.25rem; height: 2.25rem; border-radius: 11px; } .ico--sm svg { width: 1.125rem; height: 1.125rem; }
.ico--lg { width: 3.25rem; height: 3.25rem; border-radius: 16px; } .ico--lg svg { width: 1.625rem; height: 1.625rem; }
.ico--solid { background: rgb(var(--tone, var(--brand))); color: #FFFFFF; }
/* The hero: the brand gradient at the top of a home screen, with today's main thing and its buttons. */
.hero { position: relative; overflow: hidden; border-radius: 20px; background: var(--hero); color: #FFFFFF; padding: 1.25rem; box-shadow: var(--shadow-lg); }
@media (min-width: 640px) { .hero { padding: 1.75rem; } }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 9999px; background: rgb(255 255 255 / .07); pointer-events: none; }
.hero::after { right: -70px; top: -80px; width: 240px; height: 240px; }
.hero::before { right: 90px; bottom: -110px; width: 200px; height: 200px; }
.hero > * { position: relative; z-index: 1; }
.hero .hero-sub { color: rgb(255 255 255 / .85); }
.hero .kit-chip { background: rgb(255 255 255 / .16); color: #FFFFFF; }
.btn-hero { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.75rem; padding: 0 1.125rem; border-radius: var(--r-control); background: #FFFFFF; color: #006633; font-size: .875rem; font-weight: 700; text-decoration: none; white-space: nowrap; border: 0; cursor: pointer; }
.btn-hero:hover { background: #EAF8F0; }
.btn-hero--ghost { background: rgb(255 255 255 / .14); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .3); }
.btn-hero--ghost:hover { background: rgb(255 255 255 / .22); }
/* Function tiles (.app-tiles / .app-tile, not .tile: some pages have their own): an icon in its colour over a short label; a red count when something waits. */
/* Student pages keep their tab bar at the bottom: the content stops above it. */
/* A student's header holds the avatar (her profile, where the theme is chosen too): on narrow phones the sun/moon goes. */
@media (max-width: 419px) { .app-header.has-me-link [data-theme-slot] { display: none; } }
body.has-student-tabs main { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)) !important; }
/* A player bar pinned to the bottom (listening) sits on top of the tab bar, and the content stops above both. */
body.has-student-tabs .player { bottom: calc(4.1rem + env(safe-area-inset-bottom, 0px)); }
body.has-student-tabs[data-page="practice-listen"] main { padding-bottom: calc(12rem + env(safe-area-inset-bottom, 0px)) !important; }
/* A choice as a card (a radio and its label): course settings, "Báo nghỉ". */
.rule { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem; align-items: start; border: 1px solid rgb(var(--line-strong)); border-radius: var(--r-panel); background: rgb(var(--surface)); padding: .6rem .75rem; cursor: pointer; }
.rule:has(input:checked) { border-color: rgb(var(--accent-soft-line)); background: rgb(var(--accent-soft)); }
.rule input { margin-top: .2rem; accent-color: rgb(var(--accent)); }
.app-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 640px) { .app-tiles { gap: .75rem; } }
@media (min-width: 1024px) { .app-tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.app-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .45rem; min-width: 0; padding: .75rem .2rem .7rem; border-radius: var(--r-card); background: rgb(var(--surface)); box-shadow: var(--shadow); text-align: center; font-size: .75rem; font-weight: 600; line-height: 1.25; color: rgb(var(--fg)); text-decoration: none; transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.app-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
@media (min-width: 640px) { .app-tile { padding: .9rem .35rem .8rem; font-size: .8125rem; gap: .5rem; } }
@media (max-width: 639px) { .app-tile .ico { width: 2.5rem; height: 2.5rem; border-radius: 12px; } .app-tile .ico svg { width: 1.25rem; height: 1.25rem; } .app-tile .badge { top: .3rem; right: .35rem; } }
.app-tile .badge, .badge-count { min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 9999px; background: rgb(var(--danger)); color: rgb(var(--on-danger)); font-size: .6875rem; font-weight: 700; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
.app-tile .badge { position: absolute; top: .45rem; right: .55rem; }
/* A figure: its coloured icon, a large number, a short label. */
.stat { display: flex; flex-direction: column; gap: .6rem; min-width: 0; padding: 1rem; border-radius: var(--r-card); background: rgb(var(--surface)); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
a.stat:hover { box-shadow: var(--shadow-lg); }
.stat-num { font-size: 1.875rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .8125rem; font-weight: 600; color: rgb(var(--fg-2)); }
/* To-do rows: an icon in the state's colour, one short line, a chevron. */
.todo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .875rem; padding: .8rem 1rem; color: inherit; text-decoration: none; }
a.todo:hover, button.todo:hover { background: rgb(var(--inset)); }
.todo + .todo { border-top: 1px solid rgb(var(--line)); }
.todo-title { font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.todo-sub { font-size: .8125rem; color: rgb(var(--fg-2)); }
.section-title { margin: 0 0 .75rem; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
/* A status dot. */
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 9999px; background: rgb(var(--tone, var(--brand))); flex: none; }

/* The hidden attribute must win over display utilities (.grid, .flex, .block) on filtered rows and tab panels. */
[hidden] { display: none !important; }
@media print { .app-header, .app-sidebar, .tabbar { display: none !important; } body { background: #FFFFFF; color: #17201B; } }
