/*
  assets/theme.css - Wadyy design system (loaded after styles.css)
  -----------------------------------------------------------------
  1. Self-hosted fonts (no Google servers: GDPR)
  2. Colour tokens: light (navy) and dark
  3. Base polish shared by all pages
  4. Theme switch button
  5. Lesson notes ("lp" = lesson prose) and the content blocks
     teachers can use: ayah, hadith, key point, example, question,
     warning, definitions, comparison, steps, timeline, tree, summary
*/

/* ───────── 1. Fonts ───────── */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/source-serif-4-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/source-serif-4-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/source-serif-4-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/source-serif-4-latin-ext-400-italic.woff2) format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/source-serif-4-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/source-serif-4-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/source-serif-4-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/source-serif-4-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/amiri-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'Amiri'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/amiri-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0898-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }

/* ───────── 2. Colour tokens ───────── */
:root {
  color-scheme: light;
  --bg: #f6f7fa;
  --bg-sidebar: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f3f5f9;
  --surface-2: #f0f3f8;
  --border: #e3e8f0;
  --border-light: #edf0f5;
  --text: #18212f;
  --text-secondary: #485466;
  --text-muted: #647083;
  --primary: #2e4a7d;
  --primary-dark: #233a63;
  --primary-light: #e9eef7;
  --on-primary: #ffffff;
  --accent: #3f9a74;
  --accent-light: #e5f3ec;
  --gold: #8a611a;
  --gold-light: #faf4e8;
  --success: #3f9a74;
  --warning: #b7791f;
  --danger: #c84b4b;
  --danger-light: #fbeeee;
  --mark: #fdeeb5;
  --paper: #fcfbf8;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.08);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-ar: 'Amiri', 'Traditional Arabic', 'Scheherazade New', serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10141c;
  --bg-sidebar: #141a24;
  --surface: #181e29;
  --surface-hover: #1f2634;
  --surface-2: #1d2430;
  --border: #2a3242;
  --border-light: #232b39;
  --text: #e4e8ef;
  --text-secondary: #b4bdcc;
  --text-muted: #8592a6;
  --primary: #7896d4;
  --primary-dark: #9ab1e2;
  --primary-light: rgba(120, 150, 212, 0.14);
  --on-primary: #0f1522;
  --accent: #62bd95;
  --accent-light: rgba(98, 189, 149, 0.14);
  --gold: #d4ad63;
  --gold-light: #1d2433;
  --success: #62bd95;
  --warning: #e0a94a;
  --danger: #e47a7a;
  --danger-light: rgba(228, 122, 122, 0.12);
  --mark: rgba(240, 200, 90, 0.28);
  --paper: var(--surface);
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ───────── 3. Base polish ───────── */
body { font-family: var(--font-ui); font-size: 14.5px; -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--text); }
.h1, .h2, .page-title { letter-spacing: -0.02em; }
.page-title { font-weight: 700; }
.kicker { letter-spacing: 0.08em; font-weight: 600; }
.card, .stat-card { box-shadow: var(--shadow-sm); }
.btn { color: var(--on-primary); font-weight: 600; }
.btn.secondary { color: var(--text); }
input, select, textarea { background: var(--surface); color: var(--text); border-color: var(--border); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
.arabic, [lang="ar"], .ar { font-family: var(--font-ar); }
mark { background: var(--mark); color: inherit; padding: 0 3px; border-radius: 3px; }
::selection { background: var(--primary-light); }
:root[data-theme="dark"] img.logo-invert { filter: invert(1) hue-rotate(180deg); }

/* ───────── 4. Theme switch ───────── */
.theme-toggle { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; flex-shrink: 0; padding: 0; }
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ───────── 5. Lesson notes ───────── */
.lp {
  --lp-size: 17px;
  max-width: 760px; margin: 0 auto;
  font-family: var(--font-serif); font-size: var(--lp-size); line-height: 1.75;
  color: var(--text); counter-reset: lp-section;
}
.lp > :first-child { margin-top: 0 !important; }
.lp p { margin: 0 0 1em; }
.lp strong, .lp b { font-weight: 700; color: var(--text); }
.lp em { font-style: italic; }
.lp a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }

/* Section heading: roman numeral + rule, like the handouts */
.lp h3 {
  counter-increment: lp-section;
  font-family: var(--font-serif); font-size: 1.45em; font-weight: 600; line-height: 1.3;
  color: var(--text); margin: 2.2em 0 0.9em; padding-bottom: 0.45em;
  border-bottom: 2px solid var(--text); display: flex; align-items: baseline; gap: 0.6em;
}
.lp h3::before { content: counter(lp-section, upper-roman); font-weight: 400; color: var(--primary); font-size: 0.95em; min-width: 1.2em; }
:root[data-theme="dark"] .lp h3 { border-bottom-color: var(--border); }

/* Sub heading: small capitals label with a dash */
.lp h4 {
  font-family: var(--font-ui); font-size: 0.72em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--primary); margin: 2em 0 0.8em; display: flex; align-items: center; gap: 10px; line-height: 1.4;
}
.lp h4::before { content: ''; width: 18px; height: 2px; background: currentColor; flex-shrink: 0; }
.lp h5 { font-family: var(--font-ui); font-size: 0.85em; font-weight: 700; margin: 1.4em 0 0.5em; color: var(--text); }

