/* ============================================================
   EduJA — Stylesheet
   Jamaican MOE-aligned Grades 7-12 learning platform
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: radial-gradient(circle at 0% 30%, #000000 0%, #006633 45%, #FDB827 100%);
    min-height: 100vh;
    padding: 10px;
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(253, 184, 39, 0.3);
}

@media (max-width: 768px) {
    body { padding: 8px; }
    .top-bar { flex-direction: column; text-align: center; padding: 10px 12px; gap: 8px; }
    .nav-header { flex-direction: column; padding: 8px 10px; gap: 8px; }
    .nav-links { justify-content: center; flex-wrap: wrap; gap: 4px; }
    .dropbtn, .grade-btn { padding: 8px 12px; font-size: 0.8rem; }
    .search-logout { justify-content: center; margin-top: 5px; }
    .search-btn, .logout-btn { padding: 6px 14px; font-size: 0.8rem; }
    .grade-grid { gap: 12px; }
    .grade-module h2 { font-size: 1.2rem; }
    .lesson-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; }
    .lesson-title { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .lesson-grid { grid-template-columns: 1fr; }
    .grade-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grade-grid { grid-template-columns: repeat(2, 1fr); }
    .lesson-grid { grid-template-columns: repeat(3, 1fr); }
}

button, .grade-subject-btn, .subject-btn, .reset-btn, .search-btn, .logout-btn, .payment-btn {
    min-height: 44px;
    cursor: pointer;
    transition: 0.2s;
}

.top-bar {
    background: rgba(0, 119, 73, 0.9);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 2px solid #FDB827;
}

.logo {
    display: flex;
    align-items: center;
    background: #000000cc;
    padding: 4px 16px;
    border-radius: 40px;
    cursor: pointer;
}
.logo-text { font-size: 22px; font-weight: 800; }
@media (max-width: 768px) { .logo-text { font-size: 18px; } }
.logo-text .edu { color: #FDB827; }
.logo-text .ja { color: #00cc66; background: #000000aa; padding: 0 5px; border-radius: 30px; margin-left: 3px; }

.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 40px;
    flex-wrap: wrap;
    justify-content: center;
}
.welcome-msg { color: #FDB827; font-weight: bold; background: #000000aa; padding: 5px 10px; border-radius: 30px; font-size: 0.8rem; }
.student-name-btn { background: #FDB827; border: none; padding: 5px 12px; border-radius: 30px; font-weight: bold; font-size: 0.8rem; }

.nav-header {
    background: #0a0f0fdd;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #FDB827;
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.dropdown { position: relative; display: inline-block; }
.dropbtn, .grade-btn { background: transparent; color: #FDB827; padding: 8px 12px; font-weight: 600; border: none; cursor: pointer; border-radius: 30px; font-size: 0.85rem; }
.dropbtn:hover, .grade-btn:hover { background-color: #FDB827; color: #000; }
.dropdown-content { display: none; position: absolute; background-color: #1e2a1e; min-width: 160px; border-radius: 12px; top: 40px; left: 0; z-index: 1000; }
.dropdown-content a { color: #FDB827; padding: 8px 14px; display: block; border-bottom: 1px solid #3a4a2a; font-size: 0.8rem; cursor: pointer; }
.dropdown-content a:hover { background-color: #FDB827; color: #000; }
.dropdown:hover .dropdown-content { display: block; }

.grade-dropdown { position: relative; display: inline-block; }
.grade-content { display: none; position: absolute; background-color: #1e2a1e; min-width: 150px; border-radius: 12px; top: 40px; left: 0; z-index: 1000; }
.grade-content a { color: #FDB827; padding: 8px 14px; display: block; border-bottom: 1px solid #3a4a2a; font-size: 0.8rem; cursor: pointer; }
.grade-content a:hover { background-color: #FDB827; color: #000; }
.grade-dropdown:hover .grade-content { display: block; }

.nested-dropdown { position: relative; }
.nested-content { display: none; position: absolute; background-color: #1e2a1e; min-width: 140px; border-radius: 12px; top: 0; left: 100%; z-index: 1001; }
.nested-dropdown:hover .nested-content { display: block; }

.search-logout { display: flex; gap: 8px; }
.search-btn, .logout-btn {
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.search-btn { background: #FDB827; color: #000; }
.logout-btn { background: #b91c1c; color: white; }

.main-content { padding: 12px; background: rgba(0, 0, 0, 0.5); }

.grade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.grade-module {
    background: rgba(30, 42, 30, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(253, 184, 39, 0.3);
    padding: 20px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}
.grade-module:active, .grade-module:hover { background: #2a3a2a; border-color: #FDB827; transform: scale(0.98); }
.grade-module-icon { font-size: 1.8rem; margin-bottom: 4px; }
.grade-module h2 { color: #FDB827; font-size: 1.15rem; margin: 0; }
.grade-module p { color: #aaa; font-size: 0.75rem; margin: 3px 0 0; }

.back-to-grades-btn {
    background: transparent;
    border: 1px solid #FDB827;
    color: #FDB827;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    margin-bottom: 14px;
}
.back-to-grades-btn:active, .back-to-grades-btn:hover { background: #2a3a2a; }

.subject-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.subject-select-btn {
    background: #1e2a1e;
    border: 1px solid #3a4a3a;
    padding: 18px 12px;
    border-radius: 12px;
    color: #f5e7c8;
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
}
.subject-select-btn:active, .subject-select-btn:hover { background: #2a3a2a; border-color: #FDB827; }
.subject-select-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.soon-tag { display: block; font-size: 0.65rem; color: #FDB827; margin-top: 4px; }

.curriculum-container {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    padding: 12px;
    color: #f5e7c8;
    max-height: 550px;
    overflow-y: auto;
}

h1 { color: #FDB827; font-size: 1.4rem; margin-bottom: 8px; }

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 10px;
}

.lesson-card {
    background: #1e2a1e;
    border-radius: 10px;
    padding: 10px;
    transition: 0.1s;
    cursor: pointer;
    border: 1px solid #3a4a3a;
}
.lesson-card:active { background: #2a3a2a; transform: scale(0.98); }
.lesson-card.completed { opacity: 0.6; background: #2a3a2a; }
.lesson-title { font-weight: bold; color: #FDB827; margin-bottom: 4px; font-size: 0.8rem; }
.lesson-status { font-size: 0.65rem; color: #aaa; }

.progress-container { background: #2a3a2a; border-radius: 30px; margin-bottom: 12px; padding: 4px; }
.progress-bar { background: #FDB827; height: 20px; border-radius: 30px; width: 0%; text-align: center; color: #000; font-weight: bold; line-height: 20px; font-size: 0.7rem; }

.reset-btn { background: #b91c1c; color: white; border: none; padding: 6px 14px; border-radius: 30px; cursor: pointer; font-size: 0.75rem; min-height: 36px; }

.footer {
    background: #020804ee;
    padding: 16px 12px;
    border-top: 1px solid #FDB827;
}
.footer-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 15px;
    max-width: 800px;
    margin: 0 auto;
}
.footer-grid button,
.footer-grid a {
    background: none;
    border: none;
    color: #FDB827;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}
.copyright { text-align: center; margin-top: 12px; font-size: 0.6rem; opacity: 0.8; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #3a4a3a;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-back-to-top {
    background: #FDB827;
    color: #000;
    border: none;
    border-radius: 40px;
    padding: 6px 14px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dashboard-container {
    background: rgba(10, 21, 10, 0.9);
    border-radius: 16px;
    padding: 12px;
}
.dashboard-container h1, .dashboard-container h2 { color: #FDB827; font-size: 1.2rem; }
.subject-stat { background: #1e2a1e; border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.subject-stat h3 { color: #FDB827; font-size: 0.85rem; margin-bottom: 6px; }
.stat-bar { background: #2a3a2a; border-radius: 20px; height: 16px; overflow: hidden; }
.stat-fill { background: #FDB827; height: 100%; width: 0%; border-radius: 20px; }
.stat-text { font-size: 0.7rem; margin-top: 4px; }
.total-progress { background: #1e2a1e; border: 1px solid #FDB827; border-radius: 16px; padding: 10px; text-align: center; margin-bottom: 12px; }

.payment-btn {
    background: #FDB827;
    color: #000;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.75rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 15px;
}
.modal-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border: 2px solid #FDB827;
    color: #1a1a2e;
    position: relative;
}
.modal-content h3 { color: #006633; font-size: 1.2rem; margin-bottom: 12px; }
.close-x {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}
.close-modal {
    background: #b91c1c;
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    margin-top: 12px;
    cursor: pointer;
    display: inline-block;
    border: none;
    font-size: 0.8rem;
}
.quiz-option {
    background: #f0f0e8;
    padding: 8px;
    margin: 6px 0;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #ccc;
    font-size: 0.8rem;
}
.voice-btn {
    background: #e8e8e0;
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    color: #006633;
    margin: 5px 0;
    font-size: 0.75rem;
}
.tts-player {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #f0f0e8;
    border-radius: 20px;
    padding: 6px 12px;
    margin: 8px 0;
}
.tts-play-btn {
    background: #006633;
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
}
.tts-play-btn.playing { background: #FDB827; color: #1a1a2e; }
.tts-play-btn:disabled { background: #ccc; color: #666; cursor: not-allowed; }
.tts-volume-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}
.tts-volume-slider {
    width: 90px;
    accent-color: #006633;
    cursor: pointer;
}
.tts-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 4px;
    vertical-align: middle;
    line-height: 1;
}

/* Lesson mascots — one character per grade (see js/app.js
   MASCOT_BY_GRADE), shown on every subject in that grade. These rules
   are shared/generic by design (id- and character-agnostic) so every
   mascot reuses them as-is. Sits above the read-aloud player; bobs
   gently at rest and "talks" while narration is playing. */
