/* =====================================================================
   Delight Training Academy — Design system + portals
   Shared by the public website, login page and all three portals.
   Sections: tokens · base · layout · components · portal shell (student,
   teacher) · student widgets · teacher · admin (WP-style) · classroom ·
   responsive · print
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Brand (from the Delight logo) */
  --navy: #0B1B3A;
  --navy-800: #122A5C;
  --navy-700: #1A3A78;
  --blue: #1078C0;
  --blue-600: #0E6AAB;
  --blue-700: #0B5790;
  --blue-50: #EAF4FB;
  --blue-100: #D3E8F7;
  --sky: #18A0D8;
  --sky-100: #DDF1FA;
  --grey: #5A626D;

  /* Neutrals */
  --ink: #0F1A2E;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98A2B3;
  --line: #E3E8F0;
  --line-2: #EEF2F7;
  --bg: #F4F7FC;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;

  /* Semantic */
  --green: #139A63;  --green-50: #E5F6EE;
  --amber: #D98A12;  --amber-50: #FFF3DE;
  --red: #D6453D;    --red-50: #FDECEB;
  --violet: #6A4FE0; --violet-50: #EFEBFE;
  --teal: #0E8F88;   --teal-50: #E1F5F3;
  --pink: #D23F74;   --pink-50: #FDE9F0;

  /* Type */
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Shape */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-2xl: 28px; --r-pill: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 12px 32px -14px rgba(11, 27, 58, .22), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 28px 64px -24px rgba(11, 27, 58, .38);
  --ring: 0 0 0 4px rgba(16, 120, 192, .16);

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --fast: 160ms; --base: 260ms;

  /* Icons (duotone: navy line + brand accent + soft tint) */
  --ic-line: var(--navy);
  --ic-a: var(--blue);
  --ic-f: #DCEBF8;

  /* Layout */
  --container: 1200px;
  --nav-h: 68px;
  --aside-w: 248px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--ink-2); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, video { max-width: 100%; display: block; }
