/* ============================================================
   Student-specific styles (extends styles.css)
   ============================================================ */

/* ===== Hero CTA card ===== */
.hero-cta {
  background: linear-gradient(135deg, #FCE4D8 0%, #FBD6C7 55%, #F9C7B5 100%);
  border-radius: 18px;
  padding: 40px 44px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(239,106,72,0.18);
  box-shadow: 0 4px 18px rgba(196,90,52,0.10);
}
.hero-cta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #C5532A;
  background: rgba(255,255,255,0.55);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero-cta-eyebrow .pulse-dot {
  width: 7px; height: 7px;
  background: var(--primary);
  border-radius: 50%;
  animation: heroPulse 1.8s ease-in-out infinite;
}
@keyframes heroPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.55; }
}
.hero-cta-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #2A1810;
  margin: 0 0 10px;
}
.hero-cta-sub {
  font-size: 14.5px;
  color: #5A4438;
  line-height: 1.55;
  margin: 0 0 22px;
  max-width: 440px;
}
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  border: 0;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(239,106,72,0.32), 0 1px 2px rgba(239,106,72,0.18);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-hero:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239,106,72,0.4);
}
.btn-hero .mic-circle {
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

/* Hero illustration (mic + waveform) */
.hero-illust {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-mic {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  display: grid; place-items: center;
  box-shadow: 0 8px 28px rgba(196,90,52,0.18);
  position: relative;
  z-index: 2;
}
.hero-mic svg { color: var(--primary); }
.hero-mic-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(239,106,72,0.3);
  pointer-events: none;
}
.hero-mic-ring.r1 { width: 170px; height: 170px; animation: ringPulse 2.4s ease-out infinite; }
.hero-mic-ring.r2 { width: 210px; height: 210px; animation: ringPulse 2.4s ease-out infinite 0.6s; }
.hero-mic-ring.r3 { width: 250px; height: 250px; animation: ringPulse 2.4s ease-out infinite 1.2s; }
@keyframes ringPulse {
  0%   { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 0; }
}
.hero-wave {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0.35;
}

/* ===== Stats (student variant — 4 cols) ===== */
.stats-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

/* ===== Topic suggestion grid (4 col) ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.topic-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.topic-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-card);
}
.topic-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(31,27,22,0.08);
}
.topic-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topic-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.topic-icon.coral  { background: var(--pink-tile);   color: #B83C5E; }
.topic-icon.peach  { background: var(--orange-tile); color: #C5532A; }
.topic-icon.green  { background: var(--green-tile);  color: #2F7A3E; }
.topic-icon.purple { background: var(--purple-tile); color: #6B49B8; }
.topic-icon.blue   { background: var(--blue-50);     color: var(--blue-700); }
.topic-icon.yellow { background: var(--yellow-tile); color: #8A6A14; }
.topic-card-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}
.topic-card-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  min-height: 32px;
}
.topic-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.topic-card-meta .dot { width: 3px; height: 3px; background: var(--muted-2); border-radius: 50%; }
.topic-spark {
  height: 36px;
  margin: 4px -4px 0;
}
.btn-practice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  border: 0;
  font-weight: 600;
  font-size: 13.5px;
  margin-top: auto;
  transition: background 0.15s;
}
.btn-practice:hover { background: var(--primary-hover); }
.btn-practice-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-practice-ghost:hover { background: var(--primary-softer); }

/* ===== Filter chips ===== */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--muted-2); }
.chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== Search bar ===== */
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}
.search-box input {
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px 36px;
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--ink);
  width: 280px;
  outline: none;
  transition: border-color 0.15s;
}
.search-box input:focus { border-color: var(--primary); }
.search-box input::placeholder { color: var(--muted-2); }