.mascot-narration-block { display: flex; justify-content: center; margin: 4px 0 10px; }
.mascot-wrap { position: relative; width: 120px; text-align: center; }
.mascot-wrap svg { display: block; margin: 0 auto; animation: mascotBob 2.6s ease-in-out infinite; }
.mascot-wrap.mascot-talking svg { animation: mascotBob 0.9s ease-in-out infinite; }
.mascot-wrap #mascotMouth { transform-box: fill-box; transform-origin: 50% 50%; }
.mascot-wrap.mascot-talking #mascotMouth { animation: mascotTalk 0.35s ease-in-out infinite; }
@keyframes mascotBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes mascotTalk {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.6); }
}
.mascot-speech-bubble {
    margin-top: 8px;
    background: #FFF4D6;
    color: #1a1a2e;
    border: 2px solid #FDB827;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    position: relative;
}
.mascot-speech-bubble::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent #FDB827 transparent;
}
@media (prefers-reduced-motion: reduce) {
    .mascot-wrap svg, .mascot-wrap #mascotMouth { animation: none !important; }
}
.tts-icon-btn:hover { transform: scale(1.15); }

.access-gate {
    text-align: center;
    padding: 40px 20px;
    background: #f0f0e8;
    border-radius: 16px;
    margin-top: 10px;
}
.access-gate-icon { font-size: 2.5rem; margin-bottom: 8px; }
.access-gate h2 { margin: 4px 0 10px; color: #1a1a2e; }
.access-gate p { font-size: 0.9rem; opacity: 0.85; max-width: 420px; margin: 0 auto 18px; }
.access-gate-btn {
    background: #006633;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
}
.access-gate-btn:hover { background: #004d26; }
.video-placeholder {
    background: #1a1a2e;
    padding: 12px;
    border-radius: 12px;
    margin: 10px 0;
    text-align: center;
}
.video-placeholder iframe {
    width: 100%;
    border-radius: 8px;
}
.quiz-feedback { margin-top: 8px; padding: 8px; border-radius: 8px; font-size: 0.8rem; }
.correct { background: #d4ecd4; color: #2d6a2d; border-left: 4px solid #2d6a2d; }
.incorrect { background: #f0d4d4; color: #b91c1c; border-left: 4px solid #b91c1c; }
.quiz-block { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e5e5e0; }
.quiz-block:last-of-type { border-bottom: none; }
.quiz-q-text { font-size: 0.85rem; margin-bottom: 6px; }
.quiz-score-summary { margin-top: 10px; padding: 10px; border-radius: 8px; background: #f0f0e8; font-weight: bold; font-size: 0.85rem; text-align: center; color: #1a1a2e; }

.payment-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}
.payment-content {
    background: white;
    padding: 20px;
    border-radius: 20px;
    max-width: 350px;
    width: 90%;
    text-align: center;
}
.plan-option {
    background: #f0f0e8;
    margin: 8px 0;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

/* "Install the app" button — js/install-prompt.js (redesigned
   Aug 2026: a small, neat, clearly-visible pill button bottom-right
   instead of the old full-width bar). Slides/fades in, sits above
   everything except the lesson/payment modals. */
.eduja-install-fab {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #00cc66;
    color: #06210f;
    border: none;
    border-radius: 30px;
    padding: 10px 16px 10px 12px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    z-index: 2500;
    transform: translateY(90px);
    opacity: 0;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}
.eduja-install-fab.visible { transform: translateY(0); opacity: 1; }
.eduja-install-fab .eduja-install-fab-icon { font-size: 1rem; }
.eduja-install-fab-close {
    position: fixed;
    right: 8px;
    bottom: 46px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1e2a1e;
    color: #f5e7c8;
    border: 1px solid #3a4a3a;
    font-size: 0.62rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2501;
    opacity: 0;
    transform: translateY(90px);
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}
.eduja-install-fab-close.visible { transform: translateY(0); opacity: 1; }
/* iOS has no native install prompt, so tapping the FAB there shows
   this small instruction bubble instead of a big banner. */
.eduja-install-popover {
    position: fixed;
    right: 16px;
    bottom: 68px;
    max-width: 230px;
    background: #1e2a1e;
    color: #f5e7c8;
    border: 1px solid #3a4a3a;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.76rem;
    line-height: 1.4;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    z-index: 2501;
}
@media (max-width: 420px) {
    .eduja-install-fab { right: 10px; bottom: 10px; padding: 9px 14px 9px 11px; font-size: 0.76rem; }
    .eduja-install-fab-close { right: 4px; bottom: 42px; }
    .eduja-install-popover { right: 10px; max-width: 200px; }
}

.completion-badge {
    background: #FDB827;
    color: #000;
    text-align: center;
    padding: 8px;
    border-radius: 30px;
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.7rem;
}

/* "Plans" nav button (site tweak, Aug 2026) — js/nav-plan-button.js.
   Sits next to the Cart button in the top-bar on every page (or
   floats on pages with no top-bar, e.g. the sign-in portal) so
   shoppers don't have to click the cart icon to see plans. Green
   accent so it's visually distinct from the gold cart/account
   buttons next to it. */
.plans-nav-btn { background: #00cc66; color: #06210f; }
.plans-nav-btn-floating {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Referral widget share button (site tweak, Aug 2026) — js/app.js
   and js/teacher.js. Turns the old plain-text banner into a real
   one-tap share action: native share sheet where available
   (Android/iOS — usually includes WhatsApp, SMS, email...),
   clipboard copy as the fallback. */
.referral-widget-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    text-align: left;
}
.referral-widget-text { flex: 1 1 220px; }
.referral-share-btn {
    background: #00cc66;
    color: #06210f;
    border: none;
    border-radius: 30px;
    padding: 7px 16px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}
.referral-share-btn:hover { background: #1fe07f; }

/* ============================================================
   Assignment notifications + teacher chat (student-facing).
   See sql/016_external_assignments.sql, 017_messages_chat.sql,
   018_enable_realtime.sql, and js/app.js.
   ============================================================ */
.notif-bell-btn { position: relative; }
.notif-badge {
    position: absolute;
    top: -6px; right: -6px;
    background: #b91c1c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 30px;
    text-align: center;
    padding: 0 3px;
}
/* The "flashing notice" — a slow pulse on the bell/chat button itself
   while there's something unread, so it catches the eye without
   needing sound or a browser permission prompt. */
@keyframes eduja-flash-alert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.65); }
    50% { box-shadow: 0 0 0 7px rgba(185, 28, 28, 0); }
}
.flash-alert { animation: eduja-flash-alert 1.4s infinite; }

.flash-notif-banner {
    background: #FDB827;
    color: #000;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 0.85rem;
    animation: eduja-flash-alert 1.4s ease-in-out 3;
}
.flash-notif-dismiss {
    background: none;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    color: #000;
    opacity: 0.7;
}
.flash-notif-dismiss:hover { opacity: 1; }

.assign-submit-btn {
    background: #FDB827; color: #000; border: none; padding: 9px 15px;
    border-radius: 30px; font-weight: bold; font-size: 0.8rem; cursor: pointer;
}
.user-sub { font-size: 0.72rem; color: #666; margin-top: 3px; }

.assignment-card {
    background: rgba(0, 0, 0, 0.55);
    color: #f5e7c8;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.assignment-card .user-sub { color: #ccc; }
.assignment-card.assignment-new { border: 2px solid #FDB827; }
.assignment-card-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.assignment-card-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.new-badge {
    background: #b91c1c;
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 30px;
}

.chat-modal-content { display: flex; flex-direction: column; max-height: 80vh; }
.chat-messages-list {
    flex: 1;
    overflow-y: auto;
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    min-height: 200px;
    max-height: 45vh;
}
.chat-bubble-row { display: flex; flex-direction: column; margin-bottom: 10px; }
.chat-bubble-row.mine { align-items: flex-end; }
.chat-bubble-row.theirs { align-items: flex-start; }
.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-bubble-row.mine .chat-bubble { background: #006633; color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-row.theirs .chat-bubble { background: #eee; color: #1a1a2e; border-bottom-left-radius: 4px; }
.chat-bubble-time { font-size: 0.62rem; color: #888; margin-top: 2px; }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
    flex: 1;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 0.85rem;
    resize: vertical;
    min-height: 40px;
    font-family: inherit;
}

/* Chat sessions: History / New Chat (sql/024_conversations.sql) */
.chat-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.chat-toolbar-btn {
    background: rgba(0,0,0,0.06); color: inherit; border: 1px solid rgba(0,0,0,0.15);
    padding: 6px 12px; border-radius: 30px; font-size: 0.72rem; font-weight: bold; cursor: pointer;
}
.chat-toolbar-btn:hover { background: rgba(0,0,0,0.12); }
.chat-history-item {
    background: rgba(0,0,0,0.06); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.chat-history-item:hover { background: rgba(0,0,0,0.12); }
.chat-history-item.chat-history-call { cursor: default; }
.chat-history-item-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: bold; }
.chat-history-item-sub { font-size: 0.72rem; opacity: 0.75; margin-top: 3px; }

/* Voice calls (sql/024_conversations.sql + netlify/functions/daily-call-token.js) */
.call-modal-content { text-align: center; padding-top: 40px; padding-bottom: 30px; }
.call-status-label { font-size: 1.1rem; font-weight: bold; margin-bottom: 10px; }
.call-timer { font-size: 1.6rem; font-family: monospace; margin-bottom: 18px; }
.call-error-msg { color: #b91c1c; font-size: 0.8rem; margin-bottom: 10px; }
/* Video (upgrade path from a voice call — see toggleCallVideo() in
   js/app.js / js/teacher.js). Both tiles sit in normal flex flow rather
   than a picture-in-picture overlay, so the layout holds up cleanly
   whether neither, one, or both sides have their camera on — no extra
   JS needed to reflow it. */
.call-video-stage { display: flex; gap: 10px; justify-content: center; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap; }
.call-video-remote, .call-video-local {
    background: #000; border-radius: 12px; object-fit: cover; display: block;
}
.call-video-remote { width: 220px; height: 165px; }
.call-video-local { width: 100px; height: 75px; border: 2px solid #FDB827; }
.call-controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.call-control-btn {
    border: none; padding: 12px 20px; border-radius: 30px; font-weight: bold; font-size: 0.85rem; cursor: pointer;
    background: #FDB827; color: #000;
}
.call-control-btn.call-accept-btn { background: #14532d; color: #fff; }
.call-control-btn.call-decline-btn, .call-control-btn.call-hangup-btn { background: #7a2020; color: #fff; }
