/* ═══════════════════════════════════════
   SCREEN SYSTEM
═══════════════════════════════════════ */
.screen {
  position: fixed; inset: 0;
  height: 100vh;   /* fallback for older browsers without dvh support */
  height: 100dvh;  /* dynamic viewport height — keeps bottom-anchored controls (e.g. the
                      mock-test Submit/Next button) inside the actually-visible area on
                      mobile browsers in non-fullscreen mode, where 100vh/inset:0 alone
                      can render taller than the screen once the address bar is showing */
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}
.screen.active {
  display: flex;
  opacity: 1;
  overflow-y: auto; /* safety net — several screens (target, exam, lang, plan, etc.)
                        have no internal scroll container of their own, so content
                        taller than the visible viewport (forms, small phones, on-screen
                        keyboard) was previously unreachable by scroll, only by Tab.
                        Screens that already manage their own scrolling internally
                        (teach/practice/auth) keep their more specific overflow:hidden
                        override, so this has no effect there. */
}
.screen.fade-out { opacity: 0; }

/* ═══════════════════════════════════════
   DYNAMIC SLIDE ELEMENTS
═══════════════════════════════════════ */
.step-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: clamp(9px,1.1vw,13px); color: #07090F; line-height: 1.4;
}
.step-num {
  flex-shrink: 0; width: 22px; height: 22px;
  border-radius: 50%; background: var(--teal); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.cue-row {
  display: flex; gap: 12px; align-items: center;
  font-size: clamp(9px,1.1vw,12px); padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.cue-sig { color: var(--teal); font-weight: 600; min-width: 140px; font-size: 0.95em; }
.cue-need { color: #1a2535; }
.type-card {
  padding: 8px 12px; background: var(--bg3); border-radius: 6px;
  border-left: 3px solid var(--teal);
}
.type-label { color: var(--teal); font-size: clamp(9px,1vw,12px); font-weight: 600; margin-bottom: 3px; }
.type-desc { color: #1a2535; font-size: clamp(8px,0.95vw,11px); line-height: 1.4; }
.tone-row {
  display: flex; gap: 12px; align-items: center; padding: 6px 10px;
  background: var(--bg3); border-radius: 4px;
}
.tone-cat { font-weight: 700; font-size: clamp(8px,0.9vw,11px); min-width: 70px; }
.tone-words { color: #1a2535; font-size: clamp(8px,0.95vw,12px); }
.trap-row {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: clamp(8px,1vw,12px); padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.trap-code { color: var(--danger); font-weight: 700; min-width: 36px; flex-shrink: 0; }
.trap-name { color: var(--amber); font-weight: 600; min-width: 140px; flex-shrink: 0; }
.trap-desc { color: #1a2535; line-height: 1.4; }
.ex-opt {
  padding: 5px 8px; background: var(--bg3); border-radius: 4px;
  font-size: clamp(8px,0.95vw,11px); color: var(--text);
  border-left: 3px solid var(--bg4);
}
.ex-opt-correct { border-left-color: var(--teal); color: var(--white); }
.cat-row {
  display: flex; gap: 12px; align-items: center; padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.cat-name { color: var(--teal); font-weight: 600; min-width: 120px; font-size: clamp(9px,1vw,12px); }
.cat-words { color: #1a2535; font-size: clamp(8px,0.95vw,11px); }


.syra-photo {
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg3);
  border: 2px solid rgba(0,194,168,0.3);
  flex-shrink: 0;
}
.syra-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.avatar-ring-wrap {
  position: relative;
  flex-shrink: 0;
}
.avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--teal);
  border-right-color: rgba(0,194,168,0.2);
  animation: ring-spin 6s linear infinite;
  pointer-events: none;
}
.avatar-ring.active {
  animation: ring-spin 2s linear infinite;
  border-right-color: var(--teal);
  filter: drop-shadow(0 0 6px var(--teal));
}
@keyframes ring-spin { to { transform: rotate(360deg); } }

/* ambient glow */
.teal-glow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
  pointer-events: none;
}

/* ═══════════════════════════════════════
   SHARED — SPEECH BOX
═══════════════════════════════════════ */
.speech-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 10px;
  padding: 14px 16px;
}
.speech-label {
  font-family: 'Space Mono', monospace;
  font-size: 8px; letter-spacing: 2px;
  color: var(--teal); margin-bottom: 7px; opacity: 0.8;
}
.speech-text {
  font-size: 13px; color: var(--text);
  line-height: 1.65; font-style: italic;
  min-height: 40px;
}
.cursor {
  display: inline-block; width: 2px; height: 13px;
  background: var(--teal); margin-left: 1px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ═══════════════════════════════════════
   SHARED — BUTTONS
═══════════════════════════════════════ */
.btn-primary {
  background: var(--teal); color: #07090F;
  border: none; border-radius: 10px;
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.3px;
}
.btn-primary:hover { background: #00d4b8; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,194,168,0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.2); color: var(--white); }

.btn-ghost {
  background: transparent; color: var(--muted);
  border: none; font-size: 13px;
  cursor: pointer; transition: color 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-ghost:hover { color: var(--text); }

.live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,194,168,0.1);
  border: 1px solid rgba(0,194,168,0.3);
  border-radius: 20px; padding: 4px 10px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; color: var(--teal); letter-spacing: 1px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; box-shadow: 0 0 5px var(--teal); }
  50%      { opacity:0.4; box-shadow: none; }
}

/* ═══════════════════════════════════════
   TARGET SCREEN
═══════════════════════════════════════ */
.target-form { width:100%; display:flex; flex-direction:column; gap:18px; }
.target-dates { display:flex; gap:10px; flex-wrap:wrap; }
.target-date-card {
  flex:1; min-width:80px;
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:14px 10px; text-align:center; cursor:pointer; transition:all 0.2s;
}
.target-date-card:hover { border-color:rgba(0,194,168,0.4); }
.target-date-card.selected { border-color:var(--teal); background:var(--teal-lo); }
.td-val { font-size:22px; font-weight:700; color:var(--white); }
.td-unit { font-size:10px; color:var(--muted); margin-top:2px; letter-spacing:0.1em; }

/* ═══════════════════════════════════════
   STUDY PLAN SCREEN
═══════════════════════════════════════ */
.plan-inner {
  width:100%; max-width:720px; margin:0 auto;
  display:flex; flex-direction:column; gap:16px;
  padding:40px 24px; overflow-y:auto; max-height:100vh; max-height:100dvh;
}
.plan-header { display:flex; align-items:center; gap:16px; }
.plan-avatar-wrap { position:relative; }
.plan-title { font-family:'Fraunces',serif; font-size:24px; font-weight:700; color:var(--white); }
.plan-sub { font-size:13px; color:var(--muted); margin-top:4px; }
.plan-weeks { display:flex; flex-direction:column; gap:10px; }
.plan-week {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:14px 18px; display:flex; align-items:center; gap:16px;
  cursor:pointer; transition:all 0.2s;
}
.plan-week:hover { border-color:rgba(0,194,168,0.3); transform:translateX(4px); }
.plan-week.active { border-left:3px solid var(--teal); }
.plan-week.locked { opacity:0.45; cursor:default; }
.pw-num {
  width:32px; height:32px; border-radius:50%;
  background:var(--teal-lo); border:1px solid var(--teal);
  display:flex; align-items:center; justify-content:center;
  font-family:'Space Mono',monospace; font-size:11px; color:var(--teal);
  flex-shrink:0;
}
.pw-content { flex:1; }
.pw-title { font-size:14px; font-weight:600; color:var(--white); }
.pw-topics { font-size:11px; color:var(--muted); margin-top:3px; }
.pw-status { font-size:11px; font-weight:600; letter-spacing:0.08em; flex-shrink:0; }
.pw-status.done { color:var(--teal); }
.pw-status.current { color:var(--amber); }
.pw-status.locked { color:var(--muted); }
.plan-actions { display:flex; gap:12px; margin-top:8px; }

/* ═══════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════ */
#screen-dashboard { flex-direction:row; align-items:stretch; }
.dash-layout { display:flex; width:100%; height:100%; }
.dash-sidebar {
  width:220px; flex-shrink:0;
  background:var(--bg2); border-right:1px solid var(--border);
  display:flex; flex-direction:column; padding:24px 0; gap:4px;
}
.dash-brand {
  font-family:'Space Mono',monospace; font-size:13px; letter-spacing:4px;
  color:var(--teal); padding:0 20px 20px; border-bottom:1px solid var(--border); margin-bottom:8px;
}
.dash-user { display:flex; align-items:center; gap:10px; padding:8px 16px 16px; border-bottom:1px solid var(--border); margin-bottom:8px; }
.dash-user-name { font-size:13px; font-weight:600; color:var(--white); }
.dash-user-sub { font-size:10px; color:var(--teal); letter-spacing:0.1em; }
.dash-nav { display:flex; flex-direction:column; gap:2px; padding:0 8px; flex:1; }
.dash-nav-item {
  padding:10px 14px; border-radius:8px; font-size:13px; color:var(--muted);
  cursor:pointer; transition:all 0.2s;
}
.dash-nav-item:hover { background:var(--bg3); color:var(--text); }
.dash-nav-item.active { background:var(--teal-lo); color:var(--teal); font-weight:600; }
.dash-settings { padding:16px 22px 0; font-size:12px; color:var(--muted); cursor:pointer; border-top:1px solid var(--border); }
.dash-settings:hover { color:var(--text); }

.dash-main { flex:1; overflow-y:auto; padding:32px 36px; }
.dash-tab { display:flex; flex-direction:column; gap:16px; }
.dash-welcome { font-family:'Fraunces',serif; font-size:22px; color:var(--white); margin-bottom:8px; }
.dash-section-title { font-family:'Space Mono',monospace; font-size:10px; letter-spacing:0.15em; color:var(--teal); margin-top:4px; }

.dash-modules { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; }
.dash-module-card {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:16px; cursor:pointer; transition:all 0.2s;
  display:flex; flex-direction:column; min-height:128px;
}
.dash-module-card:hover { border-color:rgba(0,194,168,0.3); transform:translateY(-2px); }
.dash-module-card.active-module { border-color:var(--teal); }
.dmc-week { font-size:10px; color:var(--teal); letter-spacing:0.1em; margin-bottom:6px; flex-shrink:0; }
.dmc-title { font-size:14px; font-weight:600; color:var(--white); margin-bottom:4px; line-height:1.35; word-wrap:break-word; }
.dmc-topics { font-size:11px; color:var(--muted); line-height:1.5; word-wrap:break-word; flex:1; }
.dmc-topic-chip { cursor:pointer; transition:color 0.15s; }
.dmc-topic-chip:hover { color:#00C2A8; text-decoration:underline; }
.dmc-topic-sep { color:var(--muted); }
.dmc-bar { height:3px; background:var(--bg4); border-radius:2px; margin-top:10px; overflow:hidden; flex-shrink:0; }
.dmc-fill { height:100%; background:var(--teal); border-radius:2px; transition:width 0.5s; }
.dmc-handout {
  display:flex; align-items:center; gap:6px;
  margin-top:10px; padding:6px 10px;
  background:var(--teal-lo); border:1px solid rgba(0,194,168,0.25); border-radius:8px;
  font-size:11px; font-weight:600; color:var(--teal);
  cursor:pointer; flex-shrink:0; transition:background 0.2s;
}
.dmc-handout:hover { background:var(--teal-glow); }
.dmc-interactive {
  display:flex; align-items:center; gap:6px;
  margin-top:6px; padding:6px 10px;
  background:var(--amber-lo); border:1px solid rgba(245,158,11,0.3); border-radius:8px;
  font-size:11px; font-weight:600; color:var(--amber);
  cursor:pointer; flex-shrink:0; transition:background 0.2s;
}
.dmc-interactive:hover { background:rgba(245,158,11,0.22); }

.dash-continue-card {
  background:var(--bg3); border:1px solid rgba(0,194,168,0.25);
  border-left:3px solid var(--teal);
  border-radius:10px; padding:16px 18px;
  display:flex; align-items:center; gap:14px; cursor:pointer; transition:all 0.2s;
}
.dash-continue-card:hover { background:var(--bg4); }
.dcc-icon { font-size:22px; flex-shrink:0; }
.dcc-title { font-size:14px; font-weight:600; color:var(--white); }
.dcc-sub { font-size:11px; color:var(--muted); margin-top:3px; }
.dcc-arrow { font-size:20px; color:var(--teal); margin-left:auto; }

/* ═══════════════════════════════════════
   PRACTICE TAB
═══════════════════════════════════════ */
.practice-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; }
.practice-card {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:16px; cursor:pointer; transition:all 0.2s; text-align:center;
}
.practice-card:hover { border-color:rgba(0,194,168,0.3); transform:translateY(-2px); }
.pc-icon { font-size:28px; margin-bottom:8px; }
.pc-title { font-size:13px; font-weight:600; color:var(--white); }
.pc-count { font-size:11px; color:var(--muted); margin-top:4px; }

/* ═══════════════════════════════════════
   MOCK TESTS TAB
═══════════════════════════════════════ */
.mock-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.mock-card {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:18px; cursor:pointer; transition:all 0.2s;
}
.mock-card:hover { border-color:rgba(0,194,168,0.3); transform:translateY(-2px); }
.mock-full { border-style:dashed; }
.mock-icon { font-size:24px; margin-bottom:10px; }
.mock-title { font-size:14px; font-weight:600; color:var(--white); margin-bottom:4px; }
.mock-meta { font-size:11px; color:var(--muted); }
.mock-status { display:inline-block; margin-top:10px; font-size:10px; font-weight:700; letter-spacing:0.1em; color:var(--teal); }
.mock-locked { color:var(--muted) !important; }

/* ═══════════════════════════════════════
   DOUBT SESSION TAB
═══════════════════════════════════════ */
.doubt-layout { display:flex; gap:20px; height:calc(100vh - 180px); }
.doubt-syra-panel {
  width:200px; flex-shrink:0;
  display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:16px; background:var(--bg3); border:1px solid var(--border); border-radius:12px;
}
.doubt-syra-name { font-family:'Fraunces',serif; font-size:16px; color:var(--white); }
.doubt-syra-sub { font-size:10px; color:var(--teal); letter-spacing:0.1em; text-align:center; }
.doubt-topics { width:100%; margin-top:12px; }
.doubt-topic-title { font-size:9px; color:var(--muted); letter-spacing:0.1em; margin-bottom:8px; }
.doubt-chip {
  display:block; width:100%; padding:7px 10px; margin-bottom:6px;
  background:var(--bg2); border:1px solid var(--border); border-radius:6px;
  font-size:11px; color:var(--text); cursor:pointer; transition:all 0.2s; text-align:left;
}
.doubt-chip:hover { border-color:var(--teal); color:var(--white); }
.doubt-chat { flex:1; display:flex; flex-direction:column; gap:12px; }
.doubt-history {
  flex:1; overflow-y:auto;
  background:var(--bg3); border:1px solid var(--border); border-radius:12px;
  padding:16px; display:flex; flex-direction:column; gap:12px;
}
.doubt-welcome-msg { font-size:13px; color:var(--text); line-height:1.6; padding:12px; background:var(--teal-lo); border-left:3px solid var(--teal); border-radius:6px; }
.doubt-bubble { padding:12px 14px; border-radius:10px; font-size:13px; line-height:1.6; max-width:90%; }
.doubt-bubble.user { background:var(--bg4); color:var(--text); align-self:flex-end; }
.doubt-bubble.syra { background:var(--teal-lo); color:var(--text); border-left:2px solid var(--teal); align-self:flex-start; }
.doubt-input-row { display:flex; gap:8px; }

/* ═══════════════════════════════════════
   HANDOUTS TAB
═══════════════════════════════════════ */
.handout-grid { display:flex; flex-direction:column; gap:10px; }
.handout-card {
  display:flex; align-items:center; gap:14px;
  background:var(--bg3); border:1px solid var(--border); border-radius:10px; padding:14px 16px;
  transition:all 0.2s;
}
.handout-card:hover { border-color:rgba(0,194,168,0.25); }
.handout-featured { border-color:rgba(200,150,46,0.3); }
.handout-icon { font-size:24px; flex-shrink:0; }
.handout-info { flex:1; }
.handout-title { font-size:14px; font-weight:600; color:var(--white); }
.handout-sub { font-size:11px; color:var(--muted); margin-top:3px; }
.handout-btn {
  background:var(--teal-lo); border:1px solid var(--teal); color:var(--teal);
  border-radius:6px; padding:7px 14px; font-size:12px; font-weight:600;
  cursor:pointer; transition:all 0.2s; white-space:nowrap;
}
.handout-btn:hover { background:var(--teal); color:var(--bg); }

/* ═══════════════════════════════════════
   PROGRESS TAB
═══════════════════════════════════════ */
.progress-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.stat-card {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:20px; text-align:center;
}
.stat-val { font-family:'Fraunces',serif; font-size:32px; color:var(--teal); font-weight:700; }
.stat-label { font-size:11px; color:var(--muted); margin-top:4px; }
.accuracy-chart, .weak-list {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px; padding:20px;
}
.chart-empty { font-size:13px; color:var(--muted); text-align:center; padding:20px 0; }

/* ═══════════════════════════════════════
   MOCK TEST SCREEN
═══════════════════════════════════════ */
#screen-mock { flex-direction:column; }
.mock-test-layout { display:flex; flex-direction:column; width:100%; height:100%; }
.mock-header {
  display:flex; align-items:center; gap:20px; padding:14px 24px;
  background:var(--bg2); border-bottom:1px solid var(--border); flex-shrink:0;
}
.mock-header-left { display:flex; flex-direction:column; gap:2px; flex-shrink:0; }
.mock-h-title { font-size:13px; font-weight:600; color:var(--white); }
.mock-timer { font-family:'Space Mono',monospace; font-size:16px; color:var(--amber); }
.mock-progress-wrap { flex:1; display:flex; align-items:center; gap:10px; }
.mock-prog-bar { flex:1; height:4px; background:var(--bg4); border-radius:2px; overflow:hidden; }
.mock-prog-fill { height:100%; background:var(--teal); border-radius:2px; transition:width 0.4s; }
.mock-q-counter { font-size:12px; color:var(--muted); white-space:nowrap; }
.mock-body { flex:1; display:flex; overflow:hidden; }
.mock-passage-panel, .mock-question-panel {
  flex:1; padding:28px; overflow-y:auto;
}
.mock-passage-panel { border-right:1px solid var(--border); background:var(--bg); }
.mock-question-panel { background:var(--bg2); }
.mock-panel-label { font-family:'Space Mono',monospace; font-size:9px; letter-spacing:0.15em; color:var(--teal); margin-bottom:14px; }
.mock-passage-text { font-size:14px; color:var(--text); line-height:1.8; }
.mock-question-text { font-size:15px; font-weight:600; color:var(--white); line-height:1.5; margin-bottom:20px; }
.mock-options { display:flex; flex-direction:column; gap:10px; margin-bottom:24px; }
.mock-option {
  display:flex; align-items:flex-start; gap:12px;
  background:var(--bg3); border:1px solid var(--border); border-radius:8px;
  padding:12px 14px; cursor:pointer; transition:all 0.2s; font-size:14px; color:var(--text);
}
.mock-option:hover { border-color:rgba(0,194,168,0.4); }
.mock-option.selected { border-color:var(--teal); background:var(--teal-lo); color:var(--white); }
.mock-option.correct { border-color:#4DB88E; background:rgba(77,184,142,0.1); }
.mock-option.wrong { border-color:var(--danger); background:rgba(239,68,68,0.1); }
.opt-letter {
  width:22px; height:22px; border-radius:50%;
  background:var(--bg4); display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; color:var(--teal); flex-shrink:0;
}
.mock-nav { display:flex; justify-content:space-between; }

/* ═══════════════════════════════════════
   EVALUATION SCREEN
═══════════════════════════════════════ */
.eval-inner {
  width:100%; max-width:760px; margin:0 auto;
  padding:40px 24px; overflow-y:auto; max-height:100vh; max-height:100dvh;
  display:flex; flex-direction:column; gap:20px;
}
.eval-header { display:flex; align-items:center; gap:16px; }
.eval-title { font-family:'Fraunces',serif; font-size:24px; color:var(--white); }
.eval-sub { font-size:13px; color:var(--muted); margin-top:4px; }
.eval-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.eval-stat-card {
  background:var(--bg3); border:1px solid var(--border); border-radius:10px;
  padding:18px; text-align:center;
}
.eval-stat-highlight { border-color:rgba(0,194,168,0.3); }
.eval-stat-val { font-family:'Fraunces',serif; font-size:28px; color:var(--teal); font-weight:700; }
.eval-stat-label { font-size:11px; color:var(--muted); margin-top:4px; }
.eval-sections { display:flex; flex-direction:column; gap:14px; }
.eval-section { background:var(--bg3); border:1px solid var(--border); border-radius:10px; padding:16px 18px; }
.eval-section-title { font-size:13px; font-weight:700; color:var(--white); margin-bottom:10px; }
.eval-items { display:flex; flex-direction:column; gap:8px; }
.eval-item { font-size:13px; line-height:1.6; padding:10px 12px; border-radius:6px; }
.eval-item-warn { background:rgba(245,158,11,0.08); border-left:3px solid var(--amber); color:var(--text); }
.eval-item-good { background:rgba(77,184,142,0.08); border-left:3px solid #4DB88E; color:var(--text); }
.eval-item-action { background:var(--teal-lo); border-left:3px solid var(--teal); color:var(--text); }
.eval-actions { display:flex; gap:12px; }
.module-complete-overlay {
  position:absolute; inset:0; z-index:20;
  background:rgba(7,9,15,0.92);
  display:flex; align-items:center; justify-content:center;
  backdrop-filter:blur(8px);
}
.mc-inner {
  display:flex; flex-direction:column; align-items:center; gap:16px;
  text-align:center; max-width:420px; padding:40px 24px;
}
.mc-check {
  width:72px; height:72px; border-radius:50%;
  background:var(--teal-lo); border:2px solid var(--teal);
  display:flex; align-items:center; justify-content:center;
  font-size:32px; color:var(--teal);
}
.mc-title {
  font-family:'Fraunces',serif; font-size:32px;
  font-weight:700; color:var(--white);
}
.mc-sub { font-size:12px; color:var(--teal); letter-spacing:0.12em; }
.mc-message { font-size:14px; color:var(--text); line-height:1.7; }
.mc-actions { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin-top:8px; }

.grid-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ═══════════════════════════════════════
   SCREEN 1 — LANDING
═══════════════════════════════════════ */
#screen-landing {
  flex-direction: row;
  align-items: stretch;
  background: var(--bg);
}

.landing-left {
  width: 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
}
.landing-left::after {
  content: '';
  position: absolute; right: 0; top: 0;
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, transparent, var(--teal-dim), transparent);
}

.landing-brand {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 4px;
  color: var(--teal); margin-bottom: 48px;
}

.landing-headline {
  font-family: 'Fraunces', serif;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--white);
  margin-bottom: 20px;
}
.landing-headline em {
  font-style: italic; font-weight: 300;
  color: var(--teal);
}

.landing-sub {
  font-size: 17px; color: var(--text);
  line-height: 1.65; max-width: 420px;
  margin-bottom: 48px; font-weight: 300;
}

.landing-cta-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 48px;
}

.landing-trust {
  display: flex; align-items: center; gap: 10px;
}
.trust-avatars {
  display: flex;
}
.trust-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg4);
  border: 2px solid var(--bg);
  margin-left: -8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.trust-avatar:first-child { margin-left: 0; }
.trust-text {
  font-size: 12px; color: var(--muted);
}
.trust-text strong { color: var(--text); }

/* decorative pill tags */
.tag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 16px;
}
.tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px; color: var(--muted);
  font-family: 'Space Mono', monospace;
  letter-spacing: 1px;
}

