/* Academy — design system v3 "Glass" (20 October 2026): indigo/violet accent, glass surfaces with depth, a light and a dark
   scheme (auto from the device, switchable, remembered), fluid type, micro-interactions. Everything is built from tokens;
   RTL comes free through logical properties. The older designs (Design button) still layer on top of these tokens. */
:root {
  --bg: #F8FAFC; --bg-2: #F1F5F9; --surface: #FFFFFF; --card: rgba(255, 255, 255, 0.82); --soft: #F1F5F9; --soft-2: #F8FAFC;
  --ink: #0F172A; --ink-2: #475569; --ink-3: #64748B;
  --line: rgba(15, 23, 42, 0.08); --line-2: rgba(15, 23, 42, 0.14); --hair: rgba(255, 255, 255, 0.6);
  --accent: #6366F1; --accent-2: #4F46E5; --accent-3: #7C3AED; --accent-soft: #EEF2FF; --accent-light: #A5B4FC; --accent-rgb: 99, 102, 241;
  --teal: #10B981; --teal-soft: #D1FAE5; --sun: #F59E0B; --sun-soft: #FEF3C7; --danger: #F43F5E; --danger-soft: #FFE4E6; --violet: #8B5CF6; --violet-soft: #EDE9FE; --sky: #0EA5E9; --sky-soft: #E0F2FE;
  --dark: #0B1220; --dark-2: #182238; --dark-3: #223050; --dark-text: #A7B3CC;
  --side-w: 268px; --top-h: 64px;
  --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 24px;
  --shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.18), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px -10px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.05);
  --glow: 0 10px 30px -8px rgba(var(--accent-rgb), 0.45);
  --ring: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
  --blur: saturate(170%) blur(16px);
  --ease: cubic-bezier(.2, .8, .2, 1); --t: .22s;
  --font: Inter, Vazirmatn, 'Noto Sans Arabic', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-rtl: Vazirmatn, Inter, 'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.55; font-size: clamp(14.5px, 0.25vw + 14px, 15.5px); text-rendering: optimizeLegibility; min-height: 100vh; }
[dir="rtl"] body, [dir="rtl"] input, [dir="rtl"] select, [dir="rtl"] textarea, [dir="rtl"] button { font-family: var(--font-rtl); }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(55% 45% at 85% -10%, rgba(var(--accent-rgb), .16) 0%, rgba(var(--accent-rgb), 0) 70%), radial-gradient(40% 40% at -10% 100%, rgba(16, 185, 129, .10) 0%, rgba(16, 185, 129, 0) 70%); }
a { color: inherit; text-decoration: none; transition: color var(--t) var(--ease); } a:hover { color: var(--accent); }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(24px, 1.2vw + 20px, 30px); } h2 { font-size: clamp(19px, .6vw + 17px, 22px); } h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--ink-3); } .muted-2 { color: var(--ink-2); }
.small { font-size: 13px; } .xs { font-size: 12px; }
.accent { color: var(--accent); }
.hidden { display: none !important; }
::selection { background: rgba(var(--accent-rgb), .22); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }

body:not(.app) { background: var(--bg); }
.app-side:has([data-secondary] a) [data-primary] { display: none; }
.app-main .lesson-layout { margin: -24px; min-height: calc(100vh - var(--top-h)); }

/* Motion: every page fades up as it arrives; honoured as "off" by the device's reduce-motion setting */
#page { animation: page-in .32s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* Layout primitives */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex-grow: 1; }
.grid { display: grid; gap: 16px; }
.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)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.section { padding: 56px 0; }
.section-title { font-size: 26px; margin-bottom: 20px; }

/* Glass: the shared recipe of every floating surface (top bars, sidebar, cards, modals, the phone tab bar) */
.glass, .nav, .app-top, .app-side, .modal, .tabbar, .mobile-menu { background: var(--card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hair), var(--shadow-sm); }

