:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f0f2f8;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-soft: rgba(225, 29, 72, 0.1);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);

  /* Pleco / DuChinese Tone Colors (Light) */
  --tone-1: #e11d48;
  --tone-2: #16a34a;
  --tone-3: #2563eb;
  --tone-4: #9333ea;
  --tone-5: #64748b;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font-ui: "Be Vietnam Pro", "Inter", system-ui, -apple-system, sans-serif;
  --font-hanzi: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #131c31;
  --surface-alt: #1b2640;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #26334d;
  --primary: #fb7185;
  --primary-hover: #f43f5e;
  --primary-soft: rgba(251, 113, 133, 0.14);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);

  /* Tone Colors (Dark) */
  --tone-1: #fb7185;
  --tone-2: #4ade80;
  --tone-3: #60a5fa;
  --tone-4: #c084fc;
  --tone-5: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-shell.focus-mode .sidebar,
.app-shell.focus-mode .bottom-nav,
.app-shell.focus-mode .mobile-header {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 20px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-hanzi);
  font-size: 22px;
  font-weight: 700;
}

.brand-title {
  display: block;
  font-weight: 700;
  font-size: 16px;
}

.brand-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

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

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  background: var(--surface-alt);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.tone-legend {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tone-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-alt);
}

/* Tone color utility classes */
body.tone-colors-on .t1, .tone-pill.tone-1 { color: var(--tone-1); }
body.tone-colors-on .t2, .tone-pill.tone-2 { color: var(--tone-2); }
body.tone-colors-on .t3, .tone-pill.tone-3 { color: var(--tone-3); }
body.tone-colors-on .t4, .tone-pill.tone-4 { color: var(--tone-4); }
body.tone-colors-on .t5, .tone-pill.tone-5 { color: var(--tone-5); }

/* Toggle Switch */
.switch {
  position: relative;
  width: 38px;
  height: 22px;
}

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

.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

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

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

/* Main Content */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mobile-header {
  display: none;
}

.main-content {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 28px 60px;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.18s ease-out; }

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

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

.view-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-alt); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-lg { padding: 12px 22px; font-size: 15px; min-height: 48px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }

.icon-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
}

/* Cards & Forms */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.chip.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

/* Stats Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

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

.stat-value {
  font-size: 22px;
  font-weight: 700;
}

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

/* Lesson Grid */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.lesson-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.lesson-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.badge-level { background: var(--primary-soft); color: var(--primary); }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--surface-alt); color: var(--text-muted); }

.lesson-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

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

.mastery-bar {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
}