.landing-right {
  width: 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

/* big ambient circle behind Syra */
.landing-right .teal-glow {
  width: 400px; height: 400px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.landing-avatar-wrap {
  position: relative;
  width: 280px; height: 280px;
  margin-bottom: 28px;
  z-index: 2;
}
.landing-avatar-wrap .avatar-ring { inset: -8px; border-width: 2.5px; }
.landing-avatar-wrap .syra-photo { width: 280px; height: 280px; }

.landing-syra-name {
  font-family: 'Fraunces', serif;
  font-size: 28px; font-weight: 600;
  color: var(--white);
  z-index: 2; margin-bottom: 4px;
}
.landing-syra-role {
  font-size: 13px; color: var(--muted);
  z-index: 2; letter-spacing: 0.5px;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════
   SCREEN 2 — 60 SEC DEMO
═══════════════════════════════════════ */
#screen-demo {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  position: relative;
  overflow-y: auto;
}
#screen-demo .teal-glow {
  width: 500px; height: 500px;
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
}

.demo-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  width: 100%;
  max-width: 680px;
  padding: 40px 24px;
  z-index: 2;
  gap: 24px;
}

.demo-top {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.demo-avatar-wrap {
  position: relative;
  width: 130px; height: 130px;
  flex-shrink: 0;
}
.demo-avatar-wrap .syra-photo { width: 130px; height: 130px; }

.demo-meta { flex: 1; }
.demo-tag {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 3px;
  color: var(--amber); margin-bottom: 8px;
}
.demo-title {
  font-family: 'Fraunces', serif;
  font-size: 26px; font-weight: 600;
  color: var(--white); margin-bottom: 6px;
  line-height: 1.2;
}
.demo-sub { font-size: 13px; color: var(--amber); font-style: italic; }

.demo-speech { width: 100%; }

/* slide mini-card in demo */
.demo-slide-card {
  width: 100%;
  background: #0D1B3E;
  border-radius: 12px;
  padding: 28px 32px;
  border: 1px solid rgba(0,194,168,0.15);
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  min-height: 120px;
}
.demo-slide-card::before {
  content: '';
  position: absolute; left: 0; top: 0;
  width: 4px; height: 100%;
  background: var(--teal);
}
.demo-slide-tag {
  font-family: 'Space Mono', monospace;
  font-size: 8px; letter-spacing: 3px;
  color: var(--teal); margin-bottom: 12px;
}
.demo-slide-content {
  font-family: 'Fraunces', serif;
  font-size: 20px; color: var(--white);
  line-height: 1.4;
}
.demo-slide-sub {
  font-size: 13px; color: var(--amber);
  margin-top: 10px; font-style: italic;
  font-weight: 500;
}

.demo-progress {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
}
.demo-prog-bar {
  flex: 1; height: 3px;
  background: var(--bg4); border-radius: 2px;
  overflow: hidden;
}
.demo-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-dim), var(--teal));
  width: 0%; transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--teal);
}
.demo-prog-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px; color: var(--muted);
  white-space: nowrap;
}

