/* LMS - Simple: app styles. Loaded after Tabler CSS and Tabler Icons CSS.
   The light design (docs/07 "Light design"): built from UI/light-themes.css, with the
   parts the app already had kept at the end. Colours come only from the theme tokens;
   the exceptions are white text on --deep, --primary, --alert, --ok and the Cobalt
   sidebar, and the dark video stage.

   ADDING A THEME: one [data-theme="<key>"] block below with every token, plus one line
   in core/themes.py. The test in core/test_themes.py checks every theme has every
   token and meets the contrast pairs. */

/* ===== Fonts, served from static/fonts (SIL Open Font Licence, licences beside them). No CDN. ===== */
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-wght-normal.7660bd9909fb.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200E-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.341687eeeb6a.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200E-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("../fonts/inter-latin-ext-wght-normal.1ad231aac0a8.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Newsreader"; font-weight: 200 800; font-display: swap; src: url("../fonts/newsreader-latin-wght-normal.175a37868200.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200E-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Newsreader"; font-weight: 200 800; font-display: swap; src: url("../fonts/newsreader-latin-ext-wght-normal.b55601316b0e.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Source Serif 4"; font-weight: 200 900; font-display: swap; src: url("../fonts/source-serif-4-latin-wght-normal.fb34450b3254.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200E-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Source Serif 4"; font-weight: 200 900; font-display: swap; src: url("../fonts/source-serif-4-latin-ext-wght-normal.d903af399404.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "Hanken Grotesk"; font-weight: 100 900; font-display: swap; src: url("../fonts/hanken-grotesk-latin-wght-normal.c501f578bf3f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200E-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Hanken Grotesk"; font-weight: 100 900; font-display: swap; src: url("../fonts/hanken-grotesk-latin-ext-wght-normal.20672d217485.woff2") format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: "LMS Sinhala"; font-weight: 100 900; font-display: swap; src: url("../fonts/noto-sans-sinhala-sinhala-wght-normal.52824c82fd2b.woff2") format("woff2"); unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC; }

/* ===== Themes. Every theme defines every token (core/test_themes.py). ===== */

/* Cobalt (default): navy sidebar, cobalt blue buttons (Gemini design D, "Academic Precision"). */
:root,
[data-theme="cobalt"] {
  --deep: #0f172a;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --accent: #60a5fa;
  --accent-ink: #92400e;
  --accent-soft: #fef3c7;
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #526077;
  --nav-text: #b6c2d6;
  --ok: #065f46;
  --ok-soft: #ecfdf5;
  --alert: #b91c1c;
  --alert-soft: #fef2f2;
  --primary-rgb: 37, 99, 235;
  --side: #0f172a;
  --side-line: #263349;
  --nav-on: #2563eb;
  --nav-on-text: #ffffff;
  --cta: #a84b07;
  --cta-text: #ffffff;
  --well: #f1f5f9;
  --font-head: "Plus Jakarta Sans";
  --font-body: "Plus Jakarta Sans";
  --font-ui: "Plus Jakarta Sans";
  --head-weight: 700;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-chip: 999px;
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, .07), 0 1px 2px -1px rgba(15, 23, 42, .05);
  --side-text: #ffffff;
  --side-muted: #94a3b8;
  --side-hover: #1e293b;
  --side-panel: #172136;
  --brand-accent: #60a5fa;
  --swatch-2: #0f172a;
  --toggler-filter: invert(1);
  --hero-mid: #4338ca;
  --pay-wait: #f59e0b;
}

/* Horizon: forest green and amber on cream (Gemini design C). */
[data-theme="horizon"] {
  --deep: #08473d;
  --primary: #0e7061;
  --primary-soft: #e2f2ed;
  --accent: #e0892b;
  --accent-ink: #834800;
  --accent-soft: #ffead6;
  --bg: #fbf9f4;
  --card: #ffffff;
  --line: #e8e2d5;
  --text: #2b1704;
  --muted: #6a5f56;
  --nav-text: #33433e;
  --ok: #135542;
  --ok-soft: #d8f3e6;
  --alert: #ae1d16;
  --alert-soft: #ffe6df;
  --primary-rgb: 14, 112, 97;
  --side: #e7efe9;
  --side-line: #d5e2da;
  --nav-on: #08473d;
  --nav-on-text: #ffffff;
  --cta: #8d4f00;
  --cta-text: #ffffff;
  --well: #f6f3ec;
  --font-head: "Plus Jakarta Sans";
  --font-body: "Inter";
  --font-ui: "Plus Jakarta Sans";
  --head-weight: 700;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-chip: 999px;
  --shadow: 0 4px 20px -4px rgba(43, 23, 4, .07);
  --side-text: #08473d;
  --side-muted: #56605a;
  --side-hover: #d7e8df;
  --side-panel: #ffffff;
  --brand-accent: #08473d;
  --swatch-2: #e0892b;
  --toggler-filter: none;
  --hero-mid: #0e7061;
  --pay-wait: #e0892b;
}

/* Scholarly: navy and amber, serif headings and text (Gemini design A). */
[data-theme="scholarly"] {
  --deep: #00324b;
  --primary: #00324b;
  --primary-soft: #e3edff;
  --accent: #fda552;
  --accent-ink: #6c3a00;
  --accent-soft: #ffe2c9;
  --bg: #f8f9ff;
  --card: #ffffff;
  --line: #dde4f0;
  --text: #0b1c30;
  --muted: #50575e;
  --nav-text: #2f3a45;
  --ok: #1d4d2f;
  --ok-soft: #d3ecd9;
  --alert: #a41414;
  --alert-soft: #ffe2de;
  --primary-rgb: 0, 50, 75;
  --side: #eef3ff;
  --side-line: #dde4f0;
  --nav-on: #ffdcc1;
  --nav-on-text: #2e1500;
  --cta: #8f4e00;
  --cta-text: #ffffff;
  --well: #eff4ff;
  --font-head: "Newsreader";
  --font-body: "Source Serif 4";
  --font-ui: "Hanken Grotesk";
  --head-weight: 600;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-chip: 999px;
  --shadow: 0 2px 6px -1px rgba(30, 41, 59, .05);
  --side-text: #00324b;
  --side-muted: #50575e;
  --side-hover: #dfe9ff;
  --side-panel: #ffffff;
  --brand-accent: #00324b;
  --swatch-2: #fda552;
  --toggler-filter: none;
  --hero-mid: #00324b;
  --pay-wait: #f0943c;
}

/* Precision: indigo on white with fine lines (Gemini design B). */
[data-theme="precision"] {
  --deep: #1e1b6b;
  --primary: #4338ca;
  --primary-soft: #eeefff;
  --accent: #6366f1;
  --accent-ink: #854a05;
  --accent-soft: #fef3d6;
  --bg: #f8f8fd;
  --card: #ffffff;
  --line: #e2e5f0;
  --text: #131b2e;
  --muted: #545366;
  --nav-text: #38384a;
  --ok: #046048;
  --ok-soft: #e4f7ee;
  --alert: #a8231c;
  --alert-soft: #fdeceb;
  --primary-rgb: 67, 56, 202;
  --side: #ffffff;
  --side-line: #e2e5f0;
  --nav-on: #eeefff;
  --nav-on-text: #3125b0;
  --cta: #fef3d6;
  --cta-text: #854a05;
  --well: #f3f4fc;
  --font-head: "Plus Jakarta Sans";
  --font-body: "Inter";
  --font-ui: "Inter";
  --head-weight: 700;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-chip: 4px;
  --shadow: none;
  --side-text: #1e1b6b;
  --side-muted: #545366;
  --side-hover: #eeefff;
  --side-panel: #ffffff;
  --brand-accent: #1e1b6b;
  --swatch-2: #a5b4fc;
  --toggler-filter: none;
  --hero-mid: #4338ca;
  --pay-wait: #e59a0b;
}

/* ===== 1. Tabler variables and the base ===== */
:root, [data-bs-theme] {
  --tblr-primary: var(--primary);
  --tblr-primary-rgb: var(--primary-rgb);
  --tblr-primary-fg: #fff;
  --tblr-link-color: var(--primary);
  --tblr-link-color-rgb: var(--primary-rgb);
  --tblr-link-hover-color: var(--deep);
  /* Sinhala falls through to the bundled Noto Sans Sinhala, then a system font. */
  --tblr-font-sans-serif: var(--font-body), "LMS Sinhala", "Nirmala UI", "Iskoola Pota", system-ui, sans-serif;
}
body {
  --tblr-body-bg: var(--bg);
  --tblr-body-color: var(--text);
  --tblr-border-color: var(--line);
  --tblr-border-color-translucent: var(--line);
  --tblr-bg-surface: var(--card);
  --tblr-bg-surface-secondary: var(--well);
  --tblr-border-radius: var(--radius-sm);
  --tblr-border-radius-lg: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--tblr-font-sans-serif);
}
h1, h2, h3, h4, .page-title, .card-title, .modal-title, .brand-name, .stat-value {
  font-family: var(--font-head), "LMS Sinhala", "Nirmala UI", serif;
  font-weight: var(--head-weight);
  letter-spacing: normal; /* Tabler tightens headings, which crowds Sinhala */
}
.btn, .badge, .nav-link, .chip, .cc-chip, .eyebrow, .page-pretitle, .form-label, .table thead th, .dropdown-item {
  font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif;
}
.text-secondary, .page-pretitle { color: var(--muted) !important; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { border-bottom-color: var(--line); }
.card-title { font-size: 1.15rem; color: var(--text); }
[data-theme="scholarly"] body { font-size: .95rem; }
[data-theme="scholarly"] .card-title { font-size: 1.3rem; }
.btn { border-radius: var(--radius-sm); font-weight: 600; min-height: 2.5rem; }
.btn-sm { min-height: 2rem; }
.btn-cta { background: var(--cta); border-color: var(--cta); color: var(--cta-text); }
.btn-cta:hover, .btn-cta:focus { background: var(--cta); border-color: var(--cta); color: var(--cta-text); filter: brightness(.95); }
.btn-soft { background: var(--well); border-color: var(--line); color: var(--text); }
.btn-soft:hover { background: var(--primary-soft); color: var(--text); }
.form-control:not(.form-control-sm), .form-select:not(.form-select-sm) { min-height: 2.75rem; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line); }
.table thead th { background: var(--well); color: var(--muted); }

/* ===== 2. Sidebar (light in three themes, navy in Cobalt: all from tokens) and top bar ===== */
.navbar-vertical.brand-nav { background: var(--side) !important; border-right: 1px solid var(--side-line); box-shadow: none; }
.brand-nav .brand-name { margin: 0; }
.brand { display: flex; align-items: center; gap: .65rem; text-align: left; color: var(--side-text); text-decoration: none; }
.brand-nav .brand-name a, .brand-nav .brand-name a:hover { color: var(--side-text); text-decoration: none; }
.brand em, .brand strong span { font-style: normal; color: var(--brand-accent); }
.brand:hover { color: var(--side-text); text-decoration: none; }
.brand-mark { width: 2.5rem; height: 2.5rem; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--nav-on); color: var(--nav-on-text); font-size: 1.35rem; }
[data-theme="precision"] .brand-mark, [data-theme="scholarly"] .brand-mark { background: var(--primary); color: #fff; }
.brand strong { display: block; font-family: var(--font-head), "LMS Sinhala", "Nirmala UI", serif; font-weight: var(--head-weight); font-size: 1.25rem; line-height: 1.1; overflow-wrap: anywhere; }
.brand small { display: block; margin-top: .2rem; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-size: .65rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--side-muted); }
.brand-nav .nav-link { color: var(--nav-text) !important; border-radius: var(--radius-sm); margin: 1px .75rem; padding: .65rem .75rem !important; font-weight: 500; }
.brand-nav .nav-link:hover { background: var(--side-hover); }
.brand-nav .nav-item::after { display: none !important; }
.brand-nav .nav-item.active > .nav-link { background: var(--nav-on) !important; color: var(--nav-on-text) !important; font-weight: 700; }
[data-theme="precision"] .brand-nav .nav-item.active > .nav-link { box-shadow: inset -3px 0 0 var(--primary); }
.brand-nav .nav-link-icon, .brand-nav .nav-link:hover .nav-link-icon, .brand-nav .nav-link:focus .nav-link-icon { opacity: 1; color: inherit !important; } /* Tabler darkens the icon on hover; it must follow the link colour */
.brand-nav .nav-link.btn-link { border: 0; background: none; width: calc(100% - 1.5rem); text-align: left; }
.brand-nav .nav-has-sub { position: relative; }
.brand-nav .nav-has-sub > .nav-link { padding-right: 2.5rem !important; }
.nav-sub-toggle { position: absolute; top: .45rem; right: 1rem; width: 2rem; height: 2rem; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: none; color: var(--nav-text); cursor: pointer; }
.nav-sub-toggle:hover { background: var(--side-hover); }
.nav-has-sub.active > .nav-sub-toggle { color: var(--nav-on-text); }
.nav-sub-toggle i { transition: transform .2s; }
.nav-sub-toggle.collapsed i { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .nav-sub-toggle i { transition: none; } }
.brand-nav .nav-sub { list-style: none; margin: .15rem .75rem .35rem; padding: 0 0 0 2.25rem; text-align: left; }
.brand-nav .nav-sub a { display: block; padding: .35rem .6rem; border-radius: var(--radius-sm); color: var(--side-muted); font-size: .85rem; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.brand-nav .nav-sub a:hover, .brand-nav .nav-sub a[aria-current="page"] { background: var(--side-hover); color: var(--side-text); font-weight: 600; }
.brand-nav .nav-count {
  margin-inline-start: auto; min-width: 1.4rem; padding: .2rem .4rem; border-radius: 999px;
  background: var(--alert); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; text-align: center;
}
.side-card { margin: 1rem .75rem 0; padding: .75rem .85rem; border: 1px solid var(--side-line); border-radius: var(--radius-sm); background: var(--side-panel); color: var(--side-text); text-align: left; font-size: .85rem; }
.side-card span { display: block; color: var(--side-muted); }
.side-card strong { display: block; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; }

/* Theme switcher (bottom of the student sidebar): a plain form of swatch buttons. Each button
   carries its own data-theme, so var(--primary) there is that theme's colour. */
/* Theme menu (docs/07 "Theme menu"): a palette button in the top bar, and beside the site name on phones. */
.theme-menu { flex-shrink: 0; }
.theme-btn { border: 0; background: transparent; padding: 0; cursor: pointer; }
.brand-nav .theme-btn { color: var(--side-text); }
.brand-nav .theme-btn:hover, .brand-nav .theme-btn:focus-visible { background: var(--side-hover); color: var(--side-text); }
.theme-list { min-width: 13rem; padding: .375rem; margin-top: .375rem; }
.theme-head { padding: .25rem .625rem .375rem; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.theme-item.active { background: var(--primary-soft); color: var(--text); }
.theme-item { display: flex; align-items: center; gap: .625rem; border-radius: var(--radius-sm); font-weight: 600; }
.theme-item .swatch { width: 1.5rem; height: 1.5rem; flex-shrink: 0; border-radius: 50%; background: linear-gradient(135deg, var(--primary) 0 55%, var(--swatch-2) 55%); box-shadow: 0 0 0 1px var(--line); }

.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; height: 4rem; padding: 0 1.5rem; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .top-who { text-align: right; line-height: 1.2; padding-left: 1rem; border-left: 1px solid var(--line); }
.topbar .top-who strong { display: block; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-size: .9rem; }
.topbar .top-who small { color: var(--muted); }
.topbar form { margin: 0; }
.avatar.lms-solid { background: var(--deep); color: #fff; border-radius: 50%; font-weight: 700; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; }

/* The bell: in the top bar on wide screens, beside the site name on phones (the top bar is hidden there). */
.brand-nav .brand-row { display: flex; align-items: center; gap: .5rem; flex: 1 1 auto; min-width: 0; }
.brand-nav .brand-row .navbar-brand { margin-inline-end: auto; min-width: 0; }
@media (min-width: 992px) { .brand-nav .brand-row { width: 100%; flex: 0 0 auto; padding: 0 .75rem; } }
.nav-bell { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); color: var(--text); font-size: 1.35rem; text-decoration: none; }
.nav-bell:hover, .nav-bell:focus-visible, .nav-bell.is-active { background: var(--well); color: var(--text); text-decoration: none; }
.nav-bell .bell-count {
  position: absolute; top: .1rem; right: .05rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px;
  background: var(--alert); color: #fff; font-size: .7rem; font-weight: 700; line-height: 1.2rem; text-align: center;
  box-shadow: 0 0 0 2px var(--card);
}
.nav-bell .bell-count[hidden] { display: none; }
.brand-nav .nav-bell { color: var(--side-text); }
.brand-nav .nav-bell:hover, .brand-nav .nav-bell:focus-visible, .brand-nav .nav-bell.is-active { background: var(--side-hover); color: var(--side-text); }
.brand-nav .nav-bell .bell-count { box-shadow: 0 0 0 2px var(--side); }
@media (max-width: 991px) {
  .topbar { display: none; }
  .brand-nav .navbar-toggler-icon { filter: var(--toggler-filter); }
  .navbar-vertical.brand-nav { border-right: 0; border-bottom: 1px solid var(--side-line); position: sticky; top: 0; z-index: 1030; }
}

/* ===== 3. Page header ===== */
.eyebrow, .page-pretitle { display: inline-flex; align-items: center; gap: .45rem; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.eyebrow { color: var(--accent-ink); }
.eyebrow::before, .page-pretitle::before { content: ""; width: .45rem; height: .45rem; flex-shrink: 0; border-radius: 50%; background: var(--accent); }
.page-pretitle { text-transform: none; letter-spacing: .02em; font-size: .85rem; font-weight: 600; }
.page-pretitle::before { display: none; }
.page-title { font-size: 2rem; line-height: 1.2; color: var(--text); margin-top: .25rem; white-space: normal; overflow-wrap: anywhere; }
[data-theme="scholarly"] .page-title { font-size: 2.4rem; font-weight: 500; }
.page-sub { color: var(--muted); margin-top: .15rem; }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
@media (max-width: 575px) { .page-title, [data-theme="scholarly"] .page-title { font-size: 1.65rem; } }

/* ===== 4. State colours. Use these instead of Tabler's bg-green-lt, bg-yellow-lt and so on. ===== */
.badge { border-radius: var(--radius-chip); padding: .35rem .65rem; font-weight: 700; font-size: .72rem; line-height: 1.1; }
.badge.lms-ok, .avatar.lms-ok, .tile.ok { background: var(--ok-soft); color: var(--ok); }
.badge.lms-alert, .avatar.lms-alert, .tile.alert-tone { background: var(--alert-soft); color: var(--alert); }
.badge.lms-pending, .avatar.lms-pending, .tile.waiting { background: var(--accent-soft); color: var(--accent-ink); }
.badge.lms-info, .avatar.lms-info { background: var(--primary-soft); color: var(--primary); }
.badge.lms-muted { background: var(--well); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.alert { border-radius: var(--radius); }
.alert.lms-alert-box { background: var(--alert-soft); border: 1px solid var(--alert); color: var(--alert); }
.alert.lms-pending-box { background: var(--accent-soft); border: 1px solid var(--accent-ink); color: var(--accent-ink); }
.alert.lms-ok-box { background: var(--ok-soft); border: 1px solid var(--ok); color: var(--ok); }
.lms-alert-box .alert-title { color: var(--alert); }
.lms-pending-box .alert-title { color: var(--accent-ink); }
/* The month picker uses the primary colour, not --alert (user, 2026-12-02: "follow the mockup"). */
.lms-month { border: 1px solid var(--line); background-color: var(--card); color: var(--text); font-weight: 600; font-size: .9375rem; }
.lms-month:hover { border-color: var(--primary); }
.lms-month:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem var(--primary-soft); }
/* The month row lines up with the tab text above it and doesn't stretch across the card. */
.month-bar { padding-left: .1875rem; }
.month-pick { width: 17.5rem; max-width: 100%; }
/* Form errors use the alert tokens, not Bootstrap's fixed red (docs/07 "State classes"). */
.alert-danger { background: var(--alert-soft); border-color: var(--alert); color: var(--alert); }
.invalid-feedback { color: var(--alert); }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--alert); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus { border-color: var(--alert); box-shadow: 0 0 0 .25rem var(--alert-soft); }
.dropdown-item.active .badge { box-shadow: 0 0 0 1px #fff; }
.form-selectgroup-input:checked + .form-selectgroup-label { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

/* ===== 5. Dashboard ===== */
.tile { width: 2.75rem; height: 2.75rem; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-sm); font-size: 1.35rem; background: var(--primary-soft); color: var(--primary); }
.tile.quiet { background: var(--well); color: var(--muted); }
.stat { height: 100%; }
.stat .card-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; }
.stat-label { font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .tile { width: 2.25rem; height: 2.25rem; font-size: 1.15rem; }
.stat-value { font-size: 1.35rem; line-height: 1.25; overflow-wrap: anywhere; }
[data-theme="scholarly"] .stat-value { font-size: 1.55rem; }
.stat-foot { margin-top: auto; font-size: .82rem; color: var(--muted); }
.stat-foot a { font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-weight: 700; }
.stat-then { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.stat-then div { overflow-wrap: anywhere; }
.stat-then b { color: var(--text); font-weight: 600; }
.stat-then a { display: inline-block; margin-top: .25rem; font-weight: 700; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .65rem; margin: 2rem 0 .9rem; }
.section-head h2 { font-size: 1.35rem; margin: 0; }
[data-theme="scholarly"] .section-head h2 { font-size: 1.75rem; font-weight: 500; }

.class-card { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.class-top { position: relative; isolation: isolate; overflow: hidden; min-height: 10rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: .85rem 1rem 1rem; color: #fff;
  background-color: var(--deep);
  background-image: radial-gradient(circle at 88% 12%, rgba(255,255,255,.2) 0 3.2rem, transparent 3.25rem), radial-gradient(circle at 102% 90%, rgba(255,255,255,.12) 0 5rem, transparent 5.05rem), linear-gradient(135deg, var(--deep), var(--primary)); }
.class-top.b { background-image: radial-gradient(circle at 12% 110%, rgba(255,255,255,.14) 0 5rem, transparent 5.05rem), repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 2px, transparent 2px 14px), linear-gradient(135deg, var(--primary), var(--deep)); }
.class-top.c { background-image: radial-gradient(circle at 85% 15%, rgba(255,255,255,.16) 0 1.4rem, transparent 1.45rem), radial-gradient(circle at 65% 40%, rgba(255,255,255,.08) 0 3rem, transparent 3.05rem), linear-gradient(160deg, var(--primary), var(--deep)); }
/* A class photo fills the header; a dark fade keeps the white text readable. If it can't load, the themed pattern shows. */
.class-top > img.cc-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.class-top.has-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.6)); }
.cc-chips { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.cc-chip { padding: .3rem .6rem; border-radius: var(--radius-chip); background: var(--card); color: var(--text); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.class-top h3, .class-top h2 { margin: 0; color: #fff; font-size: 1.3rem; line-height: 1.3; overflow-wrap: anywhere; }
.class-banner .class-top h2 { font-size: 1.65rem; }
.class-top small { display: block; opacity: .9; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; margin-bottom: .2rem; }
.class-card .card-body { display: flex; flex-direction: column; gap: .75rem; }
.well { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .85rem; border-radius: var(--radius-sm); background: var(--well); }
.well i { font-size: 1.15rem; color: var(--primary); }
.well small { display: block; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.well.alert-w { background: var(--alert-soft); color: var(--alert); }
.well.alert-w i, .well.alert-w small { color: var(--alert); }
.well.pending-w { background: var(--accent-soft); color: var(--accent-ink); }
.well.pending-w i, .well.pending-w small { color: var(--accent-ink); }
.cc-facts { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: .85rem; color: var(--muted); }
.cc-facts i { color: var(--primary); margin-right: .3rem; }
.class-actions { margin-top: auto; display: flex; gap: .5rem; }
.class-actions .btn { flex: 1; }

.howto { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.howto li { counter-increment: step; display: flex; gap: .85rem; padding: .55rem 0; }
.howto li::before { content: counter(step); width: 2rem; height: 2rem; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--cta); color: var(--cta-text); font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-weight: 700; }
.howto li:last-child::before { background: var(--primary); color: #fff; }
.howto strong { display: block; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; }

.bank { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--well); }
.bank dl { margin: 0; display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .4rem 1rem; }
.bank dt { color: var(--muted); font-weight: 400; }
.bank dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.bank .account { font-size: 1.1rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.bank + p { margin-top: .75rem; }

/* ===== 6. Class page ===== */
.class-banner { border: 0; overflow: hidden; }
.class-banner .class-top { min-height: 8.5rem; border-radius: var(--radius); }
.class-banner .cc-chips { justify-content: flex-start; }
.thumb { background: linear-gradient(135deg, var(--deep), var(--primary)); display: grid; place-items: center; }
.thumb .play { width: 44px; height: 44px; border-radius: 50%; background: var(--card); color: var(--primary); display: grid; place-items: center; font-size: 1.2rem; }
.thumb > img { object-fit: cover; }
.card-link:hover { border-color: var(--primary); }
.nav-tabs .nav-link { font-weight: 600; color: var(--muted); }
.nav-tabs .nav-link.active { color: var(--primary); background: transparent; border-color: transparent; box-shadow: inset 0 -3px 0 var(--primary); }
.next-top { height: 4px; background: var(--accent); border-radius: var(--radius) var(--radius) 0 0; }
.class-photo { height: 150px; object-fit: cover; }
.photo { height: 150px; display: grid; place-items: center; color: #fff; font-size: 2.5rem; }
.photo.a { background: linear-gradient(135deg, var(--deep), var(--primary)); }
.photo.b { background: linear-gradient(135deg, var(--primary), var(--deep)); }
.class-title { font-size: 1.5rem; color: var(--text); }
.stage { background: #0b1020; }
.stage .play { width: 84px; height: 84px; font-size: 2rem; }
.playlist-thumb { width: 72px; flex-shrink: 0; border-radius: 6px; overflow: hidden; }
.playlist-thumb .play { width: 24px; height: 24px; font-size: .7rem; }
.list-group-item.playing { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); }
.upload-slip .form-control[type="file"] { background: var(--card); }

/* ===== 7. Logged-out pages ===== */
.page-center .brand-name { color: var(--deep); }
.page-center .brand-name span { color: var(--accent-ink); }
.brand-logo { max-height: 44px; max-width: 200px; object-fit: contain; }
.login-wrap { min-height: calc(100vh - 3.25rem); display: grid; place-items: center; padding: 1.5rem; }
.login-box { width: 100%; max-width: 58rem; display: grid; grid-template-columns: 1fr 1.05fr; overflow: hidden; }
.login-side { padding: 2.25rem; color: #fff; background-color: var(--deep); background-image: radial-gradient(circle at 105% 100%, rgba(255,255,255,.1) 0 9rem, transparent 9.05rem), radial-gradient(circle at 92% 4%, rgba(255,255,255,.08) 0 4rem, transparent 4.05rem); }
.login-side h2 { color: #fff; font-size: 1.6rem; }
.login-side .brand, .login-side .brand:hover { color: #fff; }
.login-side .brand small { color: rgba(255,255,255,.8); }
.login-side .brand em, .login-side .brand strong span { color: inherit; }
.login-side .brand-mark { background: var(--card); color: var(--deep); }
.login-side .howto li::before, .login-side .howto li:last-child::before { background: var(--card); color: var(--deep); }
.login-side .brand-logo { padding: .35rem .6rem; border-radius: var(--radius-sm); background: var(--card); }
.login-form { padding: 2.25rem; }
.login-form h2 { margin-bottom: 1.5rem; }
.login-box-single { max-width: 28rem; display: block; }
@media (max-width: 767px) { .login-box { grid-template-columns: 1fr; } .login-side { padding: 1.5rem; } .login-side .login-more { display: none; } .login-form { padding: 1.5rem; } }

/* ===== 8. Cobalt only: its card headers, solid status chips, navy card buttons and side-by-side summary boxes ===== */
[data-theme="cobalt"] .class-top { background-image: linear-gradient(115deg, var(--primary) 0%, var(--hero-mid) 52%, var(--deep) 100%); }
[data-theme="cobalt"] .class-top.b { background-image: linear-gradient(115deg, var(--deep) 0%, var(--hero-mid) 100%); }
[data-theme="cobalt"] .class-top.c { background-image: linear-gradient(115deg, var(--hero-mid) 0%, var(--deep) 85%); }
[data-theme="cobalt"] .class-top .badge.lms-ok { background: var(--ok); color: #fff; }
[data-theme="cobalt"] .class-top .badge.lms-alert { background: var(--alert); color: #fff; }
[data-theme="cobalt"] .class-top .cc-chip { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
[data-theme="cobalt"] .class-top small { text-transform: none; letter-spacing: normal; font-size: .85rem; }
[data-theme="cobalt"] .class-actions .btn-primary { background: var(--deep); border-color: var(--deep); }
[data-theme="cobalt"] .class-actions .btn { text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }
[data-theme="cobalt"] .eyebrow { color: var(--primary); }
[data-theme="cobalt"] .eyebrow::before, [data-theme="cobalt"] .page-pretitle::before { background: var(--primary); }
@media (min-width: 1200px) {
  [data-theme="cobalt"] .stat .card-body { display: grid; grid-template-columns: auto 1fr; column-gap: .85rem; row-gap: .25rem; align-content: center; }
  [data-theme="cobalt"] .stat .card-body > div:first-child { display: contents !important; }
  [data-theme="cobalt"] .stat .tile { grid-column: 1; grid-row: 1 / span 4; align-self: center; width: 2.75rem; height: 2.75rem; font-size: 1.35rem; }
  [data-theme="cobalt"] .stat .stat-label, [data-theme="cobalt"] .stat .stat-value, [data-theme="cobalt"] .stat .stat-foot, [data-theme="cobalt"] .stat .stat-then { grid-column: 2; }
  [data-theme="cobalt"] .stat .stat-value { font-size: 1.15rem; }
}

/* ===== 9. M9 video stage (templates/includes/video_stage.html, static/js/player.js).
   The dark stage and white-on-dark watermark are the allowed exceptions (see top). ===== */
.lms-video { position: relative; aspect-ratio: 16 / 9; background: #0b1020; overflow: hidden; }
.lms-video > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lms-watermark { position: absolute; top: 8%; left: 6%; z-index: 2; pointer-events: none; user-select: none; -webkit-user-select: none; white-space: nowrap; font: 600 clamp(.75rem, 1.6vw, 1.2rem)/1 system-ui, sans-serif; letter-spacing: .06em; color: rgba(255,255,255,.4); text-shadow: 0 0 3px rgba(0,0,0,.6); transition: opacity .6s ease; }
.lms-watermark.is-fading { opacity: 0; }
.lms-fullscreen { position: absolute; top: .5rem; right: .5rem; z-index: 3; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: rgba(11,16,32,.55); color: #fff; cursor: pointer; opacity: .85; }
.lms-fullscreen:hover, .lms-fullscreen:focus-visible { opacity: 1; background: rgba(11,16,32,.85); }
.lms-fullscreen:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lms-fs-exit, .lms-video.is-fs .lms-fs-enter { display: none; }
.lms-video.is-fs .lms-fs-exit { display: block; }
.lms-video:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; }
.lms-video:-webkit-full-screen { aspect-ratio: auto; width: 100%; height: 100%; }
.lms-video.is-pseudo-fs { position: fixed; inset: 0; z-index: 2000; aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh; }
html.lms-no-scroll, html.lms-no-scroll body { overflow: hidden; }
.lms-video-missing { position: absolute; inset: 0; display: grid; place-items: center; padding: 1.5rem; text-align: center; color: rgba(255,255,255,.85); }
@media (prefers-reduced-motion: reduce) { .lms-watermark { transition: none; } }

/* ===== 10. Notifications (docs/06, 2026-12-01): the list ===== */
.notice-row { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line); color: var(--text); }
.notice-row:first-child { border-top: 0; }
a.notice-row:hover { background: var(--well); color: var(--text); text-decoration: none; }
.notice-row.is-new { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
a.notice-row.is-new:hover { background: var(--primary-soft); }
.notice-row .grow { flex: 1; min-width: 0; }
.notice-text { display: block; overflow-wrap: anywhere; }
.notice-row.is-new .notice-text { font-weight: 600; }
.notice-row small { display: block; margin-top: .15rem; color: var(--muted); }
.notice-go { flex-shrink: 0; color: var(--muted); font-size: 1.1rem; }
.notice-new { flex-shrink: 0; }
.notice-tile {
  width: 2.5rem; height: 2.5rem; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-sm); font-size: 1.25rem;
  background: var(--primary-soft); color: var(--primary);
}
.notice-row.is-new .notice-tile.tone-info { background: var(--card); }
.notice-tile.tone-ok { background: var(--ok-soft); color: var(--ok); }
.notice-tile.tone-alert { background: var(--alert-soft); color: var(--alert); }
.notice-tile.tone-waiting { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 575px) { .notice-row { padding: .75rem 1rem; gap: .7rem; align-items: flex-start; } .notice-go { display: none; } }

/* ===== 11. Messages (docs/06 N2): lists, the conversation, Office hours ===== */
.convo-snippet { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo-badges { display: flex; flex-wrap: wrap; gap: .35rem; flex-shrink: 0; }
.office-hours { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem 1rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--text); }
.office-hours i { color: var(--accent-ink); font-size: 1.25rem; line-height: 1.2; }
.chat { display: flex; flex-direction: column; gap: .9rem; }
.chat-item { display: flex; flex-direction: column; align-items: flex-start; max-width: min(42rem, 88%); }
.chat-item.is-mine { align-self: flex-end; align-items: flex-end; }
.chat-who { font-size: .8rem; color: var(--muted); margin: 0 .35rem .2rem; }
.chat-who strong { color: var(--text); font-weight: 600; }
.bubble { padding: .65rem .9rem; border-radius: 14px; border: 1px solid var(--line); background: var(--well); color: var(--text);
  overflow-wrap: anywhere; white-space: normal; border-top-left-radius: 4px; }
.chat-item.is-mine .bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-top-left-radius: 14px; border-top-right-radius: 4px; }
.chat-new { align-self: center; display: flex; align-items: center; gap: .5rem; width: 100%; color: var(--primary); font-size: .8rem; font-weight: 600; }
.chat-new::before, .chat-new::after { content: ""; flex: 1; border-top: 1px solid var(--primary); opacity: .5; }
.chat-closed { display: flex; gap: .6rem; align-items: center; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--well);
  border: 1px dashed var(--line); color: var(--muted); }
.convo-facts { margin: 0; }
.convo-facts dt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.convo-facts dd { margin: 0 0 .75rem; overflow-wrap: anywhere; }
.convo-facts dd:last-child { margin-bottom: 0; }
/* In the office table a preview wraps to two lines at most, so the table never scrolls sideways. */
.msg-table .convo-snippet { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-table td[data-label="Status"], .msg-table td[data-label="Last message"] { white-space: nowrap; }
.msg-table .person strong { white-space: nowrap; }
@media (max-width: 575px) { .chat-item { max-width: 94%; } .convo-badges { flex-direction: column; align-items: flex-end; } }

/* ===== 12. Tute Tracking (docs/06 2026-12-02): a parcel's steps ===== */
.parcel .card-header { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.parcel .grow { flex: 1; min-width: 0; }
.track { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.track li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; color: var(--muted); }
.track li::before { content: ""; position: absolute; top: 1.2rem; right: 50%; width: 100%; height: 3px; background: var(--line); }
.track li:first-child::before { display: none; }
.track .dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
  border-radius: 50%; background: var(--well); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); font-size: 1.15rem; }
.track b { font-weight: 600; font-size: .9rem; }
.track small { font-size: .78rem; color: var(--muted); }
.track li.is-done, .track li.is-current { color: var(--text); }
.track li.is-done::before, .track li.is-current::before { background: var(--ok); }
.track li.is-done .dot { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.track li.is-current .dot { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.track li.is-current::before { background: var(--ok); }
.track li.is-alert { color: var(--text); }
.track li.is-alert::before { background: var(--alert); }
.track li.is-alert .dot { background: var(--alert-soft); color: var(--alert); box-shadow: inset 0 0 0 2px var(--alert); }
.parcel-note { margin: 0 0 1rem; color: var(--text); }
.parcel .facts { display: grid; grid-template-columns: 9rem 1fr; gap: .55rem 1rem; margin: 0; }
.parcel .facts dt { color: var(--muted); font-weight: 400; }
.parcel .facts dd { margin: 0; overflow-wrap: anywhere; }
.parcel .facts .account { font-variant-numeric: tabular-nums; letter-spacing: .03em; font-weight: 600; }
@media (max-width: 575px) { .parcel .facts { grid-template-columns: 1fr; gap: 0; } .parcel .facts dd { margin-bottom: .6rem; } .track b { font-size: .8rem; } }

/* ===== The Store (phase 2): product cards reuse the class card; prices, cart and checkout ===== */
.product-card .class-top { text-decoration: none; }
.product-card .class-top:hover h3 { text-decoration: underline; }
.price { font-family: var(--font-head), "LMS Sinhala", "Nirmala UI", serif; font-weight: var(--head-weight); font-size: 1.15rem; color: var(--deep); white-space: nowrap; }
.price-lg { font-size: 1.6rem; }
.product-card .class-actions .btn { flex: 0 0 auto; margin-inline-start: auto; }
.product-hero .class-top { min-height: 16rem; }
.store-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.store-filters .chip { padding: .35rem .85rem; border: 1px solid var(--line); border-radius: var(--radius-chip); background: var(--card); color: var(--text); font-size: .85rem; }
.store-filters .chip:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--text); text-decoration: none; }
.store-filters .chip[aria-current="true"] { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 700; }
.store-filters form { min-width: 12rem; }
.crumb-line { margin-bottom: .35rem; font-size: .85rem; }
.crumb-line a { color: var(--muted); }
.crumb-line a:hover { color: var(--primary); }
.section-label { margin-bottom: .4rem; font-family: var(--font-ui), "LMS Sinhala", "Nirmala UI", sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.file-list { margin: 0; padding: 0; list-style: none; }
.file-list li { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.file-list li:first-child { border-top: 0; }
.file-list i { color: var(--primary); font-size: 1.15rem; }
.qty-box { width: 5.5rem; }
.cart-table .icon-btn { width: 2.25rem; height: 2.25rem; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font-size: 1.1rem; }
.cart-table .icon-btn:hover { border-color: var(--alert); background: var(--alert-soft); color: var(--alert); }
.sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.order-lines { margin: 0 0 .25rem; padding: 0; list-style: none; }
.order-lines li { display: flex; align-items: flex-start; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.order-lines li:first-child { border-top: 0; }
.order-lines .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.parcel-address { white-space: normal; overflow-wrap: anywhere; }
.pack-list .grow { flex: 1; min-width: 0; }
.grow { flex: 1; min-width: 0; }

/* Weekly timetable (templates/includes/week.html), students and office */
.week { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .week { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.week-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; }
.week-day.is-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.week-name { font-size: 1rem; margin: 0 0 .5rem; display: flex; align-items: center; gap: .5rem; }
.week-list { list-style: none; margin: 0; padding: 0; }
.week-item { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--line); }
.week-item:first-child { border-top: 0; padding-top: 0; }
.week-item.is-clash:first-child { padding-top: .6rem; }
.week-item.is-clash { background: var(--alert-soft); margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: var(--radius-sm); }
.week-time { flex: 0 0 7.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.week-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.week-none { margin: 0; color: var(--muted); font-size: .9rem; }
.week-body .badge { white-space: normal; text-align: left; line-height: 1.35; }
