/* ── Kider theme (ThemeWagon preschool): https://themewagon.github.io/kider/ ── */
@import url('https://fonts.googleapis.com/css2?family=Lobster+Two:ital,wght@0,400;0,700;1,400&family=Nunito:wght@400;600;700;800&display=swap');

:root {
    /* Kider template palette */
    --primary: #FE5D37;
    --light: #FFF5F3;
    --dark: #103741;
    /* Mapped to our tokens */
    --bg: var(--light);
    --surface: #ffffff;
    --surface2: #fff0ee;
    --accent: var(--primary);
    --accent2: #ff7a5c;
    --accent-warm: var(--primary);
    --text: var(--dark);
    --muted: #5a7a85;
    /* Kider-style soft cards */
    --card-explain: #fff5f3;
    --card-example: #fff8f3;
    --card-key: #f3f9ff;
    --danger: #ef4444;
    --success: #00b98e;
    /* Soothing pastel rainbow (kid-oriented) */
    --rainbow: linear-gradient(90deg, #ffd6e0 0%, #ffe6cc 18%, #fff4cc 36%, #d4f1d4 54%, #cce5ff 72%, #e6dcff 100%);
    --rainbow-vertical: linear-gradient(180deg, #ffd6e0, #ffe6cc, #fff4cc, #d4f1d4, #cce5ff, #e6dcff);
    --font-heading: 'Lobster Two', cursive;
    --font-kid: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-kid);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* Ensure readable text on light theme (override any light-on-light) */
.page-wrap, .quiz-wrap, .att-header, .att-controls, .att-list, .att-stats, .att-empty,
.news-list, .page-hero, .controls-bar, .section, .create-panel {
    color: var(--text);
}
.page-wrap h2, .quiz-wrap .quiz-title, .att-header h2, .page-hero h2,
.section-title { color: var(--text); }
.page-wrap .sub, .att-header p, .page-hero p, .quiz-meta, .progress-label,
.results-count, .results-note, .stat-lbl, .score-label, .score-sub,
.review-ans, .view-attempts-msg, .view-attempts h4 { color: var(--muted); }
.page-wrap label, .quiz-wrap label, .create-panel label,
.teacher-reports label, .teacher-assistant label { color: var(--muted); }
.page-wrap input, .page-wrap select, .page-wrap textarea,
.quiz-wrap input, .quiz-wrap select, .att-controls .date-input,
.att-controls .export-btn, .news-list .student-select {
    background: var(--surface);
    border-color: var(--surface2);
    color: var(--text);
}
.page-wrap input::placeholder, .page-wrap textarea::placeholder { color: var(--muted); }
select option { background: var(--surface); color: var(--text); }

/* ── Global page loader (Kider-style) ── */
#global-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
#global-loader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#global-loader .loader-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--surface2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: global-spin 0.8s linear infinite;
}
#global-loader .loader-text {
    position: absolute;
    bottom: 28%;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--dark);
}
@keyframes global-spin {
    to { transform: rotate(360deg); }
}

/* ── Soothing rainbow strip (kid-oriented, soft pastel) ── */
.rainbow-strip {
    height: 6px;
    background: var(--rainbow);
    border: none;
    margin: 0;
}

/* ── Top nav (shared tab bar) ── */
.top-nav {
    background: var(--surface);
    border-bottom: 2px solid var(--surface2);
    padding: 0 20px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.top-nav-brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.35rem; font-weight: 700; color: var(--dark);
    padding: 14px 0;
    white-space: nowrap;
}
.top-nav-brand:hover { color: var(--primary); }
.top-nav-brand i { color: var(--primary); }