/* Top bar (public site) */
.nav { height: 66px; border: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-3)); display: flex; align-items: center; justify-content: center; box-shadow: var(--glow); }
.nav-links { display: flex; align-items: center; gap: 4px; font-weight: 500; font-size: 14px; }
.nav-links a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.nav-links a:hover { background: var(--soft); color: var(--ink); }
.nav-links a.active { color: var(--accent-2); background: var(--accent-soft); }
.lang { display: flex; gap: 2px; font-size: 12.5px; background: var(--soft); border-radius: 10px; padding: 3px; }
.lang button { padding: 4px 9px; border-radius: 8px; color: var(--ink-3); font-weight: 500; min-height: 30px; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.lang button.active { color: var(--ink); font-weight: 600; background: var(--surface); box-shadow: var(--shadow-sm); }
.nav .nav-burger { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px; border: 1px solid transparent; white-space: nowrap; transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease), border-color var(--t) var(--ease); line-height: 1; position: relative; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #fff; box-shadow: 0 1px 2px rgba(var(--accent-rgb), .35), inset 0 1px 0 rgba(255,255,255,.2); } .btn-primary:hover { color: #fff; box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-dark { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 1px 2px rgba(var(--accent-rgb), .35); } .btn-dark:hover { color: #fff; box-shadow: var(--glow); }
.btn-light { background: var(--surface); color: var(--ink); border-color: var(--line); } .btn-light:hover { background: var(--soft); }
.btn-outline { border-color: var(--line-2); color: var(--ink); background: var(--card); font-weight: 500; box-shadow: var(--shadow-sm); } .btn-outline:hover { border-color: var(--accent-light); color: var(--accent-2); background: var(--surface); }
.btn-ghost { color: var(--ink-2); font-weight: 500; } .btn-ghost:hover { color: var(--ink); background: var(--soft); transform: none; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; gap: 6px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn svg { flex: none; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: inset 0 1px 0 var(--hair), var(--shadow-sm); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.card-sm { padding: 14px; border-radius: var(--r); }
.card-dark { background: linear-gradient(135deg, #1E1B4B 0%, var(--accent-2) 60%, var(--accent-3) 140%); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.card-dark .muted { color: rgba(255,255,255,.72); }
.card > h3, .card > b:first-child { font-size: 15px; }
.card.selected { border: 2px solid var(--accent); padding: 19px; box-shadow: var(--ring); }
.card.clickable { cursor: pointer; } .card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.section-alt { background: var(--bg-2); }
.stat-tile { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.stat-tile .stat-value { font-size: 32px; color: var(--accent); }
.svc-icon { width: 46px; height: 46px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 0 20px; transition: border-color var(--t) var(--ease); }
.faq details[open] { border-color: var(--accent-light); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; } .faq summary::after { content: '+'; color: var(--accent); font-size: 20px; transition: transform var(--t) var(--ease); } .faq details[open] summary::after { content: '–'; }
.faq details p { padding: 0 0 16px; color: var(--ink-2); }
.app-badge { display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 12px; background: var(--dark-2); color: #fff; font-size: 13px; }
.app-badge small { display: block; font-size: 10px; color: var(--dark-text); }
.wa-fab { position: fixed; bottom: 24px; inset-inline-end: 24px; width: 54px; height: 54px; border-radius: 999px; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(37,211,102,.4); z-index: 35; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.wa-fab:hover { transform: translateY(-2px) scale(1.04); color: #fff; box-shadow: 0 14px 30px rgba(37,211,102,.45); }
body.has-tabbar .wa-fab { bottom: 90px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 14px; }
.plan-card.best { border: 2px solid var(--accent); padding: 19px; box-shadow: var(--glow); }
.plan-card .plan-price { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.story { display: flex; flex-direction: column; gap: 14px; }
.story q { quotes: none; font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.eyebrow-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 600; }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--soft); color: var(--ink-2); line-height: 1.5; white-space: nowrap; }
.pill-accent { background: var(--accent-soft); color: var(--accent-2); }
.pill-danger { background: var(--danger-soft); color: #BE123C; }
.pill-dark { background: var(--ink); color: var(--bg); } .pill-teal { background: var(--teal-soft); color: #047857; } .pill-sun { background: var(--sun-soft); color: #92400E; }
.avatar { width: 40px; height: 40px; border-radius: 999px; background: linear-gradient(135deg, var(--accent-soft), var(--violet-soft)); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: var(--accent-2); flex-shrink: 0; overflow: hidden; font-size: 14px; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .15); }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar { line-height: 1; letter-spacing: .02em; white-space: nowrap; text-overflow: clip; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.divider { height: 1px; background: var(--line); }
.progress { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-3)); border-radius: 999px; transition: width .6s var(--ease); }
.card-dark .progress { background: rgba(255,255,255,.2); } .card-dark .progress > div { background: #fff; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12.5px; cursor: pointer; background: var(--card); transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background var(--t) var(--ease); }
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.dot-live { background: var(--danger); box-shadow: 0 0 0 3px rgba(244, 63, 94, .2); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(244, 63, 94, .2); } 50% { box-shadow: 0 0 0 7px rgba(244, 63, 94, .06); } }
.notice { padding: 12px 16px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-2); font-size: 14px; border: 1px solid rgba(var(--accent-rgb), .16); }
.notice-warn { background: var(--sun-soft); color: #92400E; border-color: rgba(245, 158, 11, .3); }
.notice-danger { background: var(--danger-soft); color: #BE123C; border-color: rgba(244, 63, 94, .22); }
.stat { display: flex; flex-direction: column; gap: 6px; position: relative; }
.stat > .small.muted, .stat > .xs.muted { font-weight: 500; letter-spacing: .01em; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.thumb { border-radius: 12px; background: var(--dark); aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; overflow: hidden; }
.thumb-soft { background: var(--soft); color: var(--ink); }
.play { width: 52px; height: 52px; border-radius: 999px; background: var(--surface); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); transition: transform var(--t) var(--ease); } .thumb:hover .play { transform: scale(1.08); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.input { height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 12px; width: 100%; outline: none; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease); box-shadow: var(--shadow-sm); }
.input:hover { border-color: var(--accent-light); }
.input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder { color: var(--ink-3); }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-inline-end: 32px; }
[dir="rtl"] select.input { background-position: left 10px center; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.form-error { color: var(--danger); font-size: 13px; }
.segmented { display: inline-flex; gap: 2px; background: var(--soft); padding: 3px; border-radius: 11px; }
.segmented button { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }

/* Tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.table th { text-align: start; font-weight: 600; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--soft-2); position: sticky; top: 0; }
.table th:first-child { border-start-start-radius: 10px; } .table th:last-child { border-start-end-radius: 10px; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; transition: background var(--t) var(--ease); }
.table tbody tr:hover td { background: rgba(var(--accent-rgb), .05); }
.table tr:last-child td { border-bottom: 0; }
.table td[dir="ltr"], .table td.num { font-variant-numeric: tabular-nums; }
.card > .table, .card > div > .table { margin: 0 -6px; width: calc(100% + 12px); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); transition: background var(--t) var(--ease); }
.list-item:last-child { border-bottom: 0; }
.card .list-item:hover { background: var(--soft-2); margin: 0 -12px; padding-inline: 12px; border-radius: 10px; }

/* Hero (public site) */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; padding: 72px 0 56px; position: relative; }
.hero h1 { font-size: clamp(36px, 3.4vw + 16px, 56px); line-height: 1.08; letter-spacing: -0.03em; background: linear-gradient(135deg, var(--ink) 30%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; line-height: 1.65; color: var(--ink-2); max-width: 520px; }
.hero-visual { position: relative; min-height: 440px; display: flex; align-items: center; justify-content: center; }
.hero-visual svg { width: 100%; height: auto; max-width: 560px; filter: drop-shadow(0 30px 40px rgba(var(--accent-rgb), .18)); }
.hero-bg { position: absolute; inset: -40px -20px auto; height: 620px; z-index: -1; background: radial-gradient(60% 55% at 80% 30%, rgba(var(--accent-rgb), .18) 0%, rgba(var(--accent-rgb), 0) 70%), radial-gradient(40% 40% at 15% 80%, rgba(16, 185, 129, .14) 0%, rgba(16, 185, 129, 0) 70%); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
.grade-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.grade-cell { height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 17px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.grade-cell:hover { border-color: var(--accent-light); color: var(--accent); transform: translateY(-2px); }
.grade-cell.active { background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.pricing { border-radius: var(--r-xl); background: linear-gradient(135deg, #1E1B4B 0%, #4338CA 55%, #8B5CF6 140%); color: #fff; padding: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: center; box-shadow: var(--glow); }
.price { font-size: 60px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.check-list { display: flex; flex-direction: column; border-top: 1px solid rgba(255,255,255,.18); }
.check-list > div { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.18); }
.footer { background: var(--dark); color: var(--dark-text); padding: 56px 0 28px; font-size: 14px; margin-top: 64px; }
.footer a { color: var(--dark-text); } .footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; } .footer-col b { color: #fff; font-size: 14px; margin-bottom: 4px; }
.footer-bottom { border-top: 1px solid var(--dark-2); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.social { display: flex; gap: 10px; } .social a { width: 36px; height: 36px; border-radius: 10px; background: var(--dark-2); display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: background var(--t) var(--ease), transform var(--t) var(--ease); } .social a:hover { background: var(--accent); transform: translateY(-2px); }

/* Lesson layout */
.lesson-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 350px; min-height: calc(100vh - 66px); background: var(--surface); }
.lesson-side { border-inline-end: 1px solid var(--line); overflow-y: auto; }
.lesson-main { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.lesson-ai { border-inline-start: 1px solid var(--line); background: var(--card); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); display: flex; flex-direction: column; max-height: calc(100vh - 66px); position: sticky; top: 66px; }
.unit-head { padding: 12px 20px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background var(--t) var(--ease); }
.unit-head:hover { background: var(--soft-2); }
.unit-head.active { background: var(--accent-soft); border-inline-start: 3px solid var(--accent); }
.unit-items { background: var(--surface); padding: 0 20px 8px; }
.unit-item { padding: 9px 0; padding-inline-start: 24px; font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; cursor: pointer; transition: color var(--t) var(--ease); }
.unit-item:hover, .unit-item.active { color: var(--ink); font-weight: 600; }
.player { border-radius: 14px; background: var(--dark); aspect-ratio: 16/9; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.player video, .player iframe { width: 100%; height: 100%; border: 0; }
.chat { flex-grow: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; animation: page-in .25s var(--ease) both; }
.msg-user { align-self: flex-start; background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #fff; border-end-start-radius: 4px; }
.msg-ai { align-self: flex-end; background: var(--soft); border-end-end-radius: 4px; }
.chat-input { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.chat-input .input { height: 42px; }
.icon-btn { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); } .icon-btn:hover { transform: translateY(-1px); box-shadow: var(--glow); }

/* ===== The app shell (every signed-in role): a glass sidebar with grouped links, a glass top bar, the content area ===== */
.app-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.app-side { color: var(--ink); border: 0; border-inline-end: 1px solid var(--line); border-radius: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; box-shadow: none; }
.app-side::-webkit-scrollbar { width: 6px; } .app-side::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 12px; font-weight: 700; font-size: 18px; }
.side-brand .brand-mark { width: 34px; height: 34px; }
.side-who { margin: 0 12px 8px; padding: 12px; border-radius: 14px; background: var(--soft); display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); }
.side-who .avatar { width: 38px; height: 38px; font-size: 14px; display: inline-flex; }
.side-who b { display: block; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-who div > span { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-group { padding: 4px 12px; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 12px 10px 4px; }
.side-group a, .side-group .dash-side a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease); min-height: 44px; }
.side-group a:hover { background: var(--soft); color: var(--ink); transform: translateX(2px); } [dir="rtl"] .side-group a:hover { transform: translateX(-2px); }
.side-group a.active { background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #fff; font-weight: 600; box-shadow: var(--glow); transform: none; }
.side-group a .side-ic { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--ink-3); flex: none; transition: color var(--t) var(--ease), background var(--t) var(--ease); }
.side-group a:hover .side-ic { color: var(--accent); }
.side-group a.active .side-ic { background: rgba(255,255,255,.18); color: #fff; }
.side-group a > span:not(.side-ic) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-group a .pill { background: var(--accent-soft); color: var(--accent-2); } .side-group a.active .pill { background: rgba(255,255,255,.22); color: #fff; }
.side-group .dash-side { display: flex; flex-direction: column; gap: 2px; padding: 0; border: 0; background: transparent; }
.side-group[data-secondary]:not(:has(a)) { display: none; }
.side-foot { margin-top: auto; padding: 10px 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.side-foot a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; font-size: 14.5px; color: var(--ink-2); min-height: 44px; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.side-foot a:hover { background: var(--soft); color: var(--ink); }
.side-foot a .side-ic { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); flex: none; }
.app-body { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.app-top { height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.app-top .top-title { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-top .top-title .muted { font-weight: 600; color: var(--accent-2); }
.app-top .top-crumb { color: var(--ink-3); font-weight: 400; }
.app-top .top-right { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.app-top .top-btn, .top-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); background: var(--soft); border: 1px solid transparent; transition: color var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.app-top .top-btn:hover, .top-btn:hover { color: var(--accent); border-color: var(--accent-light); background: var(--accent-soft); }
.top-btn:active { transform: scale(.95); }
.app-top .avatar { width: 40px; height: 40px; font-size: 14px; cursor: pointer; transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); } .app-top .avatar:hover { transform: translateY(-1px); box-shadow: var(--ring); }
.app-top .side-toggle { display: none; }
.app-main { padding: 24px 28px 40px; flex: 1; }
.app-main > .container { padding: 0; max-width: 1200px; }
.app-main .section { padding: 12px 0 32px; }
.app-main .section-title { font-size: 22px; margin-bottom: 14px; }
.app-main .dash { display: block; min-height: 0; }
.app-main .dash-main { padding: 0; gap: 20px; }
.app-main .dash > .dash-side { display: none; }
.app-main .auth { margin: 32px auto; }
.app-main h1 { font-size: 26px; }
.app-main .footer { display: none; }
.app-main .demo-banner { border-radius: 12px; margin-bottom: 16px; }
.app-main .lesson-layout { margin: -24px -28px; min-height: calc(100vh - var(--top-h)); }
/* the home tiles: the big buttons at the top of every panel's first page */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.home-tiles a { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 12px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-weight: 600; font-size: 14px; color: var(--ink); min-height: 108px; justify-content: center; box-shadow: inset 0 1px 0 var(--hair), var(--shadow-sm); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease); }
.home-tiles a:hover { transform: translateY(-3px); border-color: var(--accent-light); box-shadow: var(--shadow-md); color: var(--accent-2); }
.home-tiles a .side-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; transition: transform var(--t) var(--ease); }
.home-tiles a:hover .side-ic { transform: scale(1.08) rotate(-3deg); }
.home-tiles a .side-ic svg { width: 22px; height: 22px; }
.home-tiles a span:last-child { line-height: 1.3; }
.home-tiles a:nth-child(6n+1) .side-ic { background: var(--accent-soft); color: var(--accent-2); } .home-tiles a:nth-child(6n+2) .side-ic { background: var(--teal-soft); color: #047857; } .home-tiles a:nth-child(6n+3) .side-ic { background: var(--sun-soft); color: #B45309; } .home-tiles a:nth-child(6n+4) .side-ic { background: var(--danger-soft); color: #BE123C; } .home-tiles a:nth-child(6n+5) .side-ic { background: var(--violet-soft); color: #6D28D9; } .home-tiles a:nth-child(6n+6) .side-ic { background: var(--sky-soft); color: #0369A1; }
.card.stat { border-inline-start: 4px solid var(--accent); } .grid > .card.stat:nth-child(2), .uni-stats > .card.stat:nth-child(2) { border-color: var(--teal); } .grid > .card.stat:nth-child(3), .uni-stats > .card.stat:nth-child(3) { border-color: var(--sun); } .grid > .card.stat:nth-child(4), .uni-stats > .card.stat:nth-child(4) { border-color: var(--danger); } .grid > .card.stat:nth-child(5), .uni-stats > .card.stat:nth-child(5) { border-color: var(--violet); } .grid > .card.stat:nth-child(6), .uni-stats > .card.stat:nth-child(6) { border-color: var(--sky); }

/* Dashboard (kept for pages rendered outside the shell, e.g. printing) */
.dash { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 66px); }
.dash-side { border-inline-end: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.dash-side a { padding: 10px 12px; border-radius: 9px; font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; }
.dash-side a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dash-main { padding: 28px 32px; display: flex; flex-direction: column; gap: 22px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars > div > div { border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--accent-3), var(--accent)); min-height: 2px; transition: height .6s var(--ease); box-shadow: 0 -4px 14px rgba(var(--accent-rgb), .25); }
.bar-labels { display: flex; gap: 10px; font-size: 12px; color: var(--ink-3); } .bar-labels > div { flex: 1; text-align: center; }

/* Auth, quiz, overlays */
.auth { max-width: 440px; margin: 56px auto; }
.quiz-option { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; display: flex; gap: 12px; align-items: center; transition: border-color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease); }
.quiz-option:hover { border-color: var(--accent-light); transform: translateX(2px); } [dir="rtl"] .quiz-option:hover { transform: translateX(-2px); }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.quiz-option.correct { border-color: var(--teal); background: var(--teal-soft); }
.quiz-option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); animation: toast-in .25s var(--ease); max-width: min(92vw, 520px); }
[dir="rtl"] .toast { transform: translateX(50%); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px) scale(.98); } to { opacity: 1; transform: translate(-50%, 0); } }
.modal-bg { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade-in .2s var(--ease); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { border-radius: var(--r-xl); padding: 26px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); animation: modal-in .24s var(--ease); background: var(--surface); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 18px; }
.demo-banner { background: var(--sun-soft); color: #92400E; font-size: 13px; text-align: center; padding: 8px 16px; }
.tabbar { display: none; }
.mobile-only { display: none; }

/* Sidebar drawer + responsive */
.side-scrim { display: none; }
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding: 40px 0 32px; gap: 32px; }
  .hero-visual { min-height: 320px; }
  .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pricing { grid-template-columns: 1fr; padding: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .price { font-size: 44px; }
  .nav-links, .nav .desktop-only { display: none; }
  .nav .nav-burger { display: inline-flex; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-side { border: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .lesson-ai { position: static; max-height: none; border: 0; border-top: 1px solid var(--line); }
  .dash { grid-template-columns: 1fr; }
  .dash-side { flex-direction: row; overflow-x: auto; border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .dash-side a { white-space: nowrap; }
  .dash-main { padding: 20px 16px; }
  .section { padding: 36px 0; }
  .mobile-only { display: block; }
  .app-shell { grid-template-columns: 1fr; }
  .app-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); z-index: 70; transform: translateX(-104%); transition: transform .28s var(--ease); box-shadow: none; background: var(--surface); }
  [dir="rtl"] .app-side { transform: translateX(104%); }
  body.side-open .app-side { transform: none; box-shadow: var(--shadow); }
  body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 65; animation: fade-in .2s var(--ease); }
  .app-top { padding: 0 14px; gap: 8px; }
  .app-top .side-toggle { display: inline-flex; }
  .app-top .top-tabs { display: none; }
  .app-top .lang { display: none; }
  .app-top .top-title { font-size: 16px; }
  .app-main { padding: 16px 14px; }
  .tabbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); position: fixed; bottom: 0; inset-inline: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: 0 -8px 30px rgba(2, 6, 23, .08); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; color: var(--ink-3); min-height: 48px; justify-content: center; padding: 0 2px; border-radius: 12px; transition: color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease); }
  .tabbar a:active, .tabbar button:active { transform: scale(.94); }
  .tabbar a span, .tabbar button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar .side-ic { background: none; width: auto; height: auto; }
  .tabbar a.active { color: var(--accent); font-weight: 600; }
  .tabbar a.active svg { filter: drop-shadow(0 4px 8px rgba(var(--accent-rgb), .45)); }
  body.has-tabbar { padding-bottom: 76px; }
  body.has-tabbar .app-main { padding-bottom: 90px; }
  .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .grade-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .container { padding: 0 16px; }
  .card { padding: 16px; }
  .app-top .top-title .top-crumb, .app-top .top-title .muted { display: none; }
  .table { font-size: 13px; } .table th, .table td { padding: 9px 8px; }
  .card > .table, .card > div > .table { display: block; overflow-x: auto; margin: 0; width: 100%; }
}
.mobile-menu { position: fixed; inset: 0; z-index: 60; padding: 24px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; border: 0; border-radius: 0; background: var(--surface); animation: fade-in .2s var(--ease); }
.mobile-menu a { font-size: 19px; font-weight: 600; padding: 12px 0; border-bottom: 1px solid var(--line); }

/* Skeleton loading */
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.skeleton > div { border-radius: 12px; background: linear-gradient(90deg, var(--soft) 25%, var(--line-2) 37%, var(--soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ===== The five designs (chosen with the Design button; stored as wane.theme) ===== */
/* 1 · Clear — the default: white, one blue */
/* 2 · Warm — cream paper, deep green, rounder */
/* 3 · Bold colours — violet, a coloured top bar, every tile its own colour */
/* 4 · Night — dark screen, light text, sky-blue accent */
/* 5 · Simple & big — bigger text and buttons, one orange, no side menu: the tiles and the Menu button do the work */
/* 6 · Soft — halfway: a grey-blue ground, no pure white and no black, a muted blue */
/* 7 · Warm, bold & big — the mix Mohammad chose on 14 September: Warm's cream and green, Bold's coloured top bar and tiles, Big's sizes and no side menu */
/* the Design chooser */

/* printing — receipts and report cards: only the paper part */
@media print { .nav, .footer, .tabbar, .dash-side, .app-side, .app-top, .no-print, .toast, .modal-bg, .side-scrim { display: none !important; } body { background: var(--surface); } .app-shell { display: block; } .app-main { padding: 0; } .card { box-shadow: none; border: 1px solid #ccc; } .dash-main { padding: 0; } }

/* the A4 report card — printed in the school's language, with the stamp box and the signature line */
.a4 { width: 190mm; max-width: 100%; min-height: 270mm; margin: 0 auto; background: var(--surface); color: #111; padding: 12mm; box-sizing: border-box; font-size: 12pt; border: 1px solid var(--line); border-radius: 4px; }
.a4 h1 { font-size: 22pt; margin: 0; } .a4 h2 { font-size: 14pt; margin: 0; font-weight: 500; }
.a4 table { width: 100%; border-collapse: collapse; } .a4 th, .a4 td { border: 1px solid #333; padding: 6px 8px; font-size: 11pt; text-align: start; } .a4 th { background: #f1f3f7; }
.a4-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; font-size: 11pt; }
.a4-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 18mm; flex-wrap: wrap; }
.rc-stamp { width: 44mm; height: 44mm; border: 2px dashed #555; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 9pt; color: #555; padding: 5mm; box-sizing: border-box; }
.rc-sign { border-top: 1px solid #111; min-width: 60mm; padding-top: 4px; font-size: 10pt; }
@media print { @page { size: A4; margin: 12mm; } .a4 { width: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; } .a4 th { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* M11 · the university home: six numbers in a tight grid, two per row on the phone */
.uni-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.uni-stats .card.stat { padding: 14px 14px; }
.uni-stats .stat-num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
@media (max-width: 720px) { .uni-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .uni-stats .stat-num { font-size: 21px; } }
.uni-names { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .uni-names .input { flex: 1 1 160px; max-width: 280px; }

/* 8 · React style — the default from 24 September: white and indigo, the side menu with icons on the desktop, coloured stat cards with an icon badge, the look of a modern web app */
/* M12 · stat cards with an icon badge (every theme) */
.stat-ic { padding-inline-end: 56px; } .stat-badge { position: absolute; inset-inline-end: 14px; top: 14px; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.st-teal .stat-badge { background: var(--teal-soft); color: var(--teal); } .st-sun .stat-badge { background: var(--sun-soft); color: #B45309; } .st-red .stat-badge { background: var(--danger-soft); color: var(--danger); } .st-violet .stat-badge { background: var(--violet-soft); color: var(--violet); } .st-orange .stat-badge { background: #FFEDD5; color: #EA580C; } .st-indigo .stat-badge { background: var(--accent-soft); color: var(--accent); }
/* 24 September · the login page: a split screen with the indigo hero on the left, the form and the demo box on the right */
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; padding-top: 32px; padding-bottom: 48px; }
.auth-hero { background: linear-gradient(135deg, #312E81, #4F46E5 60%, #7C3AED 130%); color: #fff; border-radius: 24px; padding: 40px 36px; min-height: 420px; position: sticky; top: 90px; box-shadow: 0 20px 50px rgba(79, 70, 229, .25); }
.auth-hero h1 { font-size: 30px; line-height: 1.2; margin: 26px 0 22px; letter-spacing: -.02em; }
.auth-hero ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-hero li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.5; opacity: .95; } .auth-hero li svg { flex: none; margin-top: 3px; background: rgba(255,255,255,.18); border-radius: 8px; padding: 3px; width: 24px; height: 24px; }
.auth-hero .brand-mark { background: rgba(255,255,255,.2); box-shadow: none; }
.auth-panel { display: flex; flex-direction: column; gap: 16px; }
.auth-split .auth { margin: 0; max-width: none; }
.demo-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.demo-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 13.5px; font-weight: 600; border: 1px solid transparent; transition: background .12s, border-color .12s, color .12s; }
.demo-chip svg { width: 16px; height: 16px; color: var(--accent); }
.demo-chip:hover { background: var(--accent-soft); border-color: var(--accent-light); color: var(--accent-2); }
@media (max-width: 900px) { .auth-split { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; } .auth-hero { position: static; min-height: 0; padding: 24px 22px; border-radius: 20px; } .auth-hero h1 { font-size: 22px; margin: 14px 0 12px; } .auth-hero li { font-size: 14px; } }
/* the login chooser: who are you? */
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s, transform .12s; }
.role-tile:hover { border-color: var(--accent-light); box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--ink); }
.role-tile .side-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.role-tile b { font-size: 15px; }
.role-grid a:nth-child(2) .side-ic { background: var(--danger-soft); color: var(--danger); } .role-grid a:nth-child(3) .side-ic { background: var(--teal-soft); color: var(--teal); } .role-grid a:nth-child(4) .side-ic { background: var(--sun-soft); color: #B45309; } .role-grid a:nth-child(5) .side-ic { background: var(--violet-soft); color: var(--violet); } .role-grid a:nth-child(6) .side-ic { background: #FFEDD5; color: #EA580C; } .role-grid a:nth-child(7) .side-ic { background: var(--soft); color: var(--ink-2); }
@media (max-width: 420px) { .role-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .role-tile { padding: 12px; } }
.academy-only { margin-top: 6px; padding: 14px; border-radius: 14px; background: var(--soft); display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
/* 25 September · the start: the country screen and the Academy-or-programme screen */
.start-screen { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 24px 16px 48px; }
.start-box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; text-align: center; } .start-box.wide { max-width: 720px; }
.start-box h1 { font-size: 26px; letter-spacing: -.02em; } .start-box .lang { margin: 8px auto 0; }
.country-list { display: flex; flex-direction: column; gap: 10px; }
.country { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: start; font-size: 16px; transition: border-color .12s, box-shadow .12s; }
.country .flag { font-size: 26px; line-height: 1; } .country b { flex: 1; } .country .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.country.active { border-color: var(--accent); box-shadow: var(--ring); } .country.active .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.who-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.who-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: center; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s, border-color .12s; }
.who-card:hover { transform: translateY(-2px); border-color: var(--accent-light); box-shadow: var(--shadow-md); color: var(--ink); }
.who-card .side-ic { width: 60px; height: 60px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; } .who-card .side-ic.alt { background: var(--teal-soft); color: var(--teal); }
.who-card b { font-size: 18px; } .who-card .btn { margin-top: 6px; }
@media (max-width: 640px) { .who-cards { grid-template-columns: 1fr; } .start-screen { align-items: flex-start; padding-top: 12px; } }

/* M18 · the staff portal: an official door */
.portal { min-height: calc(100vh - 60px); background: var(--bg); }
.portal-band { background: linear-gradient(160deg, #0B1220, #16213E 55%, #1E2A5A); color: #fff; padding: 44px 16px 84px; text-align: center; border-bottom: 4px solid #C9A227; }
.portal-band .brand { justify-content: center; color: #fff; opacity: .85; font-size: 14px; }
.portal-crest { width: 108px; height: 108px; border-radius: 50%; margin: 18px auto 14px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.35); border: 3px solid #C9A227; }
.portal-crest img { width: 100%; height: 100%; object-fit: cover; } .portal-crest svg { width: 54px; height: 54px; color: #16213E; }
.portal-caption { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #C9A227; font-weight: 700; }
.portal-name { font-family: Georgia, 'Times New Roman', serif; font-size: 32px; line-height: 1.15; margin: 8px auto 6px; max-width: 760px; letter-spacing: .01em; }
.portal-line { font-size: 14px; opacity: .85; max-width: 640px; margin: 0 auto; }
.portal-form { max-width: 480px; margin: -56px auto 40px; padding: 0 16px; }
.portal-form .card { padding: 26px 26px 20px; box-shadow: 0 18px 50px rgba(15, 23, 42, .18); border: 1px solid #E5E7EB; }
.portal-form .btn-block { background: #16213E; color: #fff; border-color: #16213E; font-weight: 700; letter-spacing: .02em; } .portal-form .btn-block:hover { background: #0B1220; }
.portal-foot { text-align: center; font-size: 12px; color: var(--muted); max-width: 560px; margin: 0 auto 40px; padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.portal-seal { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #C9A227; font-weight: 700; }
@media (max-width: 640px) { .portal-band { padding: 30px 16px 70px; } .portal-name { font-size: 24px; } .portal-crest { width: 84px; height: 84px; } }

/* M19 · the shared computer's faces, the code on the screen, the official line */
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.face { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; text-align: center; }
.face:hover { border-color: #C9A227; box-shadow: 0 6px 18px rgba(15, 23, 42, .1); }
.face-av { width: 46px; height: 46px; border-radius: 50%; background: #16213E; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; letter-spacing: .04em; }
.portal-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 30px; font-weight: 700; letter-spacing: .18em; color: #16213E; }
.portal-official { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #C9A227; margin-top: 8px; font-weight: 600; }

/* M27 · the live classroom stage: the burnt-in watermark and the capture block */
.live-stage{position:relative;background:#0b1020;border-radius:12px;min-height:180px;overflow:hidden;user-select:none;-webkit-user-select:none;margin-bottom:10px}
.stage-video{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap}
.stage-video video{max-width:100%;max-height:100%;border-radius:8px}
.wm-layer{position:absolute;inset:-20%;display:grid;grid-template-columns:repeat(3,1fr);transform:rotate(-18deg);pointer-events:none;opacity:.22;color:#fff;font-size:12px;font-weight:600;letter-spacing:.5px}
.wm-layer span{padding:26px 10px;white-space:nowrap}
.stage-bar{position:absolute;left:0;right:0;bottom:0;display:flex;justify-content:space-between;gap:8px;padding:6px 10px;background:rgba(0,0,0,.45);color:#fff}
.stage-hidden .stage-video,.stage-hidden .wm-layer{filter:blur(18px)}

/* M53 · My year follows the theme on screen and prints on white */
@media print { #yearPrint53 { background: #fff !important; color: #111 !important; border-color: #ddd !important; } #yearPrint53 .muted, #yearPrint53 .xs { color: #555 !important; } }

/* M57 · the cash ledger prints on white */
@media print { #ledger57 { background: #fff !important; color: #111 !important; border-color: #ddd !important; } #ledger57 .muted, #ledger57 .xs { color: #555 !important; } }

/* M64 · the report card prints on white */
@media print { #repCard64 { background: #fff !important; color: #111 !important; border-color: #ddd !important; } #repCard64 .muted, #repCard64 .xs { color: #555 !important; } }

/* M72 · the welcome pack prints on white */
@media print { #pack72 { background: #fff !important; color: #111 !important; border-color: #ddd !important; } #pack72 .muted, #pack72 .xs, #pack72 .notice { color: #555 !important; } #pack72 .table th, #pack72 .table td { color: #111 !important; border-color: #ddd !important; } }
/* ===== The dark scheme: Deep Slate Obsidian. Follows the device unless the person chose (the sun/moon button), kept as localStorage "theme".
   Declared last so it wins over every design above — any design can be viewed in the dark. ===== */
html[data-scheme="dark"] { color-scheme: dark;
  --bg: #020617; --bg-2: #0F172A; --surface: #0F172A; --card: rgba(30, 41, 59, 0.72); --soft: rgba(51, 65, 85, 0.45); --soft-2: rgba(30, 41, 59, 0.6);
  --ink: #E2E8F0; --ink-2: #CBD5E1; --ink-3: #94A3B8;
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.14); --hair: rgba(255, 255, 255, 0.06);
  --accent: #818CF8; --accent-2: #A5B4FC; --accent-3: #A78BFA; --accent-soft: rgba(99, 102, 241, 0.18); --accent-light: #6366F1; --accent-rgb: 129, 140, 248;
  --teal: #34D399; --teal-soft: rgba(16, 185, 129, 0.16); --sun: #FBBF24; --sun-soft: rgba(245, 158, 11, 0.16); --danger: #FB7185; --danger-soft: rgba(244, 63, 94, 0.16); --violet: #A78BFA; --violet-soft: rgba(139, 92, 246, 0.18); --sky: #38BDF8; --sky-soft: rgba(14, 165, 233, 0.16);
  --dark: #020617; --dark-2: #0F172A; --dark-3: #1E293B; --dark-text: #94A3B8;
  --shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6), 0 8px 16px -8px rgba(0, 0, 0, 0.4); --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.55);
  --glow: 0 10px 30px -8px rgba(99, 102, 241, 0.55); --ring: 0 0 0 3px rgba(129, 140, 248, 0.3);
}
html[data-scheme="dark"] body::before { background: radial-gradient(55% 45% at 85% -10%, rgba(99, 102, 241, .22) 0%, rgba(99, 102, 241, 0) 70%), radial-gradient(40% 40% at -10% 100%, rgba(139, 92, 246, .14) 0%, rgba(139, 92, 246, 0) 70%); }
html[data-scheme="dark"] .pill-teal { color: #6EE7B7; } html[data-scheme="dark"] .pill-sun { color: #FCD34D; } html[data-scheme="dark"] .pill-danger { color: #FDA4AF; } html[data-scheme="dark"] .pill-dark { background: #E2E8F0; color: #0F172A; }
html[data-scheme="dark"] .notice { color: #C7D2FE; } html[data-scheme="dark"] .notice-warn { color: #FDE68A; } html[data-scheme="dark"] .notice-danger { color: #FECDD3; }
html[data-scheme="dark"] .demo-banner { background: rgba(245, 158, 11, .14); color: #FDE68A; }
html[data-scheme="dark"] .home-tiles a:nth-child(6n+1) .side-ic { color: #C7D2FE; } html[data-scheme="dark"] .home-tiles a:nth-child(6n+2) .side-ic { color: #6EE7B7; } html[data-scheme="dark"] .home-tiles a:nth-child(6n+3) .side-ic { color: #FCD34D; } html[data-scheme="dark"] .home-tiles a:nth-child(6n+4) .side-ic { color: #FDA4AF; } html[data-scheme="dark"] .home-tiles a:nth-child(6n+5) .side-ic { color: #C4B5FD; } html[data-scheme="dark"] .home-tiles a:nth-child(6n+6) .side-ic { color: #7DD3FC; }
html[data-scheme="dark"] .stat-badge, html[data-scheme="dark"] .role-tile .side-ic, html[data-scheme="dark"] .who-card .side-ic { color: var(--accent-2); }
html[data-scheme="dark"] .st-sun .stat-badge { color: #FCD34D; } html[data-scheme="dark"] .st-teal .stat-badge { color: #6EE7B7; } html[data-scheme="dark"] .st-red .stat-badge { color: #FDA4AF; } html[data-scheme="dark"] .st-orange .stat-badge { background: rgba(234, 88, 12, .18); color: #FDBA74; }
html[data-scheme="dark"] .hero h1 { background: linear-gradient(135deg, #F8FAFC 30%, #A5B4FC); -webkit-background-clip: text; background-clip: text; }
html[data-scheme="dark"] .a4, html[data-scheme="dark"] .a4 th { background: #fff; color: #111; }
html[data-scheme="dark"] .lesson-layout, html[data-scheme="dark"] .unit-items { background: var(--bg-2); }
html[data-scheme="dark"] .input, html[data-scheme="dark"] select.input { background: rgba(15, 23, 42, 0.7); }
html[data-scheme="dark"] .modal, html[data-scheme="dark"] .mobile-menu { background: rgba(15, 23, 42, 0.92); }
html[data-scheme="dark"] .table th { background: rgba(30, 41, 59, 0.5); }
html[data-scheme="dark"] .demo-chip { color: var(--ink); } html[data-scheme="dark"] .quiz-option { background: var(--soft-2); }
html[data-scheme="dark"] .face-av { background: var(--accent); }
html[data-scheme="dark"] .portal-form .card { border-color: var(--line-2); background: rgba(15, 23, 42, 0.92); }
html[data-scheme="dark"] .toast { background: #E2E8F0; color: #0F172A; }
html[data-scheme="dark"] .side-who { background: rgba(51, 65, 85, 0.35); }
html[data-scheme="dark"] .btn-light { background: var(--soft-2); }
html[data-scheme="dark"] .msg-ai { background: rgba(51, 65, 85, 0.6); }
html[data-scheme="dark"] .skeleton > div { background: linear-gradient(90deg, rgba(51,65,85,.5) 25%, rgba(71,85,105,.6) 37%, rgba(51,65,85,.5) 63%); background-size: 400% 100%; }

/* the sun/moon button: a tiny turn as it switches */
[data-scheme-toggle] svg { transition: transform .4s var(--ease); }
[data-scheme-toggle]:hover svg { transform: rotate(20deg) scale(1.08); }

/* printing is always on white paper, whatever the screen shows */
@media print { html[data-scheme="dark"] { --bg: #fff; --surface: #fff; --card: #fff; --ink: #111; --ink-2: #333; --ink-3: #555; --line: #ccc; } }

/* ===== M73 · Pulse: the bell, the command palette, the chart kit, the risk pills, the install chip ===== */
.top-btn.bell { position: relative; } .top-badge[hidden] { display: none; } .top-badge { position: absolute; top: 5px; inset-inline-end: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); animation: page-in .3s var(--ease); }
.notif-panel { position: fixed; top: calc(var(--top-h) + 8px); inset-inline-end: 16px; width: min(380px, calc(100vw - 32px)); border-radius: var(--r-lg); z-index: 45; animation: modal-in .2s var(--ease); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.notif-list { max-height: 60vh; overflow-y: auto; } .notif-item { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; } .notif-item.unread { background: var(--accent-soft); } .notif-item:last-child { border-bottom: 0; }
.palette-bg { position: fixed; inset: 0; background: rgba(2, 6, 23, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px; animation: fade-in .15s var(--ease); }
.palette { width: 100%; max-width: 600px; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: modal-in .2s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-3); } .palette-input input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); min-width: 0; } .palette-input kbd { font: 11px/1 ui-monospace, Menlo, monospace; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-3); }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; } .palette-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink); min-height: 44px; } .palette-item > span { flex: 1; min-width: 0; } .palette-item em { font-style: normal; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; } .palette-item.active, .palette-item:hover { background: var(--accent-soft); color: var(--accent-2); } .palette-empty { padding: 20px; text-align: center; }
.chart svg { width: 100%; height: auto; display: block; } .chart text { font-family: inherit; } .spark { display: block; } .donut { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .donut-legend { display: flex; flex-direction: column; gap: 4px; font-size: 13px; } .donut-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }
.risk-high { background: var(--danger-soft); color: #BE123C; } .risk-watch { background: var(--sun-soft); color: #92400E; } .risk-ok { background: var(--teal-soft); color: #047857; }
html[data-scheme="dark"] .risk-high { color: #FDA4AF; } html[data-scheme="dark"] .risk-watch { color: #FCD34D; } html[data-scheme="dark"] .risk-ok { color: #6EE7B7; }
.ai-note { display: flex; gap: 8px; align-items: flex-start; line-height: 1.6; } .ai-note svg { flex: none; margin-top: 3px; }
.install-chip { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; font-size: 14px; color: var(--accent-2); background: var(--accent-soft); min-height: 44px; font-weight: 600; }
@media (max-width: 560px) { .app-top .top-btn[data-palette] { display: none; } }

/* ===== the brand mark (Edupotamia since 7 November; see the Edupotamia layer at the end) ===== */
.brand-mark { background: #0A0A0B; overflow: hidden; box-shadow: 0 4px 14px rgba(212, 172, 76, .35); } .brand-mark img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.hero-logo { width: 100%; max-width: 340px; border-radius: 14px; margin: 18px 0 4px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .14); }
@media (max-width: 900px) { .hero-logo { max-width: 260px; } }
.brand { white-space: nowrap; }

/* ===== 22 October · launch hardening: touch targets, scroll shadows, backdrop fallback, long strings, tablet grids ===== */
@media (pointer: coarse), (max-width: 767px) { /* fingers: nothing smaller than 44px on a touch screen or a phone-width window */
  .btn-sm, .segmented button, .chip, .lang button, .top-btn, .icon-btn, .side-group a, .side-foot a, .quiz-option, .country, .nav-links a, .palette-item, .demo-chip, .face { min-height: 44px; }
  .lang button, .segmented button { padding-inline: 12px; }
  .table td button, .table td a.btn { min-height: 40px; }
  .input, select.input { min-height: 46px; }
}
/* a table wider than the phone: it scrolls, and the fading edges say so */
.table-scroll, .card > .table, .card > div > .table { scrollbar-width: thin; }
@media (max-width: 560px) {
  .card > .table, .card > div > .table, .table-scroll { background: linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)), linear-gradient(to right, rgba(255,255,255,0), var(--surface) 70%) 100% 0, radial-gradient(farthest-side at 0 50%, rgba(15,23,42,.22), rgba(15,23,42,0)), radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,.22), rgba(15,23,42,0)) 100% 0; background-repeat: no-repeat; background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%; background-attachment: local, local, scroll, scroll; }
  html[data-scheme="dark"] .card > .table, html[data-scheme="dark"] .card > div > .table, html[data-scheme="dark"] .table-scroll { background: linear-gradient(to right, var(--bg-2) 30%, rgba(15,23,42,0)), linear-gradient(to right, rgba(15,23,42,0), var(--bg-2) 70%) 100% 0, radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.6), rgba(0,0,0,0)), radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.6), rgba(0,0,0,0)) 100% 0; background-repeat: no-repeat; background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%; background-attachment: local, local, scroll, scroll; }
}
/* no backdrop-filter (older browsers, "reduce transparency"): solid surfaces, nothing bleeds through */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav, .app-top, .app-side, .modal, .tabbar, .mobile-menu, .card, .home-tiles a, .lesson-ai, .notif-panel, .palette { background: var(--surface); }
  html[data-scheme="dark"] .nav, html[data-scheme="dark"] .app-top, html[data-scheme="dark"] .app-side, html[data-scheme="dark"] .modal, html[data-scheme="dark"] .tabbar, html[data-scheme="dark"] .mobile-menu, html[data-scheme="dark"] .card, html[data-scheme="dark"] .home-tiles a, html[data-scheme="dark"] .lesson-ai, html[data-scheme="dark"] .notif-panel, html[data-scheme="dark"] .palette { background: #111A2E; }
}
/* long e-mails, names, tokens and URLs never push a phone layout sideways */
.table td, .notif-item, .palette-item > span, .list-item, .msg, .notice, .card p, .card .small, .side-who b, .top-title span, .pill { overflow-wrap: anywhere; }
.pill { white-space: normal; }
.table td[dir="ltr"] { overflow-wrap: anywhere; }
/* tablets in portrait: multi-column grids become one column below 768px */
@media (max-width: 767px) { .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; } .uni-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) and (max-width: 1023px) { .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* modals on phones: a close target in reach of the thumb, full-width sheet from the bottom */
@media (max-width: 560px) { .modal-bg { align-items: flex-end; padding: 0; } .modal { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); animation: sheet-in .28s var(--ease); } .modal::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 14px; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* dark scheme: dark text on the lavender gradient (7:1) instead of white (3:1) */
html[data-scheme="dark"] .btn-primary, html[data-scheme="dark"] .btn-dark, html[data-scheme="dark"] .side-group a.active, html[data-scheme="dark"] .icon-btn, html[data-scheme="dark"] .msg-user, html[data-scheme="dark"] .grade-cell.active { color: #0B1220; }
html[data-scheme="dark"] .btn-primary:hover, html[data-scheme="dark"] .btn-dark:hover { color: #0B1220; }
html[data-scheme="dark"] .side-group a.active .side-ic { color: #0B1220; background: rgba(11, 18, 32, .14); } html[data-scheme="dark"] .side-group a.active .pill { color: #0B1220; background: rgba(11, 18, 32, .14); }

/* every table on a phone is its own horizontal scroller, however deep it sits; inline min-widths never beat the screen */
@media (max-width: 767px) {
  .table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .input, select.input, textarea.input { min-width: 0 !important; max-width: 100%; }
  .row > .input, .between > .input { flex: 1 1 160px; }
  #page img, #page video, #page iframe, #page svg:not(.spark) { max-width: 100%; }
}
/* grid and stack children may shrink below their content (a wide table scrolls inside its card instead of widening the page) */
.grid > *, .stack > *, .dash-main > *, .app-main #page > * { min-width: 0; }
/* long button labels (and their Kurdish / Arabic translations) wrap on phones instead of pushing the page sideways */
@media (max-width: 560px) { .btn { white-space: normal; height: auto; min-height: 44px; padding-block: 10px; line-height: 1.25; text-align: center; max-width: 100%; } .btn-sm { min-height: 40px; padding-block: 8px; } }

/* the public top bar on phones: logo, light/dark and the menu; the language and the design chooser move into the menu */
.mobile-menu-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; margin-top: auto; } .mobile-menu-tools .lang { font-size: 15px; } .mobile-menu-tools .lang button { min-height: 44px; padding: 0 14px; }
.mobile-menu .brand { gap: 10px; } .mobile-menu .brand .brand-mark { width: 32px; height: 32px; }
@media (max-width: 700px) { .nav .nav-tools .lang { display: none; } .nav .container { gap: 8px; } .nav .brand { font-size: 16px; min-width: 0; } .nav .nav-tools { gap: 4px; flex: none; } .nav .nav-tools .btn { padding: 0 10px; } }
@media (max-width: 360px) { .nav .brand { font-size: 15px; } .nav .container { padding: 0 12px; } }
@media (pointer: coarse), (max-width: 767px) { a.pill, button.pill { min-height: 44px; display: inline-flex; align-items: center; } .social a { width: 44px; height: 44px; } .nav .brand, .side-brand { min-height: 44px; } #page input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]) { min-height: 44px; } }
/* the footer on small phones: one column, links tall enough for a thumb */
@media (max-width: 420px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }
@media (pointer: coarse), (max-width: 767px) { .footer-col a { display: flex; align-items: center; min-height: 44px; } .footer-col { gap: 0; } }
/* small actions inside a pill (✕ remove) get a real hit area; the portal footer link too */
.pill > a[href="#"] { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; margin: -4px; margin-inline-start: 2px; border-radius: 999px; } .pill > a[href="#"]:hover { background: var(--danger-soft); }
@media (pointer: coarse), (max-width: 767px) { .pill > a[href="#"] { min-width: 40px; min-height: 40px; margin-block: -10px; } .portal-foot a { display: inline-flex; align-items: center; min-height: 44px; } }

/* the owner's View as picker and the Back to owner bar */
.view-as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.view-as { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: start; min-height: 64px; transition: border-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease); } .view-as:hover { border-color: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-md); } .view-as b { font-size: 14px; } .view-as span { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.viewing-as { position: fixed; z-index: 80; inset-inline: 50% auto; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; background: #0A0A0B; color: #F3D27A; box-shadow: 0 12px 30px rgba(0,0,0,.35); border: 1px solid rgba(243,210,122,.35); font-size: 14px; max-width: calc(100vw - 24px); } [dir="rtl"] .viewing-as { transform: translateX(50%); padding: 8px 16px 8px 8px; }
.viewing-as .btn { background: #F3D27A; color: #0A0A0B; border-radius: 999px; } .viewing-as svg { vertical-align: -2px; }
body.has-tabbar .viewing-as { bottom: calc(86px + env(safe-area-inset-bottom)); }
@media (max-width: 560px) { .view-as-btn span { display: none; } }

/* the top bar title is one line on phones: the school's name is cut with an ellipsis, never wrapped */
.app-top .top-title { flex: 1 1 auto; min-width: 0; } .app-top .top-title > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.app-top .top-right { flex: none; }
.app-top .top-title > span:first-child, .side-who b, .side-who div > span { unicode-bidi: plaintext; } /* a Latin name inside an Arabic or Kurdish bar keeps its own direction (ellipsis at its end) */
.top-badge { direction: ltr; unicode-bidi: isolate; }
/* 25 October · grids that set their own columns inline still stack to one column on phones (an inline style otherwise beats the stacking rule) */
@media (max-width: 767px) { .grid[style*="grid-template-columns"], .grid-2[style*="grid-template-columns"], div[style*="display:grid"][style*="grid-template-columns"] { grid-template-columns: 1fr !important; } }
/* 25 October · small text (e-mail lists, ids, references) may break anywhere rather than push a phone layout sideways */
.xs, .small, .muted, .pill, .notice { overflow-wrap: anywhere; }
/* the public top bar with a signed-in role's many links: the links scroll inside their own lane, fading at the edge; the tools never leave the screen */
.nav .container { min-width: 0; }
.nav .brand, .nav .nav-tools { flex: none; }
.nav-links { flex: 1 1 auto; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 28px), transparent 100%); padding-inline: 8px; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { flex: none; white-space: nowrap; }
/* 25 October · inline warm and red texts written for a light page stay readable in the dark */
html[data-scheme="dark"] [style*="color:#8a6100"], html[data-scheme="dark"] [style*="color:#8a5a00"], html[data-scheme="dark"] [style*="color:#b45309"], html[data-scheme="dark"] [style*="color:#b27600"], html[data-scheme="dark"] [style*="color: #b27600"] { color: #FCD34D !important; }
html[data-scheme="dark"] [style*="color:#b00"], html[data-scheme="dark"] [style*="color:#dc2626"], html[data-scheme="dark"] [style*="color:#c00"] { color: #FDA4AF !important; }
html[data-scheme="dark"] [style*="background:#fbeae8"], html[data-scheme="dark"] [style*="background:#fef2f2"] { background: var(--danger-soft) !important; }
html[data-scheme="dark"] [style*="background:#faf9f6"] { background: var(--soft-2) !important; color: var(--ink) !important; }
/* 25 October · the student pickers (cafeteria, cash, fees): rows and the filter box sized for a thumb */
@media (pointer: coarse), (max-width: 767px) { button[data-row] { min-height: 44px; padding-block: 10px !important; border-bottom: 1px solid var(--line) !important; } input[data-filter] { height: 44px !important; } }
button[data-row]:hover { background: var(--soft) !important; border-radius: 8px; }

/* 30 Oct · the home glow stays inside the screen on phones (it stuck out 20px and let the page slide sideways) */
@media (max-width: 767px) { .hero-bg { inset: -40px 0 auto; } }

/* =====================================================================================================================
   Edupotamia · the Examopotamia family look (7 November 2026). Canvas pages, white cards, a Forest side menu (the
   family's "primary on dark"), Teal actions, Gold used sparingly; Plus Jakarta Sans and Noto Kufi Arabic; a teal full
   stop after every page title. This layer only redefines tokens and a few components; everything above follows.
   ===================================================================================================================== */
:root {
  --forest: #1C3431; --ink-0: #0F1E1C; --graphite: #2A4643; --brand-teal: #0C7C6E; --brand-light-teal: #3FB5A3; --gold: #E3B04F; --canvas: #F3F1EC;
  --bg: #F3F1EC; --bg-2: #ECE9E2; --surface: #FFFFFF; --card: #FFFFFF; --soft: #EFEDE7; --soft-2: #F7F5F1;
  --ink: #0F1E1C; --ink-2: #2A4643; --ink-3: #6F6B62;
  --line: #E4E1D9; --line-2: #D0CCC1; --hair: transparent;
  --accent: #0C7C6E; --accent-2: #0A6A5E; --accent-3: #1C3431; --accent-soft: #E1F0EC; --accent-light: #3FB5A3; --accent-rgb: 12, 124, 110;
  --teal: #166B3A; --teal-soft: #E2EFE6; --sun: #B07A12; --sun-soft: #FBF1DC; --danger: #C62828; --danger-soft: #FBE7E5; --violet: #2A4643; --violet-soft: #E5ECEA; --sky: #0C7C6E; --sky-soft: #E1F0EC;
  --dark: #0F1E1C; --dark-2: #1C3431; --dark-3: #2A4643; --dark-text: #B9C9C5;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
  --shadow: 0 24px 48px -20px rgba(15, 30, 28, 0.22); --shadow-sm: 0 1px 2px rgba(15, 30, 28, 0.05);
  --shadow-md: 0 12px 28px -14px rgba(15, 30, 28, 0.22); --glow: 0 8px 20px -10px rgba(12, 124, 110, 0.5); --ring: 0 0 0 3px rgba(12, 124, 110, 0.22);
  --blur: none;
  --font: 'Plus Jakarta Sans', 'Noto Kufi Arabic', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-rtl: 'Noto Kufi Arabic', 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}
html[data-scheme="dark"] {
  --bg: #0F1E1C; --bg-2: #142824; --surface: #1C3431; --card: #1C3431; --soft: #24403C; --soft-2: #18302C;
  --ink: #F3F1EC; --ink-2: #C7D3D0; --ink-3: #9DB0AC;
  --line: rgba(243, 241, 236, 0.09); --line-2: rgba(243, 241, 236, 0.16); --hair: transparent;
  --accent: #3FB5A3; --accent-2: #74D1C3; --accent-3: #3FB5A3; --accent-soft: rgba(63, 181, 163, 0.16); --accent-light: #3FB5A3; --accent-rgb: 63, 181, 163;
  --teal: #6CCB92; --teal-soft: rgba(22, 107, 58, 0.28); --sun: #E3B04F; --sun-soft: rgba(227, 176, 79, 0.16); --danger: #EF7A72; --danger-soft: rgba(198, 40, 40, 0.2); --violet: #C7D3D0; --violet-soft: rgba(243, 241, 236, 0.08); --sky: #3FB5A3; --sky-soft: rgba(63, 181, 163, 0.16);
  --shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.6); --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-md: 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  --glow: 0 8px 20px -10px rgba(63, 181, 163, 0.5); --ring: 0 0 0 3px rgba(63, 181, 163, 0.3);
}
body { font-feature-settings: 'tnum' 0; letter-spacing: -0.005em; }
body::before, html[data-scheme="dark"] body::before { background: none; }
::selection { background: rgba(12, 124, 110, .2); }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.025em; }
h2, h3, h4 { font-weight: 700; }
td, .stat-value, .stat-num, .num, .table { font-variant-numeric: tabular-nums; }
/* the family signature: a teal full stop after the page title */
.app-main #page h1:not(.no-dot)::after, .section > h1::after, .container.section > .stack > div > h1::after { content: '.'; color: var(--accent); }

/* buttons: calm, flat, 8px corners; sentence case */
.btn { border-radius: 8px; font-weight: 600; }
.btn-primary { background: var(--brand-teal); color: #fff; box-shadow: none; } .btn-primary:hover { background: #0A6A5E; color: #fff; box-shadow: var(--glow); }
.btn-dark { background: var(--forest); color: #fff; box-shadow: none; } .btn-dark:hover { background: var(--graphite); color: #fff; box-shadow: none; }
html[data-scheme="dark"] .btn-primary { background: var(--brand-teal); } html[data-scheme="dark"] .btn-dark { background: #2A4643; }
.btn-outline { background: var(--surface); box-shadow: none; } .btn-outline:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.input, select.input, textarea.input { border-radius: 8px; } .input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.chip { border-radius: 999px; } .segmented { border-radius: 10px; } .segmented button { border-radius: 8px; }

/* cards: solid white on Canvas, a hairline and the faintest shadow — no glass */
.card, .home-tiles a { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--shadow-sm); }
.card { border-radius: var(--r-lg); }
.card.clickable:hover, .card-hover:hover { box-shadow: var(--shadow-md); border-color: var(--line-2); }
.card-dark { background: radial-gradient(120% 140% at 100% 0%, rgba(63, 181, 163, .22) 0%, rgba(63, 181, 163, 0) 55%), var(--forest); color: #fff; border-color: var(--forest); box-shadow: none; }
.card-dark .muted, .card-dark .muted-2 { color: #B9C9C5; }
.notice { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(12, 124, 110, .18); }
html[data-scheme="dark"] .notice { color: #BFE7E0; } html[data-scheme="dark"] .notice-warn { color: #F2D9A6; } html[data-scheme="dark"] .notice-danger { color: #F6C3BE; }
.pill-accent { background: var(--accent-soft); color: var(--accent-2); } .pill-teal { background: var(--teal-soft); color: var(--teal); } .pill-sun { background: var(--sun-soft); color: #7A5410; } .pill-danger { color: var(--danger); }
html[data-scheme="dark"] .pill-teal { color: #8FDDB0; } html[data-scheme="dark"] .pill-sun { color: #F2D9A6; } html[data-scheme="dark"] .pill-danger { color: #F6C3BE; } html[data-scheme="dark"] .pill-dark { background: #F3F1EC; color: #0F1E1C; }
.avatar { background: var(--accent-soft); color: var(--accent-2); }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.eyebrow-pill { background: var(--accent-soft); color: var(--accent-2); font-weight: 700; }
.progress > div { background: var(--brand-teal); }

/* stat cards and their badges: the palette, not the rainbow */
.stat-badge, .st-indigo .stat-badge { background: var(--accent-soft); color: var(--accent); border-radius: 10px; }
.st-teal .stat-badge { background: var(--teal-soft); color: var(--teal); } .st-sun .stat-badge { background: var(--sun-soft); color: #8A6416; } .st-red .stat-badge { background: var(--danger-soft); color: var(--danger); }
.st-violet .stat-badge, .st-orange .stat-badge { background: var(--violet-soft); color: var(--graphite); }
html[data-scheme="dark"] .st-sun .stat-badge { color: #E3B04F; } html[data-scheme="dark"] .st-violet .stat-badge, html[data-scheme="dark"] .st-orange .stat-badge { color: #C7D3D0; } html[data-scheme="dark"] .stat-badge, html[data-scheme="dark"] .st-indigo .stat-badge { color: #74D1C3; }
.home-tiles a { border-radius: 14px; } .home-tiles a:hover { border-color: var(--accent-light); color: var(--accent-2); }
.home-tiles a .side-ic { border-radius: 12px; }
.home-tiles a:nth-child(6n+1) .side-ic, .home-tiles a:nth-child(6n+5) .side-ic { background: var(--accent-soft); color: var(--accent); }
.home-tiles a:nth-child(6n+2) .side-ic { background: var(--violet-soft); color: var(--forest); }
.home-tiles a:nth-child(6n+3) .side-ic { background: var(--sun-soft); color: #8A6416; }
.home-tiles a:nth-child(6n+4) .side-ic { background: var(--teal-soft); color: var(--teal); }
.home-tiles a:nth-child(6n+6) .side-ic { background: var(--soft); color: var(--graphite); }
html[data-scheme="dark"] .home-tiles a .side-ic { color: #74D1C3 !important; } html[data-scheme="dark"] .home-tiles a:nth-child(6n+3) .side-ic { color: #E3B04F !important; }

/* the side menu is Forest in both schemes: the brand's primary-on-dark surface (tokens redefined inside it) */
.app-side {
  --ink: #F3F1EC; --ink-2: #C7D3D0; --ink-3: #93A7A3; --soft: rgba(243, 241, 236, .07); --soft-2: rgba(243, 241, 236, .04); --card: rgba(243, 241, 236, .06);
  --line: rgba(243, 241, 236, .09); --line-2: rgba(243, 241, 236, .16); --accent: #3FB5A3; --accent-2: #74D1C3; --accent-soft: rgba(63, 181, 163, .16); --accent-light: #3FB5A3;
  background: var(--forest); color: var(--ink); border-inline-end: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-scheme="dark"] .app-side { background: #142824; border-inline-end: 1px solid rgba(243, 241, 236, .06); }
.app-side .brand, .app-side .brand * { color: #fff; }
.side-group a:hover { background: rgba(243, 241, 236, .07); color: #fff; }
.side-group a.active { background: var(--brand-teal); color: #fff; box-shadow: none; }
.side-group a.active .side-ic { background: rgba(255, 255, 255, .14); color: #fff; }
.side-group a:hover .side-ic { color: #3FB5A3; }
.side-who { background: rgba(243, 241, 236, .06); border-color: rgba(243, 241, 236, .08); }
.side-who .avatar { background: var(--gold); color: var(--ink-0); }
.app-side::-webkit-scrollbar-thumb { background: rgba(243, 241, 236, .16); }

/* the top bar: Canvas, quiet */
.app-top { background: rgba(243, 241, 236, .9); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); }
html[data-scheme="dark"] .app-top { background: rgba(15, 30, 28, .9); }
.app-top .top-title .muted { color: var(--accent); }
.app-top .top-btn:hover, .top-btn:hover { border-color: transparent; }
.nav { background: rgba(243, 241, 236, .9); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); }
html[data-scheme="dark"] .nav { background: rgba(15, 30, 28, .9); }

/* the brand mark: the dark mark on a Forest rounded square, exactly like the app icon */
.brand-mark { background: var(--forest); box-shadow: none; border-radius: 9px; padding: 3px; }
.brand-mark img { border-radius: 0; }
.auth-hero .brand-mark, .app-side .brand-mark { background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.brand { font-weight: 800; letter-spacing: -0.02em; }

/* sign-in: the family's dark cover — Ink with a teal glow, the mark, and "by Examopotamia" */
.auth-hero { background: radial-gradient(90% 70% at 85% 10%, #2f5a52 0%, rgba(47, 90, 82, 0) 70%), var(--ink-0); box-shadow: 0 30px 60px -30px rgba(15, 30, 28, .6); border-radius: 22px; }
.auth-hero h1 { font-weight: 800; letter-spacing: -0.03em; }
.auth-hero h1::after { content: '.'; color: var(--brand-light-teal); }
.auth-hero li svg { background: rgba(63, 181, 163, .16); color: #74D1C3; }
.by-exam { display: flex; align-items: center; gap: 10px; margin-top: 28px; color: #B9C9C5; font-size: 13px; font-weight: 600; }
.by-exam img { width: 22px; height: 22px; }

/* the public home: calm Canvas with the family's teal-to-gold title */
.hero h1, html[data-scheme="dark"] .hero h1 { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--ink); -webkit-text-fill-color: currentColor; font-weight: 800; letter-spacing: -0.035em; }
.hero h1::after { content: '.'; color: var(--accent); }
.hero-bg { background: radial-gradient(60% 55% at 80% 30%, rgba(63, 181, 163, .16) 0%, rgba(63, 181, 163, 0) 70%), radial-gradient(40% 40% at 10% 80%, rgba(227, 176, 79, .12) 0%, rgba(227, 176, 79, 0) 70%); }
.demo-banner { background: var(--sun-soft); color: #7A5410; }
html[data-scheme="dark"] .demo-banner { background: rgba(227, 176, 79, .14); color: #F2D9A6; }
.tabbar a.active { color: var(--accent); }
:focus-visible { box-shadow: var(--ring); }
@media print { .app-main #page h1::after { color: #0C7C6E; } }
/* stat cards: one hairline all round — colour lives in the icon badge, not the frame */
.card.stat, .grid > .card.stat:nth-child(n), .uni-stats > .card.stat:nth-child(n) { border: 1px solid var(--line) !important; }
.card.stat .stat-value, .card.stat .stat-num { font-weight: 800; letter-spacing: -0.03em; }
/* M81 · the approvals count in the side menu and the tab bar, and the inbox rows */
.app-side .side-group a > .side-count, .app-side a .side-count, .tabbar a .side-count, .mobile-menu a .side-count { margin-inline-start: auto; flex: none; overflow: visible; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; direction: ltr; unicode-bidi: isolate; flex: none; }
.tabbar a .side-count { position: absolute; top: 2px; inset-inline-end: calc(50% - 22px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.tabbar a { position: relative; }
.card.appr81 { padding: 14px 16px; }

/* =====================================================================================================================
   M84 · the public home page and the user guide (7 November 2026). Real screenshots in a browser frame and a phone
   frame; canvas sections, one soft band, one Forest band; the teal full stop after every heading. Tokens only, so the
   dark scheme and right-to-left follow on their own.
   ===================================================================================================================== */
.eh { --eh-gap: clamp(56px, 7vw, 104px); }
.eh-dot { color: var(--brand-teal, var(--accent)); }
.eh-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.eh-eyebrow::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: var(--gold, #E3B04F); }
html[dir="rtl"] .eh-eyebrow { letter-spacing: 0; text-transform: none; font-size: 14px; }
.eh-h1 { font-size: clamp(34px, 3.6vw + 14px, 60px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 800; color: var(--ink); max-width: 15ch; }
html[dir="rtl"] .eh-h1 { line-height: 1.3; letter-spacing: 0; max-width: 18ch; }
.eh-lead { font-size: clamp(16px, .4vw + 15px, 19px); line-height: 1.65; color: var(--ink-2); max-width: 56ch; margin: 0; }
html[dir="rtl"] .eh-lead { line-height: 1.95; }
.eh-ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.eh-ctas .btn { gap: 8px; }
.eh-contact { margin: 0; font-size: 14px; color: var(--ink-3); }
.eh-contact b { color: var(--ink); font-weight: 600; }

/* hero */
.eh-hero { position: relative; overflow: hidden; padding-block: clamp(40px, 6vw, 88px) clamp(48px, 6vw, 96px); background: radial-gradient(1200px 520px at 85% -10%, rgba(var(--accent-rgb), .10), transparent 60%), radial-gradient(700px 360px at 0% 110%, rgba(227, 176, 79, .10), transparent 60%); }
html[dir="rtl"] .eh-hero { background: radial-gradient(1200px 520px at 15% -10%, rgba(var(--accent-rgb), .10), transparent 60%), radial-gradient(700px 360px at 100% 110%, rgba(227, 176, 79, .10), transparent 60%); }
.eh-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 4vw, 64px); align-items: center; }
.eh-hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.eh-hero-art { position: relative; min-width: 0; padding-block-end: 36px; padding-inline-end: 34px; }
.eh-hero-art .eh-frame { transform: perspective(1800px) rotateY(-7deg) rotateX(2deg); transform-origin: left center; }
html[dir="rtl"] .eh-hero-art .eh-frame { transform: perspective(1800px) rotateY(7deg) rotateX(2deg); transform-origin: right center; }
.eh-hero-art .eh-phone { position: absolute; inset-inline-end: 0; inset-block-end: 0; width: 27%; min-width: 108px; }

/* frames */
.eh-frame { margin: 0; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 80px -36px rgba(15, 30, 28, .45), 0 2px 6px rgba(15, 30, 28, .06); }
.eh-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
.eh-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.eh-bar span { margin-inline-start: 10px; font-size: 11px; color: var(--ink-3); background: var(--surface); border-radius: 6px; padding: 3px 10px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eh-frame img, .eh-phone img, .eh-card-img img { display: block; width: 100%; height: auto; max-width: 100%; }
.eh-phone { margin: 0; border-radius: 26px; padding: 7px; background: #0F1E1C; box-shadow: 0 30px 60px -24px rgba(15, 30, 28, .55); }
.eh-phone img { border-radius: 20px; }

/* facts strip */
.eh-facts { border-block: 1px solid var(--line); background: var(--surface); }
.eh-facts ul { list-style: none; margin: 0; padding: 18px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 28px; }
.eh-facts li { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.eh-fi, .eh-ri, .eh-si { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }

/* features */
.eh-feats { display: flex; flex-direction: column; gap: var(--eh-gap); padding-block: var(--eh-gap); }
.eh-feat, .eh-g-sec { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.eh-flip .eh-feat-copy, .eh-flip .eh-g-copy { order: 2; }
.eh-feat-copy, .eh-g-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.eh-feat-copy h2, .eh-g-copy h2, .eh-head h2, .eh-end h2 { font-size: clamp(26px, 1.6vw + 16px, 38px); line-height: 1.12; letter-spacing: -0.03em; }
html[dir="rtl"] .eh-feat-copy h2, html[dir="rtl"] .eh-g-copy h2, html[dir="rtl"] .eh-head h2, html[dir="rtl"] .eh-end h2 { line-height: 1.4; letter-spacing: 0; }
.eh-feat-copy > p, .eh-g-copy > p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.7; max-width: 52ch; }
.eh-feat-art, .eh-g-art { min-width: 0; }
.eh-k { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--accent); }
.eh-k b { font-size: 12px; font-weight: 700; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; }
.eh-ticks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.eh-ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink); line-height: 1.5; }
.eh-ticks li svg { flex: none; margin-top: 3px; color: #fff; background: var(--accent); border-radius: 50%; padding: 3px; width: 20px; height: 20px; }

/* section heads and bands */
.eh-head { display: flex; flex-direction: column; gap: 10px; max-width: 680px; margin-bottom: clamp(28px, 3vw, 44px); }
.eh-head p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.eh-band { background: var(--bg-2); padding-block: var(--eh-gap); }
.eh-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.eh-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; min-width: 0; transition: transform var(--t, .2s) ease, box-shadow var(--t, .2s) ease; }
.eh-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.eh-card-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); border-bottom: 1px solid var(--line); max-width: 100%; }
.eh-card-img img { object-fit: cover; object-position: top left; height: 100%; }
html[dir="rtl"] .eh-card-img img { object-position: top right; }
.eh-card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.eh-card-body h3 { font-size: 20px; }
.eh-card-body p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.eh-card-body .eh-ticks li { font-size: 14px; }

/* roles */
.eh-roles { padding-block: var(--eh-gap); }
.eh-role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.eh-role { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; row-gap: 3px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.eh-role .eh-ri { grid-row: span 2; }
.eh-role b { font-size: 15.5px; color: var(--ink); }
.eh-role span:last-child { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }

/* phones */
.eh-phone-row { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; gap: clamp(20px, 4vw, 56px); }
.eh-phone-cell { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.eh-phone-cell:nth-child(2) { transform: translateY(-24px); }
.eh-phone-cell span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-align: center; }

/* the Forest band */
.eh-dark { background: #0F1E1C; color: #F3F1EC; padding-block: var(--eh-gap); background-image: radial-gradient(900px 400px at 90% 0%, rgba(63, 181, 163, .16), transparent 60%); }
.eh-dark .eh-head p { color: #B9C9C5; }
.eh-dark .eh-dot { color: #3FB5A3; }
.eh-sec-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.eh-sec { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 16px; background: rgba(243, 241, 236, .05); border: 1px solid rgba(243, 241, 236, .10); min-width: 0; }
.eh-sec .eh-si { background: rgba(63, 181, 163, .16); color: #3FB5A3; }
.eh-sec b { font-size: 16px; color: #F3F1EC; }
.eh-sec p { margin: 0; font-size: 14px; line-height: 1.65; color: #B9C9C5; }

/* faq and the closing card */
.eh-faq { padding-block: var(--eh-gap) 0; max-width: 860px; }
.eh-faq .faq { display: flex; flex-direction: column; gap: 10px; }
.eh-faq details p { color: var(--ink-2); line-height: 1.75; }
.eh-end-wrap { padding-block: var(--eh-gap); }
.eh-end { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: clamp(28px, 4vw, 52px); border-radius: 24px; background: linear-gradient(135deg, #1C3431, #0C7C6E 160%); color: #F3F1EC; }
.eh-end h2 { color: #F3F1EC; }
.eh-end p { margin: 10px 0 0; color: #CFE0DC; line-height: 1.7; max-width: 52ch; }
.eh-end .eh-dot { color: #E3B04F; }
.eh-end-act { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; min-width: 0; }
.eh-mail { font-size: clamp(18px, 1.2vw + 12px, 24px); font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.eh-on-dark { color: #F3F1EC; } .eh-on-dark:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* the guide */
.eh-g-head { display: flex; flex-direction: column; gap: 18px; padding-block: clamp(36px, 5vw, 72px) clamp(20px, 3vw, 36px); }
.eh-g-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.eh-g-sec { padding-block: clamp(36px, 5vw, 72px); border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.eh-g-copy .btn { align-self: flex-start; }
.eh-steps { list-style: none; counter-reset: s; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.eh-steps li { counter-increment: s; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15.5px; line-height: 1.65; color: var(--ink); }
.eh-steps li::before { content: counter(s); display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.eh-g-phone { display: flex; justify-content: center; }
.eh-g-phone .eh-phone { width: min(300px, 70%); }

@media (max-width: 960px) {
  .eh-hero-in, .eh-feat, .eh-g-sec, .eh-end { grid-template-columns: minmax(0, 1fr); }
  .eh-flip .eh-feat-copy, .eh-flip .eh-g-copy { order: 0; }
  .eh-hero-art .eh-frame, html[dir="rtl"] .eh-hero-art .eh-frame { transform: none; }
  .eh-facts ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eh-trio, .eh-sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eh-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .eh-hero-art { padding-inline-end: 22px; padding-block-end: 26px; }
  .eh-facts ul, .eh-trio, .eh-sec-grid, .eh-role-grid { grid-template-columns: minmax(0, 1fr); }
  .eh-phone-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .eh-phone-cell:nth-child(2) { transform: none; }
  .eh-phone { border-radius: 16px; padding: 4px; } .eh-phone img { border-radius: 13px; }
  .eh-phone-cell span { font-size: 11.5px; }
  .eh-ctas .btn-lg { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .eh-card, .eh-card:hover { transition: none; transform: none; } }

/* =====================================================================================================================
   M86 · the Modules page: one card per module — icon, name, switch, one line, three things it offers, a way in.
   ===================================================================================================================== */
.mod86-group { display: flex; flex-direction: column; gap: 12px; }
.mod86-gh { font-size: 15px; font-weight: 700; letter-spacing: .02em; color: var(--ink); margin: 0; }
.mod86-gh::after { content: none; }
.mod86-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mod86 { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; opacity: .78; transition: opacity .2s, border-color .2s, box-shadow .2s; }
.mod86.on { opacity: 1; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-sm); }
.mod86-top { display: flex; align-items: center; gap: 10px; }
.mod86-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--soft); color: var(--ink-3); }
.mod86.on .mod86-ic { background: var(--accent-soft); color: var(--accent); }
.mod86-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mod86-name b { font-size: 15px; }
.mod86-desc { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.mod86-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mod86-feats li { position: relative; padding-inline-start: 18px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.mod86-feats li::before { content: ''; position: absolute; inset-inline-start: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-light); }
.mod86-open { margin-top: auto; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--accent); }
.sw86 { position: relative; flex: none; width: 42px; height: 24px; cursor: pointer; }
.sw86 input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sw86 span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.sw86 span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.sw86 input:checked + span { background: var(--accent); }
.sw86 input:checked + span::after { transform: translateX(18px); }
html[dir="rtl"] .sw86 input:checked + span::after { transform: translateX(-18px); }
.sw86 input:focus-visible + span { box-shadow: var(--ring); }
.sw86 input:disabled + span { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .mod86, .sw86 span, .sw86 span::after { transition: none; } }
