/* =====================================================================
   Budhigyan core stylesheet
   - Saffron + Green theme, calm, parent-friendly
   - Mobile-first, breakpoint 768px
   - Zero framework dependencies
   ===================================================================== */

:root {
    --primary: #D97706;
    --primary-dark: #B45309;
    --primary-light: #FEF3C7;
    --primary-xlight: #FFFBEB;
    --secondary: #059669;
    --secondary-dark: #047857;
    --secondary-light: #D1FAE5;

    --bg: #FFFBEB;
    --card: #FFFFFF;
    --text: #1F2937;
    --text-soft: #6B7280;
    --border: #E5E7EB;
    --border-soft: #F3F4F6;

    --danger: #DC2626;
    --warning: #D97706;
    --info: #2563EB;
    --success: #059669;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
    --shadow:    0 2px 6px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-lg: 0 8px 24px rgba(15,23,42,.08);
    --sidebar-w: 240px;
    --header-h: 64px;
    --bottom-nav-h: 64px;

    --font-base: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-odia: "Noto Sans Oriya", var(--font-base);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; }
body {
    margin: 0;
    font-family: var(--font-base);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}
.odia-content { font-family: var(--font-odia) !important; }
.ui-font, .app-header, .app-sidebar, .bottom-nav, .brand, .nav-link, .btn, .badge, .field label, .footer, .header-title, .header-subtitle, .lang-switch, .avatar, .plan-pill, .notification-pill { font-family: var(--font-base) !important; }