.tab-bar {
    display: flex; align-items: stretch; gap: 0;
    flex-wrap: wrap;
}
.tab-item {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 0 20px; height: 52px;
    color: var(--muted); font-size: 0.9rem; font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.tab-item:hover { color: var(--primary); }
.tab-item.tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-item i { font-size: 0.95rem; }

@media (max-width: 500px) {
    .top-nav { padding: 0 12px; }
    .top-nav-brand span { display: none; }
    .tab-item { padding: 0 14px; font-size: 0.82rem; gap: 5px; }
    .tab-item span { display: none; }
    .tab-item i { font-size: 1.1rem; }
}

/* ── Kider-style headings ── */
h1, h2, h3, h4, .h1, .h2, .h3, .h4 { font-family: var(--font-heading); font-weight: 700; color: var(--dark); }

/* ── Old header (classroom page only) ── */
header { text-align: center; padding: 16px 16px 8px; }
header h1 { display: none; } /* title now in top-nav brand */
header p { color: var(--muted); font-size: 15px; margin-top: 0; }

/* ── Layout ── */
.layout {
    display: grid; grid-template-columns: 1fr 1.3fr;
    gap: 20px; flex: 1;
    padding: 0 24px 24px;
    max-width: 1400px; width: 100%; margin: 0 auto;
}

/* ── Panel (soft cards, kid-friendly rounded) ── */
.panel {
    background: var(--surface); border-radius: 20px; padding: 24px;
    display: flex; flex-direction: column; gap: 16px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.panel-label {
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted);
}

/* ── Mic (friendly teal + coral accent) ── */
.mic-area {
    display: flex; flex-direction: column;
    align-items: center; gap: 14px; padding: 20px 0 8px;
}
.mic-btn {
    width: 88px; height: 88px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 32px;
    background: var(--primary);
    color: #fff; position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 24px rgba(254,93,55,0.4);
}
.mic-btn:hover { transform: scale(1.06); }
.mic-btn::before {
    content: ''; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid rgba(254,93,55,0.4);
    animation: glow-idle 2.5s ease-in-out infinite;
}
.mic-btn.listening {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    box-shadow: 0 6px 28px rgba(239,68,68,0.4);
    animation: mic-pulse 0.8s ease-in-out infinite;
}
.mic-btn.listening::before {
    border-color: rgba(239,68,68,0.45);
    animation: glow-listen 0.8s ease-in-out infinite;
}

@keyframes glow-idle   { 0%,100%{transform:scale(1);opacity:.5} 50%{transform:scale(1.12);opacity:1} }
@keyframes mic-pulse   { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
@keyframes glow-listen { 0%,100%{transform:scale(1);opacity:.6} 50%{transform:scale(1.18);opacity:1} }

.wave-bars {
    display: flex; align-items: center; gap: 4px;
    height: 28px; opacity: 0; transition: opacity 0.3s;
}
.wave-bars.active { opacity: 1; }
.wave-bars span { display: block; width: 4px; border-radius: 4px; background: var(--danger); }
.wave-bars span:nth-child(1){animation:bar 0.9s 0.0s ease-in-out infinite}
.wave-bars span:nth-child(2){animation:bar 0.9s .15s ease-in-out infinite}
.wave-bars span:nth-child(3){animation:bar 0.9s .3s  ease-in-out infinite}
.wave-bars span:nth-child(4){animation:bar 0.9s .45s ease-in-out infinite}
.wave-bars span:nth-child(5){animation:bar 0.9s .6s  ease-in-out infinite}
@keyframes bar { 0%,100%{height:6px} 50%{height:24px} }

.mic-status {
    font-size: 14px; color: var(--muted); text-align: center;
    min-height: 20px; transition: color 0.3s;
}
.mic-status.listening { color: var(--danger); font-weight: 600; }
.mic-status.thinking  { color: var(--accent2); font-weight: 600; }

/* ── Textarea ── */
textarea {
    width: 100%; background: var(--surface2);
    border: 2px solid rgba(0,0,0,0.06); border-radius: 16px;
    color: var(--text); font-size: 17px; line-height: 1.6;
    padding: 14px 16px; resize: none; min-height: 110px;
    transition: border-color 0.2s;
    font-family: var(--font-kid);
}
textarea:focus { outline: none; border-color: var(--primary); }
textarea::placeholder { color: var(--muted); }

/* ── Send button (Kider primary) ── */
.send-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.send-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--primary);
    color: #fff; border: none; border-radius: 50px;
    padding: 12px 24px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: opacity 0.2s, transform 0.2s;
    font-family: var(--font-kid);
    box-shadow: 0 4px 14px rgba(254,93,55,0.35);
}
.send-btn:hover   { opacity: 0.92; transform: scale(1.03); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.spinner {
    display: none; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Right panel header ── */
.answer-header {
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.topic-badge {
    display: flex; align-items: center; gap: 8px;
    font-size: 16px; font-weight: 700; color: var(--primary);
    font-family: var(--font-heading);
}
.topic-icon { font-size: 22px; }

.read-aloud-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface2); border: 2px solid rgba(0,0,0,0.06);
    border-radius: 999px; color: var(--text);
    font-size: 14px; font-weight: 600; padding: 8px 16px;
    cursor: pointer; transition: background 0.2s, transform 0.2s;
    font-family: var(--font-kid);
}
.read-aloud-btn:hover { background: var(--surface2); color: var(--primary); transform: scale(1.03); }
.read-aloud-btn.speaking { background: #fef2f2; border-color: var(--danger); color: #dc2626; }

/* ── Voice picker ── */
.voice-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voice-select {
    background: var(--surface2); border: 2px solid rgba(0,0,0,0.06);
    border-radius: 999px; color: var(--text);
    font-size: 13px; padding: 6px 12px; cursor: pointer; max-width: 200px;
    font-family: var(--font-kid);
}
.voice-select:focus { outline: none; border-color: var(--primary); }

/* ── Voice setup banner ── */
.voice-banner {
    background: var(--surface2);
    border: 2px solid var(--primary); border-radius: 16px; padding: 14px 18px;
    display: flex; gap: 14px; align-items: flex-start;
    animation: slide-up 0.4s ease;
}
.voice-banner-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.voice-banner-body { flex: 1; }
.voice-banner-title { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.voice-banner-text  { font-size: 13px; color: var(--muted); line-height: 1.5; }
.voice-banner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.voice-banner-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--primary); color: #fff; border: none; border-radius: 50px;
    padding: 7px 14px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background 0.2s; font-family: var(--font-kid);
}
.voice-banner-btn:hover { background: var(--accent2); }
.voice-banner-dismiss { background: transparent; color: var(--muted); border: 2px solid rgba(0,0,0,0.1); }
.voice-banner-dismiss:hover { background: var(--surface2); }

/* ── Media visual (soft background for kid-friendly feel) ── */
.media-visual {
    width: 100%; border-radius: 16px; overflow: hidden;
    background: var(--light);
    animation: fade-in 0.6s ease;
    border: 1px solid rgba(254,93,55,0.15);
}
.yt-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.yt-wrapper iframe { position: absolute; top:0; left:0; width:100%; height:100%; border:none; }
.wiki-gif { width:100%; max-height:200px; object-fit:contain; display:block; }

/* ── CSS animated scenes ── */
.css-scene {
    height: 160px; display: flex; align-items: center;
    justify-content: center; position: relative; overflow: hidden;
}
.scene-math .symbol {
    position: absolute; font-size: 28px; opacity: 0;
    animation: float-symbol 3s ease-in-out infinite; color: var(--primary);
}
.scene-math .symbol:nth-child(1){left:10%;animation-delay:0s}
.scene-math .symbol:nth-child(2){left:30%;animation-delay:.5s}
.scene-math .symbol:nth-child(3){left:55%;animation-delay:1s}
.scene-math .symbol:nth-child(4){left:75%;animation-delay:1.5s}
.scene-math .symbol:nth-child(5){left:90%;animation-delay:2s}
@keyframes float-symbol { 0%{opacity:0;transform:translateY(30px)} 30%,70%{opacity:1} 100%{opacity:0;transform:translateY(-30px)} }

.scene-atom { background: radial-gradient(ellipse at center,#0c1a3a,#0d1b2a); }
.atom-core { width:24px;height:24px;border-radius:50%;background:radial-gradient(circle,#f59e0b,#d97706);position:absolute;z-index:2;box-shadow:0 0 14px #f59e0b; }
.orbit { position:absolute;border-radius:50%;border:1.5px solid rgba(99,102,241,0.5); }
.orbit:nth-child(2){width:80px;height:80px;animation:spin 2s linear infinite}
.orbit:nth-child(3){width:110px;height:50px;animation:spin 3s linear infinite reverse}
.orbit:nth-child(4){width:50px;height:110px;animation:spin 4s linear infinite}
.electron { width:8px;height:8px;border-radius:50%;background:#818cf8;position:absolute;top:-4px;left:50%;margin-left:-4px; }

.scene-space { background: radial-gradient(ellipse at center,#1e1b4b,#0f172a); }
.sun { width:36px;height:36px;border-radius:50%;background:radial-gradient(circle,#fbbf24,#f59e0b);box-shadow:0 0 20px #fbbf24;position:absolute; }
.planet-orbit { position:absolute;border-radius:50%;border:1px solid rgba(255,255,255,0.1); }
.planet-orbit:nth-child(2){width:90px;height:90px;animation:spin 4s linear infinite}
.planet-orbit:nth-child(3){width:140px;height:140px;animation:spin 7s linear infinite reverse}
.planet { width:10px;height:10px;border-radius:50%;position:absolute;top:-5px;left:50%;margin-left:-5px; }
.planet-1{background:#60a5fa} .planet-2{background:#f87171}
.star { position:absolute;width:2px;height:2px;background:#fff;border-radius:50%;animation:twinkle 2s ease-in-out infinite; }
@keyframes twinkle { 0%,100%{opacity:.2} 50%{opacity:1} }

.scene-history { background:#1a1207; }
.hourglass { font-size:64px;animation:hg-flip 3s ease-in-out infinite;filter:drop-shadow(0 0 8px #d97706); }
@keyframes hg-flip { 0%,45%{transform:rotate(0deg)} 50%,95%{transform:rotate(180deg)} 100%{transform:rotate(360deg)} }

.scene-geo { background:#0c1f2c; }
.globe-ring { width:100px;height:100px;border-radius:50%;border:3px solid #34d399;position:absolute; }
.globe-ring:nth-child(1){animation:spin 4s linear infinite}
.globe-ring:nth-child(2){width:70px;height:100px;animation:spin 5s linear infinite reverse}
.globe-ring:nth-child(3){width:100px;height:60px;animation:spin 6s linear infinite}
.globe-dot { position:absolute;width:10px;height:10px;background:#34d399;border-radius:50%;box-shadow:0 0 8px #34d399; }

.scene-computer { background:#0a1a0a; }
.code-line { font-family:monospace;font-size:13px;color:#22c55e;position:absolute;white-space:nowrap;opacity:0;animation:code-scroll 4s linear infinite; }
.code-line:nth-child(1){top:20%;animation-delay:0s}
.code-line:nth-child(2){top:40%;animation-delay:1s}
.code-line:nth-child(3){top:60%;animation-delay:2s}
.code-line:nth-child(4){top:80%;animation-delay:3s}
@keyframes code-scroll { 0%{opacity:0;transform:translateX(-100%)} 20%,80%{opacity:1} 100%{opacity:0;transform:translateX(100%)} }

.scene-language { background:#1a0d2e; }
.word-float { position:absolute;font-size:18px;font-weight:700;opacity:0;animation:word-appear 4s ease-in-out infinite;color:#a78bfa; }
.word-float:nth-child(1){top:25%;left:10%;animation-delay:0s}
.word-float:nth-child(2){top:50%;left:40%;animation-delay:1.3s;color:#f472b6}
.word-float:nth-child(3){top:25%;left:70%;animation-delay:2.6s;color:#34d399}
@keyframes word-appear { 0%{opacity:0;transform:scale(.5)} 30%{opacity:1;transform:scale(1)} 70%{opacity:1} 100%{opacity:0;transform:scale(1.2)} }

.scene-music { background:#1a0a1a; }
.music-note { position:absolute;font-size:32px;animation:note-float 2.5s ease-in-out infinite; }
.music-note:nth-child(1){left:15%;animation-delay:0s;color:#f472b6}
.music-note:nth-child(2){left:40%;animation-delay:.8s;color:#a78bfa}
.music-note:nth-child(3){left:65%;animation-delay:1.6s;color:#34d399}
@keyframes note-float { 0%{opacity:0;transform:translateY(20px) rotate(-10deg)} 40%{opacity:1} 100%{opacity:0;transform:translateY(-60px) rotate(15deg)} }

.scene-health { background:#1a0a0a; }
.ecg-svg { width:100%;height:60px; }
@keyframes ecg-move { from{stroke-dashoffset:300} to{stroke-dashoffset:0} }

.scene-default { background: var(--rainbow-vertical); opacity: 0.9; }
.sparkle { position:absolute; font-size:22px; animation:sparkle-pop 2s ease-in-out infinite; }
.sparkle:nth-child(1){top:20%;left:15%;animation-delay:0s}
.sparkle:nth-child(2){top:60%;left:35%;animation-delay:.5s}
.sparkle:nth-child(3){top:30%;left:60%;animation-delay:1s}
.sparkle:nth-child(4){top:70%;left:80%;animation-delay:1.5s}
@keyframes sparkle-pop { 0%,100%{opacity:0;transform:scale(.3) rotate(0deg)} 50%{opacity:1;transform:scale(1) rotate(180deg)} }

/* ── Answer cards (soft pastel + rainbow-style left border) ── */
.answer-cards { display:flex;flex-direction:column;gap:12px;animation:slide-up 0.5s ease; }
@keyframes slide-up { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes fade-in  { from{opacity:0} to{opacity:1} }
.answer-card {
    border-radius: 16px; padding: 18px 20px; line-height: 1.65; font-size: 18px;
    border: 1px solid rgba(0,0,0,0.05);
    font-family: var(--font-kid);
}
.answer-card .card-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; opacity: 0.85; }
.card-explain { background: var(--card-explain); border-left: 5px solid var(--primary); }
.card-example { background: var(--card-example); border-left: 5px solid #00b98e; }
.card-key     { background: var(--card-key);     border-left: 5px solid #5a7a85; }

/* ── Placeholder (kid-friendly empty state) ── */
.placeholder { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; color:var(--muted); text-align:center; padding:32px; }
.placeholder i { font-size: 52px; color: var(--primary); opacity: 0.5; }
.placeholder p { font-size: 17px; font-family: var(--font-kid); }

/* ── Thinking dots (soft rainbow colors) ── */
.thinking-dots { display: none; align-items: center; gap: 8px; justify-content: center; padding: 32px; flex: 1; }
.thinking-dots span { width: 12px; height: 12px; border-radius: 50%; }
.thinking-dots span:nth-child(1) { background: #ffd6e0; animation: dot-bounce 1.2s 0.0s infinite; }
.thinking-dots span:nth-child(2) { background: #d4f1d4; animation: dot-bounce 1.2s 0.2s infinite; }
.thinking-dots span:nth-child(3) { background: #cce5ff; animation: dot-bounce 1.2s 0.4s infinite; }
.thinking-dots span:nth-child(1){animation:dot-bounce 1.2s 0.0s infinite}
.thinking-dots span:nth-child(2){animation:dot-bounce 1.2s 0.2s infinite}
.thinking-dots span:nth-child(3){animation:dot-bounce 1.2s 0.4s infinite}
@keyframes dot-bounce { 0%,80%,100%{transform:scale(.6);opacity:.4} 40%{transform:scale(1.2);opacity:1} }

/* ── Monitor Mode (light theme) ────────────────────────────────────────────── */
.monitor-section {
    max-width: 900px; margin: 18px auto 0; padding: 0 20px;
}
.monitor-toggle-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface); border: 2px solid rgba(0,0,0,0.06);
    border-radius: 16px; padding: 14px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.monitor-toggle-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.92rem; font-weight: 700; color: var(--text);
    font-family: var(--font-kid);
}
.monitor-badge {
    font-size: 0.68rem; font-weight: 800; padding: 2px 9px; border-radius: 50px;
    background: var(--surface2); color: var(--muted); letter-spacing: 0.08em;
}
.monitor-badge.badge-on { background: var(--success); color: white; }
.monitor-mic-hint {
    font-size: 0.7rem; font-weight: 500; color: var(--muted); margin-left: 6px;
}
@media (max-width: 600px) { .monitor-mic-hint { display: none; } }
.monitor-toggle-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 20px; border-radius: 50px; border: none;
    background: var(--primary); color: white; font-size: 0.85rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s; font-family: var(--font-kid);
}
.monitor-toggle-btn:hover { background: var(--accent2); }
.monitor-toggle-btn.btn-stop { background: var(--danger); }
.monitor-toggle-btn.btn-stop:hover { background: #dc2626; }

.monitor-panel {
    background: var(--surface2); border: 2px solid rgba(0,0,0,0.06);
    border-top: none; border-radius: 0 0 16px 16px;
    padding: 20px; display: flex; flex-direction: column; gap: 18px;
}

/* Meter bar */
.monitor-meter-wrap { display: flex; flex-direction: column; gap: 6px; }
.monitor-meter-bar {
    height: 18px; border-radius: 9px;
    background: rgba(255,255,255,0.07);
    overflow: hidden;
}
.monitor-meter-fill {
    height: 100%; width: 0%; border-radius: 9px;
    transition: width 0.15s ease, background 0.3s;
    background: #22c55e;
}
.monitor-meter-fill.fill-green  { background: var(--success); }
.monitor-meter-fill.fill-yellow { background: #f59e0b; }
.monitor-meter-fill.fill-red    { background: var(--danger); animation: pulse-bar 0.6s infinite; }
@keyframes pulse-bar { 0%,100%{opacity:1} 50%{opacity:0.7} }
.monitor-meter-labels {
    display: flex; justify-content: space-between;
    font-size: 0.7rem; color: var(--muted);
}

/* Status card */
.monitor-status-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px; border-radius: 14px;
    background: var(--surface); border: 2px solid rgba(0,0,0,0.06);
    transition: all 0.4s;
}
.monitor-status-card.status-calm  { border-color: rgba(34,197,94,0.4); background: #ecfdf5; }
.monitor-status-card.status-noisy { border-color: rgba(239,68,68,0.4); background: #fef2f2; }
.monitor-status-emoji { font-size: 2rem; }
.monitor-status-text  { font-size: 1rem; font-weight: 700; color: var(--text); flex: 1; font-family: var(--font-kid); }
.monitor-db-level     { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Sensitivity */
.monitor-sensitivity {
    display: flex; align-items: center; gap: 14px;
    font-size: 0.82rem; color: var(--muted);
}
.monitor-sensitivity label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.monitor-slider {
    flex: 1; accent-color: var(--primary); height: 6px; cursor: pointer;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .layout { grid-template-columns:1fr;padding:0 12px 20px; }
    header h1 { font-size:26px; }
    .answer-card { font-size:16px; }
    .monitor-toggle-bar { flex-wrap: wrap; gap: 10px; }
}
