/* ==========================================================================
   HangVy — Clean Editorial Vietnamese Study App (Desktop + Mobile First)
   ========================================================================== */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --soft: #64748b;
  --border: #e2e8f0;
  --emerald: #059669;
  --emerald-dark: #047857;
  --emerald-soft: rgba(5, 150, 105, 0.11);
  --indigo: #4f46e5;
  --indigo-soft: rgba(79, 70, 229, 0.10);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.10);
  --radius: 14px;
  --shadow: 0 6px 20px -12px rgba(15, 23, 42, 0.14);
  --font-vi: "Be Vietnam Pro", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ko: "Noto Sans KR", "Malgun Gothic", -apple-system, BlinkMacSystemFont, sans-serif;
}

html.dark {
  --bg: #0b1120;
  --surface: #131c31;
  --surface-alt: #1e293b;
  --text: #f1f5f9;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --border: rgba(148, 163, 184, 0.2);
  --emerald-soft: rgba(16, 185, 129, 0.18);
  --indigo-soft: rgba(99, 102, 241, 0.22);
  --amber-soft: rgba(245, 158, 11, 0.2);
  --rose-soft: rgba(244, 63, 94, 0.18);
  --shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ko);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.hv-wrap {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Tabs */
.hv-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
html.dark .hv-header { background: rgba(11, 17, 32, 0.92); }
.hv-hdr-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  gap: 10px;
}
.hv-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.hv-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #fff;
  font-family: var(--font-vi);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}
.hv-brand-name {
  font-family: var(--font-vi);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}
.hv-dialect-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
}
html.dark .hv-dialect-tag { color: #34d399; }
.hv-hdr-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hv-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.hv-chip-btn.slow {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: var(--amber);
}
.hv-chip-btn .hv-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--emerald);
}
.hv-chip-btn.slow .hv-dot { background: var(--amber); }
.hv-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
}
.ic-sun { display: none; }
html.dark .ic-moon { display: none; }
html.dark .ic-sun { display: block; }

/* Main 4-Tab Nav */
.hv-nav-bar {
  padding: 0 0 10px;
}
.hv-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.hv-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.hv-tab.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
  box-shadow: 0 6px 16px -6px rgba(5, 150, 105, 0.5);
}
.hv-cnt {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--soft);
}
.hv-tab.active .hv-cnt {
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

/* Main Content */
.hv-main {
  flex: 1 0 auto;
  padding-top: 16px;
  padding-bottom: 36px;
}

/* Progress Strip */
.hv-progress-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.hv-prog-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.hv-prog-text span {
  color: var(--emerald);
  font-weight: 800;
}
.hv-prog-track {
  flex: 1 1 auto;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}
.hv-prog-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669, #0d9488);
  transition: width 0.25s ease;
}

/* Stage & Lesson Selectors */
.hv-stage-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.hv-stage-row::-webkit-scrollbar { display: none; }
.hv-stage-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.hv-stage-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.hv-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.hv-lesson-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.hv-lesson-pills::-webkit-scrollbar { display: none; }
.hv-les-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.hv-les-pill.active {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--emerald-dark);
}
html.dark .hv-les-pill.active { color: #6ee7b7; }
.hv-les-pill.done::after {
  content: "✓";
  color: var(--emerald);
  font-weight: 900;
}

/* Lesson Detail Workspace */
.hv-les-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.hv-les-code {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  margin-bottom: 4px;
}
.hv-les-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}
.hv-les-goal {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.hv-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.hv-block-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.hv-block-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
}

