:root {
  --bg: #f4f6f9;
  --sidebar-bg: rgba(255, 255, 255, 0.68);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-subtle: rgba(242, 244, 248, 0.86);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-capsule-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.58) 58%, rgba(15, 118, 110, 0.08) 100%);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-rim-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.34) 36%, rgba(15, 118, 110, 0.25) 68%, rgba(255, 255, 255, 0.92) 100%);
  --border: rgba(60, 60, 67, 0.09);
  --border-strong: rgba(60, 60, 67, 0.18);
  --text: #1c1c1e;
  --ink: #1c1c1e;
  --ink-soft: #3a3a3c;
  --text-muted: #636366;
  --muted: #636366;
  --accent: #0f766e;
  --accent-hover: #0d625b;
  --accent-soft: rgba(15, 118, 110, 0.11);
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --rose: #e11d48;
  --rose-soft: #ffe4e6;
  --emerald: #047857;
  --emerald-soft: #d1fae5;
  --ok: #16a34a;
  --warn: #d97706;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow: 0 12px 34px -6px rgba(15, 23, 42, 0.075), 0 2px 6px rgba(15, 23, 42, 0.035), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --radius: 20px;
  --radius-sm: 12px;
  --ease-ios-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-ios-bounce: cubic-bezier(0.34, 1.45, 0.64, 1);
}