/* Lists with small diamonds */
.lp ul, .lp ol { margin: 0 0 1.1em; padding-left: 1.6em; }
.lp li { margin: 0.35em 0; padding-left: 0.2em; }
.lp ul > li { list-style: none; position: relative; }
.lp ul > li::before { content: ''; position: absolute; left: -1.05em; top: 0.72em; width: 6px; height: 6px; background: var(--primary); transform: rotate(45deg); }
.lp ol > li::marker { color: var(--primary); font-family: var(--font-ui); font-weight: 700; font-size: 0.85em; }

/* Tables: dark header, calm rows */
.lp table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.2em 0 1.6em; font-family: var(--font-ui); font-size: 0.84em; line-height: 1.55; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: table; }
.lp thead th { background: var(--primary); color: var(--on-primary); text-align: left; font-weight: 600; font-size: 0.82em; letter-spacing: 0.08em; text-transform: uppercase; padding: 11px 14px; }
:root[data-theme="dark"] .lp thead th { background: #243251; color: var(--text); }
.lp td { padding: 11px 14px; border-top: 1px solid var(--border-light); vertical-align: top; color: var(--text-secondary); }
.lp tbody tr:nth-child(even) td { background: var(--surface-2); }
.lp td:first-child { font-weight: 600; color: var(--text); }
.lp td [lang="ar"], .lp td[lang="ar"] { font-size: 1.35em; font-weight: 400; }
@media (max-width: 640px) { .lp table { display: block; overflow-x: auto; } }

/* Plain quotes (verses or hadith in English) */
.lp blockquote {
  margin: 1.3em 0; padding: 14px 18px 14px 20px; background: var(--primary-light);
  border-left: 3px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text); line-height: 1.65;
}
.lp blockquote .lp-ref { color: var(--primary); }
.lp blockquote p:last-child { margin-bottom: 0; }

/* Arabic inside notes */
.lp [lang="ar"], .lp .ar { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; font-style: normal; }
.lp p > [lang="ar"], .lp li > [lang="ar"] { font-size: 1.25em; }

/* Reference line (surah:ayah, hadith source) */
.lp .lp-ref { display: block; margin-top: 8px; font-family: var(--font-ui); font-style: normal; font-size: 0.68em; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

/* Ayah box: large Arabic centred, meaning under it */
.lp .lp-ayah { margin: 1.6em 0; padding: 22px 24px 18px; background: var(--primary-light); border-left: 3px solid var(--primary); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; text-align: center; }
.lp .lp-ayah .lp-ar { display: block; font-family: var(--font-ar); direction: rtl; font-size: 1.75em; line-height: 2; color: var(--text); margin-bottom: 6px; }
.lp .lp-ayah .lp-tr { display: block; font-style: italic; color: var(--text-secondary); }
.lp .lp-ayah .lp-ref { color: var(--primary); }

/* Hadith box: warm paper */
.lp .lp-hadith { margin: 1.4em 0; padding: 16px 20px; background: var(--gold-light); border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
.lp .lp-hadith .lp-ar { display: block; font-style: normal; text-align: right; font-family: var(--font-ar); direction: rtl; font-size: 1.45em; line-height: 1.9; margin-bottom: 6px; }

/* Callouts: label on top, coloured bar on the left */
.lp .lp-box { margin: 1.4em 0; padding: 14px 18px 14px 18px; border-radius: var(--radius); border: 1px solid var(--border); border-left-width: 3px; background: var(--surface); }
.lp .lp-box > :last-child { margin-bottom: 0; }
.lp .lp-box::before { display: block; font-family: var(--font-ui); font-size: 0.66em; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 6px; }
.lp .lp-key { border-left-color: var(--primary); background: var(--primary-light); border-color: transparent; border-left-color: var(--primary); }
.lp .lp-key::before { content: 'Key point'; color: var(--primary); }
.lp .lp-key > p:first-child { font-size: 1.05em; }
.lp .lp-example { border-left-color: var(--accent); }
.lp .lp-example::before { content: 'Example'; color: var(--accent); }
.lp .lp-question { border-left-color: var(--gold); }
.lp .lp-question::before { content: 'Common question'; color: var(--gold); }
.lp .lp-warn { border-left-color: var(--danger); background: var(--danger-light); border-color: transparent; border-left-color: var(--danger); }
.lp .lp-warn::before { content: 'Be careful'; color: var(--danger); }
.lp .lp-note::before { content: 'Note'; color: var(--text-muted); }
.lp .lp-box[data-label]::before { content: attr(data-label); }

/* Definitions table: Arabic | Term | Meaning */
.lp table.lp-def td:first-child { font-family: var(--font-ar); font-size: 1.5em; font-weight: 400; text-align: center; white-space: nowrap; direction: rtl; width: 1%; }
.lp table.lp-def td:nth-child(2) { font-weight: 700; color: var(--text); white-space: nowrap; }
@media (max-width: 640px) { .lp table.lp-def td:first-child, .lp table.lp-def td:nth-child(2) { white-space: normal; } .lp table.lp-def td:first-child { font-size: 1.25em; width: auto; } }

/* Two columns side by side (comparison) */
.lp .lp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.4em 0; }
.lp .lp-compare > div { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); font-size: 0.92em; }
.lp .lp-compare > div > :last-child { margin-bottom: 0; }
.lp .lp-compare .lp-col-title { display: block; font-family: var(--font-ui); font-size: 0.72em; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--primary); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.lp .lp-compare > div:nth-child(2) .lp-col-title { color: var(--gold); }
.lp .lp-compare-vs { position: relative; }
@media (max-width: 640px) { .lp .lp-compare { grid-template-columns: 1fr; } }