img, svg, video { max-width: 100%; display: block; }
a { color: var(--secondary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.muted { color: var(--text-soft); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.small { font-size: 13px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.flex { display: flex; } .flex-col { flex-direction: column; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.hide { display: none !important; }
@media (max-width: 768px) { .hide-mobile { display: none !important; } }
@media (min-width: 769px) { .hide-desktop { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font: 600 14px/1 var(--font-base);
    background: var(--card); color: var(--text);
    cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary  { background: var(--primary);   color: #fff; border-color: var(--primary); }
.btn-primary:hover  { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-secondary{ background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-secondary:hover{ background: var(--secondary-dark); color: #fff; text-decoration: none; }
.btn-outline  { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--border-soft); text-decoration: none; }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #B91C1C; color: #fff; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: var(--text); }
.field .hint { color: var(--text-soft); font-size: 12px; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="tel"], input[type="url"], input[type="search"],
select, textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font: 400 14px/1.4 var(--font-base);
    background: #fff; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input[type="color"] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217,119,6,.18);
}
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 768px) { .form-row { grid-template-columns: 1fr; } }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 12px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.card h1, .card h2, .card h3 { margin-top: 0; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
    text-align: left; padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.table th {
    background: #FAF5EE; color: var(--text);
    font-weight: 700; font-size: 13px;
    text-transform: uppercase; letter-spacing: .03em;
}
.table tbody tr:hover { background: #FFFCF2; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* ---------- Badges & pills ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.badge-success  { background: #D1FAE5; color: #065F46; }
.badge-warning  { background: #FEF3C7; color: #92400E; }
.badge-danger   { background: #FEE2E2; color: #991B1B; }
.badge-info     { background: #DBEAFE; color: #1E40AF; }
.badge-muted    { background: #F3F4F6; color: #374151; }

/* calm exam-countdown pill, NEVER red */
.pill-calm {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    background: #D1FAE5; color: #065F46;
    font-weight: 600; font-size: 13px;
}

/* ---------- Alerts (flash messages) ---------- */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 14px;
    border-left: 4px solid currentColor;
}
.alert-success { background: #ECFDF5; color: #065F46; }
.alert-error   { background: #FEF2F2; color: #991B1B; }
.alert-warning { background: #FFFBEB; color: #92400E; }
.alert-info    { background: #EFF6FF; color: #1E40AF; }

/* ---------- Layout: app shell ---------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    grid-template-areas: "sidebar header" "sidebar main";
    min-height: 100vh;
}
@media (max-width: 768px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-areas: "header" "main";
    }
}
.app-header {
    grid-area: header;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 0 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
    height: var(--header-h);
}
.app-sidebar {
    grid-area: sidebar;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    overflow-y: auto;
    position: sticky; top: 0;
    height: 100vh;
}
@media (max-width: 768px) {
    .app-sidebar { display: none; }
}
.app-main {
    grid-area: main;
    padding: 24px;
    padding-bottom: calc(24px + var(--bottom-nav-h) + env(safe-area-inset-bottom));
    max-width: 100%;
    overflow-x: hidden;
}
@media (min-width: 769px) {
    .app-main { padding-bottom: 24px; }
}

/* ---------- Sidebar ---------- */
.brand {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px 16px;
    font-weight: 800; font-size: 18px; color: var(--primary-dark);
}
.brand-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; display: grid; place-items: center; font-weight: 800;
}
.nav { list-style: none; padding: 0; margin: 0; }
.nav-section {
    color: var(--text-soft); font-size: 11px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    padding: 16px 12px 8px;
}
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text); font-weight: 600; font-size: 14px;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.nav-link:hover { background: var(--bg); color: var(--primary-dark); text-decoration: none; }
.nav-link.active { background: #FEF3C7; color: var(--primary-dark); }
.nav-link .ico { width: 18px; height: 18px; flex: 0 0 18px; }

/* ---------- Top header ---------- */
.header-title { font-size: 16px; font-weight: 700; margin: 0; }
.header-right { display: flex; align-items: center; gap: 10px; }
.lang-switch a {
    padding: 4px 8px; border-radius: 6px; font-size: 12px;
    color: var(--text-soft);
}
.lang-switch a.active { background: #FEF3C7; color: var(--primary-dark); font-weight: 700; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 14px;
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--card);
    border-top: 1px solid var(--border);
    min-height: var(--bottom-nav-h);
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 6px rgba(15,23,42,.04);
}
@media (max-width: 768px) { .bottom-nav { display: grid; grid-template-columns: repeat(5,1fr); } }
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-soft); font-size: 11px; font-weight: 600;
    padding: 4px; border-radius: 8px;
    text-decoration: none;
}
.bottom-nav a.active { color: var(--primary-dark); background: #FEF3C7; }
.bottom-nav .ico { width: 22px; height: 22px; margin-bottom: 2px; }

/* ---------- Auth pages ---------- */
.auth {
    min-height: 100vh; display: grid; place-items: center;
    background: linear-gradient(160deg, #FFFBEB 0%, #ECFDF5 100%);
    padding: 24px;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: #fff; border-radius: var(--radius); padding: 28px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .subtitle { color: var(--text-soft); margin: 0 0 24px; font-size: 14px; }

/* ---------- Stats grid (dashboard) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow-sm);
}
.stat .label { color: var(--text-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 28px; font-weight: 800; color: var(--text); margin-top: 6px; }
.stat .sub   { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* ---------- Tabs ---------- */
.tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.tabs a {
    padding: 10px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--text-soft); font-weight: 600; font-size: 14px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    text-decoration: none;
}
.tabs a:hover { color: var(--primary-dark); text-decoration: none; }
.tabs a.active { color: var(--primary-dark); border-bottom-color: var(--primary); background: #FEF3C7; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 36px; height: 36px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; color: var(--text); text-decoration: none; font-size: 13px;
}
.pagination a:hover { background: var(--bg); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.pagination .disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Toggles ---------- */
.toggle {
    display: inline-flex; align-items: center;
    width: 44px; height: 24px;
    background: #D1D5DB; border-radius: 999px;
    position: relative; cursor: pointer;
    border: 0; padding: 0;
}
.toggle::after {
    content: ""; position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
    transition: left .15s;
}
.toggle.on { background: var(--secondary); }
.toggle.on::after { left: 22px; }

/* ---------- Empty state ---------- */
.empty {
    text-align: center; padding: 48px 24px;
    color: var(--text-soft);
}

/* ---------- Misc ---------- */
.kbd {
    background: #F3F4F6; border: 1px solid var(--border); border-bottom-width: 2px;
    padding: 1px 6px; border-radius: 4px; font-size: 12px; font-family: ui-monospace,monospace;
}
.public-hero {
    background: linear-gradient(160deg, #FFFBEB 0%, #ECFDF5 100%);
    padding: 80px 24px; text-align: center;
}
.public-hero h1 { font-size: 36px; margin-bottom: 12px; }
.public-hero p { font-size: 18px; color: var(--text-soft); max-width: 600px; margin: 0 auto 24px; }
@media (max-width: 768px) {
    .public-hero { padding: 40px 16px; }
    .public-hero h1 { font-size: 28px; }
    .public-hero p { font-size: 15px; }
}
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ---------- Loading bar (top) ---------- */
.loading-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999; transition: width .25s ease-out, opacity .25s;
    opacity: 0;
}
.loading-bar.active { opacity: 1; }

/* print */
@media print {
    .app-sidebar, .app-header, .bottom-nav { display: none !important; }
    .app { grid-template-columns: 1fr; grid-template-areas: "main"; }
    .app-main { padding: 0; }
}

/* =====================================================================
   Release 2 — Learning Core
   ===================================================================== */

/* Container/wrapper for student pages */
.student-shell { max-width: 1100px; margin: 0 auto; padding: 24px 16px 96px; }
.student-shell h1 { margin-top: 8px; }
.breadcrumbs { color: var(--text-soft); font-size: 13px; margin-bottom: 8px; }
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs .sep { margin: 0 6px; opacity: .5; }

/* Generic grid of selection tiles */
.tile-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); margin-top: 16px; }
.tile {
    display: block; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 18px 18px 16px; text-decoration: none; color: var(--text);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(217,119,6,.08); border-color: var(--primary); text-decoration: none; }
.tile-eyebrow { color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.tile-title { font-weight: 700; font-size: 17px; margin: 4px 0 6px; }
.tile-meta { color: var(--text-soft); font-size: 13px; }
.tile-accent { width: 32px; height: 4px; border-radius: 2px; background: var(--primary); margin-bottom: 12px; }

/* Chapter cards */
.chapter-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); margin-top: 12px; }
.chapter-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 16px; display: flex; flex-direction: column; gap: 10px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.chapter-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.05); border-color: var(--primary); }
.chapter-no { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.chapter-title { font-weight: 700; font-size: 16px; margin: 0; line-height: 1.3; }
.chapter-meta { font-size: 13px; color: var(--text-soft); display: flex; gap: 10px; flex-wrap: wrap; }
.progress-bar { height: 6px; background: var(--border-soft); border-radius: 99px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--secondary); border-radius: 99px; transition: width .3s; }
.chapter-card a.cover { color: inherit; text-decoration: none; }
.chapter-card .premium-tag { font-size: 11px; color: var(--primary-dark); background: var(--primary-light); padding: 2px 8px; border-radius: 99px; font-weight: 600; align-self: flex-start; }

/* Tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 12px 0 18px; }
.tab-btn {
    background: none; border: none; padding: 10px 14px; font: inherit; cursor: pointer;
    color: var(--text-soft); font-weight: 600; border-bottom: 3px solid transparent;
}
.tab-btn[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Lesson grid + card */
.lesson-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); }
.lesson-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s;
    display: flex; flex-direction: column; position: relative;
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.lesson-thumb {
    position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, #FEF3C7, #FFEDD5);
    display: flex; align-items: center; justify-content: center;
}
.lesson-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-pip {
    width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; color: white; pointer-events: none;
}
.lesson-meta { padding: 10px 12px; }
.lesson-title { font-weight: 700; font-size: 15px; margin: 0 0 4px; line-height: 1.3; }
.lesson-sub { font-size: 12px; color: var(--text-soft); display: flex; gap: 8px; align-items: center; }
.lesson-card.locked { opacity: .85; }
.lesson-card.locked .lesson-thumb::after {
    content: '🔒'; position: absolute; top: 8px; right: 8px;
    background: rgba(255,255,255,.95); padding: 4px 8px; border-radius: 99px; font-size: 13px;
}
.lesson-card.completed::before {
    content: '✓ ' attr(data-completed-label); position: absolute; top: 8px; left: 8px;
    background: var(--secondary); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 99px; z-index: 2;
}

/* Video modal */
.video-modal {
    position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.78);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.video-modal.is-open { display: flex; }
.video-modal-inner {
    background: #000; width: 100%; max-width: 960px; border-radius: 12px; overflow: hidden;
    position: relative; aspect-ratio: 16/9;
}
.video-modal iframe, .video-modal video {
    width: 100%; height: 100%; border: 0; background: #000; display: block;
}
.video-modal-close {
    position: absolute; top: 10px; right: 10px; width: 36px; height: 36px;
    background: rgba(255,255,255,.92); border: 0; border-radius: 50%; font-size: 20px;
    cursor: pointer; z-index: 5; line-height: 1; padding: 0;
}
.video-modal-close:hover { background: #fff; }
.video-modal-title { position: absolute; bottom: 8px; left: 12px; right: 60px; color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px #000; }
@media (max-width: 600px) {
    .video-modal { padding: 0; }
    .video-modal-inner { border-radius: 0; max-width: 100%; max-height: 100vh; }
}

/* MCQ engine */
.mcq-shell { max-width: 720px; margin: 0 auto; padding: 16px; }
.mcq-progress {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px;
}
.mcq-progress-bar { flex: 1; height: 6px; background: var(--border-soft); border-radius: 99px; overflow: hidden; }
.mcq-progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.mcq-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.mcq-question { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 0 0 18px; }
.mcq-options { display: flex; flex-direction: column; gap: 10px; }
.mcq-option {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--border);
    border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s;
}
.mcq-option:hover { border-color: var(--primary-light); background: var(--primary-xlight); }
.mcq-option input { display: none; }
.mcq-option .letter {
    width: 32px; height: 32px; border-radius: 50%; background: var(--border-soft); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0;
}
.mcq-option.is-selected { border-color: var(--primary); background: var(--primary-xlight); }
.mcq-option.is-selected .letter { background: var(--primary); color: #fff; }
.mcq-option.is-correct { border-color: var(--secondary); background: var(--secondary-light); }
.mcq-option.is-correct .letter { background: var(--secondary); color: #fff; }
.mcq-option.is-wrong   { border-color: var(--danger); background: #FEF2F2; }
.mcq-option.is-wrong .letter { background: var(--danger); color: #fff; }
.mcq-feedback {
    margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 14px;
    display: none;
}
.mcq-feedback.is-correct { background: var(--secondary-light); color: #065F46; display: block; }
.mcq-feedback.is-wrong   { background: #FEF2F2; color: #991B1B; display: block; }
.mcq-explanation {
    margin-top: 10px; padding: 10px 14px; border-radius: 8px;
    background: var(--primary-xlight); color: var(--text); font-size: 14px; line-height: 1.55;
    border-left: 3px solid var(--primary); display: none;
}
.mcq-explanation.is-visible { display: block; }
.mcq-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.mcq-locked-card {
    margin-top: 18px; background: var(--primary-xlight); border: 1px dashed var(--primary);
    padding: 16px; border-radius: 12px; text-align: center;
}
.mcq-result-summary {
    background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; text-align: center;
}
.mcq-result-pct { font-size: 56px; font-weight: 800; color: var(--primary); margin: 8px 0; line-height: 1; }
.mcq-result-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 18px 0; }
.mcq-result-stat { background: var(--bg); padding: 12px; border-radius: 10px; }
.mcq-result-stat .v { font-size: 22px; font-weight: 800; }
.mcq-result-stat .k { font-size: 12px; color: var(--text-soft); }

/* Pricing */
.price-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); margin-top: 18px; }
.price-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px;
    display: flex; flex-direction: column; position: relative;
}
.price-card.popular { border-color: var(--primary); box-shadow: 0 6px 20px rgba(217,119,6,.10); }
.price-card .ribbon {
    position: absolute; top: -10px; right: 16px; background: var(--primary); color: #fff;
    padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 700;
}
.price-name { font-weight: 700; font-size: 18px; }
.price-amount { font-size: 36px; font-weight: 800; margin: 8px 0; }
.price-amount .per { font-size: 14px; color: var(--text-soft); font-weight: 500; }
.price-features { list-style: none; padding: 0; margin: 12px 0 16px; flex: 1; }
.price-features li { padding: 5px 0 5px 22px; position: relative; font-size: 14px; color: var(--text); }
.price-features li::before { content: '✓'; color: var(--secondary); font-weight: 700; position: absolute; left: 0; }

/* Calm exam pill */
.exam-pill-calm {
    display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px;
    background: var(--secondary-light); color: #065F46; font-size: 12px; font-weight: 600;
}
.streak-pill-calm {
    display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px;
    background: var(--primary-xlight); color: var(--primary-dark); font-size: 12px; font-weight: 600;
}

/* Stats grid for dashboard */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); margin: 14px 0 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat-num { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { color: var(--text-soft); font-size: 13px; margin-top: 4px; }

/* Progress bar inline (small) */
.progress-mini { display: inline-block; width: 100%; height: 4px; background: var(--border-soft); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.progress-mini-fill { height: 100%; background: var(--secondary); border-radius: 99px; }

/* CSV import help */
.csv-help { background: var(--primary-xlight); padding: 12px 14px; border-radius: 10px; font-size: 13px; color: var(--text); border-left: 3px solid var(--primary); margin: 12px 0; }

/* Practice tab — locked teaser styling */
.locked-teaser {
    margin-top: 18px; padding: 18px; text-align: center; border: 1px dashed var(--primary);
    background: var(--primary-xlight); border-radius: 12px;
}
.locked-teaser h3 { margin: 0 0 6px; }
.locked-teaser p { color: var(--text-soft); margin: 0 0 12px; font-size: 14px; }

/* =====================================================================
   Budhigyan Furnish Patch — strict fonts, real-app header, modal MCQ
   Safe UI-only layer. It does not change routes/controllers/database logic.
   ===================================================================== */

.header-left,
.header-center,
.header-right { display: flex; align-items: center; gap: 10px; }
.header-left { min-width: 0; }
.header-center { flex: 1 1 auto; justify-content: center; min-width: 0; }
.header-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(38vw, 520px); }
.header-subtitle { margin-top: 1px; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.mobile-brand {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff;
    font-weight: 800; text-decoration: none;
}
.mobile-brand:hover { color: #fff; text-decoration: none; }
.plan-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px;
    background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 700;
    border: 1px solid rgba(217,119,6,.15);
}
.notification-pill {
    display: inline-flex; align-items: center; gap: 4px; min-width: 34px; height: 34px; justify-content: center;
    border: 1px solid var(--border); border-radius: 99px; background: #fff; color: var(--text); text-decoration: none;
    font-weight: 700; position: relative;
}
.notification-pill:hover { text-decoration: none; background: var(--bg); }
.notification-pill span {
    position: absolute; top: -5px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; display: grid; place-items: center; background: var(--danger); color: #fff;
    font-size: 10px; line-height: 18px; border: 2px solid #fff;
}
.user-chip { text-align: right; line-height: 1.15; }
.user-chip-name { font-weight: 700; font-size: 13px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-role { color: var(--text-soft); font-size: 11px; }
.logout-form { margin: 0; }

.app-header, .app-sidebar, .bottom-nav { font-family: var(--font-base) !important; }
.app-main { min-width: 0; }
.card, .chapter-card, .lesson-card, .stat-card, .price-card { border-radius: 16px; }
.card, .chapter-card, .lesson-card, .stat-card { box-shadow: var(--shadow); }
.btn { border-radius: 10px; min-height: 40px; }
.btn-sm { min-height: 32px; }

@media (max-width: 768px) {
    :root { --header-h: 58px; --bottom-nav-h: 68px; }
    .app-header { padding: 0 12px; gap: 8px; }
    .header-title { max-width: 38vw; font-size: 14px; }
    .header-right { gap: 6px; }
    .logout-form { display: none; }
    .avatar { width: 32px; height: 32px; }
    .streak-pill-calm { padding: 5px 9px; font-size: 11px; }
    .app-main { padding: 16px; padding-bottom: calc(18px + var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
    .bottom-nav a { font-size: 10.5px; }
}

/* MCQ modal experience: desktop popup, mobile full-screen app modal. */
.mcq-modal-page { position: relative; min-height: calc(100vh - var(--header-h) - 48px); }
.mcq-modal-overlay {
    position: fixed; inset: var(--header-h) 0 0 var(--sidebar-w); z-index: 20;
    display: grid; place-items: center; padding: 24px;
    background: rgba(31,41,55,.44); backdrop-filter: blur(4px);
}
.mcq-modal {
    width: min(760px, 100%); max-height: calc(100dvh - var(--header-h) - 48px); overflow: hidden;
    display: flex; flex-direction: column; background: var(--card); border-radius: 22px;
    border: 1px solid rgba(229,231,235,.85); box-shadow: 0 26px 80px rgba(15,23,42,.24);
}
.mcq-modal-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    padding: 18px 20px; border-bottom: 1px solid var(--border-soft); background: linear-gradient(135deg, #FFFBEB, #ECFDF5);
}
.mcq-modal-title { margin: 0; font-size: 20px; line-height: 1.25; }
.mcq-modal-subtitle { margin: 5px 0 0; color: var(--text-soft); font-size: 13px; }
.mcq-modal-close {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--text);
    display: grid; place-items: center; font-size: 22px; line-height: 1; cursor: pointer; text-decoration: none; flex: 0 0 36px;
}
.mcq-modal-close:hover { background: var(--primary-light); color: var(--primary-dark); text-decoration: none; }
.mcq-modal-body { overflow: auto; padding: 20px; }
.mcq-modal-footer {
    display: flex; gap: 10px; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-top: 1px solid var(--border-soft); background: #fff;
}
.mcq-modal .mcq-shell { max-width: none; margin: 0; padding: 0; }
.mcq-modal .mcq-card { border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.mcq-modal .mcq-progress { margin-bottom: 16px; }
.mcq-modal .mcq-actions { position: sticky; bottom: -20px; background: #fff; padding-top: 14px; padding-bottom: 2px; }
.mcq-option { min-height: 48px; }
.mcq-option span:last-child { min-width: 0; }
.mcq-feedback, .mcq-explanation { border-radius: 12px; }
.mcq-locked-card { border-radius: 16px; }
.mcq-result-modal .mcq-result-summary { box-shadow: none; border: 0; padding: 0; }
.mcq-intro-strip {
    display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 0 0 16px;
}
.mcq-intro-metric { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px; }
.mcq-intro-metric strong { display: block; font-size: 20px; line-height: 1; }
.mcq-intro-metric span { display: block; margin-top: 4px; font-size: 12px; color: var(--text-soft); }
.mcq-timer-pill {
    display: none; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
    background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 800;
}
.mcq-timer-pill.is-active { display: inline-flex; }
.mcq-timer-pill.is-warning { background: #FEF2F2; color: #991B1B; }

@media (max-width: 768px) {
    .mcq-modal-overlay { inset: 0; padding: 0; place-items: stretch; z-index: 80; background: #fff; }
    .mcq-modal { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; box-shadow: none; }
    .mcq-modal-header { padding: calc(12px + env(safe-area-inset-top)) 14px 12px; }
    .mcq-modal-title { font-size: 17px; }
    .mcq-modal-body { padding: 16px 14px; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
    .mcq-modal .mcq-actions {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border);
        background: #fff; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    }
    .mcq-modal .mcq-actions .btn { width: 100%; }
    .mcq-modal .mcq-actions .btn-secondary { grid-column: 1 / -1; }
    .mcq-intro-strip { grid-template-columns: 1fr; }
    .mcq-question { font-size: 17px; }
    .bottom-nav { z-index: 25; }
}

@media (min-width: 769px) {
    .mcq-modal-page .bottom-nav { display: none; }
}


/* =====================================================================
   Stage 3A — Student graphical mobile-first shell
   Scope: student dashboard + learn shell only. Admin is intentionally unchanged.
   ===================================================================== */
:root {
    --royal-navy: #0B1B3A;
    --royal-navy-2: #132B57;
    --royal-gold: #D4A017;
    --royal-gold-2: #F2C94C;
    --royal-ivory: #FFF8E7;
    --royal-cream: #FFFCF2;
    --student-shadow: 0 16px 42px rgba(11,27,58,.12);
    --student-shadow-sm: 0 8px 22px rgba(11,27,58,.08);
}

.student-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 14px 96px;
}
.student-stage {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 20px;
    margin-bottom: 18px;
    background:
        radial-gradient(circle at 12% 8%, rgba(242,201,76,.30), transparent 28%),
        radial-gradient(circle at 88% 14%, rgba(255,255,255,.18), transparent 26%),
        linear-gradient(135deg, var(--royal-navy), var(--royal-navy-2));
    color: #fff;
    box-shadow: var(--student-shadow);
}
.student-stage::after {
    content: "";
    position: absolute;
    inset: auto -34px -64px auto;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: rgba(212,160,23,.16);
    border: 1px solid rgba(242,201,76,.28);
}
.student-stage a { color: #fff; }
.student-stage .muted { color: rgba(255,255,255,.78); }
.student-stage-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 18px;
    align-items: center;
}
.student-logo-seal {
    width: 112px;
    height: 112px;
    border-radius: 999px;
    padding: 6px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    object-fit: contain;
}
.student-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.20);
    color: rgba(255,255,255,.88);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.student-stage h1 {
    margin: 10px 0 6px !important;
    font-size: clamp(25px, 5vw, 42px);
    line-height: 1.08;
    letter-spacing: -.03em;
}
.student-stage p { max-width: 650px; }
.student-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.student-actions .btn {
    border-radius: 999px;
    padding: 11px 16px;
}
.student-actions .btn-primary {
    background: linear-gradient(135deg, var(--royal-gold), var(--royal-gold-2));
    border-color: rgba(255,255,255,.12);
    color: var(--royal-navy);
    box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.student-actions .btn-outline {
    color: #fff;
    border-color: rgba(255,255,255,.32);
    background: rgba(255,255,255,.08);
}
.student-actions .btn-outline:hover { background: rgba(255,255,255,.16); }
.student-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.student-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 7px 11px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.90);
    font-size: 12px;
    font-weight: 700;
}
.student-section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0 10px;
}
.student-section-title h2,
.student-section-title h3 { margin: 0; }
.student-section-title .muted { margin: 2px 0 0; }
.student-quick-grid,
.student-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.student-quick-card,
.stat-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #FFFFFF, var(--royal-cream));
    border: 1px solid rgba(212,160,23,.22);
    border-radius: 22px;
    box-shadow: var(--student-shadow-sm);
}
.student-quick-card {
    min-height: 124px;
    padding: 16px;
    color: var(--text);
    text-decoration: none !important;
}
.student-quick-card::before,
.stat-card::before,
.tile::before,
.chapter-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--royal-gold), var(--secondary));
}
.student-quick-icon {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(212,160,23,.16);
    color: var(--royal-navy);
    font-size: 22px;
    margin-bottom: 10px;
}
.student-quick-title { font-weight: 800; margin: 0 0 4px; color: var(--royal-navy); }
.student-quick-meta { color: var(--text-soft); font-size: 13px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.stat-card { padding: 16px; }
.stat-num { color: var(--royal-navy); font-size: 28px; letter-spacing: -.03em; }
.stat-label { color: var(--text-soft); font-weight: 700; }
.tile-grid { grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 14px; }
.tile {
    position: relative;
    overflow: hidden;
    min-height: 145px;
    border-radius: 24px;
    border-color: rgba(212,160,23,.22);
    background:
        radial-gradient(circle at 86% 14%, rgba(212,160,23,.16), transparent 24%),
        linear-gradient(180deg, #fff, var(--royal-cream));
    box-shadow: var(--student-shadow-sm);
}
.tile:hover { border-color: var(--royal-gold); box-shadow: var(--student-shadow); }
.tile-accent {
    width: 46px;
    height: 46px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--royal-gold), var(--secondary)) !important;
    margin-bottom: 13px;
    box-shadow: inset 0 -8px 16px rgba(11,27,58,.12);
}
.tile-accent::after { content: "📘"; display: grid; place-items: center; height: 100%; font-size: 22px; }
.tile-eyebrow { font-weight: 800; color: var(--royal-gold); }
.tile-title { color: var(--royal-navy); font-size: 18px; line-height: 1.25; }
.chapter-grid { gap: 14px; }
.chapter-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border-color: rgba(212,160,23,.22);
    background: linear-gradient(180deg, #fff, var(--royal-cream));
    box-shadow: var(--student-shadow-sm);
}
.chapter-card:hover { border-color: var(--royal-gold); box-shadow: var(--student-shadow); }
.chapter-no { color: var(--royal-gold); font-weight: 800; }
.chapter-title { color: var(--royal-navy); font-size: 17px; }
.lesson-card { border-radius: 22px; box-shadow: var(--student-shadow-sm); border-color: rgba(212,160,23,.22); }
.lesson-thumb { background: linear-gradient(135deg, rgba(11,27,58,.95), rgba(212,160,23,.72)); }
.play-pip { background: rgba(255,255,255,.94); color: var(--royal-navy); box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.tabs { border: 0; background: rgba(11,27,58,.06); padding: 5px; border-radius: 999px; width: fit-content; max-width: 100%; }
.tab-btn { border: 0; border-radius: 999px; padding: 10px 16px; }
.tab-btn[aria-selected="true"] { background: var(--royal-navy); color: #fff; }
.premium-tag { background: rgba(212,160,23,.16) !important; color: var(--royal-navy) !important; }
.locked-teaser {
    border: 1px solid rgba(212,160,23,.24);
    border-radius: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--royal-navy), var(--royal-navy-2));
    color: #fff;
    box-shadow: var(--student-shadow);
}
.locked-teaser p { color: rgba(255,255,255,.78); }
.locked-teaser .btn { border-radius: 999px; background: linear-gradient(135deg, var(--royal-gold), var(--royal-gold-2)); color: var(--royal-navy); border: 0; }
.student-learn-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    margin: 0 0 12px;
    color: rgba(255,255,255,.76);
}
.student-learn-breadcrumbs a { color: rgba(255,255,255,.82); text-decoration: none; }
.student-learn-breadcrumbs .sep { opacity: .55; }

@media (max-width: 900px) {
    .student-quick-grid,
    .student-stat-grid,
    .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 768px) {
    body { background: linear-gradient(180deg, var(--royal-ivory), #FFFFFF); }
    .student-shell { padding: 12px 2px 92px; }
    .student-stage { border-radius: 24px; padding: 18px; margin: 0 0 14px; }
    .student-stage-inner { grid-template-columns: 1fr; }
    .student-logo-seal { width: 86px; height: 86px; order: -1; }
    .student-stage h1 { font-size: 29px; }
    .student-actions .btn { flex: 1 1 auto; min-height: 44px; }
    .tile-grid, .chapter-grid, .lesson-grid { grid-template-columns: 1fr; }
    .tile, .chapter-card, .lesson-card { border-radius: 22px; }
    .student-quick-grid,
    .student-stat-grid,
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-num { font-size: 24px; }
    .bottom-nav {
        border-top: 1px solid rgba(212,160,23,.22);
        box-shadow: 0 -12px 28px rgba(11,27,58,.10);
    }
    .bottom-nav a.active { color: var(--royal-navy); background: rgba(212,160,23,.18); }
}
@media (max-width: 420px) {
    .student-quick-grid,
    .student-stat-grid,
    .stat-grid { grid-template-columns: 1fr; }
    .student-chip { width: 100%; justify-content: center; }
}

/* Stage 3A fix: student pages must not render the admin shell. */
.student-body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 4%, rgba(212,160,23,.20), transparent 28%),
        linear-gradient(180deg, var(--royal-ivory, #FFF8E7), #FFFFFF 58%);
    color: var(--text, #14213D);
    font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.student-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px clamp(12px, 3vw, 28px);
    border-bottom: 1px solid rgba(212,160,23,.20);
    background: rgba(255,248,231,.92);
    backdrop-filter: blur(14px);
}
.student-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--royal-navy, #0B1B3A);
    text-decoration: none;
    min-width: 0;
}
.student-brand img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 8px 20px rgba(11,27,58,.12);
}
.student-brand strong { display: block; font-size: 16px; line-height: 1.05; letter-spacing: -.01em; }
.student-brand em { display: block; font-style: normal; font-size: 11px; color: rgba(11,27,58,.62); white-space: nowrap; }
.student-top-actions { display: flex; align-items: center; gap: 8px; }
.student-top-name { font-weight: 800; color: var(--royal-navy, #0B1B3A); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-page {
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
    padding: 16px 0 96px;
}
.student-page .student-shell { padding: 0; }
.student-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 60;
    display: none;
    width: min(560px, calc(100% - 18px));
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(212,160,23,.25);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 18px 40px rgba(11,27,58,.16);
    backdrop-filter: blur(16px);
}
.student-bottom-nav a {
    min-height: 50px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(11,27,58,.66);
    text-decoration: none;
    font-weight: 800;
    font-size: 11px;
}
.student-bottom-nav a span { font-size: 19px; line-height: 1; }
.student-bottom-nav a em { font-style: normal; }
.student-bottom-nav a.active {
    color: var(--royal-navy, #0B1B3A);
    background: rgba(212,160,23,.18);
}
@media (max-width: 768px) {
    .student-topbar { padding: 8px 10px; }
    .student-brand img { width: 40px; height: 40px; }
    .student-brand em { display: none; }
    .student-top-name { display: none; }
    .student-top-actions .btn { padding: 8px 10px; }
    .student-page { width: min(100% - 18px, 560px); padding-top: 10px; }
    .student-bottom-nav { display: grid; }
}

/* =====================================================================
   Stage 3A Polish — mobile spacing, logo sizing, nav overlap fix
   Scope: student pages only. Admin remains unchanged.
   ===================================================================== */
.student-body {
    overflow-x: hidden;
}
.student-page {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
.student-page .student-shell {
    padding-bottom: 0;
}
.student-brand img {
    width: 44px;
    height: 44px;
}
.student-stage {
    padding: 18px;
    margin-bottom: 16px;
}
.student-stage-inner {
    gap: 14px;
}
.student-logo-seal {
    width: 94px;
    height: 94px;
    padding: 5px;
}
.student-stage h1 {
    margin: 8px 0 5px !important;
    letter-spacing: -.025em;
}
.student-stage p {
    margin-top: 4px;
    line-height: 1.55;
}
.student-chip-row {
    margin-top: 12px;
}
.student-chip {
    min-height: 36px;
}
.student-actions {
    margin-top: 13px;
}
.student-actions .btn {
    min-height: 48px;
    font-size: 15px;
}
.student-actions .btn-outline {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.36);
    box-shadow: none;
}
.student-quick-grid,
.student-stat-grid,
.stat-grid,
.tile-grid,
.chapter-grid {
    gap: 14px;
}
.student-quick-card {
    min-height: 116px;
    padding: 15px;
}
.student-section-title {
    margin: 18px 0 10px;
}
.student-bottom-nav {
    bottom: max(12px, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
    .student-topbar {
        min-height: 64px;
        padding: 8px 12px;
    }
    .student-brand img {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }
    .student-brand strong {
        font-size: 17px;
    }
    .student-page {
        width: min(100% - 18px, 560px);
        padding-top: 12px;
        padding-bottom: calc(122px + env(safe-area-inset-bottom));
    }
    .student-stage {
        border-radius: 24px;
        padding: 16px;
        margin-bottom: 14px;
    }
    .student-stage::after {
        width: 148px;
        height: 148px;
        right: -44px;
        bottom: -58px;
    }
    .student-logo-seal {
        width: 78px;
        height: 78px;
        box-shadow: 0 8px 22px rgba(0,0,0,.20);
    }
    .student-kicker {
        font-size: 11px;
        padding: 5px 9px;
        max-width: 100%;
    }
    .student-stage h1 {
        font-size: 27px;
        line-height: 1.12;
    }
    .student-stage p {
        font-size: 15px;
        line-height: 1.55;
    }
    .student-chip-row {
        gap: 7px;
    }
    .student-chip {
        width: auto;
        flex: 1 1 100%;
        justify-content: center;
        padding: 7px 10px;
    }
    .student-actions {
        gap: 9px;
    }
    .student-actions .btn {
        min-height: 46px;
        padding: 10px 13px;
    }
    .student-quick-card {
        min-height: 108px;
        padding: 14px;
    }
    .student-quick-icon {
        width: 38px;
        height: 38px;
        border-radius: 14px;
        font-size: 20px;
        margin-bottom: 8px;
    }
    .student-bottom-nav {
        width: min(560px, calc(100% - 20px));
        padding: 6px;
        border-radius: 20px;
    }
    .student-bottom-nav a {
        min-height: 48px;
        border-radius: 15px;
        font-size: 10.5px;
    }
    .student-bottom-nav a span {
        font-size: 18px;
    }
}

@media (max-width: 420px) {
    .student-stage h1 {
        font-size: 25px;
    }
    .student-actions {
        grid-template-columns: 1fr;
    }
    .student-actions .btn {
        width: 100%;
    }
}

/* =====================================================================
   Stage 3B — Student Learn Flow graphical polish
   Scope: student learn pages only. No admin/database/MCQ logic changes.
   ===================================================================== */
.learn-flow-shell {
    padding-bottom: 0;
}
.learn-hero.compact {
    margin-bottom: 14px;
}
.learn-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}
.learn-stepper span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    color: rgba(255,255,255,.76);
    font-size: 11px;
    font-weight: 800;
}
.learn-stepper span.is-active {
    background: linear-gradient(135deg, var(--royal-gold), var(--royal-gold-2));
    color: var(--royal-navy);
    border-color: transparent;
}
.learn-stepper span.is-done {
    color: #fff;
    background: rgba(255,255,255,.18);
}
.learn-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}
.learn-select-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 13px;
    align-items: center;
    min-height: 138px;
    padding: 17px;
    border-radius: 26px;
    background:
        radial-gradient(circle at 92% 10%, rgba(212,160,23,.14), transparent 28%),
        linear-gradient(180deg, #FFFFFF, var(--royal-cream));
    border: 1px solid rgba(212,160,23,.24);
    box-shadow: var(--student-shadow-sm);
    color: var(--text);
    text-decoration: none !important;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.learn-select-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--royal-gold), var(--secondary));
}
.learn-select-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--student-shadow);
    border-color: var(--royal-gold);
}
.learn-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: rgba(212,160,23,.16);
    color: var(--royal-navy);
    font-size: 24px;
    font-weight: 900;
    box-shadow: inset 0 -10px 18px rgba(11,27,58,.08);
}
.learn-class-card .learn-card-icon {
    font-size: 20px;
    background: rgba(11,27,58,.08);
}
.learn-card-body { min-width: 0; }
.learn-card-kicker {
    display: block;
    color: var(--royal-gold);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.learn-card-body h2 {
    margin: 0 0 5px;
    color: var(--royal-navy);
    font-size: 18px;
    line-height: 1.22;
}
.learn-card-body p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
}
.learn-card-arrow {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(11,27,58,.06);
    color: var(--royal-navy);
    font-size: 22px;
    font-weight: 900;
}
.learn-empty-card {
    border: 1px dashed rgba(212,160,23,.42);
    border-radius: 24px;
    background: rgba(255,255,255,.78);
    padding: 24px;
    text-align: center;
    box-shadow: var(--student-shadow-sm);
}
.learn-empty-card strong {
    display: block;
    color: var(--royal-navy);
    font-size: 17px;
}
.learn-empty-card p {
    margin: 6px 0 0;
    color: var(--text-soft);
}
.learn-path-list {
    display: grid;
    gap: 12px;
}
.learn-path-card {
    border-radius: 24px;
    background: linear-gradient(180deg, #FFFFFF, var(--royal-cream));
    border: 1px solid rgba(212,160,23,.24);
    box-shadow: var(--student-shadow-sm);
    overflow: hidden;
}
.learn-path-card.is-locked {
    background: linear-gradient(180deg, #fff, #FFF7DC);
}
.learn-path-link {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 16px;
    color: inherit;
    text-decoration: none !important;
}
.learn-path-number {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--royal-gold), var(--royal-gold-2));
    color: var(--royal-navy);
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(212,160,23,.24);
}
.learn-path-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--royal-gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.learn-path-main h2 {
    margin: 4px 0 6px;
    color: var(--royal-navy);
    font-size: 17px;
    line-height: 1.28;
}
.learn-path-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}
.learn-progress {
    margin-top: 8px;
    height: 7px;
    background: rgba(11,27,58,.08);
}
.learn-tab-shell {
    display: grid;
    gap: 14px;
}
.learn-tabs {
    position: sticky;
    top: 74px;
    z-index: 20;
    width: 100%;
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.learn-tabs .tab-btn {
    width: 100%;
    min-height: 42px;
    font-weight: 900;
}
.premium-lesson-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}
.premium-lesson-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(212,160,23,.24);
}
.premium-lesson-card .lesson-thumb {
    position: relative;
    min-height: 154px;
}
.lesson-index,
.preview-tag {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 1;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    background: rgba(255,255,255,.92);
    color: var(--royal-navy);
}
.preview-tag {
    left: auto;
    right: 9px;
    background: var(--secondary);
    color: #fff;
}
.practice-start-card {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-radius: 26px;
    border: 1px solid rgba(212,160,23,.24);
    background: linear-gradient(135deg, #FFFFFF, var(--royal-cream));
    box-shadow: var(--student-shadow-sm);
}
.practice-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(212,160,23,.16);
    font-size: 25px;
}
.practice-start-card h2 {
    margin: 0 0 3px;
    color: var(--royal-navy);
    font-size: 19px;
}
.practice-start-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}
.chapter-focus-hero .student-actions .btn {
    min-width: 140px;
}
@media (max-width: 768px) {
    .learn-card-grid,
    .premium-lesson-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .learn-select-card {
        min-height: 118px;
        border-radius: 22px;
        padding: 14px;
        gap: 11px;
    }
    .learn-card-icon {
        width: 48px;
        height: 48px;
        border-radius: 18px;
        font-size: 22px;
    }
    .learn-card-body h2 {
        font-size: 17px;
    }
    .learn-path-link {
        grid-template-columns: auto minmax(0,1fr);
        padding: 14px;
    }
    .learn-path-link .learn-card-arrow {
        display: none;
    }
    .learn-tabs {
        top: 66px;
    }
    .practice-start-card {
        grid-template-columns: auto minmax(0,1fr);
    }
    .practice-start-card .btn {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 46px;
    }
    .student-stage .learn-stepper span {
        flex: 1 1 calc(50% - 6px);
    }
}

/* =====================================================================
   Stage 3 language + no-footer patch
   Scope: make language selector available on every dashboard/header and
   suppress footer output everywhere.
   ===================================================================== */
footer,
.site-footer,
.public-footer,
.footer {
    display: none !important;
}

.lang-switch-global {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid rgba(217,119,6,.20);
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    white-space: nowrap;
}
.lang-switch-global a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-soft, #6B7280);
    text-decoration: none;
    line-height: 1;
}
.lang-switch-global a.active {
    background: var(--primary-light, #FEF3C7);
    color: var(--primary-dark, #B45309);
}
.lang-switch-global a:hover { text-decoration: none; }

.student-lang-switch {
    border-color: rgba(212,160,23,.28);
    background: rgba(255,255,255,.88);
}
.student-lang-switch a.active {
    background: rgba(212,160,23,.20);
    color: var(--royal-navy, #0B1B3A);
}

@media (max-width: 768px) {
    .header-right {
        gap: 6px;
        flex-wrap: nowrap;
    }
    .dashboard-lang-switch,
    .public-lang-switch,
    .student-lang-switch {
        display: inline-flex !important;
    }
    .dashboard-lang-switch a,
    .public-lang-switch a,
    .student-lang-switch a {
        min-height: 26px;
        padding: 5px 7px;
        font-size: 11px;
    }
    .student-top-actions {
        gap: 6px;
    }
    .student-top-actions .btn {
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 390px) {
    .student-brand strong { font-size: 14px; }
    .student-brand img { width: 38px; height: 38px; flex-basis: 38px; }
    .student-lang-switch a,
    .dashboard-lang-switch a,
    .public-lang-switch a {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 10px;
    }
}
