/* ==========================================================================
   IELTS Lab — Dark Cinematic Design System
   Matches https://linkai.codes aesthetic tokens & optical balance
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Elevation Surfaces */
  --bg: #08090b;
  --bg-raise: #0b0d10;
  --surface: #0f1216;
  --surface-2: #14181d;
  --surface-3: #1a1f25;
  --surface-hover: #1f252c;

  /* Line Gradients & Borders */
  --line-subtle: rgba(226, 236, 245, 0.05);
  --line: rgba(226, 236, 245, 0.08);
  --line-strong: rgba(226, 236, 245, 0.16);

  /* Typography */
  --text: #eef2f5;
  --text-2: #a9b3bc;
  --text-3: #78838d;

  /* Accent (Single Cyan Accent) */
  --accent: #4cc4ea;
  --accent-hi: #6fd2f1;
  --accent-text: #8fdcf5;
  --accent-ink: #031219;
  --accent-soft: rgba(76, 196, 234, 0.1);
  --accent-line: rgba(76, 196, 234, 0.35);

  /* Semantic Feedback Indicators */
  --success: #6cc59a;
  --success-bg: rgba(108, 197, 154, 0.12);
  --success-line: rgba(108, 197, 154, 0.35);

  --warning: #d8b064;
  --warning-bg: rgba(216, 176, 100, 0.12);
  --warning-line: rgba(216, 176, 100, 0.35);

  --error: #df8080;
  --error-bg: rgba(223, 128, 128, 0.12);
  --error-line: rgba(223, 128, 128, 0.35);

  /* Fonts */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 9999px;

  /* Elevations & Highlights */
  --inner-hi: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 0 12px rgba(255, 255, 255, 0.02);
  --shadow-card: 0 18px 40px -18px rgba(0, 0, 0, 0.8), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(76, 196, 234, 0.25);

  /* Easings */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.23, 1, 0.32, 1);
  --transition: all 0.2s var(--ease-out);

  --container: 1040px;
  --gutter: clamp(16px, 4vw, 36px);
}

/* ================= Base & Layout ================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ================= Ambient Lighting ================= */
.ambient {
  position: absolute;
  inset: 0 0 auto 0;
  height: 700px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient .shaft {
  position: absolute;
  top: -240px;
  left: 50%;
  width: 480px;
  height: 900px;
  transform: translateX(-40%) rotate(20deg);
  background: linear-gradient(180deg, rgba(76, 196, 234, 0.22) 0%, rgba(76, 196, 234, 0.04) 50%, transparent 75%);
  filter: blur(75px);
}

.ambient .glow {
  position: absolute;
  top: -160px;
  left: 50%;
  width: 680px;
  height: 380px;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(76, 196, 234, 0.12) 0%, rgba(76, 196, 234, 0.02) 60%, transparent 100%);
  filter: blur(60px);
}

.ambient .grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-subtle) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 30%, transparent 80%);
}

/* ================= Floating Pill Navigation ================= */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(100% - 32px, 880px);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px 0 20px;
  border-radius: var(--r-pill);
  background: rgba(15, 18, 22, 0.76);
  border: 1px solid var(--line);
  box-shadow: var(--inner-hi), 0 16px 40px -18px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.03em;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
}

.logo .dot {
  color: var(--accent);
}

.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  transition: color 180ms ease, background-color 180ms ease;
}

.nav-back:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-back svg {
  transition: transform 180ms var(--ease-snap);
}

.nav-back:hover svg {
  transform: translateX(-2px);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language Switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  gap: 2px;
}

.lang-switch button {
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Sleek Hidden Theme Button (Kept for DictationApp compatibility) */
#theme-btn {
  display: none;
}

/* ================= Main Container ================= */
.main-wrapper {
  position: relative;
  z-index: 1;
  padding-top: 96px;
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ================= Hero Header ================= */
.hero {
  text-align: center;
  margin-bottom: 8px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 16px;
}

.kicker .pulse-dot-cyan {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px var(--accent-hi); }
}

.hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #c6ced5 45%, #e0e6ec 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  font-size: clamp(14px, 1.8vw, 16px);
  color: var(--text-2);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-stats-strip {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.hero-stats-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-stats-strip strong {
  color: var(--accent-text);
  font-weight: 500;
}

/* ================= Ribbon Controls Panel ================= */
.controls-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card), var(--inner-hi);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.controls-left, .controls-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Select controls */
.select-ctrl {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378838d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.select-ctrl:hover {
  border-color: var(--line-strong);
  background-color: var(--surface-3);
}

.select-ctrl:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.book-select {
  font-weight: 500;
  border-color: var(--accent-line);
  background-color: rgba(76, 196, 234, 0.08);
  color: var(--accent-text);
}

/* Mode Pills */
.mode-pills {
  display: inline-flex;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  gap: 2px;
}

.mode-pill {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-2);
  border: none;
  background: transparent;
  transition: var(--transition);
}

.mode-pill:hover {
  color: var(--text);
}