/* ===== Section heading ===== */
.section-heading {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 28px 0 14px;
}
.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 14px;
}
.section-heading-row h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.section-heading-row .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== View toggle ===== */
.view-toggle {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.view-toggle button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-toggle button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ===== Floating tip banner ===== */
.tip-banner {
  background: linear-gradient(135deg, #FCE4D8 0%, #FAEFE8 100%);
  border: 1px solid rgba(239,106,72,0.2);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}
.tip-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 22px;
}
.tip-banner h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 2px;
  color: #2A1810;
}
.tip-banner p { font-size: 13px; color: #5A4438; margin: 0; line-height: 1.5; }

/* ===== Mini sparkline ===== */
.spark-svg { width: 100%; height: 100%; display: block; }

/* ===== Weekly progress bar (compact) ===== */
.progress-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.progress-stat .row { display: flex; justify-content: space-between; }
.progress-stat .row .lbl { color: var(--muted); }
.progress-stat .row .val { font-weight: 600; color: var(--ink); }

/* =====================================================
   VOICE CHAT — full-screen layout
   ===================================================== */
.app--fullscreen { grid-template-columns: 1fr; }

.voice-shell {
  display: flex;
  flex-direction: column;
  height: 1024px;
  background: var(--bg);
}

.voice-topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
}
.voice-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.voice-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.voice-back:hover { background: var(--primary-softer); border-color: var(--primary); color: var(--primary); }
.voice-topic-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.voice-topic-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.voice-timer {
  font-family: 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.voice-timer .rec-dot {
  width: 8px; height: 8px;
  background: #E94B3C;
  border-radius: 50%;
  animation: recBlink 1.4s ease-in-out infinite;
}
@keyframes recBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.voice-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-end {
  background: #FBE2DB;
  color: #B73B25;
  border: 1px solid #F1B9AB;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-end:hover { background: #F8C9BC; }

.voice-body {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  flex: 1;
  min-height: 0;
}

/* Transcript */
.transcript-col {
  background: var(--bg);
  padding: 28px 36px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bubble-row {
  display: flex;
  gap: 12px;
  max-width: 80%;
}
.bubble-row.ai { align-self: flex-start; }
.bubble-row.user { align-self: flex-end; flex-direction: row-reverse; }
.bubble-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.bubble {
  background: #F5F0E7;
  border: 1px solid rgba(239,106,72,0.06);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.bubble-row.ai .bubble { border-top-left-radius: 4px; }
.bubble-row.user .bubble {
  background: #FCE4D8;
  border-color: rgba(239,106,72,0.15);
  border-top-right-radius: 4px;
}
.bubble-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.bubble-row.user .bubble-meta { justify-content: flex-end; }

.bubble-listening {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-style: italic;
  color: var(--muted);
}
.dots {
  display: inline-flex;
  gap: 4px;
}
.dots span {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: dotPulse 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Voice greeting (empty state) */
.voice-greeting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  gap: 18px;
  padding: 32px;
}
.voice-greeting-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 6px 22px rgba(31,27,22,0.1);
}
.voice-greeting h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  max-width: 460px;
  text-wrap: balance;
}
.voice-greeting p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

/* Voice control panel */
.voice-control-col {
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.voice-status {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-top: 24px;
  text-align: center;
}
.voice-status.recording { color: #E94B3C; }
.voice-status.thinking  { color: var(--primary); }
.voice-status.denied    { color: #B73B25; }

.mic-button {
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: var(--primary);
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
  box-shadow: 0 6px 24px rgba(239,106,72,0.35), 0 2px 6px rgba(239,106,72,0.18);
  transition: transform 0.15s, background 0.15s;
}
.mic-button:hover { transform: scale(1.03); background: var(--primary-hover); }
.mic-button:active { transform: scale(0.97); }
.mic-button.recording { background: #E94B3C; }
.mic-button.disabled {
  background: #E5DCCD;
  color: #fff;
  cursor: not-allowed;
  box-shadow: none;
}
.mic-button.denied {
  background: #FBE2DB;
  color: #B73B25;
}
.mic-button.disabled:hover, .mic-button.denied:hover { transform: none; }

/* Pulsing ring on recording */
.mic-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid #E94B3C;
  pointer-events: none;
  animation: micRing 1.8s ease-out infinite;
}
.mic-ring.r1 { width: 100%; height: 100%; }
.mic-ring.r2 { width: 100%; height: 100%; animation-delay: 0.6s; }
.mic-ring.r3 { width: 100%; height: 100%; animation-delay: 1.2s; }
@keyframes micRing {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

.mic-hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: -4px;
}

/* Live waveform */
.waveform-live {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  margin-top: 4px;
}
.waveform-live span {
  display: block;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
  animation: bar 1.1s ease-in-out infinite;
}
.waveform-live span:nth-child(1)  { animation-delay: 0.0s;  height: 14px; }
.waveform-live span:nth-child(2)  { animation-delay: 0.1s;  height: 22px; }
.waveform-live span:nth-child(3)  { animation-delay: 0.2s;  height: 30px; }
.waveform-live span:nth-child(4)  { animation-delay: 0.3s;  height: 18px; }
.waveform-live span:nth-child(5)  { animation-delay: 0.4s;  height: 26px; }
.waveform-live span:nth-child(6)  { animation-delay: 0.5s;  height: 14px; }
.waveform-live span:nth-child(7)  { animation-delay: 0.6s;  height: 28px; }
.waveform-live span:nth-child(8)  { animation-delay: 0.5s;  height: 22px; }
.waveform-live span:nth-child(9)  { animation-delay: 0.4s;  height: 16px; }
.waveform-live span:nth-child(10) { animation-delay: 0.3s;  height: 24px; }
.waveform-live span:nth-child(11) { animation-delay: 0.2s;  height: 18px; }
.waveform-live span:nth-child(12) { animation-delay: 0.1s;  height: 12px; }
@keyframes bar {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

/* Quick stats inside voice panel */
.voice-quickstats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 24px;
  width: 100%;
  max-width: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.voice-quickstats .q {
  text-align: center;
}
.voice-quickstats .q .v {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.voice-quickstats .q .l {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px;
}

/* Bottom action bar */
.voice-bottom {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.voice-bottom-hint { font-size: 12.5px; color: var(--muted); }

/* Mic permission denied modal/banner inside transcript */
.mic-denied-banner {
  background: #FBE2DB;
  border: 1px solid #F1B9AB;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 auto;
  max-width: 520px;
}
.mic-denied-banner .ico {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #fff;
  display: grid; place-items: center;
  color: #B73B25;
  flex-shrink: 0;
}
.mic-denied-banner h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 4px;
  color: #5A1F12;
}
.mic-denied-banner p { font-size: 13px; color: #6B2E20; margin: 0 0 10px; line-height: 1.5; }
.mic-denied-banner button {
  background: #B73B25;
  color: #fff;
  border: 0;
  font-weight: 600;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

/* =====================================================
   SESSION COMPLETE
   ===================================================== */
.complete-shell {
  min-height: 1024px;
  background: linear-gradient(180deg, #FAEFE8 0%, #FDF8F6 38%);
  padding: 56px 32px 48px;
}
.complete-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(31,27,22,0.06), 0 2px 8px rgba(31,27,22,0.04);
  overflow: hidden;
}
.complete-header {
  background: linear-gradient(135deg, #FCE4D8 0%, #FAD6C7 100%);
  padding: 36px 40px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.confetti span {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 2px;
}
.complete-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(196,90,52,0.18);
  position: relative;
  z-index: 2;
}
.complete-header h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 8px;
  color: #2A1810;
  position: relative;
  z-index: 2;
}
.complete-header p {
  font-size: 15px;
  color: #5A4438;
  margin: 0;
  position: relative;
  z-index: 2;
}
.complete-body {
  padding: 32px 40px 36px;
}
.complete-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.complete-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
  position: relative;
}
.complete-stat .ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 8px;
}
.complete-stat .ico.coral  { background: var(--pink-tile);   color: #B83C5E; }
.complete-stat .ico.peach  { background: var(--orange-tile); color: #C5532A; }
.complete-stat .ico.orange { background: var(--orange-50);   color: var(--orange-700); }
.complete-stat .ico.purple { background: var(--purple-tile); color: #6B49B8; }
.complete-stat .v {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.complete-stat .l {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.complete-insight {
  background: #ECF6E7;
  border: 1px solid #C8E0BD;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.complete-insight .em { font-size: 22px; }
.complete-insight p { margin: 0; font-size: 13.5px; color: #2C5C20; line-height: 1.5; }
.complete-highlights {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 22px;
}
.complete-highlights .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.complete-highlights .head h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14.5px;
  margin: 0;
  color: var(--ink);
}
.mini-bubble {
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.mini-bubble.ai   { background: #F5F0E7; }
.mini-bubble.user { background: #FCE4D8; }
.complete-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 0;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-secondary:hover { background: var(--primary-softer); }
.btn-tertiary {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--border-strong);
  font-weight: 500;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}
.btn-tertiary:hover { border-color: var(--muted-2); }
.complete-footer {
  text-align: center;
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
}

/* =====================================================
   HISTORY
   ===================================================== */
.history-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 22px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.history-summary .h-sep { width: 1px; height: 22px; background: var(--border); }
.history-summary strong {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.session-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 12px;
  transition: background 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}
.session-row:hover {
  background: var(--primary-softer);
  border-color: var(--primary-soft);
}
.session-row + .session-row { margin-top: 4px; }
.session-row .ico {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--pink-tile);
  color: #B83C5E;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.session-row .ico.peach  { background: var(--orange-tile); color: #C5532A; }
.session-row .ico.green  { background: var(--green-tile); color: #2F7A3E; }
.session-row .ico.purple { background: var(--purple-tile); color: #6B49B8; }
.session-row .ico.blue   { background: var(--blue-50); color: var(--blue-700); }
.session-row .t { font-weight: 600; font-size: 14px; color: var(--ink); }
.session-row .m { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.session-row .d {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
}
.session-row .arrow {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  display: grid; place-items: center;
  color: var(--muted-2);
}
.session-row:hover .arrow { color: var(--primary); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
}
.pagination button {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}
.pagination button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination button:hover:not(.active) { border-color: var(--muted-2); }

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb .sep { color: var(--muted-2); }

/* Session detail mini stats */
.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.detail-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.detail-stat .l { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.detail-stat .v {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

/* Transcript card */
.transcript-readonly {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 4px;
}

/* =====================================================
   PROGRESS
   ===================================================== */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
  flex: 1;
}
.donut-legend .row { display: flex; align-items: center; gap: 10px; }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.donut-legend .lbl { color: var(--ink-2); font-weight: 500; }
.donut-legend .val { margin-left: auto; color: var(--muted); font-size: 12.5px; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
}
.compare-table td {
  padding: 11px 0;
  font-size: 13.5px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table td:first-child { color: var(--muted); }
.compare-table td:last-child { text-align: right; }
.delta-up   { color: #2F7A3E; font-weight: 600; font-size: 12.5px; }
.delta-down { color: #B73B25; font-weight: 600; font-size: 12.5px; }

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.badge-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.badge-card .em { font-size: 30px; line-height: 1; }
.badge-card .t {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13.5px;
  margin-top: 8px;
  color: var(--ink);
}
.badge-card .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* =====================================================
   SETTINGS
   ===================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 28px;
}
.settings-nav button {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink-2);
  border-radius: 8px;
  cursor: pointer;
}
.settings-nav button.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.settings-nav button:hover:not(.active) { background: rgba(0,0,0,0.03); }
.settings-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.settings-section h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.005em;
  margin: 0 0 4px;
  color: var(--ink);
}
.settings-section .sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}
.settings-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .lbl {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.settings-row .sub-lbl {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.input-field {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.input-field:focus { border-color: var(--primary); }
.input-field:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.toggle-switch {
  width: 40px; height: 22px;
  background: var(--border-strong);
  border-radius: 999px;
  border: 0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle-switch.on { background: var(--primary); }
.toggle-switch i {
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch.on i { transform: translateX(18px); }

.btn-danger {
  background: transparent;
  color: #B73B25;
  border: 1px solid #F1B9AB;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: #FBE2DB; }

/* =====================================================
   DARK MODE (light surface tweak)
   ===================================================== */
body.theme-dark {
  --bg: #1F1B16;
  --sidebar: #2A241E;
  --card: #2A241E;
  --border: #3A322A;
  --border-strong: #4A4036;
  --ink: #F5F0E8;
  --ink-2: #C9C0B3;
  --muted: #8F8779;
  --muted-2: #6B6458;
  --primary-soft: rgba(239,106,72,0.18);
  --primary-softer: rgba(239,106,72,0.10);
  --orange-tile: rgba(239,106,72,0.22);
  --pink-tile: rgba(232,89,134,0.18);
  --yellow-tile: rgba(247,196,87,0.18);
  --purple-tile: rgba(140,107,202,0.18);
  --green-tile: rgba(82,143,93,0.18);
}
body.theme-dark .bubble { background: #332B23; border-color: rgba(239,106,72,0.12); color: var(--ink); }
body.theme-dark .bubble-row.user .bubble { background: rgba(239,106,72,0.22); }
body.theme-dark .mini-bubble.ai { background: #332B23; }
body.theme-dark .mini-bubble.user { background: rgba(239,106,72,0.22); }
body.theme-dark .hero-cta {
  background: linear-gradient(135deg, rgba(239,106,72,0.30) 0%, rgba(239,106,72,0.18) 100%);
}
body.theme-dark .complete-shell {
  background: linear-gradient(180deg, rgba(239,106,72,0.18) 0%, var(--bg) 38%);
}
body.theme-dark .complete-header {
  background: linear-gradient(135deg, rgba(239,106,72,0.30) 0%, rgba(239,106,72,0.18) 100%);
}
body.theme-dark .complete-header h1, body.theme-dark .complete-header p, body.theme-dark .hero-cta-title, body.theme-dark .hero-cta-sub, body.theme-dark .tip-banner h3, body.theme-dark .tip-banner p {
  color: var(--ink);
}
body.theme-dark .tip-banner {
  background: linear-gradient(135deg, rgba(239,106,72,0.22) 0%, rgba(239,106,72,0.10) 100%);
}
body.theme-dark .complete-insight { background: rgba(82,143,93,0.18); border-color: rgba(82,143,93,0.30); }
body.theme-dark .complete-insight p { color: #B5D8AA; }
body.theme-dark .btn-end { background: rgba(232,89,134,0.18); color: #F4A89A; border-color: rgba(232,89,134,0.35); }

/* =====================================================
   Screen jump strip (dev tool — above frame)
   ===================================================== */
.screen-strip {
  position: fixed;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(31,27,22,0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(31,27,22,0.18);
}
.screen-strip button {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.7);
  font-size: 11.5px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.screen-strip button:hover { color: #fff; }
.screen-strip button.active { background: var(--primary); color: #fff; }

/* ===== Resource badge (topic card / list) ===== */
.resource-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: #4F9E8B;
  background: #E8F5F2;
  border: 1px solid #C2E4DC;
  border-radius: 10px;
  padding: 2px 7px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ===== Topic intro: full-width scrollable main without sidebar ===== */
.main--intro {
  padding: 0;
  overflow-y: auto;
  background: var(--bg);
}
.main--intro .topic-intro-shell {
  min-height: 100vh;
}

/* ===== Topic Intro Screen ===== */
.topic-intro-shell {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100%;
  padding: 32px 20px 48px;
  background: var(--bg);
}
.topic-intro-card {
  width: 100%;
  max-width: 640px;
  background: var(--surface, #fff);
  border-radius: 20px;
  border: 1px solid var(--border, #E8E2DA);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.tic-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border, #E8E2DA);
}
.tic-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.tic-breadcrumb button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12.5px;
  padding: 0;
  font-family: inherit;
}
.tic-breadcrumb span { color: var(--muted); }
.tic-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.tic-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tic-title { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.tic-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.tic-desc { font-size: 14px; color: var(--ink); line-height: 1.65; margin-top: 12px; }
.tic-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 22px; }
.tic-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}

/* Vocabulary chips */
.vocab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vocab-chip {
  padding: 5px 12px; border-radius: 20px;
  background: var(--bg-soft, #F5F2EC);
  border: 1px solid var(--border, #E8E2DA);
  font-size: 13px; color: var(--ink);
}

/* Sample questions */
.sample-qs { display: flex; flex-direction: column; gap: 8px; }
.sample-q {
  padding: 10px 14px;
  background: var(--bg-soft, #F5F2EC);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: 13.5px; color: var(--ink);
}

/* Resource rows */
.resource-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #E8E2DA);
}
.resource-row:last-child { border-bottom: none; }
.res-type-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  font-size: 18px; flex-shrink: 0;
}
.res-type-icon.pdf {
  background: #FEE9E6; color: var(--primary);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.res-type-icon.audio { background: #EAF4F1; }
.res-type-icon.image { background: #EEF0FB; }
.resource-info { flex: 1; min-width: 0; }
.resource-name { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resource-size { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.btn-res-action {
  padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--border, #E8E2DA);
  background: var(--bg-soft, #F5F2EC);
  color: var(--ink); cursor: pointer; white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-res-action:hover { background: var(--border); }

/* Inline audio player */
.audio-player-inline { display: flex; align-items: center; gap: 8px; }
.audio-play-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-family: inherit;
}
.audio-track {
  width: 80px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.audio-fill { height: 100%; background: var(--primary); transition: width 0.2s linear; }
.audio-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Topic intro footer */
.tic-footer {
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border, #E8E2DA);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tic-footer-left { flex: 1; display: flex; align-items: center; gap: 10px; }
.dont-show-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--muted); user-select: none;
}
.dont-show-toggle input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.btn-skip-intro {
  background: none; border: none; color: var(--muted); font-size: 13px;
  cursor: pointer; padding: 0; font-family: inherit; text-decoration: underline;
}
.btn-skip-intro:hover { color: var(--ink); }