[data-theme="warm"] {
  --bg: #f3ede2;
  --sidebar-bg: rgba(251, 247, 239, 0.72);
  --surface: rgba(253, 250, 244, 0.9);
  --surface-solid: #fcf9f4;
  --surface-subtle: rgba(238, 231, 218, 0.84);
  --glass-bg: rgba(251, 247, 239, 0.76);
  --glass-capsule-bg: linear-gradient(155deg, rgba(255, 253, 248, 0.92) 0%, rgba(252, 247, 238, 0.62) 58%, rgba(44, 109, 92, 0.09) 100%);
  --glass-border: rgba(255, 252, 246, 0.82);
  --glass-rim-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 252, 244, 0.38) 36%, rgba(44, 109, 92, 0.24) 68%, rgba(255, 255, 255, 0.92) 100%);
  --border: rgba(92, 74, 48, 0.11);
  --border-strong: rgba(92, 74, 48, 0.22);
  --text: #2a231b;
  --ink: #2a231b;
  --ink-soft: #4e4336;
  --text-muted: #6c6051;
  --muted: #6c6051;
  --accent: #2c6d5c;
  --accent-hover: #22584a;
  --accent-soft: rgba(44, 109, 92, 0.12);
  --amber: #9c5707;
  --amber-soft: #f7e6c2;
  --rose: #ab243c;
  --rose-soft: #f8dde2;
  --emerald: #226848;
  --emerald-soft: #daede1;
  --ok: #15803d;
  --warn: #b45309;
  --shadow-sm: 0 2px 8px rgba(60, 44, 22, 0.045);
  --shadow: 0 12px 34px -6px rgba(60, 44, 22, 0.08), inset 0 1px 0 rgba(255, 253, 248, 0.86);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% 14%, rgba(20, 184, 166, 0.13) 0%, transparent 42%),
    radial-gradient(circle at 88% 10%, rgba(56, 189, 248, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 70% 88%, rgba(15, 118, 110, 0.08) 0%, transparent 46%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[data-theme="warm"] body {
  background-image:
    radial-gradient(circle at 12% 16%, rgba(44, 109, 92, 0.11) 0%, transparent 44%),
    radial-gradient(circle at 86% 12%, rgba(245, 158, 11, 0.09) 0%, transparent 42%),
    radial-gradient(circle at 68% 86%, rgba(44, 109, 92, 0.07) 0%, transparent 46%);
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Desktop Workbench Shell ---------- */
.workbench {
  display: flex;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 244px;
  flex-shrink: 0;
  margin: 12px 0 12px 12px;
  height: calc(100dvh - 24px);
  border-radius: 24px;
  background: var(--sidebar-bg);
  backdrop-filter: saturate(200%) blur(26px);
  -webkit-backdrop-filter: saturate(200%) blur(26px);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 18px 42px -12px rgba(15, 23, 42, 0.1),
    0 2px 6px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px 14px;
  user-select: none;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px 16px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(155deg, #14968c 0%, #0d6a62 100%);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow:
    0 6px 14px -2px rgba(15, 118, 110, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-sub {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Sidebar mini progress */
.sidebar-progress {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.sp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

.sp-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.sp-val {
  font-size: 14px;
  color: var(--accent);
}

.sp-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
  margin-bottom: 6px;
}

.sp-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.sp-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Sidebar Navigation */
.nav-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  position: relative;
  z-index: 1;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav-item:hover {
  color: var(--text);
}

.nav-list:not(.has-liquid-capsule) .nav-item:hover {
  background: var(--surface-subtle);
}

.nav-list.has-liquid-capsule .nav-item:hover:not(.is-active) {
  background: rgba(120, 120, 128, 0.06);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.18);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.nav-svg {
  display: block;
}

.nav-text {
  flex: 1;
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  line-height: 1.45;
}

.nav-badge.is-accent {
  background: var(--accent);
  color: #fff;
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.quick-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.side-tool-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.side-tool-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.sync-pill {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.sync-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
}

.sync-pill.is-syncing .sync-dot {
  background: var(--amber);
  animation: pulseDot 0.9s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ---------- Right Workspace ---------- */
.workspace {
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-panel {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.tab-panel[hidden] {
  display: none !important;
}

.panel-scroll {
  overflow-y: auto;
  padding: 24px 32px 48px;
}

/* ---------- Generic Controls ---------- */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 17px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.18s var(--ease-ios-spring);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #14857c 0%, #0d6a62 100%);
  color: #fff;
  box-shadow:
    0 5px 14px -3px rgba(15, 118, 110, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #127b72 0%, #0b5d56 100%);
  transform: translateY(-0.5px);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  color: var(--text);
  border-color: var(--border);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-solid);
}

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

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--rose);
  border-color: transparent;
  padding: 6px 10px;
  font-size: 12.5px;
}

.btn-danger-ghost:hover {
  background: var(--rose-soft);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
}

.speak-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease;
}

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

.muted {
  color: var(--text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

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

.pill-mode {
  background: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}

.pill-level {
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.pill-due {
  background: var(--amber-soft);
  color: var(--amber);
}

/* ---------- Practice Workbench ---------- */
.practice-container {
  max-width: 1060px;
  margin: 0 auto;
}

.practice-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.practice-meta-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.badge-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.mode-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.085);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.mode-chip {
  position: relative;
  z-index: 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

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

.mode-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.prompt-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.en-sentence {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  letter-spacing: -0.005em;
}

.cloze-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 12px 0 14px;
}

.cloze-blank {
  display: inline-block;
  min-width: 88px;
  border-bottom: 2px dashed var(--accent);
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  padding: 0 5px;
  margin: 0 2px;
}

.hint-box {
  background: var(--amber-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

.hint-box strong {
  color: var(--amber);
}

.quote-box {
  background: var(--surface-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 14px 16px;
  margin: 12px 0 14px;
}

.quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.answer-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.answer-inputs.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.tone-scaffold-box {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 0 14px;
}

.tone-scaffold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.text-input,
.textarea-input,
.select-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.textarea-input {
  min-height: 86px;
  resize: vertical;
  line-height: 1.55;
}

.text-input:focus,
.textarea-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* 2-Column Desktop Reveal & Warmup Grid */
.two-col-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.96fr);
  gap: 18px;
  align-items: start;
}

.col-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.reveal-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  animation: fadeUp 0.2s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-banner {
  padding: 11px 15px;
  border-radius: 11px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.result-banner.is-correct {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.result-banner.is-review {
  background: var(--amber-soft);
  color: var(--amber);
}

.warmup-banner {
  background: var(--accent-soft);
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.warmup-banner-text {
  font-size: 13.5px;
  color: var(--text);
}

.warmup-banner-text strong {
  color: var(--accent);
}

.warmup-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.info-block {
  background: var(--surface-subtle);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14px;
}

.info-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.zh-highlight {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
}

.zh-highlight-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.tone-grid {
  display: grid;
  gap: 8px;
}

.tone-item {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
}

.tone-item.is-target {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.tone-text {
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
}

.zh-sub {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Spoken linking block */
.linking-block {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
}

.linking-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.linking-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.linking-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.linking-phrase {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.linking-sounds {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 3px 9px;
  border-radius: 7px;
  margin-bottom: 5px;
  display: inline-block;
}

.linking-rule {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* AI Coach */
.coach-area {
  margin-top: 4px;
}

.coach-feedback {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.coach-error {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 12.5px;
}

/* SRS Rating Bar */
.srs-bar {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px dashed var(--border-strong);
}

.srs-title {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 9px;
  font-weight: 600;
}

.srs-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.srs-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 11px;
  padding: 10px 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, border-color 0.14s ease, background 0.14s ease;
}

.srs-btn:hover {
  transform: translateY(-1px);
}

.srs-btn strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.srs-btn span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.srs-btn.is-fluent:hover { background: var(--emerald-soft); border-color: var(--emerald); }
.srs-btn.is-fluent strong { color: var(--emerald); }
.srs-btn.is-hesitant:hover { background: var(--amber-soft); border-color: var(--amber); }
.srs-btn.is-hesitant strong { color: var(--amber); }
.srs-btn.is-forgot:hover { background: var(--rose-soft); border-color: var(--rose); }
.srs-btn.is-forgot strong { color: var(--rose); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 46px 24px;
}

.empty-icon {
  font-size: 38px;
  margin-bottom: 8px;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.empty-state p {
  margin: 0 auto 20px;
  max-width: 440px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Master-Detail Split Layout (Library & Vocab) ---------- */
.panel-split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.master-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.pane-header {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.pane-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 11px 8px 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

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

.scene-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.master-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.master-row {
  border: 1px solid transparent;
  background: var(--surface);
  border-radius: 11px;
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
  box-shadow: var(--shadow-sm);
}

.master-row:hover {
  border-color: var(--border-strong);
}

.master-row.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.master-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.master-row-title {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.master-row-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-pane {
  height: 100%;
  overflow-y: auto;
  padding: 22px 28px 44px;
}

.detail-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.detail-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.detail-chunk {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
  margin: 0 0 8px;
}

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

/* Vocab detail specifics */
.vocab-scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vocab-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.vocab-box-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 5px;
}

.similar-list {
  display: grid;
  gap: 10px;
}

.similar-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.similar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.similar-word {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
}

.similar-scene-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

.similar-diff {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.similar-example {
  margin-top: 9px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--surface-subtle);
  border-left: 3px solid var(--accent);
}

.similar-example-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.similar-example-en {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.similar-example-zh {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------- Settings ---------- */
.settings-container {
  max-width: 820px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 18px;
}

.settings-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.settings-header p {
  margin: 0;
  font-size: 13.5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head h3 {
  margin: 0 0 3px;
  font-size: 16px;
}

.section-head p {
  margin: 0 0 14px;
  font-size: 13px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.setting-title {
  font-size: 14px;
  font-weight: 600;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(120, 120, 128, 0.28);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.24s var(--ease-ios-spring);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.28s var(--ease-ios-bounce);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 1px 1px rgba(0, 0, 0, 0.08);
}

.switch input:checked + .switch-slider {
  background: var(--accent);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.segmented {
  position: relative;
  display: inline-flex;
  background: rgba(118, 118, 128, 0.11);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 999px;
}

.seg-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s var(--ease-ios-spring);
}

.seg-btn.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.speech-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speech-controls .select-input {
  width: auto;
  padding: 6px 11px;
  font-size: 13px;
}

.config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}

.field input {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.privacy-note {
  margin: 2px 0 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--surface-subtle);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.privacy-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ---------- Clickable English Words & Bilingual Highlight ---------- */
.en-word {
  cursor: pointer;
  border-radius: 4px;
  padding: 0 1px;
  transition: background 0.12s ease, color 0.12s ease;
  border-bottom: 1px dotted transparent;
}

.en-word:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.en-word.is-selected {
  background: var(--accent);
  color: #fff;
  border-bottom-color: transparent;
}

.zh-match {
  background: #fde047;
  color: #1c2421;
  padding: 1px 5px;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35);
}

.inline-gloss {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.inline-gloss strong {
  color: var(--accent);
}

.inline-gloss-link {
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.inline-gloss-link:hover {
  background: var(--accent);
  color: #fff;
}

/* ---------- Vocab Quiz (Choices, 3-Stage Letter Slots, Mastery Dots) ---------- */
.stage-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.16s ease, transform 0.16s ease;
}

.stage-dot.is-done {
  background: var(--accent);
}

.stage-dot.is-current {
  background: var(--amber);
  transform: scale(1.22);
}

.pill-mastered {
  background: var(--emerald-soft);
  color: var(--emerald);
}

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

.pill-requeue {
  background: var(--rose-soft);
  color: var(--rose);
}

.study-btn-active {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: rgba(4, 120, 87, 0.25);
}

.study-btn-active:hover {
  background: var(--emerald);
  color: #fff;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.choice-card {
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.1s ease;
}

.choice-card:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.choice-card:disabled {
  cursor: default;
}

.choice-key {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.choice-word {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.choice-card.is-correct {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.choice-card.is-correct .choice-key {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.choice-card.is-wrong {
  border-color: var(--rose);
  background: var(--rose-soft);
  color: var(--rose);
}

.choice-card.is-wrong .choice-key {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

/* Progressive Letter-Blank Spelling Slots */
.letter-stage-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 18px 20px;
  margin: 14px 0 16px;
}

.letter-slots-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.letter-word-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.letter-tile {
  width: 36px;
  height: 44px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: "Inter", "Segoe UI", ui-monospace, monospace;
  font-size: 19px;
  font-weight: 800;
  user-select: none;
}

.letter-tile.is-fixed {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.letter-tile.is-punct {
  width: auto;
  padding: 0 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.letter-input {
  width: 38px;
  height: 44px;
  border-radius: 9px;
  border: 2px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  text-align: center;
  font-family: "Inter", "Segoe UI", ui-monospace, monospace;
  font-size: 19px;
  font-weight: 800;
  padding: 0;
  outline: none;
  transition: box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.letter-input:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.letter-input.is-right {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.letter-input.is-wrong {
  border-color: var(--rose);
  background: var(--rose-soft);
  color: var(--rose);
}

.letter-diff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.diff-char {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 28px;
  padding: 0 5px;
  border-radius: 6px;
  font-family: "Inter", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 700;
}

.diff-char.is-ok {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.diff-char.is-bad {
  background: var(--rose-soft);
  color: var(--rose);
}

.quiz-next-bar {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 680px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast (Desktop Capsule + Mobile Dynamic Island Pill) */
.toast {
  position: fixed;
  bottom: 22px;
  right: 24px;
  background: rgba(28, 28, 30, 0.88);
  color: #ffffff;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  z-index: 200;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.22s var(--ease-ios-spring), transform 0.28s var(--ease-ios-bounce);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast[hidden] {
  display: none !important;
}

/* ---------- Responsive Narrow Window Fallback ---------- */
@media (max-width: 960px) {
  .two-col-grid,
  .vocab-scene-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .panel-split {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .panel-split {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}

/* Mistake Radar */
.mistake-radar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mistake-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mistake-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt, rgba(0, 0, 0, 0.02));
  flex-wrap: wrap;
}

.mistake-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mistake-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 600;
}

.mistake-badge-danger {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--rose);
  background: var(--rose-soft);
}

.mistake-badge-ok {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-soft);
}

.mistake-chips-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
}

.mistake-mini-chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--rose-soft);
  color: var(--rose);
  font-weight: 600;
}

/* ---------- Vocab Library Browser & Manager ---------- */
.panel-vlib {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.panel-vlib[hidden] {
  display: none !important;
}

.vlib-top {
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  min-width: 0;
}

.vlib-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vlib-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.vlib-kpi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.vlib-kpi-label {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 3px;
}

.vlib-kpi-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.vlib-kpi-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.vlib-progress-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  margin-top: 6px;
  overflow: hidden;
}

.vlib-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.vlib-report-drawer {
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
  line-height: 1.6;
}

.vlib-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vlib-search {
  flex: 1 1 220px;
  min-width: 190px;
  margin: 0;
}

.vlib-pill-group {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.vlib-select {
  height: 32px;
  font-size: 12.5px;
  padding: 0 8px;
  max-width: 175px;
}

.vlib-body {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.vlib-list-pane {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.vlib-list-meta {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vlib-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vlib-row {
  text-align: left;
  width: 100%;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vlib-row:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}

.vlib-row.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.vlib-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.vlib-row-word-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.vlib-row-word {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.vlib-row-ipa {
  font-size: 12px;
  color: var(--muted);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.vlib-row-rank {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.vlib-row-sense {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.vlib-badge-l1 {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.vlib-badge-l2 {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.vlib-badge-enriched {
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
}

.vlib-badge-raw {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
}

.vlib-pagination {
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  background: var(--surface);
}

.vlib-page-jump {
  width: 52px;
  text-align: center;
  padding: 3px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}

.vlib-detail-pane {
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  background: var(--bg);
}

.vlib-hook-card {
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.vlib-chunk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.vlib-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.vlib-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.vlib-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

@media (max-width: 980px) {
  .panel-vlib {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .vlib-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vlib-body {
    grid-template-columns: minmax(0, 1fr);
    flex: 0 0 auto;
    overflow: visible;
  }
  .vlib-list-pane {
    max-height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .vlib-detail-pane {
    overflow: visible;
    padding: 16px;
  }
  .vlib-form-grid {
    grid-template-columns: 1fr;
  }
}

.vlib-syllable-chip {
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  letter-spacing: 0.4px;
}

.vlib-confusable-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  background: var(--amber-soft, rgba(245, 158, 11, 0.12));
  border: 1px solid var(--amber, #d97706);
  color: var(--text);
  font-size: 13px;
  margin-bottom: 14px;
}

.vlib-meaning-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vlib-meaning-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 13px;
}

.vlib-meaning-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.vlib-meaning-sense {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.vlib-meaning-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  margin-right: 6px;
}

.vlib-meaning-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
}

.vlib-meaning-chunk-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

.vlib-meaning-chunk-en {
  font-weight: 650;
  color: var(--accent);
}

.vlib-meaning-chunk-zh {
  color: var(--text);
  font-weight: 500;
}

.vlib-meaning-example {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.vlib-meaning-ex-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.vlib-meaning-ex-en {
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--text);
}

.vlib-meaning-ex-zh {
  font-size: 13px;
  color: var(--text-muted, var(--muted));
  margin-top: 4px;
  line-height: 1.5;
}

.vlib-study-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--surface-subtle, var(--bg));
  border: 1px solid var(--border);
}

.vlib-study-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

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

.vlib-similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.vlib-similar-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vlib-similar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.vlib-similar-word {
  font-size: 16px;
  font-weight: 750;
  color: var(--accent);
}

.vlib-similar-diff {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 6px 9px;
  border-radius: 0 6px 6px 0;
}

.vlib-similar-ex {
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Vocab Library Practice Arena (vlib-quiz) ---------- */
.vq-polysemy-sentence {
  font-size: 18px;
  line-height: 1.65;
  font-weight: 550;
  color: var(--text);
  margin: 6px 0 8px;
}

.vq-target-hl {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  border-bottom: 2px solid var(--accent);
}

.choice-card-rich {
  align-items: flex-start;
  padding: 14px 16px;
}

.choice-rich-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.choice-rich-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.choice-rich-sub {
  font-size: 12.5px;
  color: var(--text-muted, var(--muted));
  line-height: 1.45;
}

.choice-card.is-correct .choice-rich-sub,
.choice-card.is-wrong .choice-rich-sub {
  color: inherit;
  opacity: 0.9;
}

.vlib-quiz-diff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.vlib-quiz-diff-row {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.55;
}

.vlib-quiz-diff-row.is-answer {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}

.vlib-quiz-diff-row.is-picked-wrong {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.vlib-quiz-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.vlib-quiz-hint-drawer {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- Vocab Library Per-Meaning Real Photo Layout ---------- */
.vlib-img-dot {
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  font-weight: 600;
}

.vlib-meaning-card.has-photo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.vlib-meaning-main {
  flex: 1 1 auto;
  min-width: 0;
}

.vlib-meaning-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.vlib-add-img-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.42;
  transition: opacity 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.vlib-meaning-card:hover .vlib-add-img-link,
.vlib-add-img-link:focus-visible {
  opacity: 0.85;
}

.vlib-add-img-link:hover:not(:disabled) {
  opacity: 1;
  color: var(--accent);
  background: var(--accent-soft);
}

.vlib-add-img-link:disabled {
  cursor: wait;
  opacity: 0.6;
}

.vlib-meaning-media {
  flex: 0 0 198px;
  width: 198px;
}

.vlib-mimg-card {
  width: 100%;
}

.vlib-mimg-card.is-quiz {
  margin-top: 10px;
  max-width: 240px;
}

.vlib-mimg-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.vlib-mimg-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vlib-image-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.72;
  transition: opacity 0.16s ease;
}

.vlib-mimg-frame:hover .vlib-image-actions,
.vlib-image-actions:focus-within {
  opacity: 1;
}

.vlib-img-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.66);
  color: #f8fafc;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.vlib-img-btn:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
}

.vlib-img-btn.is-danger:hover:not(:disabled) {
  background: rgba(190, 18, 60, 0.9);
  border-color: rgba(255, 228, 230, 0.7);
}

.vlib-img-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.vlib-mimg-query-cap {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.vlib-mimg-inline-search {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
}

.vlib-img-search-input {
  flex: 1 1 160px;
  min-width: 0;
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
}

.filter-pill.is-photo-collection:not(.is-active) {
  border-color: rgba(14, 165, 233, 0.35);
  color: var(--accent);
}

.vlib-kpi-card.is-photo-kpi {
  border-color: rgba(14, 165, 233, 0.32);
}

.vlib-kpi-link {
  appearance: none;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.vlib-kpi-link:hover {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 920px) {
  .vlib-meaning-card.has-photo {
    flex-direction: column;
  }
  .vlib-meaning-media {
    flex: 0 0 auto;
    width: 100%;
    max-width: 260px;
  }
}

/* ---------- Unified 4-Stage Scientific Vocabulary Flow ---------- */
.tricky-letter {
  color: var(--rose, #e11d48);
  font-weight: 850;
  text-decoration: underline wavy rgba(225, 29, 72, 0.55);
  text-underline-offset: 3px;
}

.vlq-header-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.vlq-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.vlq-tier-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.vlq-pipeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.vlq-pipeline-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vlq-stage-pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.vlq-stage-pill:hover {
  border-color: var(--accent);
}

.vlq-stage-pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 650;
}

.vlq-stage-pill.is-mastered {
  cursor: default;
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald);
}

.vlq-pipe-arrow {
  color: var(--muted);
  font-size: 11px;
  user-select: none;
}

.vlq-session-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vlq-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vlq-word-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.vlq-big-word {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.vlq-stage0-actions,
.vlq-stage2-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.vlq-choice-action {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.vlq-choice-action:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.vlq-choice-action.is-master:hover {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}

.vlq-choice-action.is-danger-act:hover {
  border-color: var(--rose);
  background: var(--rose-soft);
}

.vlq-choice-action strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.vlq-choice-action small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}

.vlq-typing-panel {
  position: relative;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  margin-bottom: 12px;
  cursor: text;
}

.vlq-typing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 12px;
}

.vlq-typing-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 50px;
}

.vlq-slot-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 46px;
  padding: 0 6px;
  border-radius: 9px;
  border: 2px solid var(--border-strong);
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  font-weight: 750;
  color: var(--text);
  user-select: none;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.vlq-typing-grid.is-copy .vlq-slot-box:not(.is-filled):not(.is-hinted) {
  color: var(--muted);
  opacity: 0.45;
}

.vlq-slot-box.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.vlq-slot-box.is-filled {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--emerald);
  opacity: 1;
}

.vlq-slot-box.is-hinted {
  border-color: var(--amber, #d97706);
  background: var(--amber-soft, rgba(245, 158, 11, 0.14));
  color: var(--amber, #d97706);
  opacity: 1;
}

.vlq-slot-box.is-tricky-mark:not(.is-filled) {
  border-bottom-color: var(--rose, #e11d48);
  border-bottom-style: dashed;
}

.vlq-slot-box.is-wrong-shake {
  border-color: var(--rose, #e11d48) !important;
  background: var(--rose-soft, rgba(225, 29, 72, 0.14)) !important;
  color: var(--rose, #e11d48) !important;
  animation: vlqShake 0.34s ease;
}

@keyframes vlqShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
  90% { transform: translateX(3px); }
}

.vlq-slot-sep {
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
  padding: 0 3px;
}

.vlq-type-capture {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  left: 0;
  bottom: 0;
}

.vlq-s2-front {
  padding: 18px 20px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.vlq-s2-front.is-flipped {
  cursor: default;
  border-color: var(--border);
}

.vlq-s2-prompt-foot {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.vlq-s2-back {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}

.vlq-s2-reveal-grid.has-photo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.vlq-s2-reveal-text {
  flex: 1 1 auto;
  min-width: 0;
}

.vlq-s2-reveal-photo {
  flex: 0 0 215px;
  width: 215px;
}

.vlq-s3-senses {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vlq-s3-sense-line {
  font-size: 14.5px;
  line-height: 1.5;
}

.vlq-s3-cloze-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
}

.vlq-s3-cloze-text {
  font-size: 16.5px;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.55;
}

.s3-stem-blank {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 2px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.s3-stem-suffix {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  color: var(--emerald);
  background: var(--emerald-soft);
  padding: 0 4px;
  border-radius: 4px;
  margin-left: 1px;
}

.feedback-banner.is-retry {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}

.workspace-subnav {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-shrink: 0;
}

.workspace-subnav[hidden] {
  display: none;
}

.subnav-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.085);
  border: 1px solid var(--border);
}

.subnav-pill {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s var(--ease-ios-spring), background 0.18s ease;
}

.subnav-pill:hover {
  color: var(--ink);
}

.subnav-pill.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, 0.2);
}

.vlq-quota-pill {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.pill-func {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.vlq-listen-stage {
  padding: 20px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
}

.vlq-listen-hero {
  text-align: center;
  padding: 14px 8px;
}

.vlq-listen-icon {
  font-size: 40px;
  line-height: 1;
}

.vlq-chunk-input-wrap {
  margin-top: 8px;
}

.radar-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 4px 0 8px;
  letter-spacing: 0.02em;
}

.quota-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-soft);
}

.quota-input-sm {
  width: 68px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 780px) {
  .vlq-stage0-actions,
  .vlq-stage2-actions {
    grid-template-columns: 1fr;
  }
  .vlq-s2-reveal-grid.has-photo {
    flex-direction: column;
  }
  .vlq-s2-reveal-photo {
    flex: 0 0 auto;
    width: 100%;
    max-width: 260px;
  }
}

/* ---------- Phase 3: Long-Term Trends Chart & Backup Manager ---------- */
.trends-head,
.backup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.trends-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.trends-kpi {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trends-kpi-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.trends-kpi-lbl {
  font-size: 12px;
  color: var(--muted);
}

.trends-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 152px;
  padding: 12px 8px 6px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.trend-col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.trend-bar-track {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.trend-bar {
  width: 78%;
  max-width: 18px;
  min-width: 4px;
  border-radius: 4px 4px 2px 2px;
  background: var(--accent);
  opacity: 0.86;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.trend-col:hover .trend-bar {
  opacity: 1;
}

.trend-bar.is-empty {
  background: var(--border-strong);
  opacity: 0.35;
}

.trend-bar-new {
  width: 100%;
  background: var(--ok, #16a34a);
}

.trend-ret-dot {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warn, #f59e0b);
  border: 1.5px solid var(--surface);
  z-index: 2;
  pointer-events: none;
}

.trend-tick {
  font-size: 10px;
  color: var(--muted);
  height: 14px;
  line-height: 14px;
  white-space: nowrap;
}

.trend-col.is-today .trend-tick {
  color: var(--accent);
  font-weight: 700;
}

.trends-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.trends-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-swatch.is-review {
  background: var(--accent);
}

.legend-swatch.is-new {
  background: var(--ok, #16a34a);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warn, #f59e0b);
}

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

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.backup-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.backup-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink);
}

.backup-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.backup-tag.is-daily {
  background: var(--accent-soft);
  color: var(--accent);
}

.backup-tag.is-manual {
  background: rgba(22, 163, 74, 0.14);
  color: var(--ok, #15803d);
}

.backup-tag.is-protect {
  background: rgba(245, 158, 11, 0.16);
  color: var(--warn, #b45309);
}

@media (max-width: 960px) {
  .trends-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =========================================================================
   Phase 4: Native iOS Design Polish, Animations, Lock Screen & iPhone 15 Plus
   ========================================================================= */

/* Desktop Pass-Through Wrappers for Responsive Toolbar */
.vlib-search-row,
.vlib-filter-drawer {
  display: contents;
}

.mobile-topbar,
.mobile-detail-nav,
.vlib-filter-toggle {
  display: none;
}

/* Tactile Spring Compression & Subtle Card Elevation */
.btn,
.speak-btn,
.filter-pill,
.mode-chip,
.choice-card,
.srs-btn,
.nav-item,
.subnav-pill,
.side-tool-btn,
.sync-pill,
.vlib-row,
.master-row,
.vlq-stage-pill,
.mobile-top-btn,
.mobile-back-btn,
.mobile-pager-btn {
  transition:
    transform 0.18s var(--ease-ios-spring),
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.22s ease,
    color 0.15s ease;
}

.btn:active:not(:disabled),
.speak-btn:active:not(:disabled),
.filter-pill:active:not(:disabled),
.mode-chip:active:not(:disabled),
.choice-card:active:not(:disabled),
.srs-btn:active:not(:disabled),
.nav-item:active:not(:disabled),
.subnav-pill:active:not(:disabled),
.side-tool-btn:active:not(:disabled),
.sync-pill:active:not(:disabled),
.vlq-stage-pill:active:not(:disabled),
.mobile-top-btn:active:not(:disabled),
.mobile-back-btn:active:not(:disabled),
.mobile-pager-btn:active:not(:disabled) {
  transform: scale(0.955);
}

.vlib-row:active,
.master-row:active {
  transform: scale(0.985);
}

/* Smooth Entrance Keyframes */
@keyframes iosPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iosCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes iosShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-8px); }
  36% { transform: translateX(7px); }
  54% { transform: translateX(-5px); }
  72% { transform: translateX(4px); }
  90% { transform: translateX(-2px); }
}

@keyframes iosSparkPop {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4);
  }
  65% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-dx, 0px)), calc(-50% + var(--spark-dy, -24px))) scale(1.1);
  }
}

@keyframes iosSonarRing {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.38);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(15, 118, 110, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
  }
}

.tab-panel.is-active > * {
  animation: iosPanelIn 0.28s var(--ease-ios-spring);
}

.practice-card,
.vlq-card,
.detail-inner {
  animation: iosCardIn 0.28s var(--ease-ios-spring);
}

.ios-shake {
  animation: iosShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.ios-spark-dot {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 260;
  animation: iosSparkPop 0.65s var(--ease-ios-spring) forwards;
}

.speak-btn {
  position: relative;
}

.speak-btn.is-speaking {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  animation: iosSonarRing 1.15s infinite ease-out;
}

/* Remote Access Settings Card */
.remote-pass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.remote-guide-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.remote-guide-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.remote-guide-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* iOS Frosted Glass Passcode Lock Screen */
.auth-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(242, 242, 247, 0.72);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  animation: iosPanelIn 0.28s var(--ease-ios-spring);
}

[data-theme="warm"] .auth-lock-overlay {
  background: rgba(239, 233, 222, 0.76);
}

.auth-lock-overlay[hidden] {
  display: none !important;
}

.auth-lock-card {
  width: 100%;
  max-width: 390px;
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  padding: 30px 24px 26px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  text-align: center;
  animation: iosCardIn 0.34s var(--ease-ios-spring);
}

.auth-lock-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 26px;
}

.auth-lock-title {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
}

.auth-lock-desc {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.auth-lock-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-lock-form[hidden] {
  display: none !important;
}

.auth-passcode-input {
  text-align: center;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  letter-spacing: 0.08em;
}

.auth-lock-error {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 12.5px;
  font-weight: 600;
}

.auth-lock-submit {
  width: 100%;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 15px;
}

.auth-lock-hint {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =========================================================================
   iPhone 15 Plus (430x932) & Mobile Native iOS Shell (<= 768px)
   ========================================================================= */
@media (max-width: 768px) {
  .workbench {
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
  }

  /* Prevent iOS Safari zoom on input/select focus */
  input,
  textarea,
  select,
  .text-input,
  .textarea-input,
  .select-input,
  .vlib-select,
  .quota-input-sm {
    font-size: 16px !important;
  }

  /* Sticky iOS Frosted Topbar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
    padding: calc(env(safe-area-inset-top) + 8px) 14px 10px;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    border-bottom: 1px solid var(--glass-border);
  }

  .mobile-top-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mobile-brand-dot {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
  }

  .mobile-top-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .mobile-top-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    border-radius: 999px;
    min-height: 34px;
    min-width: 34px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-top-btn[hidden] {
    display: none !important;
  }

  /* Transform Sidebar into Fixed Bottom Frosted iOS TabBar */
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 50;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-right: none;
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05);
  }

  .sidebar .brand,
  .sidebar .sidebar-progress,
  .sidebar .sidebar-footer {
    display: none;
  }

  .sidebar-top {
    width: 100%;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  .nav-item {
    position: relative;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 5px 4px;
    border-radius: 12px;
    border-color: transparent;
    text-align: center;
  }

  .nav-item.is-active {
    background: transparent;
    border-color: transparent;
    color: var(--accent);
  }

  .nav-icon {
    font-size: 19px;
    line-height: 1.1;
  }

  .nav-text {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
  }

  .nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 28px);
    font-size: 10px;
    padding: 0 5px;
    line-height: 1.45;
    min-width: 18px;
    text-align: center;
  }

  /* Scrollable Main Workspace above Bottom TabBar */
  .workspace {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-subnav {
    padding: 8px 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .workspace-subnav::-webkit-scrollbar {
    display: none;
  }

  .tab-panel {
    flex: 0 0 auto;
    min-height: auto;
  }

  .panel-scroll {
    overflow: visible;
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .trends-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .btn,
  .choice-card,
  .srs-btn {
    min-height: 44px;
  }

  .btn-sm {
    min-height: 36px;
  }

  .srs-buttons {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Mobile Dynamic Island Style Floating Toast */
  .toast {
    top: calc(env(safe-area-inset-top) + 12px);
    bottom: auto;
    left: 50%;
    right: auto;
    max-width: calc(100vw - 28px);
    text-align: center;
    transform: translate(-50%, -18px) scale(0.92);
  }

  .toast.is-visible {
    transform: translate(-50%, 0) scale(1);
  }

  /* Mobile Vocab Library: Compact Search + Collapsible Filter Drawer */
  .panel-vlib {
    overflow: visible;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .vlib-top {
    padding: 12px 14px 10px;
  }

  .vlib-title-row {
    margin-bottom: 10px;
  }

  .vlib-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .vlib-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .vlib-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .vlib-search {
    flex: 1 1 auto;
    min-width: 0;
  }

  .vlib-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-height: 42px;
    padding: 6px 12px;
    border-radius: 12px;
  }

  .vlib-filter-toggle.is-active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
  }

  .vlib-filter-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
  }

  .vlib-filter-dot[hidden] {
    display: none !important;
  }

  .vlib-filter-drawer {
    display: none;
    flex-direction: column;
    gap: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .vlib-top.is-filters-open .vlib-filter-drawer {
    display: flex;
    animation: iosPanelIn 0.22s var(--ease-ios-spring);
  }

  .vlib-pill-group {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .vlib-pill-group::-webkit-scrollbar {
    display: none;
  }

  .vlib-pill-group .filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
  }

  .vlib-select {
    max-width: 100%;
    width: 100%;
    height: 42px;
  }

  .vlib-body,
  .panel-split {
    display: block;
    overflow: visible;
    height: auto;
  }

  .vlib-list-pane,
  .master-pane {
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: none;
    background: transparent;
  }

  .vlib-list,
  .master-list {
    overflow: visible;
    max-height: none;
  }

  .panel-split {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .panel-split .pane-header {
    padding: 12px 14px 10px;
  }

  .panel-split .scene-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .panel-split .scene-pills::-webkit-scrollbar {
    display: none;
  }

  .panel-split .scene-pills .filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* iOS Drill-Down Push Detail Sheet */
  .panel-vlib .vlib-detail-pane,
  .panel-split .detail-pane {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 14px calc(36px + env(safe-area-inset-bottom));
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s var(--ease-ios-spring), visibility 0s linear 0.3s;
  }

  .panel-vlib.is-mobile-detail-open .vlib-detail-pane,
  .panel-split.is-mobile-detail-open .detail-pane {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s var(--ease-ios-spring), visibility 0s;
  }

  .mobile-detail-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0 -14px 12px;
    padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    border-bottom: 1px solid var(--glass-border);
  }

  .mobile-back-btn,
  .mobile-pager-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--accent);
    border-radius: 999px;
    min-height: 36px;
    padding: 5px 13px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .mobile-pager-btn {
    color: var(--ink);
    font-weight: 600;
    font-size: 12.5px;
    padding: 5px 11px;
  }

  .mobile-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .mobile-detail-pager {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .mobile-detail-nav-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vlib-meaning-media {
    max-width: 100%;
  }

  /* Practice & Quiz Arena on 430px iPhone */
  .mode-switcher {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .mode-switcher::-webkit-scrollbar {
    display: none;
  }

  .mode-chip {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 38px;
  }

  .vlq-typing-slot,
  .spell-slot {
    min-width: 32px;
    height: 42px;
    font-size: 18px;
  }
}

/* Honor System Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
