:root {
  --bg: #f3f8fd;
  --card: #ffffff;
  --text: #101418;
  --muted: #7f8b96;
  --green: #18bf55;
  --green-dark: #0b9640;
  --green-soft: #c8f3d5;
  --blue: #1295eb;
  --orange: #ff970d;
  --purple: #7045f7;
  --red: #ff4438;
  --red-soft: #ffe5e1;
  --line: #e6edf3;
  --shadow: 0 8px 24px rgba(33, 64, 96, .08);
  --radius: 26px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(24,191,85,.09), transparent 22rem),
    radial-gradient(circle at 90% 10%, rgba(18,149,235,.08), transparent 20rem),
    var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }

#app {
  min-height: 100vh;
  max-width: 980px;
  margin: 0 auto;
}

.shell {
  min-height: 100vh;
  padding: 22px 22px 110px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 22px;
}
.brand-badge {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--green), #71dd8d);
  color: white;
  font-size: 26px;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.12);
}
.top-actions { display: flex; gap: 10px; }
.icon-btn {
  width: 46px; height: 46px;
  border-radius: 50%; border: 0;
  background: white;
  box-shadow: var(--shadow);
  font-size: 22px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(225, 235, 244, .9);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(100%, 460px);
  padding: 28px;
}
.auth-logo {
  width: 76px; height: 76px;
  border-radius: 25px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  font-size: 40px;
  color: #fff;
  background: linear-gradient(150deg, var(--green), var(--blue));
  box-shadow: inset 0 -8px 0 rgba(0,0,0,.12);
}
.auth-card h1 { margin: 0; text-align: center; font-size: 30px; }
.auth-card p { text-align: center; color: var(--muted); line-height: 1.55; }
.auth-tabs { display: flex; gap: 8px; background: #f1f6fa; border-radius: 16px; padding: 5px; margin: 24px 0 18px; }
.auth-tabs button { flex: 1; border: 0; padding: 12px; border-radius: 12px; background: transparent; font-weight: 800; }
.auth-tabs button.active { background: white; color: var(--green-dark); box-shadow: 0 3px 10px rgba(0,0,0,.07); }
.form-group { margin: 14px 0; }
.form-group label { display: block; margin: 0 0 8px 4px; font-weight: 800; }
.form-group input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  outline: none;
  background: #fbfdff;
}
.form-group input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(18,149,235,.12); }