/* Rules List */
.hv-rules {
  display: grid;
  gap: 8px;
}
.hv-rule-row {
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-alt);
  font-size: 0.85rem;
}
.hv-rule-k {
  font-family: var(--font-vi);
  font-weight: 800;
  color: var(--emerald-dark);
}
html.dark .hv-rule-k { color: #34d399; }
.hv-rule-v { color: var(--text); }

/* 3-Turn Dialogue */
.hv-dlg-list {
  display: grid;
  gap: 9px;
}
.hv-dlg-turn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.hv-dlg-turn.sp-m {
  border-left: 3.5px solid var(--indigo);
}
.hv-dlg-turn.sp-f {
  border-left: 3.5px solid var(--emerald);
}
.hv-dlg-body { flex: 1 1 auto; min-width: 0; }
.hv-dlg-role {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--soft);
  margin-bottom: 2px;
}
.hv-dlg-vi {
  font-family: var(--font-vi);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.hv-dlg-ko {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 2px;
}
.hv-dlg-tip {
  font-size: 0.76rem;
  color: var(--emerald-dark);
  margin-top: 4px;
}
html.dark .hv-dlg-tip { color: #6ee7b7; }
.hv-dlg-acts {
  display: inline-flex;
  gap: 5px;
  flex-shrink: 0;
}

/* Audio Speaker Buttons */
.hv-spk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--emerald);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.hv-spk:hover {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}
.hv-spk.playing {
  background: var(--emerald) !important;
  border-color: var(--emerald) !important;
  color: #ffffff !important;
  transform: scale(1.03);
}
.hv-spk.north {
  color: var(--indigo);
}
.hv-spk.north:hover {
  border-color: var(--indigo);
  background: var(--indigo-soft);
}
.hv-spk.north.playing {
  background: var(--indigo) !important;
  border-color: var(--indigo) !important;
}
.hv-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--soft);
  font-size: 0.84rem;
}
.hv-mini-btn:hover { color: var(--text); border-color: var(--soft); }
.hv-mini-btn.fav-on { color: #f59e0b; border-color: rgba(245, 158, 11, 0.45); background: var(--amber-soft); }

/* Lesson Footer Actions */
.hv-les-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.hv-btn-primary {
  padding: 10px 18px;
  border-radius: 11px;
  border: none;
  background: var(--emerald);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
}
.hv-btn-outline {
  padding: 10px 16px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}
.hv-btn-outline.done {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--emerald-dark);
}
html.dark .hv-btn-outline.done { color: #6ee7b7; }

/* Contrast Grid (North Gemini vs South Fish Audio) */
.hv-contrast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.hv-contrast-card {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hv-contrast-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.hv-contrast-vi {
  font-family: var(--font-vi);
  font-size: 1.15rem;
  font-weight: 800;
}
.hv-contrast-ko {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}
.hv-contrast-tip {
  font-size: 0.76rem;
  color: var(--soft);
}
.hv-contrast-btns {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

/* Vocabulary Bank */
.hv-vocab-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.hv-search-box {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
}
.hv-search-box:focus-within { border-color: var(--emerald); }
.hv-search-box input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
}
.hv-clear-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--soft);
  padding: 0 4px;
}
.hv-study-toggles {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}
.hv-toggle-pill {
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.77rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.hv-toggle-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.hv-toggle-pill.accent {
  border-color: rgba(5, 150, 105, 0.4);
  color: var(--emerald-dark);
  background: var(--emerald-soft);
}
html.dark .hv-toggle-pill.accent { color: #6ee7b7; }
.hv-toggle-pill.accent.active {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.hv-cat-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.hv-cat-strip::-webkit-scrollbar { display: none; }
.hv-cat-pill {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.hv-cat-pill.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.hv-vocab-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--soft);
  margin-bottom: 10px;
}
.hv-vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.hv-vcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.15s ease;
}
.hv-vcard.auto-active {
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px var(--emerald-soft);
}
.hv-vtop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.hv-vword-wrap { min-width: 0; }
.hv-vword {
  font-family: var(--font-vi);
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.hv-vko {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--emerald-dark);
  margin-top: 2px;
}
html.dark .hv-vko { color: #34d399; }
.hv-vnote {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--soft);
  background: var(--surface-alt);
  padding: 1px 7px;
  border-radius: 6px;
  margin-top: 4px;
}
.hv-vacts {
  display: inline-flex;
  gap: 5px;
  flex-shrink: 0;
}
.hv-vex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.hv-vex-txt { min-width: 0; flex: 1 1 auto; }
.hv-vex-vi {
  font-family: var(--font-vi);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}
.hv-vex-ko {
  font-size: 0.78rem;
  color: var(--soft);
}

/* Hide Mode (Blur-to-Reveal) */
.hv-masked {
  filter: blur(7px);
  user-select: none;
  cursor: pointer;
  transition: filter 0.16s ease;
}
.hv-masked.revealed { filter: none; }

/* Pager */
.hv-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.hv-pg-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
}
.hv-pg-btn.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