/* Steps with arrows (an order or a chain) */
.lp .lp-steps { display: flex; align-items: stretch; gap: 0; margin: 1.6em 0; counter-reset: lp-step; flex-wrap: wrap; row-gap: 12px; }
.lp .lp-step { counter-increment: lp-step; flex: 1 1 0; min-width: 120px; position: relative; padding: 14px 14px 12px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: var(--radius); font-family: var(--font-ui); font-size: 0.8em; line-height: 1.45; color: var(--text-secondary); margin-right: 26px; }
.lp .lp-step:last-child { margin-right: 0; }
.lp .lp-step::before { content: counter(lp-step); display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 0.85em; align-items: center; justify-content: center; margin-bottom: 8px; }
.lp .lp-step:not(:last-child)::after { content: ''; position: absolute; right: -20px; top: 50%; width: 12px; height: 12px; border-top: 2px solid var(--text-muted); border-right: 2px solid var(--text-muted); transform: translateY(-50%) rotate(45deg); }
.lp .lp-step b, .lp .lp-step strong { display: block; font-size: 1.15em; color: var(--text); margin-bottom: 2px; }
.lp .lp-step [lang="ar"] { display: block; font-size: 1.5em; color: var(--primary); line-height: 1.5; }
@media (max-width: 640px) {
  .lp .lp-steps { flex-direction: column; }
  .lp .lp-step { margin-right: 0; margin-bottom: 22px; }
  .lp .lp-step:last-child { margin-bottom: 0; }
  .lp .lp-step:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -18px; transform: translateX(-50%) rotate(135deg); }
}

/* Timeline (dates and events) */
.lp .lp-timeline { margin: 1.6em 0; padding-left: 22px; border-left: 2px solid var(--border); font-family: var(--font-ui); font-size: 0.86em; }
.lp .lp-event { position: relative; padding: 0 0 18px 14px; }
.lp .lp-event:last-child { padding-bottom: 0; }
.lp .lp-event::before { content: ''; position: absolute; left: -29px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.lp .lp-when { display: block; font-size: 0.78em; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.lp .lp-event b, .lp .lp-event strong { display: block; color: var(--text); font-size: 1.05em; }
.lp .lp-event p { margin: 2px 0 0; color: var(--text-secondary); line-height: 1.55; }

/* Tree (one idea with branches, like a mind map) */
.lp .lp-tree { margin: 1.6em 0; font-family: var(--font-ui); font-size: 0.85em; }
.lp .lp-root { display: inline-block; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius); font-weight: 700; font-size: 1.05em; }
.lp .lp-root [lang="ar"] { font-size: 1.3em; margin-left: 8px; font-weight: 400; }
:root[data-theme="dark"] .lp .lp-root { background: #243251; color: var(--text); }
.lp .lp-branches { margin: 0 0 0 18px; padding: 10px 0 0 22px; border-left: 2px solid var(--border); }
.lp .lp-branch { position: relative; margin: 0 0 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); color: var(--text-secondary); line-height: 1.5; }
.lp .lp-branch::before { content: ''; position: absolute; left: -25px; top: 50%; width: 22px; height: 2px; background: var(--border); }
.lp .lp-branch:last-child { margin-bottom: 0; }
.lp .lp-branch b, .lp .lp-branch strong { color: var(--text); }

/* Two equal columns of normal content */
.lp .lp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 640px) { .lp .lp-cols { grid-template-columns: 1fr; } }

/* Summary at the end */
.lp .lp-summary { margin: 2.4em 0 0; padding: 18px 22px; background: var(--surface-2); border-radius: var(--radius-lg); border: 1px solid var(--border); }
.lp .lp-summary h4 { margin-top: 0; }
.lp .lp-summary ul { margin-bottom: 0; font-size: 0.93em; }

/* Big one-line statement */
.lp .lp-statement { font-size: 1.25em; line-height: 1.5; font-weight: 600; text-align: center; margin: 1.4em auto; max-width: 600px; color: var(--text); }
.lp .lp-statement::before, .lp .lp-statement::after { content: ''; display: block; width: 40px; height: 2px; background: var(--gold); margin: 12px auto; }

@media (max-width: 640px) { .lp { --lp-size: 16px; } .lp h3 { font-size: 1.3em; } }

/* Small centred caption under a diagram */
.lp .lp-caption { text-align: center; color: var(--text-muted); font-size: 0.88em; margin-top: -0.4em; }
.lp .lp-caption .lp-ref { display: inline; margin: 0; }
.lp .lp-muted { color: var(--text-muted); }

/* Steps: centred content */
.lp .lp-step { text-align: center; }
.lp .lp-step::before { margin-left: auto; margin-right: auto; display: flex; }
.lp .lp-step [lang="ar"] { margin-bottom: 2px; }