.demo-actions {
  display: flex; gap: 12px; width: 100%;
  justify-content: center;
}

/* ═══════════════════════════════════════
   SCREEN 3 — VOICE PREFERENCE
═══════════════════════════════════════ */
#screen-voice {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  position: relative;
  overflow-y: auto;
  padding-bottom: 40px;
}
#screen-voice .teal-glow {
  width: 400px; height: 400px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.voice-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  max-width: 520px; width: 100%;
  padding: 28px 24px 36px; z-index: 2;
  margin: auto;
}

.voice-avatar-wrap {
  position: relative; width: 110px; height: 110px;
}
.voice-avatar-wrap .syra-photo { width: 110px; height: 110px; }

.voice-question {
  font-family: 'Fraunces', serif;
  font-size: 28px; font-weight: 600;
  text-align: center; line-height: 1.3;
  color: var(--white);
}
.voice-sub {
  font-size: 14px; color: var(--muted);
  text-align: center; line-height: 1.6;
  margin-top: -16px;
}

.voice-cards {
  display: flex; gap: 16px; width: 100%;
}
.voice-card {
  flex: 1; background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 16px; padding: 20px 16px;
  cursor: pointer; transition: all 0.25s;
  text-align: center;
}
.voice-card:hover {
  border-color: var(--teal);
  background: var(--teal-lo);
  transform: translateY(-2px);
}
.voice-card.selected {
  border-color: var(--teal);
  background: var(--teal-lo);
  box-shadow: 0 0 0 1px var(--teal), 0 8px 32px rgba(0,194,168,0.2);
}
.voice-card-icon { font-size: 28px; margin-bottom: 8px; }
.voice-card-title {
  font-family: 'Fraunces', serif;
  font-size: 18px; font-weight: 600;
  color: var(--white); margin-bottom: 6px;
}
.voice-card-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ═══════════════════════════════════════
   SCREEN 4 — AUTH (SIGN UP / LOGIN)