.primary-btn, .secondary-btn, .orange-btn, .purple-btn, .danger-btn {
  border: 0;
  border-radius: 18px;
  padding: 15px 20px;
  font-weight: 900;
  font-size: 17px;
  transition: transform .15s ease;
}
.primary-btn:active, .secondary-btn:active, .orange-btn:active, .purple-btn:active { transform: translateY(2px); }
.primary-btn { color: #fff; background: var(--green); box-shadow: inset 0 -5px 0 var(--green-dark); }
.secondary-btn { color: var(--green-dark); background: white; border: 2px solid var(--green); }
.orange-btn { color: #fff; background: var(--orange); box-shadow: inset 0 -5px 0 #cb641b; }
.purple-btn { color: #fff; background: var(--purple); box-shadow: inset 0 -5px 0 #5032c5; }
.danger-btn { color: white; background: var(--red); }
.full { width: 100%; }

.hero-card { padding: 24px; }
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hero-card h1 { margin: 0 0 8px; font-size: clamp(27px, 6vw, 42px); }
.hero-card p { color: var(--muted); margin: 0; }
.level-pill { padding: 10px 14px; border-radius: 999px; background: #eef9f1; color: var(--green-dark); font-weight: 900; white-space: nowrap; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat-card { padding: 18px; }
.stat-label { font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.stat-value { font-size: 27px; font-weight: 900; }
.stat-unit { font-size: 13px; color: var(--muted); margin-left: 3px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-title h2 { margin: 0; font-size: 24px; }
.section-title small { color: var(--green); font-weight: 800; }

.memory-card { padding: 24px; }
.memory-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.memory-head strong { font-size: 24px; }
.memory-rings { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 20px 0; }
.ring-wrap { text-align: center; }
.ring {
  --p: 0;
  width: 76px; height: 76px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), #c7f0d3 0);
  display: grid; place-items: center;
  position: relative;
}
.ring::after { content: ''; width: 56px; height: 56px; border-radius: 50%; background: white; position: absolute; }
.ring strong { position: relative; z-index: 1; font-size: 20px; }
.ring-label { font-size: 13px; line-height: 1.25; }
.ring-interval { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.smart-review-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.review-count-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  color: #e77900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.practice-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.practice-banner strong { color: var(--orange); font-size: 20px; }
.practice-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.skill-card { padding: 18px; }
.skill-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 800; }
.progress-track { height: 12px; background: #e8f0f5; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green), #5ddb82); }

.parts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.part-card { padding: 18px; overflow: hidden; position: relative; }
.part-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.part-number { width: 62px; height: 62px; border-radius: 19px; display: grid; place-items: center; background: linear-gradient(145deg, #d4f5df, #edfdf3); color: var(--green-dark); font-weight: 900; font-size: 24px; }
.part-card h3 { margin: 0 0 5px; }
.part-card p { margin: 0; color: var(--muted); font-size: 14px; }
.part-progress { margin: 16px 0 10px; }
.part-actions { display: flex; gap: 10px; }
.part-actions button { flex: 1; }

.hard-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.hard-word { padding: 14px; display: flex; gap: 12px; align-items: center; }
.word-thumb { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; background: linear-gradient(145deg,#e8f5ef,#f4f8ff); display: grid; place-items: center; font-size: 28px; flex: 0 0 auto; }
.hard-word h4 { margin: 0 0 4px; font-size: 18px; }
.hard-word p { margin: 0; font-size: 13px; color: var(--muted); }
.error-chip { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 999px; color: var(--red); background: var(--red-soft); font-size: 12px; font-weight: 900; }

.bottom-nav {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: min(100%, 980px);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  z-index: 20;
}
.nav-btn { border: 0; background: transparent; color: #9aa3aa; padding: 8px; font-weight: 800; }
.nav-btn span { display: block; font-size: 23px; margin-bottom: 3px; }
.nav-btn.active { color: var(--green); }

.search-card { padding: 16px; display: flex; gap: 10px; }
.search-card input { flex: 1; border: 0; outline: 0; font-size: 18px; }
.search-results { margin-top: 14px; }
.search-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.search-item:last-child { border-bottom: 0; }
.search-item strong { font-size: 20px; }
.search-item p { margin: 5px 0 0; color: var(--muted); }

.plan-header { padding: 22px; margin-bottom: 18px; }
.back-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.back-btn { border: 0; background: #edf4f8; border-radius: 12px; width: 42px; height: 42px; font-size: 20px; }
.plan-header h1 { margin: 0 0 6px; }
.plan-header p { margin: 0; color: var(--muted); }
.video-card { padding: 18px; margin-bottom: 18px; }
.video-card video { width: 100%; border-radius: 18px; background: #0b1118; max-height: 420px; }
.video-placeholder { min-height: 180px; border-radius: 18px; background: linear-gradient(145deg,#dfeff9,#f0f8ef); display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); }

.block-card { padding: 20px; margin-bottom: 16px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.block-head h3 { margin: 0; }
.complete-badge { color: var(--green-dark); background: #e7f8ec; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 900; }
.stage-list { display: grid; gap: 10px; }
.stage-btn {
  border: 2px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}
.stage-btn strong { display: block; }
.stage-btn small { color: var(--muted); }
.stage-btn.available { border-color: #94e3ad; background: #f5fff8; }
.stage-btn.completed { border-color: #b7ebc6; background: #eefbf2; color: var(--green-dark); }
.stage-btn.retry { border-color: #ffd4cd; background: #fff4f2; color: #d43b2d; }
.stage-btn.locked { background: #f5f7f8; color: #a4adb5; }
.stage-icon { font-size: 22px; }

.quiz-shell { min-height: 100vh; background: white; padding: 22px 22px 150px; }
.quiz-top { display: grid; grid-template-columns: 46px 1fr 46px; gap: 14px; align-items: center; }
.quiz-progress { height: 16px; border-radius: 999px; background: #bceecb; overflow: hidden; }
.quiz-progress > div { height: 100%; background: var(--green); width: 0; border-radius: inherit; transition: width .25s ease; }
.quiz-kicker { color: var(--orange); font-weight: 900; font-size: 20px; margin-top: 25px; }
.quiz-title { font-size: 30px; margin: 12px 0 22px; }
.quiz-prompt { font-size: clamp(24px, 5vw, 36px); line-height: 1.35; margin: 22px 0; }
.audio-zone { display: flex; justify-content: center; margin: 22px 0 30px; }
.audio-btn { width: 112px; height: 112px; border: 0; border-radius: 50%; background: var(--blue); color: white; font-size: 44px; box-shadow: inset 0 -8px 0 #0873b8; }
.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.option-btn {
  min-height: 150px;
  border: 3px solid #edf0f2;
  background: white;
  border-radius: 22px;
  padding: 18px;
  text-align: left;
  font-size: 20px;
  line-height: 1.35;
  box-shadow: inset 0 -5px 0 #edf0f2;
}
.option-btn:hover { border-color: #c8e9d2; }
.option-btn.selected { border-color: var(--blue); background: #f1f9ff; }
.option-btn.correct { border-color: var(--green); color: white; background: #31b56f; box-shadow: inset 0 -5px 0 #17864b; }
.option-btn.wrong { border-color: var(--red); color: white; background: var(--red); box-shadow: inset 0 -5px 0 #c73028; }
.quiz-image { width: min(280px, 70%); max-height: 210px; object-fit: cover; border-radius: 18px; display: block; margin: 18px auto; }

.result-card { width: min(100%, 600px); margin: 40px auto; padding: 28px; text-align: center; }
.result-emoji { font-size: 70px; }
.result-score { font-size: 58px; font-weight: 900; color: var(--green); }
.result-card h1 { margin: 8px 0; }
.result-card p { color: var(--muted); }
.result-actions { display: grid; gap: 12px; margin-top: 24px; }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%; transform: translateX(-50%) translateY(30px);
  bottom: 90px;
  background: #17212b;
  color: white;
  border-radius: 14px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(247,250,253,.86);
  backdrop-filter: blur(5px);
  display: grid; place-items: center;
  align-content: center; gap: 14px;
  font-weight: 900;
}
.spinner { width: 46px; height: 46px; border: 5px solid #dce8ef; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .shell { padding: 16px 14px 105px; }
  .brand { font-size: 19px; }
  .brand-badge { width: 42px; height: 42px; border-radius: 13px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .memory-rings { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 3px; }
  .ring { width: 58px; height: 58px; }
  .ring::after { width: 44px; height: 44px; }
  .ring strong { font-size: 16px; }
  .ring-label { font-size: 11px; }
  .parts-grid, .hard-list { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .practice-banner { align-items: flex-start; flex-direction: column; }
  .practice-actions { width: 100%; }
  .practice-actions button { flex: 1; }
  .options-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .option-btn { min-height: 132px; padding: 14px; font-size: 18px; }
  .quiz-shell { padding: 16px 14px 150px; }
  .quiz-title { font-size: 27px; }
  .audio-btn { width: 96px; height: 96px; }
}

@media (max-width: 430px) {
  .memory-card { padding: 17px 12px; }
  .ring { width: 54px; height: 54px; }
  .ring::after { width: 41px; height: 41px; }
  .ring-label { font-size: 10px; }
  .options-grid { gap: 9px; }
  .option-btn { min-height: 125px; font-size: 17px; padding: 11px; }
}

/* Media reliability UI */
.audio-zone {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.audio-source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.search-item-media {
  display: flex;
  align-items: center;
  gap: 13px;
}
.search-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 16px;
  object-fit: cover;
  background: #eef4f7;
}
.search-thumb-empty {
  display: grid;
  place-items: center;
  font-size: 27px;
}
.search-copy { min-width: 0; flex: 1; }
.mini-audio-btn {
  margin-left: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eaf6ff;
  color: #0873b8;
  cursor: pointer;
}

/* v2.3: text-answer learning modes */
.text-answer-wrap {
  width: min(100%, 760px);
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: stretch;
}
.text-answer-input {
  width: 100%;
  min-height: 64px;
  border: 3px solid #dfe7ec;
  border-radius: 18px;
  padding: 0 20px;
  font: inherit;
  font-size: 21px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: .18s ease;
}
.text-answer-input:focus {
  border-color: #1595e7;
  box-shadow: 0 0 0 4px rgba(21,149,231,.12);
}
.text-answer-input.input-correct {
  border-color: var(--green);
  background: #effcf4;
}
.text-answer-input.input-wrong {
  border-color: #f44336;
  background: #fff2f0;
}
.text-submit-btn {
  min-width: 150px;
  padding-inline: 24px;
}

/* SweetAlert2 alert-dialog learning UI */
.learning-alert-dialog {
  width: min(92vw, 660px) !important;
  border-radius: 26px !important;
  padding: 18px 18px 22px !important;
}
.learning-alert-dialog .swal2-title {
  font-size: 30px !important;
  color: var(--text) !important;
}
.learning-alert-dialog .swal2-html-container {
  margin: 10px 0 0 !important;
  overflow: visible !important;
}
.dialog-word {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 4px;
}
.dialog-word strong { font-size: 30px; }
.dialog-word span { color: var(--muted); font-size: 18px; }
.dialog-status,
.dialog-expected {
  font-size: 18px;
  line-height: 1.5;
  margin: 4px 0 8px;
}
.dialog-expected strong { color: #ef3f35; }
.dialog-meaning {
  color: #48545f;
  line-height: 1.55;
  margin: 4px 0 12px;
}
.dialog-media-image {
  display: block;
  width: min(100%, 320px);
  max-height: 240px;
  object-fit: contain;
  border-radius: 18px;
  margin: 12px auto;
  background: #f3f7fa;
}
.dialog-media-video {
  display: block;
  width: min(100%, 360px);
  max-height: 300px;
  object-fit: contain;
  border-radius: 18px;
  margin: 12px auto 6px;
  background: #111;
}
.dialog-auto-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.dialog-next-btn {
  min-width: 220px !important;
  min-height: 52px !important;
  border-radius: 15px !important;
  font-weight: 900 !important;
  font-size: 17px !important;
}

@media (max-width: 640px) {
  .text-answer-wrap { grid-template-columns: 1fr; }
  .text-submit-btn { width: 100%; min-height: 58px; }
  .text-answer-input { min-height: 60px; font-size: 19px; }
  .learning-alert-dialog { width: calc(100vw - 20px) !important; }
  .dialog-media-video { max-height: 250px; }
}

/* v2.5: Part video preview with a large centered Start button */
.part-video-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  background: #080b0e;
}
.part-video-wrap video {
  display: block;
  width: 100%;
  min-height: 240px;
  max-height: 520px;
  object-fit: contain;
  border-radius: 0;
}
.video-start-btn {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  min-width: 190px;
  min-height: 72px;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(23,185,83,.96);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 14px 40px rgba(0,0,0,.34), inset 0 -6px 0 rgba(0,0,0,.16);
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease;
}
.video-start-btn:hover { transform: translate(-50%, -50%) scale(1.04); }
.video-start-btn.hidden { opacity: 0; pointer-events: none; }
.video-start-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding-left: 4px;
  background: #fff;
  color: var(--green-dark);
  font-size: 21px;
}

/* v2.5: large flip flashcards */
.flashcard-quiz-shell {
  max-width: 860px;
  margin: 0 auto;
}
.flip-card {
  width: min(100%, 680px);
  height: min(66vh, 610px);
  min-height: 470px;
  margin: 10px auto 22px;
  padding: 0;
  border: 0;
  background: transparent;
  perspective: 1500px;
  cursor: pointer;
  display: block;
}
.flip-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2,.75,.25,1);
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute;
  inset: 0;
  padding: 28px;
  border-radius: 30px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px solid #dce8ee;
  box-shadow: 0 20px 55px rgba(28,51,70,.16), inset 0 -8px 0 rgba(0,0,0,.04);
}
.flip-front {
  background: linear-gradient(155deg, #ffffff 0%, #eefbf3 100%);
}
.flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(155deg, #effcf4 0%, #e9f4ff 100%);
}
.flip-card-image {
  width: min(82%, 360px);
  height: 250px;
  object-fit: contain;
  border-radius: 24px;
  background: #f2f6f8;
  margin-bottom: 18px;
}
.flip-card-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 74px;
  background: #e9f8ef;
  margin-bottom: 22px;
}
.flip-card-word {
  font-size: clamp(42px, 8vw, 72px);
  line-height: 1.05;
  color: var(--text);
  word-break: break-word;
}
.flip-card-pronunciation {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(20px, 4vw, 30px);
  font-style: italic;
}
.flip-back-title {
  font-size: clamp(34px, 7vw, 60px);
  margin-bottom: 20px;
  color: var(--green-dark);
}
.flip-card-meaning {
  font-size: clamp(21px, 4vw, 31px);
  line-height: 1.45;
  color: var(--text);
}
.flip-example-en {
  margin-top: 28px;
  font-size: clamp(18px, 3.4vw, 25px);
  line-height: 1.5;
  font-weight: 800;
}
.flip-example-vi {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(16px, 3vw, 21px);
  line-height: 1.5;
}
.flip-card-hint {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.flashcard-actions {
  width: min(100%, 680px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.flashcard-actions button { min-height: 62px; }
.flashcard-tip {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 12px auto 0;
}

/* v2.5: sentence dictation with multiple inline blank inputs */
.dictation-answer-wrap {
  width: min(100%, 900px);
  margin: 22px auto 0;
}
.dictation-sentence {
  padding: 24px;
  border-radius: 24px;
  background: #242424;
  color: #fff;
  font-size: clamp(20px, 4vw, 30px);
  line-height: 2.15;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.dictation-token { white-space: nowrap; }
.dictation-input {
  width: max(76px, var(--dictation-ch));
  max-width: 180px;
  height: 48px;
  margin: 0 4px;
  padding: 3px 8px;
  border: 2px solid #4a4a4a;
  border-radius: 10px;
  background: #3b3b3b;
  color: #fff;
  font: inherit;
  font-size: .86em;
  text-align: center;
  outline: none;
  vertical-align: middle;
}
.dictation-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(23,185,83,.17);
}
.dictation-input.input-correct {
  border-color: var(--green);
  background: #154d2b;
}
.dictation-input.input-wrong {
  border-color: #f44336;
  background: #5a2320;
}
.dictation-help {
  text-align: center;
  color: var(--muted);
  margin: 12px 0 16px;
}
.dictation-submit-btn {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
  min-height: 60px;
}

/* Feedback dialog no longer contains video. */
.dialog-media-video { display: none !important; }

@media (max-width: 640px) {
  .part-video-wrap video { min-height: 190px; }
  .video-start-btn { min-width: 160px; min-height: 62px; font-size: 17px; }
  .video-start-icon { width: 36px; height: 36px; }

  .flip-card {
    min-height: 430px;
    height: 58vh;
  }
  .flip-face { padding: 18px 16px 46px; border-radius: 24px; }
  .flip-card-image { height: 200px; width: 90%; }
  .flashcard-actions { grid-template-columns: 1fr; }

  .dictation-sentence {
    padding: 18px 12px;
    font-size: 20px;
    line-height: 2.35;
  }
  .dictation-input {
    min-width: 68px;
    max-width: 135px;
    height: 44px;
    margin: 2px;
  }
}
