:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --border: #e2e5ec;
  --text: #1c2230;
  --muted: #6b7280;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-soft: #eef0fd;
  --danger: #dc2626;
  --radius: 16px;

  --hl-0: #4338ca;
  --hl-1: #b45309;
  --hl-2: #0f766e;
  --hl-3: #be185d;
  --hl-4: #15803d;

  --uz-color: #007a8f;
  --uz-soft: #e2f4f6;
  --ru-color: #b91c1c;
  --ru-soft: #fbe9e7;

  --gold: #b8860b;
  --tab-active-text: #ffffff;

  --shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.04), 0 1px 1px rgba(20, 20, 40, 0.03);
  --shadow-md: 0 6px 16px rgba(20, 20, 40, 0.07), 0 2px 6px rgba(20, 20, 40, 0.04);
  --shadow-lg: 0 16px 32px rgba(20, 20, 40, 0.1), 0 4px 10px rgba(20, 20, 40, 0.05);

  --surface-glass: color-mix(in srgb, var(--surface) 74%, transparent);
  --glow-gold: 0 8px 26px color-mix(in srgb, var(--gold) 30%, transparent);
  --font-display: "Fraunces", "Georgia", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141c;
    --surface: #1a1d29;
    --border: #2b2f3d;
    --text: #edeef2;
    --muted: #9297a6;
    --accent: #818cf8;
    --accent-hover: #a5b0fb;
    --accent-soft: #232744;

    --hl-0: #a5b0fb;
    --hl-1: #fbbf24;
    --hl-2: #2dd4bf;
    --hl-3: #f472b6;
    --hl-4: #4ade80;

    --uz-color: #5fd4e8;
    --uz-soft: #16323a;
    --ru-color: #ff8a80;
    --ru-soft: #3a1f1c;

    --gold: #e0b34d;
    --tab-active-text: #14121b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18), 0 1px 1px rgba(0, 0, 0, 0.14);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 18px 36px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);

    --surface-glass: color-mix(in srgb, var(--surface) 62%, transparent);
    --glow-gold: 0 8px 30px color-mix(in srgb, var(--gold) 22%, transparent);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px circle at 12% -8%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 58%),
    radial-gradient(900px circle at 92% 4%, color-mix(in srgb, var(--gold) 24%, transparent), transparent 55%),
    radial-gradient(800px circle at 50% 105%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

.site-header {
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1c1826, #100e17);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  padding: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-md), var(--glow-gold);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.wave-bar {
  transform-box: fill-box;
  transform-origin: center;
  animation: wave-bounce 1.1s ease-in-out infinite;
}

@keyframes wave-bounce {
  0%, 100% { transform: scaleY(0.45); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wave-bar {
    animation: none;
    transform: scaleY(0.75);
    opacity: 0.85;
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  font-size: 1.85rem;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
}

.brand-text strong,
.brand-text span {
  background: linear-gradient(120deg, var(--gold), var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.brand-text strong {
  font-weight: 600;
}

.tagline {
  margin: 1rem 0 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tagline-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.level-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.level-tab {
  border: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--text);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.level-tab:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.level-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md), var(--glow-gold);
}

.level-tab-icon {
  margin-right: 0.35rem;
  font-size: 1rem;
}

.level-tab:nth-child(1) { border-color: color-mix(in srgb, var(--hl-4) 45%, var(--border)); color: var(--hl-4); }
.level-tab:nth-child(2) { border-color: color-mix(in srgb, var(--hl-2) 45%, var(--border)); color: var(--hl-2); }
.level-tab:nth-child(3) { border-color: color-mix(in srgb, var(--hl-1) 45%, var(--border)); color: var(--hl-1); }
.level-tab:nth-child(4) { border-color: color-mix(in srgb, var(--hl-3) 45%, var(--border)); color: var(--hl-3); }
.level-tab:nth-child(5) { border-color: color-mix(in srgb, var(--hl-0) 45%, var(--border)); color: var(--hl-0); }

.level-tab:nth-child(1).active { background: var(--hl-4); border-color: var(--hl-4); color: var(--tab-active-text); }
.level-tab:nth-child(2).active { background: var(--hl-2); border-color: var(--hl-2); color: var(--tab-active-text); }
.level-tab:nth-child(3).active { background: var(--hl-1); border-color: var(--hl-1); color: var(--tab-active-text); }
.level-tab:nth-child(4).active { background: var(--hl-3); border-color: var(--hl-3); color: var(--tab-active-text); }
.level-tab:nth-child(5).active { background: var(--hl-0); border-color: var(--hl-0); color: var(--tab-active-text); }

.part-block {
  margin-bottom: 1.75rem;
}

.part-block h2 {
  font-size: 1.15rem;
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.part-block .part-desc {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.topic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1rem;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.topic-card:hover {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--accent));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--glow-gold);
}

.topic-icon {
  font-size: 1.8rem;
  display: inline-block;
  animation: sticker-float 2.6s ease-in-out infinite;
}

.topic-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.topic-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.topic-back {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
}

.topic-back:hover {
  color: var(--accent);
}

.topic-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 1rem;
}

.prompt-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.prompt-card:hover {
  border-color: color-mix(in srgb, var(--gold) 40%, var(--accent));
  box-shadow: var(--shadow-md), var(--glow-gold);
}

.prompt-card.open {
  border-color: color-mix(in srgb, var(--gold) 40%, var(--accent));
  box-shadow: var(--shadow-md), var(--glow-gold);
}

.prompt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  cursor: pointer;
}

.prompt-text {
  margin: 0;
  font-size: 0.95rem;
}

.exam-date {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

.sticker {
  font-size: 1.3rem;
  margin-right: 0.5rem;
  vertical-align: -3px;
  display: inline-block;
  animation: sticker-float 2.6s ease-in-out infinite;
}

.anim-icon {
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.28em;
  color: var(--gold);
}

.topic-icon .anim-icon {
  width: 1.6rem;
  height: 1.6rem;
  vertical-align: -0.3rem;
}

.run-leg-back,
.run-leg-front,
.run-arm-back,
.run-arm-front {
  transform-origin: 0 0;
  animation-duration: 0.6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.run-leg-back,
.run-arm-front {
  animation-name: run-swing-a;
}

.run-leg-front,
.run-arm-back {
  animation-name: run-swing-b;
}

@keyframes run-swing-a {
  0%, 100% { transform: rotate(-22deg); }
  50% { transform: rotate(30deg); }
}

@keyframes run-swing-b {
  0%, 100% { transform: rotate(30deg); }
  50% { transform: rotate(-22deg); }
}

.dog-jaw {
  transform-origin: 0 0;
  animation: dog-bark 1.1s ease-in-out infinite;
}

@keyframes dog-bark {
  0%, 22%, 100% { transform: rotate(0deg); }
  11% { transform: rotate(20deg); }
}

@media (prefers-reduced-motion: reduce) {
  .run-leg-back,
  .run-leg-front,
  .run-arm-back,
  .run-arm-front,
  .dog-jaw {
    animation: none;
  }
}

@keyframes sticker-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.prompt-card:nth-child(3n+1) .sticker,
.topic-card:nth-child(3n+1) .topic-icon {
  animation-delay: 0s;
}

.prompt-card:nth-child(3n+2) .sticker,
.topic-card:nth-child(3n+2) .topic-icon {
  animation-delay: 0.35s;
}

.prompt-card:nth-child(3n) .sticker,
.topic-card:nth-child(3n) .topic-icon {
  animation-delay: 0.7s;
}

@media (prefers-reduced-motion: reduce) {
  .sticker,
  .topic-icon {
    animation: none;
  }
}

.model-answer {
  background: linear-gradient(160deg, var(--accent-soft), color-mix(in srgb, var(--gold) 10%, var(--accent-soft)));
  border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
  border-radius: 12px;
  padding: 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.model-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.model-answer h3 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pronounce-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.speak-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.speak-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.speak-btn:active {
  transform: scale(0.96);
}

.speak-btn.playing {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  animation: speak-btn-pulse 1.3s ease-out infinite;
}

@keyframes speak-btn-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .speak-btn.playing {
    animation: none;
  }
}

.speak-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pause-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pause-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pause-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.pause-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.pause-btn.paused {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.vocab-chunk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.model-answer h4 {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.answer-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

mark.chunk {
  background: none;
  font-weight: 700;
  padding: 0;
}

.hl-0 { color: var(--hl-0); }
.hl-1 { color: var(--hl-1); }
.hl-2 { color: var(--hl-2); }
.hl-3 { color: var(--hl-3); }
.hl-4 { color: var(--hl-4); }

.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.vocab-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.vocab-chunk {
  font-weight: 700;
}

.vocab-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.vocab-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 500;
}

.vocab-pill .flag {
  font-size: 0.9rem;
}

.vocab-pill-uz {
  background: var(--uz-soft);
  color: var(--uz-color);
}

.vocab-pill-ru {
  background: var(--ru-soft);
  color: var(--ru-color);
}

.vocab-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.record-label {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cue-bullets {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.cue-tail {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.badge {
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.chevron {
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.prompt-card.open .chevron {
  transform: rotate(90deg);
}

.practice-panel {
  display: none;
  border-top: 1px solid var(--border);
  padding: 1rem;
  flex-direction: column;
  gap: 0.9rem;
}

.prompt-card.open .practice-panel {
  display: flex;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid transparent;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--danger);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.85rem;
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0;
}

audio {
  width: 100%;
  height: 34px;
}

.attempts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.attempts h3 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.attempt-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.attempt-row .attempt-meta {
  display: flex;
  flex-direction: column;
  min-width: 90px;
  font-size: 0.72rem;
  color: var(--muted);
}

.attempt-row audio {
  flex: 1;
}

.teacher-trigger {
  cursor: pointer;
  position: relative;
}

.teacher-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(120deg, var(--gold), var(--accent));
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.32rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  animation: teacher-badge-pulse 2.4s ease-in-out infinite;
}

@keyframes teacher-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-badge {
    animation: none;
  }
}

.teacher-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(360px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 2rem));
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, #ff8fd8 30%, transparent), transparent 60%),
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--gold) 35%, transparent), transparent 55%),
    radial-gradient(120% 130% at 100% 100%, color-mix(in srgb, #7c5cff 32%, transparent), transparent 60%),
    radial-gradient(120% 120% at 0% 100%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 55%),
    var(--surface-glass);
  background-size: 200% 200%;
  animation: teacher-aurora 14s ease-in-out infinite;
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
  border-radius: 18px;
  box-shadow: var(--shadow-lg), var(--glow-gold);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

@keyframes teacher-aurora {
  0%, 100% { background-position: 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%; }
  50% { background-position: 20% 20%, 80% 10%, 90% 90%, 10% 80%, 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-panel {
    animation: none;
  }
}

.teacher-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (max-width: 520px) {
  .teacher-panel {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    height: min(70vh, 560px);
  }
}

.teacher-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.teacher-panel-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  background: linear-gradient(120deg, var(--gold), var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.teacher-close {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.teacher-close:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.teacher-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.teacher-msg {
  display: flex;
}

.teacher-msg-student {
  justify-content: flex-end;
}

.teacher-msg-teacher {
  justify-content: flex-start;
}

.teacher-bubble {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.teacher-bubble p {
  margin: 0;
}

.teacher-bubble p + p {
  margin-top: 0.5rem;
}

.teacher-bubble hr {
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--gold) 30%, var(--border));
  margin: 0.5rem 0;
}

.teacher-formula {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  margin: 0.4rem 0;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.8rem;
}

.teacher-formula p {
  margin: 0;
}

.teacher-formula p + p {
  margin-top: 0.25rem;
}

.teacher-line-bad {
  color: var(--danger);
}

.teacher-line-good {
  color: #15803d;
}

@media (prefers-color-scheme: dark) {
  .teacher-line-good {
    color: #4ade80;
  }
}

.teacher-msg-student .teacher-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.teacher-msg-teacher .teacher-bubble {
  background: linear-gradient(160deg, var(--accent-soft), color-mix(in srgb, var(--gold) 10%, var(--accent-soft)));
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.teacher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1rem 0.7rem;
}

.teacher-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.teacher-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.teacher-input-row {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.teacher-input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.teacher-input:focus {
  outline: none;
  border-color: var(--accent);
}

.teacher-mic {
  flex-shrink: 0;
  width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.teacher-mic:hover:not(:disabled) {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.teacher-mic:disabled {
  opacity: 0.4;
  cursor: default;
}

.teacher-mic.recording {
  background: linear-gradient(120deg, #ff5f6d, var(--gold));
  border-color: transparent;
  color: #fff;
  animation: teacher-mic-pulse 1s ease-out infinite;
}

@keyframes teacher-mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 95, 109, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(255, 95, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 95, 109, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-mic.recording {
    animation: none;
  }
}

.teacher-send {
  border: none;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--gold) 40%, var(--accent)));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}

.teacher-send:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.vocab-card {
  max-width: 92%;
  background: linear-gradient(165deg, var(--surface), color-mix(in srgb, var(--gold) 8%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--border));
  border-radius: 14px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.vocab-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.vocab-card-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  background: linear-gradient(120deg, var(--gold), var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vocab-card-level {
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.vocab-card-ipa {
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -0.4rem;
}

.vocab-card-pron-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.vocab-pron-btn {
  border: 1px solid var(--border);
  background: var(--surface-glass);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.vocab-pron-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

.vocab-pron-btn:active {
  transform: scale(0.96);
}

.vocab-card-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.vocab-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.vocab-card-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
}

.vocab-card-speaking {
  font-style: italic;
  color: var(--accent);
}

.vocab-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.vocab-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 500;
}

.vocab-pill-synonym {
  background: var(--uz-soft);
  color: var(--uz-color);
}

.vocab-pill-collocation {
  background: var(--accent-soft);
  color: var(--accent);
}

.vocab-card-examples {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.vocab-card-challenge {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold);
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}

.privacy-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  max-width: 760px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

/* ---- cross-nav to the Millat hub / Reading product ---- */
.hub-nav{
  display:flex; justify-content:center; gap:10px; margin-bottom:1.1rem;
  font-family:var(--font-body, "Manrope", sans-serif);
}
.hub-nav a{
  font-size:0.78rem; font-weight:700; text-decoration:none; color:var(--text);
  background: var(--surface); border:1px solid var(--border);
  padding:6px 14px; border-radius:999px; box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.hub-nav a:hover{ border-color: var(--gold); transform: translateY(-1px); }
.hub-nav a.hub-nav-highlight{
  background: linear-gradient(120deg, var(--gold), var(--accent) 85%);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-sm), var(--glow-gold);
}