═══════════════════════════════════════ */
#screen-auth {
  flex-direction: row;
  align-items: stretch;
  background: var(--bg);
}

.auth-left {
  width: 42%;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 48px;
  position: relative; overflow: hidden;
}
.auth-left .teal-glow {
  width: 300px; height: 300px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.auth-avatar-wrap {
  position: relative; width: 160px; height: 160px;
  margin-bottom: 24px; z-index: 2;
}
.auth-avatar-wrap .syra-photo { width: 160px; height: 160px; }
.auth-quote {
  font-family: 'Fraunces', serif;
  font-size: 18px; font-weight: 300;
  font-style: italic;
  color: var(--text); text-align: center;
  line-height: 1.6; z-index: 2;
  max-width: 280px;
}
.auth-quote strong { color: var(--teal); font-style: normal; font-weight: 600; }

.auth-right {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 64px;
}

.auth-tabs {
  display: flex; gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  margin-bottom: 36px; width: 100%; max-width: 380px;
}
.auth-tab {
  flex: 1; padding: 12px;
  background: transparent; border: none;
  color: var(--muted); font-family: 'DM Sans', sans-serif;
  font-size: 14px; cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--teal-lo);
  color: var(--teal);
  border-bottom: 2px solid var(--teal);
}

.auth-form {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px;
}
.auth-form-title {
  font-family: 'Fraunces', serif;
  font-size: 26px; font-weight: 600;
  color: var(--white); margin-bottom: 8px;
}
.auth-form-sub {
  font-size: 13px; color: var(--muted);
  margin-bottom: 8px;
}

