/* Life n Learn LMS — theme */
/* The admin panel links THIS file and ds/styles.css, but not theme.css, so the
   values below are the admin UI's own neutral vocabulary. Anything that should
   follow the brand must resolve through a design-system token — see --violet
   just below, and the `var(--brand, #2B2F36)` fallbacks used throughout this
   file. Do not reintroduce a literal brand colour here: this file used to
   define --violet-600 outright, which overrode ds/tokens/colors.css on every
   page and made re-theming look broken. */
:root {
    --violet: var(--brand, #2B2F36);
    --indigo: #4f46e5;
    --teal: #0d9488;
    --teal-600: #0f766e;
    --bg: #f6f7fb;
    --card: #ffffff;
    --ink: #1f2430;
    --muted: #6b7280;
    --line: #e5e7eb;
    --ok: #12805c;
    --ok-bg: #e7f6ef;
    --err: #b42318;
    --err-bg: #fdecea;
    --info: #1d4ed8;
    --info-bg: #e8effe;
    --amber: #b45309;
    --amber-bg: #fef3e2;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1100px, 92vw); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
    background: linear-gradient(100deg, var(--violet), var(--indigo));
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 30;
}
.header-inner { display: flex; align-items: center; gap: 18px; padding: 12px 0; }
.brand { color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; opacity: .95; }
.brand-logo { width: 36px; height: 36px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; flex: none; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.auth-logo-wrap { text-align: center; margin-bottom: 6px; }
.auth-logo-wrap img { width: 88px; height: 88px; border-radius: 50%; background: #fff; object-fit: contain; box-shadow: 0 6px 20px rgba(90, 20, 190, .18); }
.main-nav { display: flex; gap: 6px; margin-inline-start: 8px; flex: 1; }
.main-nav a {
    color: #ffffff; opacity: .85; padding: 6px 12px; border-radius: 8px; font-weight: 600;
}
.main-nav a:hover { opacity: 1; text-decoration: none; background: rgba(255, 255, 255, .12); }
.main-nav a.active { opacity: 1; background: rgba(255, 255, 255, .18); }
.header-right { display: flex; align-items: center; gap: 14px; }
.user-menu { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.user-menu .uname { opacity: .9; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Language toggle ---------- */
.lang-toggle { display: inline-flex; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 2px; }
.lang-toggle a { color: #fff; opacity: .8; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.lang-toggle a:hover { text-decoration: none; opacity: 1; }
.lang-toggle a.active { background: #fff; color: var(--violet); opacity: 1; }

/* ---------- Layout / main ---------- */
.main { padding: 28px 0 56px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; }
.breadcrumbs { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: var(--indigo); color: #fff; border: 1px solid transparent;
    padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 650; line-height: 1;
    transition: filter .15s ease, transform .02s ease;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.teal { background: var(--teal); }
.btn.ghost { background: transparent; color: var(--indigo); border-color: transparent; }
.btn.danger { background: var(--err); }
.btn.sm { padding: 6px 11px; font-size: .85rem; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
}
.card.pad-lg { padding: 26px; }
.course-card { display: flex; flex-direction: column; gap: 10px; }
.course-card .ct { margin: 0; font-size: 1.15rem; }
.course-card .cd { color: var(--muted); font-size: .92rem; flex: 1; }
.course-card .cmeta { display: flex; gap: 14px; color: var(--muted); font-size: .85rem; align-items: center; }
.course-card .cmeta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.err { color: var(--err); background: var(--err-bg); }
.badge.muted { color: var(--muted); background: #f1f2f5; }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.amber { color: var(--amber); background: var(--amber-bg); }
.chip { display: inline-flex; gap: 6px; align-items: center; background: #eef0f6; color: #414a5c; border-radius: 8px; padding: 4px 9px; font-size: .8rem; font-weight: 600; }

/* ---------- Alerts ---------- */
.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-weight: 550; border: 1px solid transparent; }
.alert.success { background: var(--ok-bg); color: var(--ok); border-color: #bfe6d5; }
.alert.error { background: var(--err-bg); color: var(--err); border-color: #f5c6c0; }
.alert.info { background: var(--info-bg); color: var(--info); border-color: #c7d7fb; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 650; margin-bottom: 6px; font-size: .92rem; }
.form-row .hint { color: var(--muted); font-size: .82rem; font-weight: 400; }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=password],
.form-row input[type=number], .form-row input[type=url], .form-row textarea, .form-row select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
    font: inherit; background: #fff; color: var(--ink);
}
.form-row textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.form-row.invalid input, .form-row.invalid textarea { border-color: var(--err); }
.field-error { color: var(--err); font-size: .83rem; margin-top: 5px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lang-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lang-col { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fcfcfe; }
.lang-col > h4 { margin: 0 0 12px; font-size: .82rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data th, table.data td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: middle; }
table.data th { background: #fafafe; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fbfbfe; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(130deg, #ede9fe, #e0f2fe 60%, #ccfbf1); padding: 24px; }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(16, 24, 40, .12); padding: 30px 28px; }
.auth-card .logo { text-align: center; font-size: 1.5rem; font-weight: 800; color: var(--violet); margin-bottom: 4px; }
.auth-card .tag { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: .92rem; }
.auth-card .lang-toggle { background: #eef0f6; }
.auth-card .lang-toggle a { color: var(--muted); }
.auth-card .lang-toggle a.active { background: var(--violet); color: #fff; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: .84rem; }

/* ---------- Lesson / content ---------- */
.content-layout { display: grid; grid-template-columns: 1fr 260px; gap: 26px; align-items: start; }
.lesson-toc { position: sticky; top: 76px; }
.lesson-toc ol { margin: 0; padding-inline-start: 18px; }
.lesson-toc li { margin-bottom: 6px; }
.lesson-toc a.current { font-weight: 750; color: var(--violet); }
.prose { font-size: 1.03rem; }
.prose :first-child { margin-top: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; }
.prose h2, .prose h3 { line-height: 1.3; }
.prose blockquote { border-inline-start: 4px solid var(--indigo); margin-inline: 0; padding: 4px 16px; color: #374151; background: #f5f4ff; border-radius: 0 8px 8px 0; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; }
.prose code { background: #eef0f6; padding: 1px 5px; border-radius: 5px; }
.prose pre code { background: none; padding: 0; }

.media-block { margin: 22px 0; }
.media-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.audio-player { width: 100%; }
.video-embed { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.lesson-nav .spacer { flex: 1; }

/* ---------- Exam ---------- */
.exam-q { border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; background: #fff; box-shadow: var(--shadow); }
.exam-q .qnum { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.exam-q .qtext { font-size: 1.08rem; font-weight: 600; margin: 6px 0 14px; }
.opt { display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin-bottom: 9px; cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover { border-color: #c7cbe0; background: #fbfbff; }
.opt input { margin-top: 3px; }
.opt.is-correct { border-color: #9be3c4; background: var(--ok-bg); }
.opt.is-wrong { border-color: #f3b6ae; background: var(--err-bg); }
.opt .opt-key { font-weight: 700; margin-inline-end: 2px; }
.opt-mark { margin-inline-start: auto; font-weight: 700; }

.score-hero { text-align: center; padding: 30px; border-radius: 16px; box-shadow: var(--shadow); margin-bottom: 26px; color: #fff; }
.score-hero.pass { background: linear-gradient(120deg, var(--teal), #0ea5a0); }
.score-hero.fail { background: linear-gradient(120deg, #be123c, #e11d48); }
.score-hero .pct { font-size: 3rem; font-weight: 800; line-height: 1; }
.score-hero .lbl { opacity: .95; margin-top: 6px; font-size: 1.05rem; }
.score-hero .sc { opacity: .9; margin-top: 2px; }
.explain { margin-top: 10px; font-size: .9rem; background: #f7f7fb; border-radius: 8px; padding: 9px 12px; color: #374151; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 2rem; font-weight: 800; color: var(--violet); line-height: 1; }
.stat .l { color: var(--muted); font-size: .88rem; margin-top: 6px; }

/* ---------- Admin shell ---------- */
body.admin { background: #f3f4f8; }
/* Brand wordmark — the middle "n" in violet, everywhere the mark appears.
   Literal fallback because the admin layout does not load the token sheets. */
.brand .n, .auth-card .logo .n { color: var(--brand, #2B2F36); }
/* On the dark admin bar, use a lighter violet so it stays legible. */
.admin-topbar .brand .n { color: var(--violet-300, #8B93A0); }

.admin-topbar { background: #111827; color: #fff; position: sticky; top: 0; z-index: 30; }
.admin-topbar .header-inner { padding: 11px 0; }
.admin-topbar .brand { color: #fff; }
.admin-topbar .lang-toggle { background: rgba(255, 255, 255, .12); }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px 0 56px; align-items: start; }
.admin-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 3px; }
.admin-sidebar a { color: #374151; padding: 10px 13px; border-radius: 9px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.admin-sidebar a:hover { background: #e9eaf1; text-decoration: none; }
.admin-sidebar a.active { background: var(--violet); color: #fff; }
.admin-main { min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85em; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.filters .form-row { margin-bottom: 0; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: .88rem; }
.pagination .current { background: var(--violet); color: #fff; border-color: var(--violet); }

/* ---------- Cookie consent ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 940px; margin-inline: auto; background: #111827; color: #fff; border-radius: 12px; padding: 14px 18px; display: flex; align-items: center; gap: 16px; box-shadow: 0 10px 34px rgba(0, 0, 0, .28); }
.cookie-banner .cookie-text { flex: 1; font-size: .9rem; line-height: 1.5; }
.cookie-banner a { color: #c7d2fe; }
.cookie-banner .btn { flex: none; }
@media (max-width: 560px) { .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; } }

/* ---------- Community & discussion ---------- */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.discuss { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.discuss.discuss-single { border-top: none; margin-top: 0; padding-top: 0; }
.discuss-h { font-size: 1.2rem; margin: 0 0 14px; }
.discuss-composer { margin-bottom: 20px; }
.discuss-label { display: block; font-weight: 650; margin-bottom: 8px; font-size: .95rem; }
.discuss-composer textarea, .discuss-reply-form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
    font: inherit; background: #fff; color: var(--ink); resize: vertical; line-height: 1.5;
}
.discuss-composer textarea:focus, .discuss-reply-form textarea:focus {
    outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.discuss-empty { padding: 8px 0 4px; }
.discuss-list { display: flex; flex-direction: column; gap: 16px; }
.discuss-thread { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); padding: 16px 18px; }
.discuss-replies { margin-top: 12px; padding-inline-start: 16px; border-inline-start: 2px solid var(--line); display: flex; flex-direction: column; }
.discuss-replies .discuss-post + .discuss-post { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.discuss-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.discuss-author { font-weight: 700; font-size: .92rem; }
.discuss-post .post-title { font-size: 1.35rem; margin: 4px 0 8px; }
.discuss-body { line-height: 1.6; overflow-wrap: anywhere; }
.discuss-actions { display: flex; gap: 14px; margin-top: 8px; }
.discuss-actions form { margin: 0; }
.discuss-link { background: none; border: none; padding: 0; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.discuss-link:hover { color: var(--ink); text-decoration: underline; }
.discuss-link.danger { color: var(--err); }
.discuss-reply-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; }
.discuss-reply-form textarea { min-height: 44px; }
.discuss-reply-form .btn { flex: none; }
@media (max-width: 560px) { .discuss-reply-form { flex-direction: column; } .discuss-reply-form .btn { width: 100%; justify-content: center; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .content-layout { grid-template-columns: 1fr; }
    .lesson-toc { position: static; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .lang-cols, .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .main-nav { display: none; }
    .header-inner { gap: 10px; }
    .user-menu .uname { display: none; }
    .page-head h1 { font-size: 1.35rem; }
}

/* ---------- Course outline: weekly modules, progress, drip ---------- */
/* Also used inside /admin previews, so only literal-fallback var() here. */
details.module {
    background: #fff; border: 1px solid var(--line, #e4e0ee); border-radius: 14px;
    overflow: clip;
}
details.module > summary {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 18px; cursor: pointer; list-style: none; user-select: none;
}
details.module > summary::-webkit-details-marker { display: none; }
details.module > summary::after {
    content: ''; margin-left: auto; flex: none; width: 8px; height: 8px;
    border-right: 2px solid var(--muted, #6f6a7e); border-bottom: 2px solid var(--muted, #6f6a7e);
    transform: rotate(45deg); transition: transform .15s ease;
}
details.module[open] > summary::after { transform: rotate(-135deg); }
details.module > summary:hover { background: var(--bg-soft, #F1F3F6); }
details.module > summary:focus-visible { outline: 2px solid var(--brand, #2B2F36); outline-offset: -2px; }
.module-week {
    flex: none; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
    color: var(--brand-strong, #21252D); background: var(--bg-lavender, #E4E7EB);
    border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.module-title { font-weight: 650; min-width: 0; }
.module-meta { color: var(--muted, #6f6a7e); font-size: .85rem; white-space: nowrap; }
details.module .module-body { padding: 4px 12px 12px; }
details.module.is-locked > summary { cursor: default; color: var(--muted, #6f6a7e); }
details.module.is-locked > summary::after { display: none; }
details.module.is-locked .module-week { color: var(--muted, #6f6a7e); background: var(--bg-soft, #F1F3F6); }
.lesson-row.is-locked { opacity: .55; }
@media (prefers-reduced-motion: reduce) {
    details.module > summary::after { transition: none; }
}

/* Progress bar */
.progress-card { margin-top: 18px; }
.progress-track {
    margin-top: 10px; height: 10px; border-radius: 999px;
    background: var(--bg-lavender, #E4E7EB); overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 999px; min-width: 0;
    background: linear-gradient(90deg, var(--brand, #2B2F36), var(--accent, #4A5568));
    transition: width .3s ease;
}
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }

/* Start (self-enrol) + upsell cards */
.start-card { margin-top: 18px; border: 1px solid var(--brand, #2B2F36); }
.upsell-card { margin-top: 26px; }
.upsell-card textarea { width: 100%; resize: vertical; }
.toc-locked { color: var(--muted, #6f6a7e); font-size: .9rem; display:block; padding: 4px 0; }

/* Exam stepper (one question per screen) */
.stepper-bar { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; flex-wrap: wrap; }
.stepper-dots { display: flex; gap: 8px; flex-wrap: wrap; margin-inline: auto; }
.stepper-dot {
    width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line, #cfc9dd);
    background: #fff; padding: 0; cursor: pointer;
}
.stepper-dot.is-answered { background: var(--ok, #1d9a6c); border-color: var(--ok, #1d9a6c); }
.stepper-dot.is-current { border-color: var(--brand, #2B2F36); box-shadow: 0 0 0 3px var(--bg-lavender, #E4E7EB); }

/* Course-card tier badges (Free / Premium) */
.course-card .ctier { display: flex; gap: 6px; flex-wrap: wrap; }
.badge.tier-premium {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, var(--brand, #2B2F36), var(--accent, #4A5568));
}

/* Per-week live-class request block (inside a module accordion) */
.week-live { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line, #e4e0ee); }
.week-live .wl-state { font-size: .9rem; padding: 8px 12px; border-radius: 10px; }
.week-live .wl-state.pending { background: var(--amber-bg, #fff7e6); color: var(--amber, #8a5a00); }
.week-live .wl-state.ok      { background: var(--ok-bg, #e3f5ec);  color: var(--ok, #0f7b4f); }
.week-live .wl-state.muted   { background: var(--bg-soft, #F1F3F6); color: var(--muted, #6f6a7e); }
.week-live details.wl-form > summary {
    cursor: pointer; list-style: none; font-size: .9rem; font-weight: 600;
    color: var(--brand-strong, #21252D); padding: 6px 0;
}
.week-live details.wl-form > summary::-webkit-details-marker { display: none; }
.week-live details.wl-form > summary:hover { text-decoration: underline; }
.week-live details.wl-form > summary:focus-visible { outline: 2px solid var(--brand, #2B2F36); outline-offset: 2px; border-radius: 6px; }
.week-live textarea, .week-live select { width: 100%; max-width: 420px; }

/* Admin email page: SMTP transcript block */
.mail-transcript {
    margin: 0; padding: 14px 16px; border-radius: 10px; overflow-x: auto;
    background: #1a1523; color: #e8e3f2;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem; line-height: 1.55; white-space: pre;
}

/* ---------- Avatar (Google profile picture, initials fallback) ---------- */
/* The initials sit underneath and the <img> covers them, so a picture that fails
   to load simply reveals the fallback: `onerror` removes the image, no JS needed. */
.avatar {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; border-radius: 50%; overflow: hidden;
    background: var(--brand-soft, #E4E7EB); color: var(--brand-strong, #21252D);
    font-weight: 700; line-height: 1; letter-spacing: .02em; user-select: none;
}
.avatar img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; border-radius: 50%;
}
/* In the violet header the tinted disc has too little contrast, so go translucent white. */
.user-menu .avatar { background: rgba(255, 255, 255, .22); color: #fff; }
.user-menu .uname { display: inline-flex; align-items: center; gap: 8px; max-width: 200px; }
.user-menu .uname > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Profile header card ---------- */
.profile-card { display: flex; align-items: center; gap: 18px; max-width: 560px; }
.profile-id { min-width: 0; }
.profile-id h2 { font-size: 1.25rem; line-height: 1.2; }
.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge.google { color: var(--brand-strong, #21252D); background: var(--brand-soft, #E4E7EB); }
.profile-google { max-width: 560px; }

@media (max-width: 480px) {
    .profile-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .user-menu .uname > span { display: none; }
}

/* ---------- /courses: the two access groups ---------- */
/* Purely presentational. The split is courses.is_open, which is the access
   rule itself -- see app/Views/courses/index.php. */
.course-group { margin-bottom: 34px; }
.course-group:last-child { margin-bottom: 0; }
.cg-head {
    margin: 0 0 14px; padding-bottom: 10px;
    border-bottom: 1px solid var(--line, #e4e0ee);
}
.cg-head h2 {
    margin: 0 0 3px; font-size: 1.08rem; line-height: 1.2;
    color: var(--ink, #1c1b22);
}

/* ---------- Admin: chapter editor, English beside Hindi ---------- */
/* Two columns is the working layout, not decoration: a translator needs the
   source paragraph beside the box they are typing into. Collapses to one
   column under 900px, where side-by-side stops being readable. */
.bi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.bi-col label { display: block; font-weight: 650; margin-bottom: 6px; font-size: .92rem; }
.bi-col input[type=text], .bi-col textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line, #e4e0ee);
    border-radius: 9px; font: inherit; background: #fff;
}
.bi-col textarea { line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }
.bi-col.invalid input, .bi-col.invalid textarea { border-color: var(--err, #b3261e); }
/* An untranslated field is tinted so the gaps are findable by scrolling. */
.bi-col.needs-hi textarea, .bi-col.needs-hi input[type=text] { background: var(--amber-bg, #fdf4e3); }
.lang-tag {
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    background: var(--ink-100, #EEF0F3); color: var(--muted, #5b6172);
    border-radius: 999px; padding: 2px 7px; margin-left: 4px;
}
.lang-tag.hi { background: var(--brand-soft, #E4E7EB); color: var(--brand-strong, #21252D); }

.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.chapter-form .card { margin-bottom: 16px; }

.hindi-progress .bar {
    height: 6px; background: var(--line, #e4e0ee); border-radius: 999px;
    overflow: hidden; margin: 10px 0 8px;
}
.hindi-progress .bar span { display: block; height: 100%; background: var(--brand, #2B2F36); }

@media (max-width: 900px) {
    .bi-row { grid-template-columns: 1fr; gap: 10px; }
    .form-grid-3 { grid-template-columns: 1fr; }
}

/* Version stamp in the admin footer. Muted on purpose: it is diagnostic, not
   navigation. Literal fallbacks because layouts/admin.php does not load
   theme.css — see docs/THEMING.md. */
.admin-version {
    margin: 32px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line, #DDE1E6);
    font-size: .78rem;
    color: var(--text-faint, #8E959F);
    text-align: right;
    letter-spacing: .01em;
}
.admin-version .n { color: var(--brand, #2B2F36); }