/* Tools / Cheat Sheets */
.hv-tools-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.hv-tools-subtabs::-webkit-scrollbar { display: none; }
.hv-subtab {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.hv-subtab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.hv-pronoun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.hv-pro-btn {
  padding: 11px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
}
.hv-pro-btn.active {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}
.hv-pro-result {
  padding: 18px;
  border-radius: 14px;
  border: 1.5px solid var(--emerald);
  background: var(--surface);
  display: grid;
  gap: 10px;
}
.hv-pro-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hv-pro-box {
  padding: 12px;
  border-radius: 11px;
  background: var(--surface-alt);
  text-align: center;
}
.hv-pro-box small { display: block; color: var(--soft); font-size: 0.74rem; }
.hv-pro-box strong {
  display: block;
  font-family: var(--font-vi);
  font-size: 1.55rem;
  color: var(--emerald-dark);
  margin-top: 2px;
}
html.dark .hv-pro-box strong { color: #34d399; }

/* Money & Dialect Table */
.hv-money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hv-money-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hv-money-amt {
  font-family: var(--font-vi);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--emerald-dark);
}
html.dark .hv-money-amt { color: #34d399; }
.hv-money-street {
  font-family: var(--font-vi);
  font-size: 0.96rem;
  font-weight: 700;
}
.hv-money-formal {
  font-size: 0.76rem;
  color: var(--soft);
}

.hv-ns-table {
  display: grid;
  gap: 7px;
}
.hv-ns-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.84rem;
}
.hv-ns-hdr {
  background: var(--surface-alt);
  font-weight: 800;
  font-size: 0.76rem;
  color: var(--soft);
}

/* Practice (Flashcard & Quiz) */
.hv-practice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.hv-mode-switch { display: flex; gap: 6px; }
.hv-select {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
}

.hv-fc-wrap {
  max-width: 540px;
  margin: 0 auto;
}
.hv-fc-card {
  min-height: 250px;
  padding: 28px 22px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
}
.hv-fc-tag {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
}
.hv-fc-main {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.3;
}
.hv-fc-vi {
  font-family: var(--font-vi);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--emerald-dark);
}
html.dark .hv-fc-vi { color: #34d399; }
.hv-fc-ex {
  font-family: var(--font-vi);
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 4px;
}
.hv-fc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.hv-quiz-box {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.hv-quiz-opts {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}
.hv-qopt {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 0.92rem;
  font-weight: 700;
}
.hv-qopt.correct { border-color: #059669; background: rgba(5, 150, 105, 0.14); color: #047857; }
.hv-qopt.wrong   { border-color: #e11d48; background: rgba(225, 29, 72, 0.12); color: #be123c; }
html.dark .hv-qopt.correct { color: #6ee7b7; }
html.dark .hv-qopt.wrong   { color: #fda4af; }

/* Full-Screen Show Modal */
.hv-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}
.hv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}
.hv-modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border-radius: 22px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.hv-modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 1.2rem;
}
.hv-modal-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  margin-bottom: 14px;
}
.hv-modal-vi {
  font-family: var(--font-vi);
  font-size: clamp(1.55rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 10px;
}
.hv-modal-ko {
  font-size: 0.96rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.hv-modal-play {
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  background: var(--emerald);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
}

/* Footer */
.hv-footer {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  font-size: 0.78rem;
  color: var(--soft);
}
.hv-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mobile Responsive (<= 720px & <= 375px) */
@media (max-width: 720px) {
  .hv-vocab-grid,
  .hv-contrast-grid,
  .hv-money-grid {
    grid-template-columns: 1fr;
  }
  .hv-rule-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .hv-study-toggles {
    width: 100%;
    overflow-x: auto;
  }
  .hv-vocab-meta .hv-hint-txt { display: none; }
  .hv-ns-row {
    grid-template-columns: 0.95fr 1fr 1fr;
    padding: 8px 9px;
    font-size: 0.78rem;
  }
}
@media (max-width: 390px) {
  .hv-wrap { padding: 0 12px; }
  .hv-dialect-tag { display: none; }
  .hv-tab {
    font-size: 0.75rem;
    padding: 7.5px 3px;
    gap: 3px;
  }
  .hv-cnt {
    font-size: 0.62rem;
    padding: 1px 5px;
  }
  .hv-les-title { font-size: 1.08rem; }
  .hv-toggle-pill { font-size: 0.72rem; padding: 0 9px; }
}