.form-field {
  display: flex; flex-direction: column; gap: 6px;
}
.form-label {
  font-size: 12px; color: var(--muted);
  font-family: 'Space Mono', monospace;
  letter-spacing: 1px;
}
.form-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: rgba(0,194,168,0.4);
  box-shadow: 0 0 0 3px rgba(0,194,168,0.08);
}
.form-input::placeholder { color: var(--muted); }

.form-row { display: flex; gap: 12px; }
.form-row .form-field { flex: 1; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px;
  color: var(--text); font-size: 14px;
  cursor: pointer; transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.btn-google:hover { border-color: rgba(255,255,255,0.2); color: var(--white); }

.auth-switch {
  text-align: center; font-size: 13px; color: var(--muted);
}
.auth-switch a {
  color: var(--teal); text-decoration: none;
  cursor: pointer;
}

/* ═══════════════════════════════════════
   SCREEN 5 — SYRA INTRODUCTION
═══════════════════════════════════════ */
#screen-intro {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  position: relative;
  overflow-y: auto;
}
#screen-intro .teal-glow {
  width: 500px; height: 500px;
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
}

.intro-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 28px;
  max-width: 620px; width: 100%;
  padding: 40px 24px; z-index: 2;
}

.intro-avatar-wrap {
  position: relative; width: 200px; height: 200px;
  display: block;
}
.intro-avatar-wrap .syra-photo {
  width: 200px; height: 200px;
  position: absolute; top: 0; left: 0;
}

.intro-greeting {
  font-family: 'Fraunces', serif;
  font-size: 32px; font-weight: 600;
  text-align: center; color: var(--white);
  line-height: 1.2;
}
.intro-greeting em { color: var(--teal); font-style: italic; font-weight: 300; }

.intro-speech { width: 100%; }

.intro-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
}
.intro-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 16px;
  font-size: 12px; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.intro-pill span { font-size: 14px; }

/* ═══════════════════════════════════════
   SCREEN 6 — EXAM SELECTION
═══════════════════════════════════════ */
#screen-exam {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--bg);
  position: relative;
  overflow-y: auto;
  padding-bottom: 40px;
}
#screen-exam .teal-glow {
  width: 400px; height: 400px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.exam-inner {
  display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  max-width: 640px; width: 100%;
  padding: 28px 24px 32px; z-index: 2;
  margin: auto;
}

.exam-avatar-wrap {
  position: relative; width: 90px; height: 90px;
}
.exam-avatar-wrap .syra-photo { width: 90px; height: 90px; }

.exam-title {
  font-family: 'Fraunces', serif;
  font-size: 24px; font-weight: 600;
  text-align: center; color: var(--white);
}
.exam-sub {
  font-size: 13px; color: var(--muted);
  text-align: center; margin-top: -8px;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px; width: 100%;
}
.exam-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: 14px; padding: 14px 12px;
  cursor: pointer; transition: all 0.25s;
  text-align: center; position: relative;
}
.exam-card:hover {
  border-color: var(--teal-dim);
  background: var(--teal-lo);
}
.exam-card.selected {
  border-color: var(--teal);
  background: var(--teal-lo);
}
.exam-card.selected::after {
  content: '✓';
  position: absolute; top: 8px; right: 10px;
  font-size: 12px; color: var(--teal);
  font-weight: 700;
}
.exam-icon { font-size: 22px; margin-bottom: 6px; }
.exam-name {
  font-family: 'Space Mono', monospace;
  font-size: 13px; font-weight: 700;
  color: var(--white); margin-bottom: 4px;
}
.exam-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* ═══════════════════════════════════════
   SCREEN 7 — TEACHING
═══════════════════════════════════════ */
#screen-teach {
  flex-direction: column;
  background: var(--bg);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.teach-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  overflow: hidden;
  min-height: 0;
}

/* LEFT PANEL */
#syra-panel {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 20px 18px 16px;
  position: relative; overflow-y: auto; overflow-x: hidden;
}
#syra-panel .teal-glow {
  width: 250px; height: 250px;
  top: 180px; left: 50%;
  transform: translateX(-50%);
}

.panel-header {
  width: 100%;
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px; z-index: 2;
}
.panel-brand {
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 3px; color: var(--teal);
}

.teach-avatar-wrap {
  position: relative; width: 190px; height: 190px;
  margin-bottom: 18px; z-index: 2; flex-shrink: 0;
  display: block;
}
.teach-avatar-wrap .syra-photo {
  width: 190px; height: 190px;
  position: absolute; top: 0; left: 0;
}

.topic-card {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
  z-index: 2; margin-bottom: 14px;
}
.topic-label {
  font-family: 'Space Mono', monospace;
  font-size: 8px; letter-spacing: 2px;
  color: var(--amber); margin-bottom: 3px;
}
.topic-name {
  font-family: 'Fraunces', serif;
  font-size: 14px; color: var(--white); margin-bottom: 2px;
}
.topic-sub { font-size: 11px; color: var(--amber); }