.mastery-fill {
  height: 100%;
  background: var(--success);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.lesson-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.lesson-menu-row {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* Form Elements */
.form-grid, .entry-grid, .config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.span-2 { grid-column: span 2; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.input-hanzi {
  font-family: var(--font-hanzi);
  font-size: 18px !important;
  font-weight: 600;
}

.size-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--warn);
}

/* Builder Tabs & Split View */
.builder-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.builder-pane { display: none; }
.builder-pane.active { display: block; }

.entry-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

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

kbd {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.split-col { display: flex; flex-direction: column; gap: 10px; }

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

.preview-counters { display: flex; gap: 6px; }

.bulk-preview-list, .builder-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

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

.preview-row.invalid { border-color: var(--warn); background: var(--warn-soft); }

.vocab-inline {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.hanzi-sm {
  font-family: var(--font-hanzi);
  font-size: 22px;
  font-weight: 700;
}

.pinyin-sm { font-size: 13px; font-weight: 600; }
.meaning-sm { font-size: 14px; color: var(--text); }

/* Focus Topbar */
.focus-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

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

.progress-track {
  flex: 1;
  height: 10px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
}

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

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.streak-badge {
  background: var(--warn-soft);
  color: var(--warn);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

/* 3D Flashcard */
.flashcard-stage {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.fc-lesson-name {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 600;
}

.flashcard-3d {
  width: 100%;
  height: 340px;
  perspective: 1000px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.28s ease-out;
  transform-style: preserve-3d;
}

.flashcard-3d.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.flashcard-back {
  transform: rotateY(180deg);
}

.card-tag {
  position: absolute;
  top: 16px;
  left: 18px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.fc-hanzi {
  font-family: var(--font-hanzi);
  font-size: 52px;
  font-weight: 700;
  line-height: 1.25;
}

.fc-hanzi-sm {
  font-family: var(--font-hanzi);
  font-size: 32px;
  font-weight: 700;
}

.fc-pinyin-hint, .fc-pinyin-back {
  font-size: 20px;
  font-weight: 600;
}

.fc-pinyin-hint.hidden { opacity: 0; pointer-events: none; }

.fc-meaning {
  font-size: 20px;
  font-weight: 700;
}

.fc-example {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 90%;
}

.fc-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 8px;
}

.fc-audio-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.audio-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.audio-btn.speaking {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.flip-hint {
  position: absolute;
  bottom: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.fc-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

/* Quiz Hub & Stage */
.lesson-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.lesson-check-chip input { accent-color: var(--primary); }

.config-options { margin-top: 16px; }
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.config-footer { margin-top: 20px; }

.quiz-stage {
  max-width: 640px;
  margin: 0 auto 90px;
}

.quiz-prompt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.quiz-mode-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 10px;
}

.quiz-hanzi {
  font-family: var(--font-hanzi);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.3;
}

.quiz-pinyin {
  font-size: 19px;
  font-weight: 600;
  margin-top: 4px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quiz-opt {
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}

.quiz-opt:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.quiz-opt.correct {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.quiz-opt.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  animation: shake 0.25s ease-in-out;
}

.quiz-opt.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.quiz-opt.matched {
  border-color: var(--success);
  background: var(--success-soft);
  opacity: 0.55;
  pointer-events: none;
}

.opt-key {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Tone Drill Buttons */
.tone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.tone-btn {
  padding: 14px 8px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font: inherit;
  font-weight: 700;
}

.tone-btn .tone-contour { font-size: 22px; }
.tone-btn .tone-name { font-size: 12px; color: var(--text-muted); }

/* Slide-up Feedback Bar */
.feedback-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transform: translateY(110%);
  transition: transform 0.2s ease-out;
  z-index: 40;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
}

.feedback-bar.show { transform: translateY(0); }
.feedback-bar.is-correct { border-top-color: var(--success); background: var(--surface); }
.feedback-bar.is-wrong { border-top-color: var(--danger); background: var(--surface); }

.feedback-status { font-size: 16px; font-weight: 700; }
.feedback-bar.is-correct .feedback-status { color: var(--success); }
.feedback-bar.is-wrong .feedback-status { color: var(--danger); }
.feedback-detail { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* Result Summary */
.result-stage {
  max-width: 680px;
  margin: 0 auto;
}

.score-hero {
  text-align: center;
  padding: 28px 20px;
}

.score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 6px solid var(--primary);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 28px;
  font-weight: 800;
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.skill-row span:first-child { width: 130px; color: var(--text-muted); }

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.empty-inline {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Mobile Bottom Nav */
.bottom-nav { display: none; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .brand-compact { display: flex; align-items: center; gap: 8px; font-weight: 700; }
  .brand-mark-sm {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--primary); color: #fff;
    display: grid; place-items: center; font-family: var(--font-hanzi);
  }
  .mobile-actions { display: flex; gap: 8px; }
  .main-content { padding: 18px 14px 86px; }
  .form-grid, .entry-grid, .config-grid, .split-view, .quiz-options {
    grid-template-columns: 1fr;
  }
  .span-2 { grid-column: span 1; }
  .tone-grid { grid-template-columns: repeat(2, 1fr); }
  .feedback-bar { flex-direction: column; align-items: stretch; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px env(safe-area-inset-bottom);
    z-index: 30;
  }
  .bottom-nav-item {
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
  }
  .bottom-nav-item.active { color: var(--primary); font-weight: 700; }
}