.mode-pill.active {
  background: var(--surface-3);
  color: var(--accent-text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid var(--accent-line);
}

/* Generic Buttons */
.btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: #fff;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #0e87b0 0%, #4cc4ea 100%);
  color: #031219;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 10px rgba(76, 196, 234, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(76, 196, 234, 0.4);
  color: #000;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-line);
}

.btn-accent:hover {
  background: rgba(76, 196, 234, 0.18);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ================= Progress Card ================= */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card), var(--inner-hi);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}

#progress-text {
  font-weight: 500;
  color: var(--text);
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

#accuracy-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6cc59a);
  width: 0%;
  border-radius: var(--r-pill);
  transition: width 0.3s var(--ease-out);
  box-shadow: 0 0 10px rgba(76, 196, 234, 0.4);
}

/* ================= Question Grid Card (答题卡) ================= */
.grid-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card), var(--inner-hi);
}

.grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-2);
}

.grid-header strong {
  color: var(--text);
  font-weight: 500;
}

#grid-status-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.grid-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
  transition: var(--transition);
}

.grid-badge:hover {
  border-color: var(--accent-line);
  color: var(--text);
  background: var(--surface-3);
  transform: scale(1.06);
}

.grid-badge.current {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px rgba(76, 196, 234, 0.3);
  font-weight: 600;
}

.grid-badge.correct {
  background: var(--success-bg);
  border-color: var(--success-line);
  color: var(--success);
  font-weight: 600;
}

.grid-badge.incorrect {
  background: var(--error-bg);
  border-color: var(--error-line);
  color: var(--error);
  font-weight: 600;
}

.grid-badge.skipped {
  background: var(--warning-bg);
  border-color: var(--warning-line);
  color: var(--warning);
  font-weight: 600;
}

/* ================= Dictation Stage Card ================= */
.dictation-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  position: relative;
  box-shadow: var(--shadow-card), var(--inner-hi);
}

.audio-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 6px 16px;
  border-radius: var(--r-pill);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(76, 196, 234, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(76, 196, 234, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(76, 196, 234, 0); }
}

.countdown-container {
  width: 100%;
  max-width: 620px;
  height: 4px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: -6px;
  margin-bottom: -6px;
}

.countdown-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--warning), var(--accent));
  transition: width 0.1s linear;
}

/* Large Typing Input */
.word-input-container {
  width: 100%;
  max-width: 620px;
  position: relative;
}

.word-input {
  width: 100%;
  font-size: clamp(20px, 3.2vw, 30px);
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: center;
  padding: 18px 24px;
  border: 2px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: var(--transition);
  letter-spacing: 0.06em;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.word-input:focus {
  border-color: var(--accent);
  background: var(--surface-3);
  box-shadow: 0 0 0 4px var(--accent-soft), inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.word-input.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
  box-shadow: 0 0 0 4px rgba(108, 197, 154, 0.15);
}

.word-input.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
  box-shadow: 0 0 0 4px rgba(223, 128, 128, 0.15);
}

/* Feedback & Answer Reveal Box */
.feedback-box {
  width: 100%;
  max-width: 620px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  transition: var(--transition);
  min-height: 85px;
}

.feedback-word {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text);
}

.feedback-phonetic {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--accent-text);
}

.feedback-meaning {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.5;
}

.feedback-diff {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding-top: 4px;
}

.diff-correct {
  color: var(--success);
  font-weight: 600;
}

.diff-missing {
  color: var(--warning);
  text-decoration: underline;
  font-weight: 600;
}

.diff-wrong {
  color: var(--error);
  text-decoration: line-through;
  font-weight: 600;
}

/* Shortcut Action Bar */
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.key-badge {
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ================= Real-time Stats Grid ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow-card), var(--inner-hi);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 600;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ================= Mistakes & Anki Drawer ================= */
.mistakes-drawer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-card), var(--inner-hi);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mistakes-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.tab-pills {
  display: inline-flex;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  gap: 2px;
}

.tab-pill {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--text-2);
  border: none;
  background: transparent;
  transition: var(--transition);
}

.tab-pill:hover {
  color: var(--text);
}

.tab-pill.active {
  background: var(--surface-3);
  color: var(--accent-text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid var(--accent-line);
}

.mistakes-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

#mistakes-subtext {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 6px;
}

.mistake-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.mistake-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

.mistake-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.mistake-word-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mistake-word {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.unit-tag-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-line);
}

.mistake-meaning {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
}

/* ================= Footer ================= */
footer {
  margin-top: auto;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

footer a {
  color: var(--text-2);
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--accent);
}

/* ================= Media Queries ================= */
@media (max-width: 768px) {
  .nav {
    height: 50px;
    padding: 0 8px 0 14px;
  }
  .controls-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .controls-left, .controls-right {
    flex-direction: column;
    align-items: stretch;
  }
  .select-ctrl, .mode-pills {
    width: 100%;
  }
  .mode-pills {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
  }
  .word-input {
    font-size: 1.25rem;
    padding: 14px 16px;
  }
  .action-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .action-bar .btn {
    width: 100%;
  }
}