.syra-controls {
  display: flex; gap: 8px;
  margin-top: auto; padding-top: 12px; z-index: 2; width: 100%;
}
.ctrl-btn {
  flex: 1; padding: 8px 0;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--muted);
  font-family: 'Space Mono', monospace; font-size: 9px;
  letter-spacing: 1px; cursor: pointer; transition: all 0.2s;
  text-align: center;
}
.ctrl-btn:hover { background: var(--bg4); color: var(--white); }
.ctrl-btn.on { background: var(--teal-lo); color: var(--teal); border-color: rgba(0,194,168,0.4); }

/* RIGHT CONTENT STAGE */
#content-stage {
  display: flex; flex-direction: column; overflow: hidden;
}

.stage-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.breadcrumb span { color: var(--text); }
.breadcrumb .sep { opacity: 0.3; }
.slide-nav { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all 0.2s;
}
.nav-btn:hover { background: var(--bg4); border-color: var(--teal-dim); color: var(--teal); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.global-fullscreen-btn {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 500; /* above every .screen (z-index:1) but below the
                   content-load-error overlay (z-index:9999) */
  background: rgba(7,9,15,0.55);
  backdrop-filter: blur(4px);
}
.slide-counter {
  font-family: 'Space Mono', monospace;
  font-size: 11px; color: var(--muted);
  min-width: 50px; text-align: center;
}

.prog-bar { height: 2px; background: var(--border); flex-shrink: 0; }
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-dim), var(--teal));
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--teal);
}

.slide-area {
  flex: 1; display: flex;
  align-items: center; justify-content: center;
  padding: 16px 28px 12px 28px; overflow: hidden;
  position: relative;
}
.slide-area::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.slide-card {
  width: 100%; max-width: 820px;
  max-height: calc(100vh - 220px);
  aspect-ratio: 16/9;
  background: #0D1B3E;
  border-radius: 14px; overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0,194,168,0.15), 0 24px 80px rgba(0,0,0,0.6);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.slide-card.transitioning { transform: scale(0.97); opacity: 0.3; }

.slide-content { width:100%; height:100%; display:none; position:absolute; inset:0; }
.slide-content.active { display:block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.slide-content.active .sl { animation: fadeIn 0.4s ease forwards; }

.thumb-strip {
  display: flex; gap: 8px;
  padding: 10px 24px; overflow-x: auto; flex-shrink: 0;
  background: var(--bg2); border-top: 1px solid var(--border);
  scrollbar-width: thin; scrollbar-color: var(--bg4) transparent;
}
.thumb {
  width: 76px; height: 43px; border-radius: 5px;
  background: var(--bg4); border: 1.5px solid transparent;
  cursor: pointer; flex-shrink: 0; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Mono', monospace; font-size: 9px;
  color: var(--muted);
}
.thumb:hover { border-color: var(--teal-dim); }
.thumb.active { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 10px rgba(0,194,168,0.2); }

/* CHAT BAR */
#chat-bar {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  display: flex; flex-direction: column;
  height: 64px; overflow: hidden;
  transition: height 0.3s ease; flex-shrink: 0;
}
#chat-bar.expanded { height: 220px; }
#chat-history {
  flex: 1; overflow-y: auto;
  padding: 10px 20px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: var(--bg4) transparent;
}
#chat-history:empty { display: none; }
#chat-input-row {
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  height: 64px; flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.chat-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px; color: var(--teal);
  letter-spacing: 2px; white-space: nowrap; flex-shrink: 0;
}
.chat-input-wrap {
  flex: 1; display: flex; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-wrap:focus-within {
  border-color: rgba(0,194,168,0.4);
  box-shadow: 0 0 0 3px rgba(0,194,168,0.07);
}
.chat-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--white); font-family: 'DM Sans', sans-serif;
  font-size: 13px; padding: 14px 0;
}
.chat-input::placeholder { color: var(--muted); }

/* file upload btn */
.chat-upload {
  background: none; border: none;
  color: var(--muted); font-size: 18px;
  cursor: pointer; padding: 4px 8px;
  transition: color 0.2s; flex-shrink: 0;
}
.chat-upload:hover { color: var(--teal); }
#file-input { display: none; }

.chat-mic {
  background: none; border: none;
  color: var(--muted); font-size: 17px;
  cursor: pointer; padding: 4px 8px;
  transition: color 0.2s, transform 0.2s; flex-shrink: 0;
}
.chat-mic:hover { color: var(--teal); }
.chat-mic.listening { color: var(--danger); transform: scale(1.1); }

.chat-send {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--teal); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #07090F; font-size: 16px; flex-shrink: 0;
  transition: all 0.2s;
}
.chat-send:hover { background: #00d4b8; transform: scale(1.05); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.chat-bubble {
  max-width: 72%; padding: 8px 14px;
  border-radius: 10px; font-size: 12.5px; line-height: 1.55;
}
.chat-bubble.student {
  background: var(--bg4); color: var(--text);
  align-self: flex-end; border-bottom-right-radius: 3px;
}
.chat-bubble.syra {
  background: var(--teal-lo);
  border: 1px solid rgba(0,194,168,0.2);
  color: var(--white); align-self: flex-start;
  border-bottom-left-radius: 3px; font-style: italic;
}

/* voice indicator */
.voice-indicator {
  display: none; align-items: center; gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; color: var(--teal); flex-shrink: 0;
}
.voice-indicator.speaking { display: flex; }
.voice-bar {
  width: 3px; background: var(--teal); border-radius: 2px;
  animation: voice-wave 0.6s ease-in-out infinite alternate;
}
.voice-bar:nth-child(2) { animation-delay: 0.1s; height: 8px; }
.voice-bar:nth-child(3) { animation-delay: 0.2s; height: 14px; }
.voice-bar:nth-child(4) { animation-delay: 0.15s; height: 10px; }
.voice-bar:nth-child(5) { animation-delay: 0.05s; height: 6px; }
@keyframes voice-wave { from { transform: scaleY(0.4); } to { transform: scaleY(1); } }

/* ═══════════════════════════════════════
   SLIDE DESIGNS
═══════════════════════════════════════ */
.sl { width:100%; height:100%; font-family:'DM Sans',sans-serif; position:relative; overflow:hidden; }
.sl-bar { position:absolute; left:0; top:0; width:3.5%; height:100%; }
.sl-tag { position:absolute; top:7%; left:5%; font-family:'Space Mono',monospace; font-size:9px; letter-spacing:3px; opacity:0.8; }
.sl-title { position:absolute; left:5%; top:20%; font-family:'Fraunces',serif; line-height:1.15; }
.sl-rule { position:absolute; left:5%; height:2px; border-radius:2px; }
.sl-sub { position:absolute; left:5%; font-style:italic; line-height:1.6; }
.sl-foot { position:absolute; bottom:4%; left:5%; font-family:'Space Mono',monospace; font-size:8px; letter-spacing:2px; opacity:0.4; }