svg { flex: none; }
/* Every icon has a text-sized default, so an icon without a size rule can never render at full width */
.ic { width: 1.25em; height: 1.25em; }
/* Duotone icon system — see DA.icons in app.js. Line = currentColor, accent = --ic-a, tint = --ic-f */
.ic .a { stroke: var(--ic-a); }
.ic .f { fill: var(--ic-f); stroke: none; }
.ic .af { fill: var(--ic-a); stroke: none; }
/* On solid colour (buttons, dark panels) icons become single-colour */
.btn-primary, .btn-navy, .btn-danger, .btn-success, .btn-live, .badge-navy, .toast, .segment button.active, .aside nav a.active { --ic-a: currentColor; --ic-f: transparent; }
.on-dark { --ic-a: #7FD3F7; --ic-f: rgba(255, 255, 255, .12); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-700); }
h1, h2, h3, h4, h5 { font-family: var(--font); color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul, ol.steps-bar, ol.sp-topics { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(16, 120, 192, .45); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--blue-100); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 999; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }
html.modal-open, html.nav-open { overflow: hidden; }

/* ---------- 3. Layout & utilities ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.two-col-rev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 20px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }
.flex { display: flex; } .wrap { flex-wrap: wrap; } .center { align-items: center; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 28px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .78rem; } .strong { font-weight: 600; color: var(--ink); }
.text-center { text-align: center; } .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
@media (max-width: 680px) { .hide-sm { display: none !important; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }

/* ---------- 4. Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--r-md); border: 1px solid transparent; font-weight: 600; font-size: .92rem; line-height: 1.2; white-space: nowrap; transition: background var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast), transform var(--fast); text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(16, 120, 192, .7); }
.btn-primary:hover { background: var(--blue-600); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-800); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-soft { background: var(--blue-50); color: var(--blue-700); }
.btn-soft:hover { background: var(--blue-100); color: var(--blue-700); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-ghost.danger, .linkbtn.danger { color: var(--red); }
.btn-ghost.danger:hover { background: var(--red-50); color: #B7342D; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #BE3830; color: #fff; }
.btn-danger-soft { background: var(--red-50); color: var(--red); }
.btn-danger-soft:hover { background: #F9D8D5; color: #B7342D; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0F8354; color: #fff; }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: #EEF4FA; color: var(--navy); }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; --ic-a: currentColor; --ic-f: transparent; }
.btn-outline-light:hover { background: #fff; border-color: #fff; color: var(--navy); }
.btn-live { background: var(--green); color: #fff; box-shadow: 0 6px 16px -8px rgba(19, 154, 99, .8); }
.btn-live:hover { background: #0F8354; color: #fff; }
.btn-sm { padding: 8px 13px; font-size: .84rem; border-radius: 10px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-color: rgba(255, 255, 255, .9) rgba(255, 255, 255, .9) transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline.is-loading::after, .btn-ghost.is-loading::after, .btn-soft.is-loading::after { border-color: var(--blue) var(--blue) transparent transparent; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; font-size: .82rem; }
.linkbtn svg { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 5. Forms ---------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.input, .select, .textarea { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 14px; font-size: .94rem; color: var(--ink); transition: border-color var(--fast), box-shadow var(--fast); min-height: 46px; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.field-error { display: none; color: var(--red); font-size: .8rem; margin-top: 6px; }
.field-hint { color: var(--muted); font-size: .8rem; margin-top: 6px; }
.field.has-error .field-error { display: block; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea, .field.has-error .choice-grid { border-color: var(--red); }
.field.has-error .input:focus { box-shadow: 0 0 0 4px rgba(214, 69, 61, .14); }
.field-warn { background: var(--amber-50); color: #7A4B00; border-radius: 10px; padding: 8px 12px; font-size: .8rem; margin-top: 8px; display: flex; gap: 8px; align-items: flex-start; }
.field-warn svg { width: 16px; height: 16px; margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.input-wrap { position: relative; }
.input-wrap.has-icon .input { padding-left: 44px; }
.input-wrap .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); pointer-events: none; }
.input-wrap .input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 8px; border-radius: 8px; color: var(--muted); }
.input-wrap .input-action svg { width: 18px; height: 18px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; font-size: .9rem; cursor: pointer; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
/* Card-style choice buttons (radio / checkbox) */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; border: 1px solid transparent; border-radius: var(--r-md); }
.choice { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; cursor: pointer; font-size: .88rem; font-weight: 500; color: var(--ink); transition: border-color var(--fast), background var(--fast); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .tick { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--muted-2); display: grid; place-items: center; flex: none; transition: all var(--fast); }
.choice input[type=radio] + .tick { border-radius: 50%; }
.choice .tick svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.choice:hover { border-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.choice input:checked + .tick { background: var(--blue); border-color: var(--blue); }
.choice input:checked + .tick svg { opacity: 1; }
.choice input[type=radio]:checked + .tick::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.choice input:focus-visible + .tick { box-shadow: var(--ring); }
.choice small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: var(--r-pill); padding: 6px 12px; font-size: .8rem; font-weight: 500; color: var(--ink-2); }
.chip:hover, .chip.active { border-color: var(--blue); color: var(--blue); background: var(--blue-50); }
.drop { display: grid; justify-items: center; gap: 6px; padding: 22px; border: 1.5px dashed var(--line); border-radius: var(--r-lg); background: var(--surface-2); text-align: center; cursor: pointer; color: var(--muted); font-size: .88rem; transition: all var(--fast); }
.drop svg { width: 26px; height: 26px; color: var(--blue); }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-50); }
.drop.has-file { border-style: solid; border-color: var(--green); background: var(--green-50); color: var(--ink); }
.drop.has-file svg { color: var(--green); }
.drop b { color: var(--ink); }
/* On/off switch (settings) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.switch-row b { display: block; font-size: .9rem; font-weight: 600; color: var(--ink); }
.switch-row small { display: block; font-size: .78rem; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: #CBD2DD; flex: none; cursor: pointer; transition: background var(--fast); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform var(--fast) var(--ease); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }

/* ---------- 6. Components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-xs); }
.card-pad { padding: 22px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 18px 22px 0; }
.card-head h3 { margin: 0; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { width: 18px; height: 18px; flex: none; color: var(--navy); }
.card-head .link, .card-head a.small { font-size: .84rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.card-head .link svg { width: 15px; height: 15px; }
.card-body { padding: 16px 22px 22px; }
.card-hover { transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease), border-color var(--base); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #D6DFEA; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: .74rem; font-weight: 600; background: var(--line-2); color: var(--ink-2); line-height: 1.3; white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-green { background: var(--green-50); color: #0C7A4C; }
.badge-amber { background: var(--amber-50); color: #9A5E00; }
.badge-red { background: var(--red-50); color: #B3332C; }
.badge-violet { background: var(--violet-50); color: var(--violet); }
.badge-navy { background: var(--navy); color: #fff; }
.badge-soft { background: var(--line-2); color: var(--muted); }
.badge-free { background: var(--pink-50); color: #B8325F; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--green-50); color: #0C7A4C; font-size: .74rem; font-weight: 700; padding: 4px 10px 4px 8px; border-radius: 8px; letter-spacing: .01em; white-space: nowrap; --ic-a: var(--green); --ic-f: transparent; }
.live-tag svg { width: 15px; height: 15px; color: #0C7A4C; }
.live-tag.soon { background: var(--blue-50); color: var(--blue-700); --ic-a: var(--blue); }
.live-tag.soon svg { color: var(--blue-700); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

.progress { height: 8px; background: var(--line-2); border-radius: var(--r-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue); border-radius: inherit; transition: width .8s var(--ease); }
.progress-sm { height: 6px; }
.progress-green > span { background: var(--green); }
.ring { position: relative; width: var(--size, 84px); height: var(--size, 84px); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .track { stroke: var(--line-2); }
.ring .bar { stroke: var(--blue); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--ink); font-size: calc(var(--size, 84px) * .22); }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { width: 100%; height: 100%; }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-c b { font-size: 1.5rem; color: var(--ink); line-height: 1.1; }
.donut-c span { font-size: .72rem; color: var(--muted); }
.legend { display: grid; gap: 8px; font-size: .85rem; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; color: var(--ink); }
/* Ratings: read-only stars (DA.stars) and the 1–5 star picker (DA.starInput) */
.stars { display: inline-flex; gap: 1px; flex: none; vertical-align: middle; --ic-a: #C3CBD8; --ic-f: transparent; }
.stars i { display: inline-grid; }
.stars svg { width: 15px; height: 15px; }
.stars i.on { --ic-a: var(--amber); --ic-f: var(--amber); }
.star-input { display: inline-flex; gap: 2px; }
.star-input button { border: 0; background: none; padding: 3px; border-radius: 8px; --ic-a: #C3CBD8; --ic-f: transparent; transition: transform var(--fast); }
.star-input svg { display: block; width: 30px; height: 30px; }
.star-input button.on, .star-input:has(button:hover) button { --ic-a: var(--amber); --ic-f: var(--amber); }
.star-input button:hover ~ button { --ic-a: #C3CBD8; --ic-f: transparent; }
.star-input button:hover { transform: scale(1.1); }

.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blue-50); color: var(--blue-700); font-weight: 600; font-size: .86rem; flex: none; letter-spacing: .02em; }
.avatar-xs { width: 24px; height: 24px; font-size: .62rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .74rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.05rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }
img.avatar { object-fit: cover; }
.tone-1 { background: #E3F0FF; color: #1D5FC2; }
.tone-2 { background: #E6F6EE; color: #0F7A4D; }
.tone-3 { background: #FFF1DC; color: #A1600A; }
.tone-4 { background: #F0EBFF; color: #5B3FD0; }
.tone-5 { background: #FDE9F0; color: #B8325F; }

.icon-box { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #F3F7FC; border: 1px solid #E4ECF6; color: var(--navy); flex: none; }
.icon-box svg { width: 22px; height: 22px; }
.icon-box.green { background: #F1FAF5; border-color: #DCF0E5; --ic-a: var(--green); --ic-f: #D3EFE1; color: #0E3B2B; }
.icon-box.amber { background: #FFF9EF; border-color: #F7E7C8; --ic-a: var(--amber); --ic-f: #FBE6BF; color: #3F2A06; }
.icon-box.red { background: #FEF4F3; border-color: #F8DCD9; --ic-a: var(--red); --ic-f: #F9D5D1; color: #3E1411; }
.icon-box.violet { background: #F6F3FF; border-color: #E6E0FC; --ic-a: var(--violet); --ic-f: #E3DCFD; color: #22174F; }
.icon-box.navy { background: var(--navy); border-color: var(--navy); color: #fff; --ic-a: #7FD3F7; --ic-f: rgba(255, 255, 255, .12); }
.icon-box.teal { background: #F0FAF9; border-color: #D8EFEC; --ic-a: var(--teal); --ic-f: #CDEDEA; color: #0B3432; }
.icon-box.pink { background: #FEF3F7; border-color: #F8DCE6; --ic-a: var(--pink); --ic-f: #F9D6E3; color: #431226; }
.icon-box.lg { width: 52px; height: 52px; border-radius: 14px; }
.icon-box.lg svg { width: 26px; height: 26px; }
.icon-box.sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-box.sm svg { width: 18px; height: 18px; }

.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover .title { color: var(--blue); }
.list-item .title { font-weight: 600; color: var(--ink); font-size: .92rem; line-height: 1.35; }
.list-item .sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 10px 14px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }
/* Downloadable files (assignment sheets, attachments, submissions) */
.file-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink-2); text-align: left; }
button.file-chip:hover { border-color: var(--blue); color: var(--blue); }
.file-chip svg { width: 18px; height: 18px; flex: none; color: var(--navy); }
button.file-chip:hover svg:last-child { color: var(--blue); }
.file-chip > span { min-width: 0; }
.file-chip b { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; color: var(--ink); }
.file-chip small { display: block; font-size: .72rem; color: var(--muted); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:hover td, .table tr.selected td { background: #F6FAFE; }
.table .check input { margin: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 12px 16px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--blue); border-color: var(--blue); }
.tab .pill-count { margin-left: 0; }
.segment { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; gap: 2px; flex-wrap: wrap; }
.segment button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-size: .85rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.segment button svg { width: 15px; height: 15px; }
.segment button.active { background: var(--blue); color: #fff; }
.segment.seg-sm { padding: 3px; }
.segment.seg-sm button { padding: 6px 10px; font-size: .8rem; }
.pill-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; margin-left: auto; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: .9rem; border: 1px solid transparent; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-info { background: var(--blue-50); color: #0B4E80; border-color: var(--blue-100); }
.alert-success { background: var(--green-50); color: #0B6A43; border-color: #C5EAD8; }
.alert-warn { background: var(--amber-50); color: #7A4B00; border-color: #F5DDB0; }
.alert-error { background: var(--red-50); color: #9E2B25; border-color: #F5C9C5; }
.alert a { color: inherit; text-decoration: underline; }
/* Short note with a leading icon (modals, forms) */
.icon-note { display: flex; align-items: flex-start; gap: 8px; }
.icon-note svg { width: 16px; height: 16px; margin-top: 1px; color: var(--navy); }

.empty { text-align: center; padding: 34px 20px; }
.empty-icon { width: 58px; height: 58px; border-radius: 18px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty h4 { margin: 0 0 4px; }
.empty p { color: var(--muted); font-size: .88rem; max-width: 380px; margin: 0 auto 14px; }

.skeleton { background: linear-gradient(90deg, var(--line-2), #F7F9FC, var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 28px; height: 28px; border: 3px solid var(--blue-100); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.loader { display: grid; place-items: center; padding: 80px 0; }

.modal-backdrop { position: fixed; inset: 0; z-index: 900; background: rgba(11, 27, 58, .55); display: grid; place-items: center; padding: 20px; animation: fade .18s ease; overflow-y: auto; }
.modal { width: 100%; max-width: 540px; background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 1.08rem; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
/* Media viewer (DA.media in files.js): video, embedded video, PDF, image or a download card */
.viewer { border-radius: var(--r-lg); overflow: hidden; background: var(--navy); }
.viewer:has(.viewer-frame.doc), .viewer:has(.viewer-file) { background: var(--surface-2); border: 1px solid var(--line); }
.viewer-frame { position: relative; aspect-ratio: 16 / 9; }
.viewer-frame.doc { aspect-ratio: auto; height: min(72vh, 820px); }
.viewer-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.viewer-video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 70vh; background: #000; }
.viewer-img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; }
.viewer-file { display: grid; justify-items: center; gap: 8px; padding: 48px 20px; text-align: center; }
.viewer-file svg { width: 40px; height: 40px; color: var(--navy); }
.viewer-file b { color: var(--ink); overflow-wrap: anywhere; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; background: var(--navy); color: #fff; padding: 14px 14px 14px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: .88rem; animation: toastIn .3s var(--ease); }
.toast .toast-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-800); color: #7EE2B4; flex: none; }
.toast .toast-ic svg { width: 18px; height: 18px; }
.toast.error .toast-ic { color: #FFB1AB; } .toast.info .toast-ic { color: #9FE0FA; } .toast.payment .toast-ic { background: #16A36A; color: #fff; }
.toast > div { flex: 1; min-width: 0; }
.toast b { display: block; font-size: .92rem; margin-bottom: 2px; }
.toast button { border: 0; background: none; color: rgba(255, 255, 255, .6); padding: 2px; }
.toast button svg { width: 16px; height: 16px; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

.dropdown { position: relative; }
.dropdown.open { z-index: 2; }
/* Page dim behind an open menu (DA.dim in app.js). The layer sits inside the header,
   under the open menu (z-index 2) and over everything else; the header is lifted above the
   rest of the page (assistant included) only while a menu is open. */
.page-dim { position: fixed; inset: 0; z-index: 1; background: rgba(11, 27, 58, .4); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease, visibility 0s linear .12s; }
.dim-on > .page-dim { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .2s ease, visibility 0s; }
.pnav.dim-on, .abar.dim-on { z-index: 720; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 8px; display: none; z-index: 400; }
.dropdown.open .dropdown-menu { display: block; animation: pop .16s var(--ease); }
.dropdown-menu a, .dropdown-menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; font-size: .9rem; color: var(--ink-2); border: 0; background: none; text-align: left; }
.dropdown-menu a svg, .dropdown-menu > button svg { width: 19px; height: 19px; color: var(--navy); }
.dropdown-menu a:hover, .dropdown-menu > button:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-menu .who { padding: 8px 12px; }
.dropdown-menu .who b { display: block; color: var(--ink); font-size: .92rem; }
.dropdown-menu .who span { font-size: .8rem; color: var(--muted); }
.dropdown-menu .sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.notif-menu { width: 370px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.notif-head b { color: var(--ink); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-menu .notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 0; border-bottom: 1px solid var(--line-2); }
.notif-menu .notif.unread { background: #F5FAFF; }
.notif-menu .notif.unread { box-shadow: inset 3px 0 0 var(--blue); }
.notif-menu .notif .icon-box { width: 36px; height: 36px; border-radius: 10px; }
.notif-menu .notif .icon-box svg { width: 17px; height: 17px; color: inherit; }
.notif-menu .notif b { display: block; font-size: .86rem; color: var(--ink); line-height: 1.35; }
.notif-menu .notif span { display: block; font-size: .8rem; color: var(--muted); line-height: 1.4; }
.notif-menu .notif em { font-style: normal; font-size: .72rem; color: var(--muted-2); }
.notif-menu .notif.msg { background: var(--blue-50); }
.notif-empty { display: grid; justify-items: center; gap: 6px; padding: 30px; color: var(--muted); font-size: .88rem; }
.notif-empty svg { width: 26px; height: 26px; color: var(--muted-2); }

/* Charts */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line-2); }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart text.val { fill: var(--ink); font-weight: 600; }
.chart .bar { fill: var(--blue); }
.chart .bar.fail { fill: var(--red); }
.chart .bar.alt { fill: var(--sky); }
.chart .pass { stroke: var(--amber); stroke-dasharray: 5 4; stroke-width: 1.5; }

/* ---------- 7. Portal shell (student + teacher: top navigation) ---------- */
body.portal { min-height: 100vh; display: flex; flex-direction: column; }
.pnav { position: sticky; top: 0; z-index: 300; background: #fff; border-bottom: 1px solid var(--line); transition: box-shadow var(--base); }
.pnav.scrolled { box-shadow: 0 6px 20px -12px rgba(11, 27, 58, .25); }
.pnav .inner { display: flex; align-items: center; gap: 20px; height: var(--nav-h); max-width: 1320px; }
.pnav .brand { display: flex; align-items: center; gap: 12px; flex: none; }
.pnav .brand img { height: 36px; width: auto; }
.portal-tag { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.2; }
.pnav-links { display: flex; gap: 2px; flex: 1; justify-content: center; }
.pnav-links a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: 10px; font-size: .88rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.pnav-links a svg { width: 18px; height: 18px; color: var(--navy); --ic-a: var(--muted-2); --ic-f: transparent; }
.pnav-links a:hover { background: var(--surface-2); color: var(--ink); }
.pnav-links a.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.pnav-links a.active svg { color: var(--navy); --ic-a: var(--blue); --ic-f: var(--blue-100); }
.pnav-links.is-long a { padding: 9px 8px; }
.pnav:has(.pnav-links.is-long) .portal-tag { display: none; }
.pnav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pnav.gated .pnav-right { margin-left: auto; }
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.icon-btn svg { width: 21px; height: 21px; color: var(--navy); }
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: #fff; }
.user-btn .name { font-weight: 600; font-size: .88rem; color: var(--ink); }
.user-btn .chev { width: 16px; height: 16px; color: var(--muted); }
.burger { display: none; }
/* Portal mobile menu button: hamburger icon + "Menu" label inside one bordered button (same as the website). */
.menu-btn { align-items: center; gap: 7px; height: 42px; padding: 0 14px 0 11px; border: 1px solid var(--blue); border-radius: 12px; background: var(--blue); color: #fff; font: inherit; font-size: .9rem; font-weight: 600; line-height: 1; cursor: pointer; transition: background var(--fast), border-color var(--fast); }
.menu-btn:hover, .menu-btn:focus-visible { background: var(--navy); border-color: var(--navy); color: #fff; }
.menu-btn svg { width: 21px; height: 21px; flex: none; color: #fff; }
.pnav-backdrop { position: fixed; inset: 0; background: rgba(11, 27, 58, .45); z-index: 600; opacity: 0; pointer-events: none; transition: opacity var(--base); }
.pnav-backdrop.open { opacity: 1; pointer-events: auto; }
.pnav-mobile { position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 100vw); background: #fff; z-index: 610; transform: translateX(100%); transition: transform var(--base) var(--ease); display: flex; flex-direction: column; visibility: hidden; }
.pnav-mobile.open { transform: none; visibility: visible; }
.pnav-mobile .head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.pnav-mobile .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pnav-mobile .who b { display: block; color: var(--ink); font-size: .95rem; }
.pnav-mobile .who span { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.pnav-mobile .close { width: 40px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 12px; display: grid; place-items: center; }
.pnav-mobile .close svg { width: 20px; height: 20px; }
.pnav-mobile .scroll { overflow-y: auto; padding: 12px; flex: 1; }
.pnav-mobile .grp { display: grid; gap: 2px; }
.pnav-mobile .grp a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 12px; font-weight: 500; color: var(--ink-2); }
.pnav-mobile .grp a svg { width: 21px; height: 21px; color: var(--navy); }
.pnav-mobile .grp a.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.pnav-mobile .lbl { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); padding: 18px 14px 6px; }
.pnav-mobile .signout { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--red); font-weight: 600; }
.pnav-mobile .signout svg { width: 20px; height: 20px; }
.pmain { flex: 1; padding: 28px 0 56px; }
.pmain > .container { max-width: 1320px; }
.pfoot { border-top: 1px solid var(--line); background: #fff; padding: 18px 0; font-size: .82rem; color: var(--muted); }
.pfoot .container { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; max-width: 1320px; }
/* Student mobile tab bar */
.tabbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; }
.page-head .sub { color: var(--muted); margin: 0; font-size: .95rem; max-width: 640px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.back-link svg { width: 16px; height: 16px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; font-size: 1.15rem; }
.section-title p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.section-title .link { font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-title .link svg { width: 15px; height: 15px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 220px; }
.toolbar .select { width: auto; min-width: 150px; }
.fade-up { animation: fadeUp .5s var(--ease) both; }
.d1 { animation-delay: .06s; } .d2 { animation-delay: .12s; } .d3 { animation-delay: .18s; } .d4 { animation-delay: .24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }

/* ---------- 8. Portal widgets (student + teacher) ---------- */
/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); color: inherit; transition: box-shadow var(--base), transform var(--base); }
a.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; }
.kpi .val { font-size: 1.45rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.kpi .lbl { font-size: .8rem; color: var(--muted); }
.kpi .icon-box { width: 48px; height: 48px; border-radius: 14px; }
.kpi .icon-box svg { width: 22px; height: 22px; }
.kpi .ring { margin-left: auto; }

.provider { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); background: var(--line-2); color: var(--ink-2); }
.provider svg { width: 13px; height: 13px; }
.provider.zoom { background: #E6F0FF; color: #1A5FD6; } .provider.meet { background: #E6F6EE; color: #0F7A4D; } .provider.teams { background: #EEEBFD; color: #4E3FB5; } .provider.jitsi { background: #E3F2FB; color: #0C5E94; } .provider.none { background: var(--amber-50); color: #8A5600; }

/* Timeline (agenda) */
.timeline { display: grid; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); }
.tl-item .time { font-weight: 600; font-size: .84rem; color: var(--ink); line-height: 1.2; }
.tl-item .time span { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; }
.tl-item .t { font-weight: 600; color: var(--ink); font-size: .92rem; line-height: 1.3; }
.tl-item .s { font-size: .78rem; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tl-item.subj { border-left: 4px solid var(--sc, var(--blue)); background: var(--sbg, var(--surface-2)); }
.tl-item.deadline { border-left: 4px solid var(--amber); background: #FFFAF0; }
.tl-item.is-live { box-shadow: 0 0 0 3px rgba(19, 154, 99, .18); }
.tl-empty { text-align: center; padding: 26px 10px; color: var(--muted); font-size: .88rem; border: 1.5px dashed var(--line); border-radius: 16px; }
.tl-empty svg { width: 26px; height: 26px; margin: 0 auto 6px; color: var(--muted-2); }

/* Subject colour system */
.c-blue { --sc: #1B64D6; --sbg: #EDF4FF; }
.c-green { --sc: #12915E; --sbg: #E9F8F0; }
.c-amber { --sc: #C77A0A; --sbg: #FFF5E3; }
.c-violet { --sc: #6A4FE0; --sbg: #F2EEFF; }
.c-teal { --sc: #0E8F88; --sbg: #E4F6F4; }
.c-pink { --sc: #D23F74; --sbg: #FEEDF3; }
.c-navy { --sc: var(--navy); --sbg: #EEF2F8; }
.s-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #fff; color: var(--sc); box-shadow: 0 4px 10px -6px rgba(11, 27, 58, .3); flex: none; }
.s-icon svg { width: 22px; height: 22px; }
.s-dot { width: 4px; height: 16px; border-radius: 2px; background: var(--sc); display: inline-block; flex: none; }

/* Subject cards (My Subjects) */
.scard { display: flex; flex-direction: column; overflow: hidden; }
.scard .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--sbg); }
.scard .thumb picture, .scard .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.scard:hover .thumb img { transform: scale(1.04); }
.scard .thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 27, 58, 0) 45%, rgba(11, 27, 58, .55)); }
.scard .thumb .tags { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; z-index: 1; }
.scard .thumb .tags .badge { background: rgba(255, 255, 255, .94); color: var(--navy); }
.scard .thumb .status { position: absolute; right: 12px; top: 12px; z-index: 1; }
.scard .thumb .s-icon { position: absolute; left: 14px; bottom: -22px; z-index: 2; width: 48px; height: 48px; }
.scard .thumb .prog-line { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .35); z-index: 1; }
.scard .thumb .prog-line span { display: block; height: 100%; background: var(--sc); }
.scard .body { padding: 30px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.scard .body h3 { margin: 0; font-size: 1.05rem; }
.scard .body h3 a { color: inherit; }
.scard .kick { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--sc); }
.scard .inst { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.scard .pct { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.scard .pct b { color: var(--ink); }
.scard .meta { display: grid; gap: 6px; font-size: .8rem; color: var(--ink-2); }
.scard .meta span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.scard .meta svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.scard .foot { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.scard .foot .btn { flex: 1; }

/* Assignment cards */
.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.acard { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 18px; border-top: 4px solid var(--sc, var(--blue)); }
.acard.overdue { border-top-color: var(--red); }
.acard .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.acard h4 { margin: 0; font-size: .98rem; }
.acard .subj { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.acard .desc { font-size: .84rem; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard .meta { display: grid; gap: 6px; font-size: .8rem; color: var(--ink-2); }
.acard .meta div { display: flex; align-items: center; gap: 8px; }
.acard .meta svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.acard .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
/* Balance card (payments pages) */
.paycard { border-radius: var(--r-xl); padding: 20px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); }
.paycard.due { border-left-color: var(--amber); }
.paycard.bad { border-left-color: var(--red); }
.paycard .lbl { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 8px; font-weight: 500; }
.paycard .lbl svg { width: 18px; height: 18px; color: var(--navy); }
.paycard .amt { font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.1; margin: 8px 0 4px; }
.paycard p { margin: 0; font-size: .86rem; color: var(--muted); }
.photo-pick .pp-row { display: flex; align-items: center; gap: 16px; }
.photo-pick .pp-prev { flex: none; }
.photo-pick .btn-outline { cursor: pointer; }
.photo-pick .pp-rm[hidden] { display: none; }
.intent-row { display: grid; grid-template-columns: minmax(118px, 1.1fr) 2fr 32px 38px; align-items: center; gap: 10px; padding: 7px 0; color: var(--ink); font-size: .86rem; border-bottom: 1px solid var(--line); }
.intent-row:last-of-type { border-bottom: 0; }
.intent-row:hover .il { color: var(--blue-600); }
.intent-row .num { text-align: right; }
.intent-row .ip { text-align: right; }

/* Results mini list */
.res-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.res-row:last-child { border-bottom: 0; }
.res-row .t { font-weight: 600; color: var(--ink); font-size: .88rem; line-height: 1.3; }
.res-row .s { font-size: .76rem; color: var(--muted); }
.mark { font-weight: 700; font-size: .95rem; padding: 6px 10px; border-radius: 10px; background: var(--green-50); color: #0C7A4C; min-width: 56px; text-align: center; }
.mark.low { background: var(--red-50); color: #B3332C; }
.mark.mid { background: var(--amber-50); color: #9A5E00; }
.grade { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 700; font-size: .8rem; }
.grade.a { background: var(--green-50); color: #0C7A4C; } .grade.b { background: #E6F4FF; color: #1D5FC2; } .grade.c { background: var(--violet-50); color: var(--violet); } .grade.d { background: var(--amber-50); color: #9A5E00; } .grade.e { background: var(--red-50); color: #B3332C; } .grade.p { background: var(--line-2); color: var(--muted); }

/* Messages mini */
.msg-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); color: inherit; }
.msg-row:last-child { border-bottom: 0; }
.msg-row .t { font-weight: 600; color: var(--ink); font-size: .88rem; display: flex; gap: 8px; align-items: center; }
.msg-row .t em { font-style: normal; font-weight: 400; color: var(--muted-2); font-size: .74rem; margin-left: auto; white-space: nowrap; }
.msg-row .p { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.msg-row.unread .t { color: var(--blue-700); }

/* Month calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 6px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal .day { position: relative; aspect-ratio: 1 / .92; border: 1px solid transparent; background: var(--surface-2); border-radius: 12px; font-size: .86rem; font-weight: 500; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 8px; gap: 4px; }
.cal .day:hover { border-color: var(--blue-100); }
.cal .day.other { color: var(--muted-2); background: transparent; }
.cal .day.today { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.cal .day.selected { background: var(--blue); color: #fff; }
.cal .day .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 80%; min-width: 0; }
.cal .day .dots i { width: 12px; max-width: 40%; height: 3px; border-radius: 2px; background: var(--sc, var(--blue)); }
.cal .day .dots i.deadline { background: var(--amber); }
.cal .day .dots i.cancelled { background: var(--red); }
.cal .day.selected .dots i { background: #fff; }
.cal .day .cal-n { position: absolute; top: 5px; right: 7px; font-size: .64rem; font-weight: 700; color: var(--muted); }
.cal .day.selected .cal-n { color: #fff; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .78rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 14px; height: 3px; border-radius: 2px; }

/* Subject page (course.html) */
.subj-hero { position: relative; overflow: hidden; border-radius: var(--r-2xl); color: #fff; padding: 30px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; }
.subj-hero > picture, .subj-hero > img, .subj-hero > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.subj-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11, 27, 58, .92) 0%, rgba(11, 27, 58, .7) 50%, rgba(11, 27, 58, .25) 100%); z-index: -1; }
.subj-hero h1 { color: #fff; margin: 10px 0 6px; }
.subj-hero p { color: rgba(255, 255, 255, .85); margin: 0; font-size: .92rem; }
.subj-hero .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.subj-hero .prog { min-width: 220px; }
.subj-hero .prog .progress { background: rgba(255, 255, 255, .25); }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-xl); overflow: hidden; background: var(--navy); }
.player picture, .player img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.player .play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; background: #fff; color: var(--blue); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.player .play svg { width: 28px; height: 28px; margin-left: 4px; }
.player .doc { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; color: #fff; padding: 20px; }
.player .doc svg { width: 40px; height: 40px; }
.module { border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.module-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; width: 100%; border: 0; background: none; text-align: left; }
.module-head .num { width: 32px; height: 32px; border-radius: 10px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: .84rem; flex: none; }
.module-head .num.done { background: var(--green-50); color: var(--green); }
.module-head .num svg { width: 16px; height: 16px; }
.module-head h4 { margin: 0; font-size: .92rem; }
.module-head .sub { font-size: .76rem; color: var(--muted); }
.module-head .chev { width: 18px; height: 18px; color: var(--muted); transition: transform var(--base); }
.module.open .module-head .chev { transform: rotate(180deg); }
.module-body { display: none; border-top: 1px solid var(--line-2); padding: 6px; }
.module.open .module-body { display: block; }
.lesson { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.lesson:hover { background: var(--surface-2); }
.lesson.current { background: var(--blue-50); }
.lesson .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.lesson .tick svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.lesson.done .tick { background: var(--green); border-color: var(--green); }
.lesson.done .tick svg { opacity: 1; }
.lesson .t { font-size: .86rem; font-weight: 500; color: var(--ink); line-height: 1.3; }
.lesson .m { font-size: .74rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lesson .m svg { width: 13px; height: 13px; }

/* Library */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lib-item { display: flex; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; align-items: flex-start; }
.lib-item .t { font-weight: 600; color: var(--ink); font-size: .9rem; line-height: 1.35; }
.lib-item .s { font-size: .76rem; color: var(--muted); margin: 2px 0 10px; }
.lib-thumb { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex: none; background: var(--sbg); display: grid; place-items: center; color: var(--sc); }
.lib-thumb svg { width: 26px; height: 26px; }

/* Inbox */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; min-height: 520px; }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; max-height: 680px; overflow-y: auto; }
.inbox-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 1; }
.inbox-head b { color: var(--ink); font-size: 1rem; }
.inbox-head .btn { margin-left: auto; }
.thread-item { display: flex; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; text-align: left; width: 100%; position: relative; }
.thread-item:hover { background: var(--surface-2); }
.thread-item.active { background: var(--blue-50); }
.thread-item .t { display: flex; align-items: baseline; gap: 8px; }
.thread-item .t b { font-size: .88rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item .t em { font-style: normal; font-size: .72rem; color: var(--muted-2); margin-left: auto; white-space: nowrap; }
.thread-item .s { font-size: .84rem; color: var(--ink-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item .p { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item.unread .s { color: var(--ink); font-weight: 700; }
.thread-item.unread { box-shadow: inset 3px 0 0 var(--blue); }
.thread-item .udot { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 2px; }
.inbox-thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.thread-head h3 { margin: 0; font-size: 1.02rem; }
.thread-back { display: none; }
.thread-msgs { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 14px; align-content: start; background: var(--surface-2); }
.bubble { max-width: 80%; background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 12px 14px; }
.bubble.me { justify-self: end; background: var(--blue); border-color: var(--blue); color: #fff; border-radius: 18px 18px 6px 18px; }
.bubble .bh { display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.bubble .bh b { color: var(--ink); font-size: .8rem; }
.bubble.me .bh, .bubble.me .bh b { color: rgba(255, 255, 255, .85); }
.bubble.me .avatar { background: rgba(255, 255, 255, .2); color: #fff; }
.bubble p { margin: 0; font-size: .9rem; line-height: 1.55; }
.thread-reply { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line-2); align-items: flex-end; }
.thread-reply .textarea { min-height: 48px; }
.thread-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); padding: 40px; text-align: center; }
.thread-empty svg { width: 34px; height: 34px; color: var(--muted-2); }
.thread-empty b { color: var(--ink); }

/* Gate screen (pending payment / suspended) */
.gate { max-width: 880px; margin: 0 auto; }
.gate-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--r-2xl); overflow: hidden; box-shadow: var(--shadow-md); }
.gate-card .main { padding: 32px; }
.gate-card .lockic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--red-50); color: var(--red); margin-bottom: 16px; }
.gate-card.pending .lockic { background: var(--amber-50); color: var(--amber); }
.gate-card .lockic svg { width: 30px; height: 30px; }
.gate-card h1 { font-size: 1.6rem; }
.gate-card .owed { display: flex; align-items: baseline; gap: 10px; margin: 18px 0; padding: 16px 18px; background: var(--surface-2); border-radius: 16px; border: 1px solid var(--line-2); }
.gate-card .owed b { font-size: 2rem; color: var(--ink); line-height: 1; }
.gate-card .owed span { color: var(--muted); font-size: .86rem; }
.gate-card .side { background: var(--surface-2); border-left: 1px solid var(--line); padding: 28px; }
.gate-steps { display: grid; gap: 14px; margin: 16px 0; padding: 0; list-style: none; }
.gate-steps li { display: flex; gap: 12px; font-size: .88rem; }
.gate-steps li i { width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .78rem; flex: none; }

/* Class rows (teacher + admin) */
.class-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; border-left: 4px solid var(--sc, var(--blue)); }
.class-row .when { text-align: center; background: var(--sbg, var(--blue-50)); border-radius: 12px; padding: 8px 4px; }
.class-row .when b { display: block; font-size: 1.2rem; color: var(--ink); line-height: 1.1; }
.class-row .when span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.class-row .t { font-weight: 600; color: var(--ink); font-size: .94rem; }
.class-row .s { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; }
.class-row .s svg { width: 14px; height: 14px; }
.class-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.class-row.cancelled { opacity: .65; }
/* Day list beside the admin month calendar is narrow: actions go under the details */
.cal-wrap .class-row { grid-template-columns: 54px minmax(0, 1fr); }
.cal-wrap .class-row .acts { grid-column: 1 / -1; justify-content: flex-start; }
/* Class register (DA.registerModal) */
.register-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.register-head b { color: var(--ink); }
.reg-seg { flex-wrap: nowrap; }
.reg-seg button.active.late { background: var(--amber); }
.reg-seg button.active.absent { background: var(--red); }
.reg-seg button.active.present { background: var(--green); }
.meeting-box { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface-2); }
.where-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.where-pick .choice { align-items: flex-start; background: #fff; }
.where-pick .choice .tick { margin-top: 2px; }
.where-pick .choice > span:last-child { display: block; font-weight: 600; }
.where-pick .choice > span:last-child svg { width: 18px; height: 18px; display: inline-block; vertical-align: -4px; margin-right: 4px; color: var(--navy); }
.where-pick .choice small { margin-top: 3px; line-height: 1.4; }
.room-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .84rem; }
.room-row code { font-size: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.created { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; margin-bottom: 14px; }
.created b { color: var(--ink); }
.meeting-box .detect { margin-top: 8px; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.repeat-box { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 16px; }
.repeat-box .preview { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.cover-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.cover-pick label { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 10; cursor: pointer; border: 2px solid transparent; }
.cover-pick label img { width: 100%; height: 100%; object-fit: cover; }
.cover-pick input { position: absolute; opacity: 0; }
.cover-pick label:has(input:checked) { border-color: var(--blue); box-shadow: var(--ring); }
.topic-edit { display: grid; gap: 8px; }
.topic-edit .row { display: flex; gap: 8px; align-items: center; }
.topic-edit .row .input { min-height: 40px; padding: 8px 12px; }
.topic-edit .lesson-media-btn { flex: none; }
.lesson-media { padding: 14px; margin: 2px 0 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }

/* ---------- 8b. Portal components (hero, classes, schedule, quick links, work, library) ---------- */
/* Full-width portal hero — same photographic presence as the homepage */
.pmain.has-hero { padding-top: 0; }
.phero { position: relative; isolation: isolate; overflow: hidden; background: var(--navy); color: #fff; margin-bottom: 30px; }
.phero-bg, .phero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.phero-bg img { object-position: var(--pos, 70% 35%); }
.phero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11, 27, 58, .94) 0%, rgba(11, 27, 58, .8) 40%, rgba(11, 27, 58, .25) 78%, rgba(11, 27, 58, .1) 100%); }
.phero .container { max-width: 1320px; padding-top: 44px; padding-bottom: 46px; min-height: 300px; display: flex; flex-direction: column; justify-content: center; }
.phero-in { max-width: 700px; }
.phero-date { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: rgba(255, 255, 255, .78); margin-bottom: 10px; }
.phero-date svg { width: 17px; height: 17px; color: #fff; }
.phero h1 { color: #fff; font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.phero-lead { color: rgba(255, 255, 255, .88); font-size: 1rem; margin: 0 0 22px; max-width: 540px; }
.phero-lead b { color: #fff; }
.phero-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.phero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; font-size: .84rem; color: rgba(255, 255, 255, .78); }
.phero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.phero-meta svg { width: 17px; height: 17px; color: #fff; }

/* Section heading row with an action */
.sec { margin-top: 34px; }
.sec:first-child { margin-top: 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: 1.2rem; }
.sec-head p { margin: 3px 0 0; font-size: .86rem; color: var(--muted); }
.sec-head .link { font-size: .86rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sec-head .link svg { width: 15px; height: 15px; }

/* Your classes (subject cards) */
.cls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.cls-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; transition: box-shadow var(--base), transform var(--base); }
.cls-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cls-card.is-live { border-color: #9ADDBF; }
.cls-thumb { position: relative; display: block; aspect-ratio: 16 / 8; background: var(--sbg); overflow: hidden; }
.cls-thumb picture, .cls-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cls-thumb .s-icon { position: absolute; left: 14px; bottom: -20px; width: 44px; height: 44px; }
.cls-thumb .live-tag { position: absolute; right: 12px; top: 12px; background: #fff; }
.cls-body { padding: 28px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cls-body h3 { margin: 0; font-size: 1.04rem; }
.cls-body h3 a { color: inherit; }
.cls-kick { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sc); }
.cls-line { display: flex; align-items: center; gap: 8px; font-size: .83rem; color: var(--ink-2); min-width: 0; }
.cls-line svg { width: 17px; height: 17px; color: var(--navy); --ic-a: var(--sc, var(--blue)); flex: none; }
.cls-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-prog { display: flex; align-items: center; gap: 10px; font-size: .76rem; color: var(--muted); }
.cls-prog .progress { flex: 1; }
.cls-prog .progress > span { background: var(--sc); }
.cls-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.cls-foot .btn { flex: 1; }

/* Schedule table (student dashboard + schedule page) */
.sched { overflow: hidden; }
.sched-head, .sched-row { display: grid; grid-template-columns: 118px 118px minmax(0, 1.5fr) minmax(0, 1fr) 150px 132px; gap: 14px; align-items: center; padding: 0 20px; }
.sched-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); min-height: 42px; }
.sched-row { min-height: 70px; border-bottom: 1px solid var(--line-2); padding-top: 10px; padding-bottom: 10px; }
.sched-row:last-child { border-bottom: 0; }
.sched-row.is-live { background: #F4FBF7; box-shadow: inset 3px 0 0 var(--green); }
.sched-row .sd b { display: block; color: var(--ink); font-size: .9rem; }
.sched-row .sd span, .sched-row .st span { font-size: .78rem; color: var(--muted); }
.sched-row .st { font-weight: 600; color: var(--ink); font-size: .88rem; font-variant-numeric: tabular-nums; }
.sched-row .st span { display: block; font-weight: 400; }
.sched-row .ss { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sched-row .ss b { display: block; color: var(--ink); font-size: .9rem; line-height: 1.3; }
.sched-row .ss span.sub { display: block; font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row .stc { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-2); min-width: 0; }
.sched-row .stc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-row .sa { text-align: right; }
.sched-row .sa .btn { width: 100%; }
.sched-row .btn[data-soon], .cls-foot .btn[data-soon] { color: var(--muted); }
.sched-row .btn[data-soon] svg { color: var(--muted-2); }
.sched-empty { padding: 28px 20px; text-align: center; color: var(--muted); font-size: .9rem; }
.status-txt { font-size: .82rem; color: var(--muted); font-weight: 500; }

/* Quick links */
.qlinks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.qlink { display: flex; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); color: inherit; transition: border-color var(--fast), box-shadow var(--fast); }
.qlink:hover { border-color: #C9DCF0; box-shadow: var(--shadow-md); color: inherit; }
.qlink b { display: block; color: var(--ink); font-size: .98rem; }
.qlink span.m { display: block; font-size: .82rem; color: var(--muted); }
.qlink .go { margin-left: auto; width: 18px; height: 18px; color: var(--muted-2); }
.qlink .cnt { margin-left: auto; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--blue); color: #fff; font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
/* Rate your last class (student dashboard) */
.rate-card { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 16px; padding: 18px 20px; box-shadow: inset 4px 0 0 var(--sc, var(--blue)), var(--shadow-xs); }
.rate-card b { display: block; color: var(--ink); font-size: 1rem; }
.rate-card .grow > span { display: block; }

/* Assignment dashboard */
.astrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.astat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-align: left; width: 100%; transition: border-color var(--fast), box-shadow var(--fast); }
.astat:hover { border-color: #C9DCF0; }
.astat.active { border-color: var(--blue); box-shadow: var(--ring); }
.astat b { display: block; font-size: 1.3rem; color: var(--ink); line-height: 1.1; }
.astat span { font-size: .8rem; color: var(--muted); }
.alist .alist-head, .arow { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr) 150px 130px 128px; gap: 14px; align-items: center; padding: 0 20px; }
.alist-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); min-height: 42px; }
.arow { min-height: 74px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); box-shadow: inset 3px 0 0 var(--line); }
.arow:last-child { border-bottom: 0; }
.arow.overdue { box-shadow: inset 3px 0 0 var(--red); }
.arow.due { box-shadow: inset 3px 0 0 var(--amber); }
.arow.submitted { box-shadow: inset 3px 0 0 var(--blue); }
.arow.marked { box-shadow: inset 3px 0 0 var(--green); }
.arow .at b { display: block; color: var(--ink); font-size: .92rem; line-height: 1.3; }
.arow .at span, .arow .ad span { display: block; font-size: .78rem; color: var(--muted); }
.arow .as { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-2); min-width: 0; }
.arow .ad b { font-size: .86rem; color: var(--ink); font-weight: 600; }
.arow .ad .progress { margin-top: 6px; height: 4px; }
.arow .aa { text-align: right; }
.arow .aa .btn { width: 100%; }
.mlabel { display: none; }

/* Results by subject */
.rcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.rcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; }
.rcard-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.rcard-head h3 { margin: 0; font-size: 1.02rem; }
.rcard-head .tiny { display: block; }
.rcard-head .badge { margin-left: auto; }
.rcard-sum { display: flex; align-items: center; gap: 18px; padding: 18px 20px 6px; }
.rcard-sum .big { font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1; }
.rcard-sum .big small { font-size: .8rem; color: var(--muted); font-weight: 500; display: block; margin-top: 6px; }
.rmarks { padding: 6px 20px 16px; }
.rmark { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.rmark:last-child { border-bottom: 0; }
.rmark .t { font-size: .88rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.rmark .s { font-size: .76rem; color: var(--muted); }
.rmark .mark { margin-left: auto; }
.rbar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.rbar span { display: block; height: 100%; background: var(--sc, var(--blue)); border-radius: inherit; }

/* Library (media cards) */
.lib-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.lib-toolbar .search { flex: 1; min-width: 220px; }
.lib-toolbar .select { width: auto; min-width: 170px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.media-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; transition: box-shadow var(--base), transform var(--base); }
.media-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.media-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--sbg); overflow: hidden; }
.media-thumb picture, .media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 27, 58, 0) 50%, rgba(11, 27, 58, .55)); }
.media-thumb.doc::after { background: rgba(11, 27, 58, .35); }
.media-thumb .play { position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; z-index: 1; color: var(--navy); box-shadow: var(--shadow-md); }
.media-thumb .play svg { width: 20px; height: 20px; margin-left: 3px; }
.media-thumb .doc-ic { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 14px; background: #fff; display: grid; place-items: center; z-index: 1; color: var(--navy); --ic-a: var(--sc); }
.media-thumb .doc-ic svg { width: 28px; height: 28px; }
.media-thumb .len { position: absolute; right: 10px; bottom: 10px; z-index: 1; background: #fff; color: var(--ink); font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.media-thumb .kind { position: absolute; left: 10px; top: 10px; z-index: 1; background: #fff; color: var(--ink); font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.media-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.media-body b { color: var(--ink); font-size: .94rem; line-height: 1.35; }
.media-body span { font-size: .8rem; color: var(--muted); }
.media-body .btn { margin-top: auto; align-self: flex-start; }

/* Attendance */
.att-top { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.att-top .big { font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.att-subj { display: grid; grid-template-columns: minmax(0, 1fr) 160px 60px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.att-subj:last-child { border-bottom: 0; }
.att-subj .progress > span { background: var(--sc); }

/* Teacher: today / next session panel in the hero */
.phero-next { margin-top: 22px; display: inline-flex; align-items: center; gap: 14px; background: #fff; color: var(--ink-2); border-radius: 16px; padding: 12px 14px 12px 12px; max-width: 100%; }
.phero-next b { display: block; color: var(--ink); font-size: .92rem; }
.phero-next span { font-size: .8rem; color: var(--muted); }

/* Parent portal */
.child-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.child-switch button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 14px 8px 8px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.child-switch button.active { border-color: var(--blue); box-shadow: var(--ring); }
.facts4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.fact { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: inherit; }
a.fact:hover { border-color: #C9DCF0; color: inherit; }
.fact b { display: block; color: var(--ink); font-size: .98rem; line-height: 1.3; }
.fact span { display: block; font-size: .8rem; color: var(--muted); }

/* Admin overview */
.ov-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.ov-stat { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; color: inherit; transition: border-color var(--fast), box-shadow var(--fast); }
.ov-stat:hover { border-color: #C9DCF0; box-shadow: var(--shadow-md); color: inherit; }
.ov-stat b { font-size: 1.55rem; color: var(--ink); line-height: 1; }
.ov-stat span { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.attn { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); color: inherit; }
.attn:last-child { border-bottom: 0; }
.attn b { display: block; color: var(--ink); font-size: .9rem; }
.attn span { display: block; font-size: .8rem; color: var(--muted); }
.attn .btn { margin-left: auto; }

/* ---------- 8c. Delight Classroom (in-platform meetings) ---------- */
body.classroom { background: #0A1630; min-height: 100vh; display: flex; flex-direction: column; }
body.classroom #main, body.classroom #app { flex: 1; display: flex; flex-direction: column; }
.croom { flex: 1; display: flex; flex-direction: column; color: #fff; --ic-a: #7FD3F7; --ic-f: rgba(255, 255, 255, .12); }
.croom-top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid rgba(255, 255, 255, .08); flex-wrap: wrap; }
.croom-top .back { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .8); font-size: .86rem; font-weight: 500; }
.croom-top .back:hover { color: #fff; }
.croom-top .back svg { width: 17px; height: 17px; }
.croom-title { flex: 1; min-width: 200px; }
.croom-title b { display: block; font-size: 1.02rem; color: #fff; line-height: 1.3; }
.croom-title span { font-size: .8rem; color: rgba(255, 255, 255, .65); }
.croom-top .live-tag { background: #0F3A2C; color: #7EE2B4; --ic-a: #7EE2B4; }
.croom-top .live-tag svg { color: #7EE2B4; }
.croom-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; padding: 16px 24px; min-height: 0; }
.croom-stage { position: relative; background: #06102A; border-radius: 20px; overflow: hidden; min-height: 460px; border: 1px solid rgba(255, 255, 255, .06); }
.croom-stage iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
.croom-lobby { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 2; background: #06102A; }
.croom-lobby-in { width: 100%; max-width: 560px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.croom-lobby h2 { color: #fff; margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.croom-lobby p { color: rgba(255, 255, 255, .75); margin: 0; font-size: .92rem; }
.preview { position: relative; width: 100%; max-width: 420px; aspect-ratio: 16 / 10; border-radius: 16px; background: #0F2148; overflow: hidden; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .08); }
.preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .avatar { width: 72px; height: 72px; font-size: 1.4rem; }
.preview-tools { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; z-index: 1; }
.croom-note { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: .82rem; color: rgba(255, 255, 255, .8); background: #12244A; border: 1px solid #1E335E; border-radius: 12px; padding: 10px 12px; width: 100%; }
.croom-note svg { width: 18px; height: 18px; color: #fff; margin-top: 1px; }
.croom-note.warn { background: #2A2412; border-color: #5A4414; color: #FFE2B0; }
.croom-note b { color: #fff; }
.croom-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; }
.cpanel { background: #0E1D3F; border: 1px solid #1B2D55; border-radius: 16px; padding: 16px; }
.cpanel h3 { color: #fff; font-size: .92rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.cpanel h3 svg { width: 18px; height: 18px; color: #fff; }
.cpanel dl { display: grid; grid-template-columns: 88px 1fr; gap: 8px 10px; margin: 0; font-size: .84rem; }
.cpanel dt { color: rgba(255, 255, 255, .55); }
.cpanel dd { margin: 0; color: #fff; }
.cpanel p { font-size: .84rem; color: rgba(255, 255, 255, .75); margin: 0; }
.plist { display: grid; gap: 8px; }
.plist div { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: #fff; }
.plist .avatar { background: #1A2D55; color: #fff; }
.plist em { font-style: normal; margin-left: auto; font-size: .74rem; color: rgba(255, 255, 255, .55); }
.croom-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 24px 18px; flex-wrap: wrap; }
.cbtn { display: grid; justify-items: center; gap: 5px; border: 0; background: none; color: #fff; font-size: .72rem; font-weight: 500; min-width: 64px; }
.cbtn .k { width: 48px; height: 48px; border-radius: 14px; background: #1A2D55; display: grid; place-items: center; transition: background var(--fast); }
.cbtn:hover .k { background: #243B6B; }
.cbtn svg { width: 21px; height: 21px; }
.cbtn.off .k { background: #C23A33; }
.cbtn.on .k { background: var(--blue); }
.cbtn:disabled { opacity: .4; cursor: not-allowed; }
.cbtn.leave .k { background: #D6453D; width: 64px; }
.cbtn em { font-style: normal; color: rgba(255, 255, 255, .75); }

/* ---------- 8d. Help assistant ---------- */
.asst-btn { position: fixed; right: 20px; bottom: 20px; z-index: 700; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border: 0; border-radius: 16px; background: var(--navy); color: #fff; font-weight: 600; font-size: .9rem; box-shadow: 0 14px 32px -12px rgba(11, 27, 58, .55); --ic-a: #7FD3F7; --ic-f: rgba(255, 255, 255, .14); }
.asst-btn:hover { background: var(--navy-800); }
.asst-btn svg { width: 22px; height: 22px; }
.asst { position: fixed; right: 20px; bottom: 20px; z-index: 710; width: 390px; max-width: calc(100vw - 24px); height: min(600px, calc(100vh - 40px)); background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); border: 1px solid var(--line); display: none; flex-direction: column; overflow: hidden; }
.asst.open { display: flex; animation: pop .2s var(--ease); }
.asst-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--navy); color: #fff; --ic-a: #7FD3F7; --ic-f: rgba(255, 255, 255, .14); }
.asst-head .ic-wrap { width: 38px; height: 38px; border-radius: 12px; background: var(--navy-800); display: grid; place-items: center; }
.asst-head .ic-wrap svg { width: 22px; height: 22px; }
.asst-head b { display: block; font-size: .95rem; }
.asst-head span { font-size: .76rem; color: rgba(255, 255, 255, .7); }
.asst-head button { margin-left: auto; border: 0; background: none; color: #fff; padding: 6px; border-radius: 8px; }
.asst-head button:hover { background: rgba(255, 255, 255, .1); }
.asst-head button svg { width: 20px; height: 20px; }
.asst-log { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start; background: var(--surface-2); }
.am { max-width: 88%; padding: 11px 14px; border-radius: 16px 16px 16px 6px; background: #fff; border: 1px solid var(--line); font-size: .88rem; line-height: 1.55; color: var(--ink-2); }
.am.me { justify-self: end; background: var(--blue); border-color: var(--blue); color: #fff; border-radius: 16px 16px 6px 16px; }
.am p { margin: 0 0 6px; } .am p:last-child { margin: 0; }
.am ol, .am ul { margin: 6px 0; padding-left: 18px; }
.am ul { list-style: disc; }
.am li { margin: 3px 0; }
.am a { font-weight: 600; }
.am .src { display: block; margin-top: 8px; font-size: .75rem; color: var(--muted); }
.am.typing { color: var(--muted); font-style: italic; }
.asst-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; background: #fff; border-top: 1px solid var(--line-2); }
.asst-form { display: flex; gap: 8px; padding: 12px 16px 14px; background: #fff; }
.asst-form .input { min-height: 44px; }
.asst-form .btn { flex: none; }
.asst-scope { font-size: .72rem; color: var(--muted); padding: 0 16px 10px; background: #fff; display: flex; align-items: center; gap: 6px; }
.asst-scope svg { width: 14px; height: 14px; color: var(--navy); }
.asst-scope .linkbtn { margin-left: auto; }
/* Help answers / Chat with our team */
.asst-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--line-2); }
.asst-modes button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; font-size: .82rem; font-weight: 600; color: var(--muted); }
.asst-modes button svg { width: 17px; height: 17px; }
.asst-modes button:hover { background: var(--surface-2); color: var(--ink); }
.asst-modes button.active { background: var(--blue-50); color: var(--blue-700); }
.asst-dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.asst-btn.has-reply::after { content: ''; position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.asst-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.asst-chat-log { flex: 1; display: grid; align-content: start; gap: 12px; padding: 16px; overflow-y: auto; background: var(--surface-2); }
.am-who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: .72rem; font-weight: 600; color: var(--blue-700); }
.am-who svg { width: 14px; height: 14px; }
.am-time { display: block; margin-top: 4px; font-size: .68rem; color: var(--muted-2); text-align: right; }
.am.me .am-time { color: rgba(255, 255, 255, .75); }
.am-sys { justify-self: center; max-width: 92%; padding: 6px 12px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; font-size: .76rem; color: var(--muted); text-align: center; }
.asst-chat-start { padding: 14px 16px 4px; overflow-y: auto; background: #fff; border-top: 1px solid var(--line-2); }
.asst-chat-start .field { margin-bottom: 10px; }
.asst-chat-start .textarea { min-height: 72px; }
.asst-chat-start .btn { margin-bottom: 12px; }
.asst-chat-end { display: grid; justify-items: center; gap: 8px; padding: 14px 16px; background: #fff; border-top: 1px solid var(--line-2); text-align: center; }
.asst-chat-end p { margin: 0; }
.asst-chat-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; background: var(--surface-2); text-align: center; }
.asst-chat-empty svg { width: 30px; height: 30px; color: var(--muted-2); }
.asst-chat-empty b { color: var(--ink); }
.asst-chat-empty p { margin: 0; font-size: .86rem; color: var(--muted); }
body.has-tabbar .asst-btn { bottom: 84px; }
/* While a menu drawer is open, the assistant button goes under its dimmed backdrop like the rest of the page */
html.nav-open .asst-btn, body.aside-open .asst-btn { z-index: 440; }

/* ---------- 8e. Knowledge base (help centre + homepage) ---------- */
.kb-search { position: relative; max-width: 680px; }
.kb-search .input { min-height: 58px; padding-left: 54px; font-size: 1.02rem; border-radius: 16px; }
.kb-search .input-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--navy); pointer-events: none; }
.kb-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.kb-cat { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); color: inherit; text-align: left; width: 100%; transition: border-color var(--fast), box-shadow var(--fast); }
.kb-cat:hover, .kb-cat.active { border-color: #C9DCF0; box-shadow: var(--shadow-md); color: inherit; }
.kb-cat.active { border-color: var(--blue); }
.kb-cat b { display: block; color: var(--ink); font-size: .98rem; }
.kb-cat span { display: block; font-size: .83rem; color: var(--muted); margin-top: 2px; }
.kb-cat em { font-style: normal; font-size: .76rem; color: var(--blue-700); font-weight: 600; display: block; margin-top: 8px; }
.kb-list { display: grid; gap: 10px; }
.kb-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-align: left; width: 100%; }
.kb-item:hover { border-color: var(--blue); color: inherit; }
.kb-item b { display: block; color: var(--ink); font-size: .94rem; }
.kb-item span { display: block; font-size: .82rem; color: var(--muted); line-height: 1.45; }
.kb-item > svg:last-child { margin-left: auto; width: 18px; height: 18px; color: var(--muted-2); flex: none; }
.kb-article { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 28px; }
.kb-article h2 { font-size: 1.4rem; margin-bottom: 8px; }
.kb-article .lead { color: var(--ink-2); font-size: 1rem; }
.kb-steps { counter-reset: k; display: grid; gap: 12px; margin: 18px 0; padding: 0; list-style: none; }
.kb-steps li { counter-increment: k; display: flex; gap: 14px; align-items: flex-start; font-size: .94rem; }
.kb-steps li::before { content: counter(k); width: 28px; height: 28px; border-radius: 9px; background: var(--blue-50); color: var(--blue-700); display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none; }
.kb-tip { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; font-size: .88rem; }
.kb-tip svg { width: 20px; height: 20px; color: var(--navy); flex: none; }
.kb-empty { padding: 26px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 16px; }

/* ---------- 8f. Community & feedback ---------- */
.comm { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.comm-side { display: grid; gap: 16px; }
.board-list { display: grid; gap: 2px; padding: 8px; }
.board-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; font-size: .88rem; font-weight: 500; color: var(--ink-2); text-align: left; }
.board-list button svg { width: 18px; height: 18px; flex: none; color: var(--navy); }
.board-list button .s-dot { height: 14px; margin: 0 7px; }
.board-list button span:not(.s-dot) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list button em { font-style: normal; font-size: .74rem; font-weight: 600; color: var(--muted); }
.board-list button:hover { background: var(--surface-2); color: var(--ink); }
.board-list button.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.board-gr { display: none; font-style: normal; }
.board-grp { padding: 12px 10px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.comm-rules h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .92rem; }
.comm-rules h4 svg { width: 18px; height: 18px; color: var(--navy); }
.comm-rules ul { display: grid; gap: 4px; margin: 0 0 10px; padding-left: 18px; list-style: disc; font-size: .84rem; color: var(--ink-2); }
.comm-fb { display: flex; align-items: center; gap: 12px; color: inherit; }
.comm-fb:hover { border-color: #C9DCF0; color: inherit; }
.comm-fb b { display: block; color: var(--ink); font-size: .9rem; }
.comm-fb .small { display: block; }
.post-list { display: grid; gap: 12px; }
.post-card { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: inset 4px 0 0 var(--sc, var(--navy)); cursor: pointer; transition: border-color var(--fast), box-shadow var(--fast); }
.post-card:hover { border-color: #C9DCF0; box-shadow: inset 4px 0 0 var(--sc, var(--navy)), var(--shadow-md); }
.post-card:focus-visible { outline: none; box-shadow: inset 4px 0 0 var(--sc, var(--navy)), var(--ring); }
.post-card.pinned { background: #FFFCF5; }
.post-card.is-hidden, .reply.is-hidden { opacity: .6; }
.post-card h3 { margin: 10px 0 4px; font-size: 1rem; }
.post-card p { margin: 0; font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: .78rem; color: var(--muted); }
.post-meta b { font-size: .84rem; color: var(--ink); }
.post-meta .board { display: inline-flex; align-items: center; gap: 6px; }
.post-meta .s-dot { height: 12px; }
.dotsep { color: var(--muted-2); }
.post-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.post-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.post-foot svg { width: 16px; height: 16px; }
.post-foot .liked { color: var(--pink); --ic-a: var(--pink); --ic-f: var(--pink-50); }
.thread { box-shadow: inset 4px 0 0 var(--sc, var(--navy)), var(--shadow-xs); }
.thread h2 { margin: 12px 0 10px; font-size: 1.3rem; overflow-wrap: anywhere; }
.thread-body p, .reply-body p { color: var(--ink-2); line-height: 1.65; overflow-wrap: anywhere; }
.thread-body p { font-size: .95rem; }
.thread-body p:last-child, .reply-body p:last-child { margin-bottom: 0; }
.thread-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.thread-actions .is-liked { background: var(--pink-50); color: var(--pink); --ic-a: var(--pink); --ic-f: #F9D6E3; }
.replies-h { margin: 22px 0 10px; font-size: 1rem; }
.replies { display: grid; gap: 10px; margin-bottom: 16px; }
.reply { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.reply.staff { background: #F7FBFF; border-color: var(--blue-100); }
.reply-body { margin-top: 6px; }
.reply-body p { margin-bottom: 8px; font-size: .9rem; }
.reply-actions { display: flex; gap: 14px; margin-top: 6px; }
.fb-item { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.fb-item:last-child { border-bottom: 0; }
.fb-item p { color: var(--ink-2); }
.fb-reply { margin-top: 10px; padding: 10px 12px; background: var(--blue-50); border-left: 3px solid var(--blue); border-radius: 4px 12px 12px 4px; }
.fb-reply .strong { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--blue-700); }
.fb-reply svg { width: 14px; height: 14px; }
.fb-card.is-new { border-color: var(--blue-100); box-shadow: inset 3px 0 0 var(--blue), var(--shadow-xs); }

/* ---------- 9. Admin (WordPress-style) ---------- */
body.admin { background: #F1F4F9; }
.aside { position: fixed; left: 0; top: 0; bottom: 0; width: var(--aside-w); background: var(--navy); color: rgba(255, 255, 255, .78); display: flex; flex-direction: column; z-index: 500; --ic-a: #7FD3F7; --ic-f: #1A2D55; }
.aside-brand { display: flex; align-items: center; padding: 18px 20px; height: 70px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.aside-brand img { height: 36px; width: auto; }
.aside nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.aside-grp { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .42); padding: 16px 12px 6px; }
.aside nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .8); font-size: .9rem; font-weight: 500; position: relative; }
.aside nav a svg { width: 18px; height: 18px; opacity: .8; }
.aside nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.aside nav a.active { background: var(--blue); color: #fff; font-weight: 600; }
.aside nav a.active svg { opacity: 1; }
.menu-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.aside-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding: 10px; display: grid; gap: 2px; }
.aside-foot a, .aside-foot button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .7); font-size: .86rem; background: none; border: 0; width: 100%; text-align: left; }
.aside-foot a:hover, .aside-foot button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.aside-foot svg { width: 18px; height: 18px; }
.abar { position: sticky; top: 0; z-index: 300; margin-left: var(--aside-w); height: 70px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; }
.abar-title b { display: block; color: var(--ink); font-size: 1.05rem; line-height: 1.2; }
.abar-title span { font-size: .76rem; color: var(--muted); }
.abar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.aside-toggle { display: none; }
.aside-scrim { display: none; }
.amain { margin-left: var(--aside-w); padding: 26px 28px 60px; }
.amain > .wrap-in { max-width: 1400px; }
body.admin .pfoot { margin-left: var(--aside-w); }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 6px; color: inherit; position: relative; overflow: hidden; }
a.stat-box:hover { border-color: var(--blue); color: inherit; }
.stat-box .lbl { font-size: .78rem; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat-box .lbl svg { width: 16px; height: 16px; }
.stat-box .val { font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat-box .foot { font-size: .76rem; color: var(--muted); }
.stat-box::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acc, var(--blue)); }
.stats-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--navy); color: #fff; border-radius: 14px; margin-bottom: 12px; font-size: .88rem; }
.bulkbar .btn-outline-light { padding: 7px 12px; }
.wp-actions { display: flex; gap: 10px; font-size: .78rem; margin-top: 3px; opacity: 0; transition: opacity var(--fast); }
.table tr:hover .wp-actions, .table tr:focus-within .wp-actions { opacity: 1; }
.wp-actions a, .wp-actions button { background: none; border: 0; padding: 0; color: var(--blue); font-size: .78rem; }
.wp-actions .danger { color: var(--red); }
.filters-count { font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.filters-count a, .filters-count button { font-weight: 600; background: none; border: 0; padding: 0; color: var(--blue); font-size: .82rem; }
.filters-count .on { color: var(--ink); }
.log-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: .86rem; }
.log-item:last-child { border-bottom: 0; }
.log-item .icon-box { width: 34px; height: 34px; border-radius: 10px; }
.log-item .icon-box svg { width: 16px; height: 16px; }
.log-item b { color: var(--ink); }
.log-item .when { font-size: .74rem; color: var(--muted); }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; color: #9A5E00; background: var(--amber-50); border-radius: 6px; padding: 2px 7px; }
.flag svg { width: 12px; height: 12px; }
button.kpi { width: 100%; text-align: left; }
.kpi-btn:hover { box-shadow: var(--shadow-md); }
.kpi-btn.on { border-color: var(--blue); box-shadow: var(--ring); }
.danger-zone { border-color: #F5C9C5; }
.danger-zone h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; color: #9E2B25; }
.danger-zone h3 svg { width: 18px; height: 18px; color: var(--red); }
/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.settings-grid h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 1.02rem; }
.settings-grid h3 svg { width: 20px; height: 20px; color: var(--navy); }
.settings-grid .switch-row:last-of-type { border-bottom: 0; }
/* Live chat console */
.chat-console { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: min(680px, calc(100vh - 300px)); min-height: 480px; overflow: hidden; }
.chat-list { overflow-y: auto; border-right: 1px solid var(--line); }
.chat-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line-2); background: #fff; text-align: left; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--blue-50); }
.chat-item.unread { box-shadow: inset 3px 0 0 var(--blue); }
.chat-item .row1 { display: flex; align-items: baseline; gap: 8px; }
.chat-item .row1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; color: var(--ink); }
.chat-item .row1 em { margin-left: auto; font-style: normal; font-size: .72rem; color: var(--muted-2); white-space: nowrap; }
.chat-item .row2 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--muted); }
.chat-item.unread .row2 { font-weight: 600; color: var(--ink); }
.chat-item .cnt { display: grid; place-items: center; flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-style: normal; font-size: .7rem; font-weight: 700; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.chat-msgs { flex: 1; display: grid; align-content: start; gap: 12px; padding: 18px; overflow-y: auto; background: var(--surface-2); }
.cm { display: grid; justify-items: start; gap: 4px; }
.cm.me { justify-items: end; }
.cm .bubble { max-width: 75%; font-size: .9rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm.me .bubble { background: var(--blue); border-color: var(--blue); color: #fff; border-radius: 18px 18px 6px 18px; }
.cm-sys { justify-self: center; padding: 4px 12px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: .74rem; color: var(--muted); text-align: center; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; border-top: 1px solid var(--line-2); }
.chat-form { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px 14px; }
.chat-form .textarea { min-height: 48px; }
.chat-closed { padding: 14px 18px; border-top: 1px solid var(--line-2); text-align: center; }
.chat-empty { flex: 1; display: grid; place-items: center; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }

/* ---------- 11. Responsive ---------- */
@media (max-width: 1480px) {
  .portal-tag { display: none; }
  /* The teacher menu has eight links: text only below this width */
  .pnav-links.is-long a { padding: 9px 10px; }
  .pnav-links.is-long a svg { display: none; }
}
@media (max-width: 1280px) {
  .pnav-links a { padding: 9px 10px; }
  .pnav-links a svg { display: none; }
}
@media (max-width: 1200px) {
  .pnav .user-btn .name, .pnav .user-btn .chev { display: none; }
  .pnav .user-btn { padding: 4px; }
  .stats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ov-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .croom-body { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1100px) {
  .pnav-links { display: none; }
  .burger { display: grid; }
  .burger.menu-btn { display: inline-flex; }
  .pnav .user-btn .name, .pnav .user-btn .chev { display: none; }
  .pnav .user-btn { padding: 4px; }
  .two-col, .two-col-rev { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qlinks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aside { transform: translateX(-100%); transition: transform var(--base) var(--ease); box-shadow: var(--shadow-lg); }
  body.aside-open .aside { transform: none; }
  body.aside-open .aside-scrim { display: block; position: fixed; inset: 0; background: rgba(11, 27, 58, .45); z-index: 450; }
  .aside-toggle { display: grid; }
  .abar, .amain, body.admin .pfoot { margin-left: 0; }
  .abar { padding: 0 16px; }
  .amain { padding: 20px 16px 48px; }
}
@media (max-width: 1000px) {
  .sched-head, .alist .alist-head { display: none; }
  .sched-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ss ss sst" "sd st st" "stc stc stc" "sa sa sa"; gap: 6px 12px; padding: 14px 18px; }
  .sched-row .sst { white-space: nowrap; }
  .sched-row .st span { display: none !important; }
  .sched-row .sd { grid-area: sd; } .sched-row .st { grid-area: st; } .sched-row .ss { grid-area: ss; } .sched-row .stc { grid-area: stc; } .sched-row .sst { grid-area: sst; justify-self: end; } .sched-row .sa { grid-area: sa; }
  .sched-row .sa:empty { display: none; }
  .sched-row .sd b, .sched-row .st { display: inline; font-size: .84rem; }
  .sched-row .sd span { margin-left: 4px; }
  .sched-row .st span { display: inline; margin-left: 4px; }
  .arow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "at ast" "as ad" "atc atc" "aa aa"; gap: 8px 14px; padding: 14px 18px; }
  .arow .at { grid-area: at; } .arow .as { grid-area: as; } .arow .atc { grid-area: atc; } .arow .ad { grid-area: ad; text-align: right; } .arow .ast { grid-area: ast; justify-self: end; } .arow .aa { grid-area: aa; }
  .arow .ad .progress { display: none; }
  .astrip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .croom-body { grid-template-columns: 1fr; padding: 12px 16px; }
  .croom-stage { min-height: 56vh; }
  .facts4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  /* Community: boards become a scrolling row above the posts; guidelines move below */
  .comm { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .comm-side { display: contents; }
  .comm-side > .card:first-child { order: 0; min-width: 0; }
  .comm-main { order: 1; }
  .comm-rules, .comm-fb { order: 2; }
  .board-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .board-list::-webkit-scrollbar { display: none; }
  .board-list button { flex: none; width: auto; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 12px; }
  .board-list button span:not(.s-dot) { overflow: visible; }
  .board-list button .s-dot { margin: 0; }
  .board-grp { display: none; }
  .board-gr { display: inline; }
}
@media (max-width: 860px) {
  .rcards { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gate-card { grid-template-columns: 1fr; }
  .gate-card .side { border-left: 0; border-top: 1px solid var(--line); }
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .inbox-thread { display: none; }
  .inbox-list { border-right: 0; max-height: none; }
  .thread-back { display: inline-flex; }
  .stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-console { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .chat-console.has-chat .chat-list { display: none; }
  .chat-console:not(.has-chat) .chat-pane { display: none; }
  .chat-list { border-right: 0; }
  .chat-pane { height: calc(100vh - 200px); min-height: 440px; }
}
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .container { padding: 0 16px; }
  :root { --nav-h: 62px; }
  .pnav .brand img { height: 30px; }
  .portal-tag { display: none; }
  .pmain { padding: 18px 0 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi .icon-box { width: 40px; height: 40px; }
  .kpi .val { font-size: 1.2rem; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 0; }
  .where-pick { grid-template-columns: minmax(0, 1fr); }
  .card-pad { padding: 18px; }
  .card-head { padding: 16px 18px 0; }
  .card-body { padding: 14px 18px 18px; }
  .page-head { margin-bottom: 16px; }
  .page-head .actions { width: 100%; }
  .page-head .segment { width: 100%; }
  .page-head .segment button { flex: 1; justify-content: center; }
  .tl-item { grid-template-columns: 52px minmax(0, 1fr); }
  .tl-item .cta { grid-column: 1 / -1; }
  .tl-item .cta .btn { width: 100%; }
  .class-row { grid-template-columns: 54px minmax(0, 1fr); }
  .class-row .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .subj-hero { padding: 22px; min-height: 200px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; }
  .modal-foot .btn { flex: 1; }
  .toasts { right: 16px; left: 16px; bottom: 16px; width: auto; }
  body.has-tabbar .toasts { bottom: 84px; }
  .dropdown-menu { position: fixed; left: 12px; right: 12px; top: calc(var(--nav-h) + 6px); min-width: 0; }
  .notif-menu { width: auto; }
  .table th, .table td { padding: 11px 12px; }
  .stats-6 { gap: 10px; }
  .stat-box .val { font-size: 1.35rem; }
  .gate-card .main, .gate-card .side { padding: 22px; }
  .abar { gap: 10px; }
  .abar-title span { display: none; }
  .abar-title b { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
  .abar .user-btn .name, .abar .user-btn .chev { display: none; }
  .abar .user-btn { padding: 4px; }
  .phero .container { padding-top: 30px; padding-bottom: 32px; min-height: 0; }
  .phero::before { background: linear-gradient(180deg, rgba(11, 27, 58, .72) 0%, rgba(11, 27, 58, .9) 55%, rgba(11, 27, 58, .96) 100%); }
  .phero-lead { font-size: .94rem; margin-bottom: 18px; }
  .phero-ctas .btn { flex: 1 1 auto; }
  .phero-next { width: 100%; }
  .sec { margin-top: 28px; }
  .qlinks { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .qlink { padding: 14px; }
  .rate-card { padding: 16px; }
  .rate-card .star-input { width: 100%; justify-content: center; }
  .post-card, .reply { padding: 14px 16px; }
  .file-chip b { max-width: 190px; }
  .cm .bubble { max-width: 88%; }
  .chat-form .btn { padding: 11px 14px; }
  .viewer-frame.doc { height: 62vh; }
  .cls-grid, .media-grid { grid-template-columns: minmax(0, 1fr); }
  .astrip { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 16px; padding: 0 16px 2px; }
  .astrip::-webkit-scrollbar { display: none; }
  .astat { flex: 0 0 auto; width: auto; min-width: 128px; }
  .att-subj { grid-template-columns: minmax(0, 1fr) 90px 44px; }
  .facts4 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ov-stat { padding: 12px; gap: 6px; }
  .ov-stat .icon-box { width: 34px; height: 34px; border-radius: 10px; }
  .ov-stat .icon-box svg { width: 19px; height: 19px; }
  .ov-stat b { font-size: 1.3rem; }
  .croom-top { padding: 12px 16px; gap: 10px; }
  .croom-stage { min-height: 62vh; border-radius: 14px; }
  .croom-bar { gap: 4px; padding: 10px 8px 14px; }
  .cbtn { min-width: 52px; font-size: .66rem; }
  .cbtn .k { width: 44px; height: 44px; }
  .asst { right: 0; bottom: 0; width: 100vw; max-width: none; height: 100%; border-radius: 0; }
  .asst-btn { right: 16px; bottom: 16px; padding: 12px; }
  .asst-btn span { display: none; }
  .kb-article { padding: 20px; }
  .kb-search .input { min-height: 52px; }
  /* Student tab bar */
  body.has-tabbar { padding-bottom: 72px; }
  body.has-tabbar .pfoot { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 350; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -16px rgba(11, 27, 58, .3); }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; font-size: .68rem; font-weight: 600; color: var(--muted); }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--blue); background: var(--blue-50); }
  .tabbar .dot { position: absolute; top: 2px; left: 55%; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-style: normal; font-size: .62rem; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; }
}
@media (max-width: 400px) {
  .kpi { flex-direction: column; align-items: flex-start; gap: 8px; }
  .kpi .ring { margin-left: 0; }
  .stats-6 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 12. Print ---------- */
@media print {
  .pnav, .pfoot, .tabbar, .aside, .abar, .page-head .actions, .toasts, .btn { display: none !important; }
  body, body.admin { background: #fff; padding: 0; }
  .amain { margin: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