/* Grid of equal cards, no order (e.g. the six pillars) */
.lp .lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 1.4em 0; counter-reset: lp-card; }
.lp .lp-card { counter-increment: lp-card; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-ui); font-size: 0.8em; line-height: 1.45; color: var(--text-secondary); }
.lp .lp-card::before { content: counter(lp-card); display: block; font-size: 0.85em; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.lp .lp-card b, .lp .lp-card strong { display: block; font-size: 1.15em; color: var(--text); }
.lp .lp-grid.lp-unnumbered .lp-card::before { display: none; }

/* Hadith keeps the gold reference; ayat use navy */
.lp .lp-hadith .lp-ref { color: var(--gold); }

/* Lesson text sits on warm paper (light mode) */
#section-notes, #section-notes .collapsible-header { background: var(--paper); }

/* Avatar in the brand colour */
.user-avatar, .header-avatar { background: var(--primary) !important; color: var(--on-primary) !important; }

/* Sisters-only marker */
:root { --sisters: #b4467a; --sisters-light: #fbeef4; }
:root[data-theme="dark"] { --sisters: #e58fb6; --sisters-light: rgba(229, 143, 182, 0.12); }

/* ───────── Course card picture ───────── */
.wthumb { position: relative; aspect-ratio: 16 / 7; background: #1f3358; color: #fff; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px 18px; }
.wthumb::before { content: ''; position: absolute; inset: 0; opacity: .09; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 0L56 28L28 56L0 28Z' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Ccircle cx='28' cy='28' r='10' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E"); background-size: 56px 56px; }
.wthumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(10, 18, 34, .55)); }
.wthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wthumb-cat, .wthumb-title, .wthumb-badge, .wthumb-sisters { position: relative; z-index: 1; }
.wthumb-cat { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #c9d6ee; }
.wthumb-title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; line-height: 1.25; margin-top: 4px; }
.wthumb-badge { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.95); color: #1f3358; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.wthumb-sisters { position: absolute; top: 12px; left: 12px; background: var(--sisters); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
:root[data-theme="dark"] .wthumb { background: #1b2a47; }

/* ───────── Lesson page: curriculum shows only the current unit open ───────── */
.unit-block:not(.exam-block) > .unit-title { cursor: pointer; padding: 8px 0; }
.unit-block:not(.exam-block) > .unit-title > span:first-child::before { content: '›'; display: inline-block; width: 14px; color: var(--text-muted); transition: transform .15s; }
.unit-block.open > .unit-title > span:first-child::before, .unit-block.is-current > .unit-title > span:first-child::before { transform: rotate(90deg); }
.unit-block:not(.exam-block):not(.is-current):not(.open) > .lesson-list { display: none; }
.unit-block.is-current { background: var(--primary-light); }
.unit-block { margin-bottom: 4px; }
bdi { unicode-bidi: isolate; }

/* Live class banner (dashboard) */
.live-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 24px; }
.live-banner.is-live { border-left-color: var(--danger); }
.live-banner-kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }
.live-banner.is-live .live-banner-kicker { color: var(--danger); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: wlive 1.2s infinite; }
@keyframes wlive { 50% { opacity: .3; } }
.live-banner-title { font-size: 17px; font-weight: 700; color: var(--text); }
.live-banner-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Public navbar (contact, about, legal pages) */
.navbar { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.navbar .logo-text, .navbar-logo { color: var(--text); }

/* ───────── Course files list ───────── */
.cfiles { list-style: none; margin: 0; padding: 0; }
.cfiles li { border-bottom: 1px solid var(--border-light); }
.cfiles li:last-child { border-bottom: none; }
.cfiles li > a, .cfiles li > span { display: flex; align-items: center; gap: 12px; padding: 11px 2px; color: var(--text); }
.cfiles li > a:hover .cfile-name bdi { color: var(--primary); }
.cfiles li.locked { opacity: .6; }
.cfile-kind { flex-shrink: 0; min-width: 44px; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 5px 6px; border-radius: 6px; background: var(--primary-light); color: var(--primary); }
.cfile-name { flex: 1; min-width: 0; font-weight: 500; font-size: 14px; line-height: 1.35; }
.cfile-name small { display: block; color: var(--text-muted); font-weight: 400; font-size: 12px; }
.cfile-go { color: var(--text-muted); font-size: 14px; }
.cfiles.compact .cfile-name { font-size: 13px; }
.cfiles.compact .cfile-kind { min-width: 38px; font-size: 9px; }

/* Steps: long words wrap; 5 or more steps become a vertical chain */
.lp .lp-step { overflow-wrap: anywhere; hyphens: auto; min-width: 128px; }
.lp .lp-steps:has(> .lp-step:nth-child(5)) { flex-direction: column; gap: 0; }
.lp .lp-steps:has(> .lp-step:nth-child(5)) > .lp-step {
  display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: baseline;
  text-align: left; margin: 0 0 18px; border-top-width: 1px; border-left: 3px solid var(--primary); padding: 10px 14px; min-width: 0;
}
.lp .lp-steps:has(> .lp-step:nth-child(5)) > .lp-step:last-child { margin-bottom: 0; }
.lp .lp-steps:has(> .lp-step:nth-child(5)) > .lp-step::before { grid-row: 1 / span 3; margin: 0; }
.lp .lp-steps:has(> .lp-step:nth-child(5)) > .lp-step > * { grid-column: 2; }
.lp .lp-steps:has(> .lp-step:nth-child(5)) > .lp-step:not(:last-child)::after { right: auto; left: 22px; top: auto; bottom: -15px; width: 8px; height: 8px; transform: rotate(135deg); }
.lp .lp-timeline { margin-left: 8px; }

/* ═══════════ Lesson page: outline + video + tabs ═══════════ */
.lesson-layout { grid-template-columns: 290px minmax(0, 1fr); gap: 28px; margin-top: 0; align-items: start; }
.lnav { position: sticky; top: 92px; max-height: calc(100vh - 110px); }
.lnav-full { padding: 18px !important; max-height: calc(100vh - 110px); overflow-y: auto; }
.lnav-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lnav-course { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--text); }
.lnav-course:hover { color: var(--primary); }
.lnav-toggle { width: 34px; height: 34px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; padding: 0; font-size: 14px; }
.lnav-toggle:hover { color: var(--primary); border-color: var(--primary); }
.lnav-progress { margin: 12px 0 6px; font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.lnav-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.lnav-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.lnav .curriculum { margin-top: 10px; }
.lnav-rail { display: none; }
/* collapsed */
.lnav-collapsed .lesson-layout { grid-template-columns: 60px minmax(0, 1fr); }
.lnav-collapsed .lnav-full { display: none; }
.lnav-collapsed .lnav-rail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; max-height: calc(100vh - 110px); overflow-y: auto; }
.lnav-rail .lnav-toggle { margin-bottom: 4px; }
.lnav-u { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.lnav-u:hover { border-color: var(--primary); color: var(--primary); }
.lnav-u.done { border-color: var(--accent); color: var(--accent); }
.lnav-u.cur { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* main column */
.lmain { min-width: 0; }
.lmain #section-video { border: 0; background: transparent; margin-bottom: 0; }
.lmain #section-video > .collapsible-header { display: none; }
.lmain #section-video > .collapsible-body { display: block; padding: 0; }
.lmain #section-video .card-title { display: none; }
.lmain #section-video iframe, .lmain #section-video video, .lmain #section-video .video-wrapper { border-radius: 14px; overflow: hidden; }
.lhead { margin: 18px 0 0; }
.lmain > .lhead:first-child, .lmain > #section-video[style*="none"] + .lhead { margin-top: 0; }
.lhead-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.lhead-kick { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }
.lhead-title { font-family: var(--font-serif); font-weight: 600; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; color: var(--text); margin: 0; }
.lhead-nav { display: flex; gap: 8px; flex-shrink: 0; }
.lhead-nav .btn { padding: 10px 16px; }
.lhead-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.lhead-meta .ok { color: var(--accent); font-weight: 600; }
.lhead-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.lbtn { display: inline-flex; align-items: center; gap: 6px; width: auto !important; height: auto !important; padding: 7px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lbtn:hover, .lbtn.active { color: var(--primary); border-color: var(--primary); }
.lbtn svg { width: 15px !important; height: 15px !important; }

.ltabs { position: sticky; top: 76px; z-index: 6; display: flex; gap: 4px; margin: 16px 0 14px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow-sm); }
.ltabs::-webkit-scrollbar { display: none; }
.ltab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.ltab:hover { color: var(--text); background: var(--surface-hover); }
.ltab.on { background: var(--primary); color: var(--on-primary); }
.ltab .ct { font-size: 11px; background: var(--surface-2); color: var(--text-muted); padding: 1px 7px; border-radius: 10px; }
.ltab.on .ct { background: rgba(255,255,255,.22); color: inherit; }
.ltab .ck { display: none; color: var(--accent); font-size: 12px; }
.ltab.done .ck { display: inline; }
.ltab.on .ck { color: inherit; }
/* panels inside tabs: no collapsible chrome */
.has-ltabs .lmain [data-tab][hidden] { display: none !important; }
.has-ltabs .lmain .collapsible-section[data-tab] > .collapsible-header { display: none; }
.has-ltabs .lmain .collapsible-section[data-tab] > .collapsible-body { display: block; padding: 28px 30px; }
.has-ltabs .lmain .collapsible-section[data-tab] { border-radius: 14px; margin-bottom: 0; }
.has-ltabs .lmain #section-coursefiles + .lnext, .has-ltabs .lmain #section-coursefiles { margin-bottom: 12px; }
#section-notes > .collapsible-body { padding: 40px 44px !important; }
.lnext { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 13.5px; color: var(--text-muted); }

/* notes drawer */
.ldrawer { position: fixed !important; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 300; margin: 0 !important; border-radius: 0 !important; transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.ldrawer .notes-widget-header { cursor: default; display: flex; justify-content: space-between; align-items: center; }
.ldrawer .notes-widget-body { display: flex !important; flex-direction: column; flex: 1; }
.ldrawer textarea { flex: 1; min-height: 240px; }
.notes-open .ldrawer { transform: none; }
.ldrawer-bg { position: fixed; inset: 0; background: rgba(10, 15, 25, .35); z-index: 299; opacity: 0; pointer-events: none; transition: opacity .2s; }
.notes-open .ldrawer-bg { opacity: 1; pointer-events: auto; }

@media (max-width: 900px) {
  .lesson-layout, .lnav-collapsed .lesson-layout { grid-template-columns: 1fr; }
  .lesson-layout .lnav { position: static; max-height: none; order: -1; }
  .lnav-full { max-height: 60vh; }
  .lnav-collapsed .lnav-rail { flex-direction: row; overflow-x: auto; padding: 8px; justify-content: flex-start; }
  .lnav-rail .lnav-toggle { margin: 0 4px 0 0; }
  .lhead-title { font-size: 24px; }
  .lhead-row { flex-wrap: wrap; }
  .ltabs { top: 64px; }
  #section-notes > .collapsible-body { padding: 22px 18px !important; }
  .has-ltabs .lmain .collapsible-section[data-tab] > .collapsible-body { padding: 20px 16px; }
}
.ldrawer .notes-widget-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ldrawer .notes-widget-header h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0; }
.ldrawer .notes-widget-body { padding: 16px 20px 20px; gap: 12px; }
.ldrawer textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 14px; line-height: 1.6; resize: none; background: var(--surface-2); color: var(--text); }
.ldrawer .notes-widget-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .lesson-layout, .lnav-collapsed .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .lesson-layout .lnav, .lmain { min-width: 0; }
  .lhead-actions { margin-left: 0; }
}
.lnav .lesson-list li.is-current .lesson-link { color: var(--primary); font-weight: 600; }
.lnav .lesson-list li.is-current .lesson-link .dot { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* Video and title above both columns; outline starts at the tab bar */
.ltop { margin-bottom: 16px; }
.ltop #section-video { border: 0; background: transparent; margin: 0 0 18px; }
.ltop #section-video > .collapsible-header { display: none; }
.ltop #section-video > .collapsible-body { display: block; padding: 0; }
.ltop #section-video .card-title { display: none; }
.ltop #section-video .video-wrapper, .ltop #section-video iframe, .ltop #section-video video { border-radius: 14px; overflow: hidden; max-height: 72vh; }
.ltop .lhead { margin-top: 0; }
.lmain > .ltabs:first-child { margin-top: 0; }
.lnav { top: 76px; max-height: calc(100vh - 92px); }
.lnav-full, .lnav-collapsed .lnav-rail { max-height: calc(100vh - 92px); }
/* Outline: header stays, only the lesson list scrolls */
.lnav-full { overflow: hidden; display: flex; flex-direction: column; }
.lnav .curriculum { overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1; margin-right: -8px; padding-right: 8px; }
@media (max-width: 900px) { .lnav .curriculum { max-height: 50vh; } }

/* ---- Left menu: compact, no scrollbar on normal screens ---- */
.sidebar-nav { padding: 8px 12px; scrollbar-width: thin; }
.sidebar-nav .nav-item { padding: 9px 14px; margin-bottom: 2px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 14px 14px 6px; }
.sidebar-footer { padding: 10px 12px; }
.sidebar-userrow { display: flex; align-items: center; gap: 4px; }
.sidebar-userrow .sidebar-user { flex: 1; min-width: 0; padding: 6px 8px; border-radius: var(--radius); }
.sidebar-userrow .sidebar-user:hover, .sidebar-userrow .sidebar-user.active { background: var(--primary-light); }
.sidebar-userrow .user-info { min-width: 0; }
.sidebar-userrow .user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { flex: none; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); color: var(--text-muted); }
.sidebar-logout:hover { background: var(--primary-light); color: var(--danger, #b42318); }

/* ---- My Study Room tabs ---- */
.study-head { margin-bottom: 14px; }
.study-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 26px; background: var(--surface-2, var(--bg)); border: 1px solid var(--border); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.study-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.study-tab:hover { color: var(--text); }
.study-tab.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .10); }
:root[data-theme="dark"] .study-tab.active { box-shadow: none; outline: 1px solid var(--border); }
.sidebar-nav .nav-label:first-of-type { padding-top: 12px; }
.sidebar-nav .nav-item { padding: 8px 14px; }
.nav-label { padding: 10px 14px 4px; }

/* ---- Dashboard ---- */
.db-greet { margin-bottom: 22px; }
.db-hello { font-family: var(--font-serif); font-size: 30px; font-weight: 600; margin: 2px 0 0; line-height: 1.25; }
.db-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.db-rail > * + * { margin-top: 16px; }
.db-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.db-pad { padding: 20px 22px; }
.db-muted { color: var(--text-muted); font-size: 13px; }
.db-strong { font-weight: 700; }
.db-strong a, .db-row-main a { color: inherit; }
.db-strong a:hover, .db-row-main a:hover { color: var(--primary); }
.db-title { display: block; font-size: 18px; font-weight: 700; margin: 0; color: var(--text); }
a.db-title:hover { color: var(--primary); }
.db-sec { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: 28px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.db-sec a, .db-link { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--primary); font-size: 13px; }
.db-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.db-bar span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.db-cont { display: flex; gap: 18px; align-items: center; margin-top: 10px; }
.db-cont-thumb { width: 180px; flex: none; }
.db-cont-thumb .wthumb { border-radius: 10px; }
.db-cont-body { flex: 1; min-width: 0; }
.db-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border-light, var(--border)); }
.db-row:first-child { border-top: none; }
.db-row-main { flex: 1; min-width: 0; }
.db-row-prog { width: 140px; flex: none; }
.db-stripe { width: 4px; align-self: stretch; border-radius: 4px; background: var(--primary); flex: none; }
.db-stripe.off { opacity: .25; }
.db-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; vertical-align: middle; }
.db-score { font-weight: 700; white-space: nowrap; }
.db-score.ok { color: var(--accent); }
.db-score.low { color: var(--gold); }
.db-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.db-num { font-size: 26px; font-weight: 700; line-height: 1; }
.db-numlab { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.db-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.db-badge { font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 20px; background: var(--primary-light); color: var(--primary); }
.db-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.db-welcome { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.db-reco { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.db-reco-card { overflow: hidden; color: var(--text); text-decoration: none; transition: border-color .15s; }
.db-reco-card:hover { border-color: var(--primary); }
.db-reco-card .wthumb { border-radius: 0; }
.db-code { display: flex; gap: 8px; margin: 0; }
.db-code input { flex: 1; min-width: 0; text-transform: uppercase; }
.db-live-now { border-color: var(--danger, #c0392b); }
@media (max-width: 1100px) { .db-grid { grid-template-columns: minmax(0, 1fr) 280px; } }
@media (max-width: 900px) {
  .db-grid { grid-template-columns: minmax(0, 1fr); }
  .db-reco { grid-template-columns: minmax(0, 1fr); }
  .db-cont { flex-wrap: wrap; }
  .db-cont-thumb { width: 120px; }
  .db-row { flex-wrap: wrap; }
  .db-row-prog { width: 100%; order: 3; }
  .db-hello { font-size: 25px; }
}
.db-greet .page-subtitle { margin-top: 6px; }
.db-cont-thumb .wthumb { aspect-ratio: 16 / 9; padding: 10px 12px; }
.db-cont-thumb .wthumb-title { font-size: 16px; }
.db-cont-thumb .wthumb-cat { font-size: 9.5px; letter-spacing: .1em; }
.db-cont-thumb .wthumb-sisters, .db-cont-thumb .wthumb-badge { display: none; }
.db-live-m { display: none; }
@media (max-width: 900px) {
  .db-live-d { display: none; }
  .db-live-m { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; margin-bottom: 16px; color: var(--text); text-decoration: none; }
  .db-cont-thumb { display: none; }
  .db-cont .btn { width: 100%; justify-content: center; }
}

/* ---- Every text-like field gets the same look (number, date, url... were native) ---- */
input:not([type]), input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"],
input[type="url"], input[type="tel"], input[type="month"] {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
:root[data-theme="dark"] input[type="date"], :root[data-theme="dark"] input[type="datetime-local"], :root[data-theme="dark"] input[type="time"] { color-scheme: dark; }
input[type="file"] { font-size: 13px; color: var(--text-muted); max-width: 100%; }
/* admin tab rows scroll sideways instead of widening the page */
.tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.tabs .tab { white-space: nowrap; }

/* ---- Leftovers from the old palette ---- */
.chip.member { background: var(--gold-light, rgba(138,97,26,.10)); border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold); }
.badge.preview { background: var(--primary-light); color: var(--primary); }
.table-wrapper { overflow-x: auto; max-width: 100%; }
.hero-section { background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }

/* ---- Legal pages ---- */
.legal { max-width: 780px; }
.legal-lang { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 22px; }
.legal-lang a { padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.legal-lang a.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.legal-doc { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 30px 34px; line-height: 1.7; font-size: 15px; color: var(--text); }
.legal-doc h2 { font-size: 19px; font-weight: 700; margin: 30px 0 8px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc h3 { font-size: 15.5px; font-weight: 700; margin: 20px 0 6px; }
.legal-doc p, .legal-doc ul { margin: 0 0 12px; }
.legal-doc ul { padding-left: 20px; }
.legal-doc li { margin-bottom: 4px; }
.legal-doc .legal-note { font-size: 13px; color: var(--text-muted); }
.legal-doc .legal-box { background: var(--surface-2); border-radius: 10px; padding: 14px 18px; margin: 12px 0 16px; }
.legal-ph { background: var(--gold-light); color: var(--gold); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.legal-toc { columns: 2; column-gap: 28px; font-size: 14px; padding-left: 18px; }
@media (max-width: 640px) { .legal-doc { padding: 20px 18px; } .legal-toc { columns: 1; } }
/* Withdrawal link: set apart from the other footer links (required by § 356a BGB) */
.withdraw-link { font-weight: 700 !important; color: var(--primary) !important; border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent); padding: 3px 10px; border-radius: 20px; }
.buy-waiver { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 12px; cursor: pointer; }
.buy-waiver input { margin-top: 3px; flex: none; width: 16px; height: 16px; }
.buy-waiver-de { display: block; margin-top: 4px; color: var(--text-muted); }

/* ── Lesson complete: header button and end card ── */
.lc-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); border-color: var(--accent); color: #fff; }
.lc-btn:hover { filter: brightness(1.05); }
.lc-btn .lc-ic { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lc-btn.done { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.lc-btn.done .lc-ic { background: var(--accent); border-color: var(--accent); }
.lc-btn.done .lc-ic::after { content: '\2713'; color: #fff; font-size: 10px; line-height: 1; }
.lc-btn[disabled] { opacity: .6; cursor: wait; }
.lc-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 16px 0 0; padding: 18px 20px; border: 2px dashed var(--accent); border-radius: 14px; background: var(--surface); }
.lc-card.done { border-style: solid; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.lc-card .lc-big { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.lc-card.done .lc-big { background: var(--accent); }
.lc-card.done .lc-big::after { content: '\2713'; color: #fff; font-size: 18px; font-weight: 700; }
.lc-card-tx { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.lc-card-tx b { font-size: 15.5px; color: var(--text); }
.lc-card-tx span { font-size: 13px; color: var(--text-muted); }
.lc-card .btn { padding: 11px 18px; }
.lc-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; z-index: 9999; }
.lnav .lesson-list li.is-done .lesson-link .dot { width: 14px; height: 14px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.lnav .lesson-list li.is-done .lesson-link .dot::after { content: '\2713'; color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }
@media (max-width: 640px) { .lhead-nav { width: 100%; } .lhead-nav .lc-btn { flex: 1; justify-content: center; } .lc-card { padding: 16px; } .lc-card .btn { width: 100%; justify-content: center; text-align: center; } }

/* ── Browse courses ── */
/* Sections overview and the Recorded / Live tabs */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.sec-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: inherit; overflow: hidden; transition: box-shadow .18s, transform .18s; }
.sec-card:hover { box-shadow: 0 14px 34px rgba(16,30,60,.12); transform: translateY(-3px); text-decoration: none; }
.sec-card h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; margin: 0; color: var(--text); }
.sec-card p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.sec-ar { font-family: var(--font-ar); font-size: 30px; line-height: 1.3; color: var(--primary); direction: rtl; text-align: right; }
.sec-n { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.sec-n b { color: var(--text); margin-left: 3px; }
.fmt-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 16px; }
.fmt-tab { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--border); color: var(--text-muted); text-decoration: none; }
.fmt-tab:hover { border-color: var(--primary); text-decoration: none; }
.fmt-tab > span:first-of-type { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.fmt-tab strong { color: var(--text); font-size: 15px; }
.fmt-tab small { font-size: 12.5px; }
.fmt-tab .n { font-weight: 700; font-size: 13px; padding: 2px 9px; border-radius: 20px; background: var(--border); color: var(--text); }
.fmt-tab.on { border-color: var(--primary); background: var(--primary); color: rgba(255,255,255,.85); }
.fmt-tab.on strong { color: #fff; }
.fmt-tab.on .n { background: rgba(255,255,255,.2); color: #fff; }
@media (max-width: 520px) { .fmt-tab small { display: none; } .fmt-tab { padding: 12px; gap: 8px; } }
.cb-head { margin-bottom: 14px; }
.cb-head h1 { font-family: var(--font-serif); font-size: 30px; font-weight: 600; margin: 4px 0 4px; color: var(--text); }
.cb-head p { margin: 0; color: var(--text-muted); }
.cb-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }
.cb-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.cb-tab { padding: 7px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.cb-tab:hover { color: var(--primary); }
.cb-tab.on { background: var(--primary); color: #fff; }
.cb-tab .n { font-weight: 500; opacity: .75; margin-left: 4px; }
.cb-filt { margin-left: auto; display: flex; gap: 8px; }
.cb-filt select { min-width: 150px; width: auto; padding: 8px 30px 8px 12px; border-radius: 10px; font-size: 13px; background-color: var(--surface); }
.cb-q { margin: -8px 0 18px; font-size: 14px; color: var(--text-muted); }
.cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.cb-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .18s, transform .18s, border-color .18s; }
.cb-card:hover { box-shadow: 0 14px 34px rgba(16,30,60,.12); transform: translateY(-3px); border-color: transparent; text-decoration: none; }
.cb-art { position: relative; height: 128px; color: #fff; overflow: hidden; background: linear-gradient(135deg,#1f3358,#2c4a7c); }
.cb-art::before { content: ''; position: absolute; inset: 0; opacity: .13; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M28 0L56 28L28 56L0 28Z' fill='none' stroke='%23fff' stroke-width='1'/%3E%3Ccircle cx='28' cy='28' r='10' fill='none' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E"); background-size: 44px 44px; }
.cb-art::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 85% 50%, rgba(255,255,255,.10), transparent 60%); }
.cb-art.has-img::before, .cb-art.has-img::after { display: none; }
.cb-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cb-art.c1 { background: linear-gradient(135deg,#1f3358,#2c4a7c); } .cb-art.c2 { background: linear-gradient(135deg,#17484a,#236b69); }
.cb-art.c3 { background: linear-gradient(135deg,#5a3d22,#86603a); } .cb-art.c4 { background: linear-gradient(135deg,#24563f,#3a7d5c); }
.cb-art.c5 { background: linear-gradient(135deg,#472e50,#6c4877); } .cb-art.c6 { background: linear-gradient(135deg,#3a3f66,#565d92); }
.cb-art.c7 { background: linear-gradient(135deg,#6a2f3a,#94505c); }
.cb-ar { position: absolute; right: 18px; top: 50%; transform: translateY(-52%); font-family: var(--font-ar); font-size: 46px; line-height: 1.2; color: rgba(255,255,255,.92); z-index: 1; direction: rtl; white-space: nowrap; }
.cb-cat { position: absolute; left: 16px; bottom: 12px; z-index: 1; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.cb-acc, .cb-start, .cb-sis { position: absolute; top: 12px; z-index: 1; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.cb-acc { left: 14px; background: rgba(255,255,255,.95); color: #1f3358; }
.cb-acc.free { background: #e3f3ea; color: #23704d; }
.cb-start { right: 14px; background: #f6e7c8; color: #6e4c10; }
.cb-sis { left: 14px; top: 42px; background: var(--sisters); color: #fff; }
.cb-progline { height: 4px; background: var(--border); } .cb-progline i { display: block; height: 100%; background: var(--accent); }
.cb-b { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cb-t { font-family: var(--font-serif); font-size: 19px; font-weight: 600; line-height: 1.3; margin: 0; color: var(--text); }
.cb-d { margin: 0; color: var(--text-muted); font-size: 13.8px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cb-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; margin-top: 14px; border-top: 1px solid var(--border); font-size: 12.8px; color: var(--text-muted); }
.cb-f .mt { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cb-f .mt span { display: inline-flex; align-items: center; gap: 5px; }
.cb-go { font-weight: 700; color: var(--primary); font-size: 13.5px; white-space: nowrap; }
.cb-go b { color: var(--accent); }
.cb-go.done { color: var(--accent); }
.cb-card:hover .cb-go { text-decoration: underline; }
:root[data-theme="dark"] .cb-acc { background: rgba(255,255,255,.92); }
@media (max-width: 760px) {
  .cb-head h1 { font-size: 26px; }
  .cb-filt { margin-left: 0; width: 100%; } .cb-filt select { flex: 1; min-width: 0; }
  .cb-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .cb-grid { grid-template-columns: 1fr; gap: 14px; }
  .cb-art { height: 104px; } .cb-ar { font-size: 38px; }
}

/* Sidebar: "Explore" heading opens the course overview */
.nav-label-link { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; border-radius: 6px; }
.nav-label-link:hover, .nav-label-link.active { color: var(--primary); }
.nav-label-link span { font-size: 13px; line-height: 1; }