.cover-sl { background:#07090F; }
.cover-sl .sl-bar { background:#00C2A8; }
.cover-sl .sl-tag { color:#00C2A8; top:6%; }
.cover-sl .sl-title { color:#fff; font-size:clamp(20px,4vw,38px); top:16%; max-width:85%; }
.cover-sl .sl-rule { background:#00C2A8; width:22%; top:63%; }
.cover-sl .sl-sub { color:#7EC8BE; font-size:clamp(9px,1.2vw,13px); top:68%; width:80%; }

.fn-title-sl { background:#07090F; }
.fn-title-sl .sl-bar { background:#00C2A8; }
.fn-title-sl .sl-tag { color:#00C2A8; }
.fn-num { position:absolute; left:5%; top:6%; font-family:'Space Mono',monospace; font-size:clamp(11px,1.5vw,14px); font-weight:700; background:rgba(0,194,168,0.12); border:1px solid rgba(0,194,168,0.4); color:#00C2A8; padding:3px 10px; border-radius:4px; }
.fn-title-sl .sl-title { color:#fff; font-size:clamp(18px,3.5vw,32px); top:22%; max-width:88%; }
.fn-title-sl .sl-rule { background:#00C2A8; width:18%; top:63%; }
.fn-title-sl .sl-sub { color:#7EC8BE; font-size:clamp(9px,1.1vw,12px); top:68%; width:82%; }

.spot-sl { background:#F0F4FA; color:#07090F; }
.spot-sl .sl-bar { background:#00C2A8; }
.spot-sl .sl-tag { color:#00C2A8; }
.spot-sl .card-l { position:absolute; left:5%; top:14%; width:44%; height:40%; background:#111827; border-radius:6px; border-top:3px solid #00C2A8; padding:6% 7% 5%; }
.spot-sl .card-l .cl { font-family:'Space Mono',monospace; font-size:8px; letter-spacing:2px; color:#00C2A8; margin-bottom:8px; }
.spot-sl .card-l .ct { font-size:clamp(8px,1.1vw,11px); color:#C8E6E2; line-height:1.7; }
.spot-sl .card-b { position:absolute; left:5%; top:57%; width:44%; height:36%; background:#fff; border-radius:6px; border-top:3px solid #F59E0B; padding:5% 7%; }
.spot-sl .card-b .cl { font-family:'Space Mono',monospace; font-size:8px; letter-spacing:2px; color:#1A2340; margin-bottom:8px; }
.spot-sl .card-b ul { list-style:disc; padding-left:14px; }
.spot-sl .card-b li { font-size:clamp(8px,1vw,11px); color:#1A2340; line-height:1.65; }
.spot-sl .card-r { position:absolute; right:4%; top:14%; width:47%; height:79%; background:#fff; border-radius:6px; border-top:3px solid #F59E0B; padding:5% 7%; }
.spot-sl .card-r .cl { font-family:'Space Mono',monospace; font-size:8px; letter-spacing:2px; color:#1A2340; margin-bottom:10px; }
.spot-sl .card-r .ct { font-size:clamp(8px,1.1vw,12px); color:#2A3A5E; font-style:italic; line-height:1.75; }
.spot-sl .sl-foot { color:#8A9ABB; bottom:2%; }

/* ═══════════════════════════════════════
   PRACTICE ENGINE
═══════════════════════════════════════ */
#screen-practice {
  flex-direction: column;
  background: var(--bg);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.practice-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  overflow: hidden;
  min-height: 0;
}
.practice-panel {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 14px;
  overflow-y: auto;
}
.practice-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.practice-header {
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  font-size: 13px;
}
.practice-header .ph-back {
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  padding: 4px 8px;
}
.practice-header .ph-back:hover { color: var(--teal); }
.practice-topic-tag {
  color: var(--teal);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
}
.practice-score-bar {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 12px;
}
.ps-correct { color: #1A6B3C; font-weight: 700; }
.ps-wrong   { color: #E8645A; font-weight: 700; }
.practice-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pq-passage {
  background: var(--bg3);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  font-size: clamp(12px,1.3vw,15px);
  line-height: 1.7;
  color: var(--text);
}
.pq-passage .pq-passage-label {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: var(--teal);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.pq-question {
  font-size: clamp(13px,1.4vw,16px);
  color: var(--white);
  font-weight: 600;
  line-height: 1.5;
}
.pq-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pq-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: clamp(12px,1.2vw,14px);
  color: var(--text);
}
.pq-option:hover:not(.disabled) {
  border-color: var(--teal);
  background: rgba(0,194,168,0.08);
}
.pq-option.selected { border-color: var(--amber); background: rgba(201,168,76,0.1); }
.pq-option.correct  { border-color: #1A6B3C; background: rgba(26,107,60,0.15); color: var(--white); }
.pq-option.wrong    { border-color: #E8645A; background: rgba(232,100,90,0.12); }
.pq-option.disabled { cursor: default; pointer-events: none; }
.pq-opt-letter {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg4);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  font-family: 'Space Mono', monospace;
}
.pq-option.correct .pq-opt-letter  { background: #1A6B3C; color: #fff; }
.pq-option.wrong .pq-opt-letter    { background: #E8645A; color: #fff; }
.pq-option.selected .pq-opt-letter { background: var(--amber); color: #000; }
.pq-diagnosis {
  background: var(--bg3);
  border-radius: 10px;
  padding: 16px 20px;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.pq-diagnosis.show { display: flex; }
.pqd-verdict {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}
.pqd-verdict.correct-v { background: rgba(26,107,60,0.2); color: #4CAF50; }
.pqd-verdict.wrong-v   { background: rgba(232,100,90,0.2); color: #E8645A; }
.pqd-trap {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--amber);
  letter-spacing: 1px;
}
.pqd-explanation {
  font-size: clamp(12px,1.2vw,14px);
  color: var(--text);
  line-height: 1.6;
}
.pqd-syra-says {
  font-size: clamp(11px,1.1vw,13px);
  color: #7EC8BE;
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 4px;
}
.pq-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.pq-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
}
.pq-loading .pql-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  animation: dotPulse 1.2s infinite;
  margin: 0 2px;
}
.pq-loading .pql-dots span:nth-child(2) { animation-delay: 0.2s; }
.pq-loading .pql-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%,80%,100%{opacity:0.2} 40%{opacity:1} }
.practice-stat-card {
  background: var(--bg3);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.psc-val { font-size: 22px; font-weight: 700; color: var(--teal); }
.psc-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.trap-badge {
  padding: 3px 8px;
  background: rgba(232,100,90,0.15);
  border: 1px solid rgba(232,100,90,0.3);
  border-radius: 4px;
  font-size: 10px;
  color: #E8645A;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
}

/* ═══════════════════════════════════════
   LANGUAGE SELECTOR
═══════════════════════════════════════ */
.lang-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 5px;
}
.lang-btn {
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  padding: 3px 9px;
  border-radius: 14px;
  cursor: pointer;
  color: var(--muted);
  background: none;
  border: none;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.lang-btn:hover { color: var(--white); }
.lang-btn.active {
  background: var(--teal);
  color: var(--bg);
  font-weight: 700;
}
.lang-indicator {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  color: var(--teal);
  letter-spacing: 1px;
  padding: 2px 6px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s;
}
.lang-indicator.show { opacity: 1; }

/* ═══════════════════════════════════════
   PASSAGE + TIMER SLIDES
═══════════════════════════════════════ */
.passage-sl {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 5% 6%;
  gap: 12px;
}
.psg-timer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10%;
}
.psg-text {
  flex: 1;
  font-size: clamp(12px,1.35vw,16px);
  color: var(--text);
  line-height: 1.8;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  overflow-y: auto;
}
.timer-arc {
  transition: stroke-dashoffset 1s linear;
}
.qsl-opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 12px;
  background: #E8F0FA;
  border-radius: 6px;
  font-size: clamp(10px,1.1vw,13px);
  color: #07090F;
}
.qsl-letter {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: #00C2A8;
  color: #07090F;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
  font-family: 'Space Mono', monospace;
}
.wt-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 8px 12px;
  background: #EEF2F8;
  border-radius: 6px;
  font-size: clamp(10px,1.1vw,13px);
}
.wt-label {
  color: #00C2A8; font-weight: 700; min-width: 60px;
  font-family: 'Space Mono', monospace; font-size: 10px;
}
.wt-val { color: #07090F; line-height: 1.5; }

/* ═══════════════════════════════════════
   TEACHING POINT SLIDES (4 points)
═══════════════════════════════════════ */
.teach-sl { display: flex; flex-direction: column; justify-content: center; padding: 5% 6%; }
.teach-points {
  margin-top: 9%;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.teach-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tp-dot {
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: #C9A84C;
  color: #07090F;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  font-family: 'Space Mono', monospace;
}
.tp-dot-teal { background: #00C2A8; }
.tp-body { display: flex; flex-direction: column; gap: 2px; }
.tp-head {
  color: #00C2A8;
  font-weight: 700;
  font-size: clamp(11px,1.2vw,14px);
}
.tp-text {
  color: #1a2535;
  font-size: clamp(10px,1.1vw,13px);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET & PHONE
   Two breakpoints:
   ≤1023px (tablet & phone): the slide-card's fixed 16:9 ratio
     was clipping dense content (passage+chart+options) even with
     the sidebar untouched — this fixes height independent of width.
   ≤767px (phone only): sidebars collapse to a compact top strip,
     since there isn't enough width to keep them side-by-side at all.
═══════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {
  /* Stop deriving slide-card height from width via aspect-ratio —
     on a narrower screen that math produces a short, wide card that
     clips anything beyond a couple of lines. Let it fill whatever
     space .slide-area actually has instead of guessing in pixels —
     robust regardless of how tall the header ends up being. */
  .teach-layout, .practice-layout { min-height: 0; }
  #content-stage { min-height: 0; }
  .slide-area { min-height: 0; }
  .slide-card {
    aspect-ratio: unset;
    width: 100%; height: 100%;
    max-width: 820px; max-height: none;
  }
  .slide-area { padding: 10px 16px 8px 16px; }

  /* Only show the current slide name in the breadcrumb — the full
     chain wraps to 2-3 lines on a narrow header and eats vertical
     space the slide itself needs. The deck title is bare text (not
     a span), so blank the whole row's font-size and restore it only
     on the slide name. */
  .breadcrumb { font-size: 0; white-space: nowrap; overflow: hidden; }
  .breadcrumb #slide-name-bc { font-size: 12px; }
}

@media (max-width: 767px) {
  .teach-layout, .practice-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .dash-layout { flex-direction: column; }
  .dash-sidebar {
    width: 100%; flex-direction: row; align-items: center;
    padding: 10px 14px; gap: 10px; overflow-x: auto; border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .dash-nav { flex-direction: row; flex: none; }
  .dash-user { border-bottom: none; padding: 0; margin-bottom: 0; }

  .doubt-layout { flex-direction: column; height: auto; }
  .doubt-syra-panel { width: 100%; flex-direction: row; }

  /* Syra's panel becomes a slim top strip instead of a 300px side
     column — there simply isn't width to spare for both the avatar
     chrome AND the question content on a phone. */
  #syra-panel, .practice-panel {
    flex-direction: row; align-items: center; justify-content: flex-start;
    flex-wrap: wrap;
    padding: 8px 12px; gap: 8px; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--border);
    width: 100%; height: auto;
  }
  #syra-panel .teal-glow { display: none; }
  #syra-panel .panel-header { display: none; }
  #syra-panel .speech-box { display: none; }
  .teach-avatar-wrap {
    width: 42px; height: 42px; margin-bottom: 0; flex-shrink: 0;
  }
  .teach-avatar-wrap .syra-photo {
    width: 42px; height: 42px;
  }
  #syra-panel .topic-card {
    flex: 1; min-width: 0; padding: 0; background: none; border: none;
  }
  #syra-panel .topic-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #syra-panel .topic-label, #syra-panel .topic-sub { display: none; }
  #syra-panel .lang-toggle, #syra-panel .lang-indicator { display: none; }
  .syra-controls {
    flex-direction: row; gap: 6px; width: auto; flex-shrink: 0;
  }
  .syra-controls .ctrl-btn { padding: 5px 8px; font-size: 9px; }

  .nav-btn { width: 38px; height: 38px; }

  /* Auth/signup screen — was a fixed 60px/64px desktop padding with no
     scroll fallback, so overflow on a phone was genuinely unreachable */
  #screen-auth { flex-direction: column; overflow-y: auto; height: 100vh; height: 100dvh; }
  .auth-left { width: 100%; padding: 28px 20px 20px; }
  .auth-avatar-wrap { width: 84px; height: 84px; margin-bottom: 12px; }
  .auth-avatar-wrap .syra-photo { width: 84px; height: 84px; }
  .auth-quote { font-size: 13px; max-width: 92%; }
  .auth-right { padding: 24px 20px 32px; }
  .form-row { flex-direction: column; gap: 14px; }

  /* Intro screen avatar — proportionally too large on a phone */
  .intro-avatar-wrap { width: 130px; height: 130px; }
  .intro-avatar-wrap .syra-photo { width: 130px; height: 130px; }
  .intro-greeting { font-size: 24px; }
/* Landing screen — same bug class as screen-auth above: fixed 55%/45%
     desktop row with overflow:hidden on the columns, no scroll fallback,
     so on a phone the headline wrapped one word per line and anything
     taller than the viewport was simply unreachable. */
  #screen-landing { flex-direction: column; overflow-y: auto; height: 100vh; height: 100dvh; }
  .landing-left, .landing-right { width: 100%; overflow: visible; }
  .landing-left { padding: 32px 20px 24px; }
  .landing-left::after { display: none; }
  .landing-headline { font-size: clamp(30px, 9vw, 42px); }
  .landing-sub { font-size: 15px; max-width: 100%; margin-bottom: 28px; }
  .landing-cta-row { flex-wrap: wrap; margin-bottom: 24px; }
  .landing-right { padding: 24px 20px 40px; }
  .landing-avatar-wrap { width: 160px; height: 160px; margin-bottom: 16px; }
  .landing-avatar-wrap .syra-photo { width: 160px; height: 160px; }
  .landing-right .teal-glow { width: 260px; height: 260px; }
}

/* ── PROGRESSIVE REVEAL ("build" slides) ──
   Items marked .reveal-pending start hidden; Slides.deliverBuildReveal()
   adds .revealed to each in sequence, synced with per-point narration. */
.reveal-pending {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal-pending.revealed {
  opacity: 1;
  transform: translateY(0);
}
.syra-build-advance {
  display: none;
}
.syra-build-mode-toggle:hover {
  background: rgba(0,194,168,0.18);
  border-color: rgba(0,194,168,0.5);
}
.reveal-pending-row {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.reveal-pending-row.revealed {
  opacity: 1;
}
