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

:root {
  --bg: #0f172a;
  --bg2: #1e293b;
  --bg3: #334155;
  --surface: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --accent: #3b82f6;
  --accent2: #6366f1;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* Light theme */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg2: #f1f5f9;
  --bg3: #e2e8f0;
  --surface: #ffffff;
  --border: #cbd5e1;
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

[data-theme="light"] header { background: rgba(248,250,252,0.9); }
[data-theme="light"] .today-card { background: linear-gradient(135deg, #dbeafe 0%, #ffffff 100%); border-color: rgba(59,130,246,0.2); }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

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

.bible-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bible-ref {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

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

.file-info {
  font-size: 12px;
  color: var(--text3);
  padding: 4px 0 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.file-info .sep { color: var(--bg3); }

/* ===== Buttons ===== */
.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-accent:hover { background: #2563eb; transform: translateY(-1px); }

.file-upload-label { display: inline-block; cursor: pointer; }

.theme-toggle {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  margin-left: 4px;
  border-radius: 6px;
  transition: color 0.2s;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle .hidden { display: none; }

.btn-sm-outline {
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sm-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm-outline.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

.option-toggle {
  font-size: 12px;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.option-toggle input { accent-color: var(--accent); }

/* Range Panel */
.range-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.range-panel.hidden { display: none; }
.range-label { font-size: 12px; font-weight: 600; color: var(--text3); }
.range-sep { font-size: 14px; color: var(--text3); margin: 0 4px; }
.range-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

/* Listen options */
.listen-options { margin-bottom: 8px; }

/* ===== Container ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px;
}

/* ===== Mode Tabs ===== */
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover { color: var(--text2); }
.tab.active { background: var(--accent); color: #fff; }
.tab svg { flex-shrink: 0; }

/* ===== Home Screen ===== */
.home-screen { display: flex; flex-direction: column; gap: 20px; }
.home-screen.hidden { display: none; }

.today-card {
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: 0 4px 32px rgba(59, 130, 246, 0.1);
}

.today-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.today-ref {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 16px;
}

.today-text {
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.9;
  word-break: keep-all;
  margin-bottom: 28px;
  max-height: 200px;
  overflow-y: auto;
}

.today-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.today-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.today-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Progress */
.progress-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.progress-count {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.prog-mode {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.prog-mode-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.prog-mode-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

/* ===== Practice Area ===== */
.practice-area.hidden { display: none; }
.practice-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

/* ===== Stats Bar ===== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  text-align: center;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
}

.accent-blue { color: var(--accent); }
.accent-green { color: var(--green); }

/* ===== Display Text ===== */
.display-text {
  font-size: 26px;
  line-height: 2;
  padding: 28px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 80px;
  margin-bottom: 16px;
  word-break: keep-all;
  color: var(--text3);
  font-family: 'Noto Serif KR', Georgia, 'Times New Roman', serif;
}

.display-text .correct { color: var(--green); }
.display-text .incorrect { color: var(--red); background: rgba(239, 68, 68, 0.15); border-radius: 2px; }
.display-text .current { border-bottom: 2px solid var(--accent); background: rgba(59, 130, 246, 0.15); border-radius: 2px; }
.display-text .word-match { color: var(--green); }
.display-text .word-miss { color: var(--red); text-decoration: underline; }

.display-text.hidden-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--text3);
  font-size: 16px;
}

/* ===== Mode Inputs ===== */
.mode-input.hidden { display: none; }

/* ── Typing ── */
.typing-input {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 22px;
  padding: 18px 22px;
  border-radius: var(--radius);
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.typing-input:focus { border-color: var(--accent); }
.typing-input.completed { border-color: var(--green); background: rgba(16, 185, 129, 0.05); }

/* ── Voice ── */
.voice-difficulty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.voice-diff-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  margin-right: 4px;
}

.vdiff-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.vdiff-btn:hover { border-color: var(--accent); color: var(--accent); }
.vdiff-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.voice-diff-desc {
  font-size: 12px;
  color: var(--text3);
  margin-left: 8px;
}

.display-text .word-hidden {
  color: var(--bg3);
  letter-spacing: 2px;
  user-select: none;
}

.display-text .word-chosung {
  color: var(--text3);
  font-size: 0.85em;
  letter-spacing: 1px;
}

.voice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  margin: 0 auto 16px;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
}

.voice-btn:hover { background: #2563eb; transform: scale(1.05); }

.voice-btn.recording {
  background: var(--red);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}

.voice-result {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.voice-result.hidden { display: none; }

.voice-result-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.voice-result-text {
  font-size: 16px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 8px;
  min-height: 24px;
}

.voice-similarity {
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.voice-similarity.good { color: var(--green); }
.voice-similarity.ok { color: var(--yellow); }
.voice-similarity.bad { color: var(--red); }

/* ── Blank ── */
.blank-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.blank-difficulty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blank-diff-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  margin-right: 4px;
}

.diff-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.diff-btn:hover { border-color: var(--accent); color: var(--accent); }
.diff-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.blank-word {
  display: inline-flex;
  position: relative;
  margin: 0 2px;
  cursor: text;
}

.blank-cells {
  display: inline-flex;
  gap: 3px;
}

.blank-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.5em;
  border-bottom: 2px dashed var(--accent);
  color: var(--text3);
  pointer-events: none;
  transition: all 0.15s;
}

.blank-cell.filled {
  color: var(--text);
  border-bottom-style: solid;
  border-bottom-color: var(--accent);
}

.blank-cell.cursor {
  border-bottom-style: solid;
  border-bottom-color: var(--accent2);
  animation: cellBlink 1s step-end infinite;
}

@keyframes cellBlink {
  50% { border-bottom-color: transparent; }
}

.blank-word:focus-within .blank-cell:not(.filled):not(.cursor) {
  border-bottom-color: rgba(99, 102, 241, 0.4);
}

.blank-word-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  font-size: inherit;
  cursor: text;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
}

.blank-word.correct .blank-cell { border-color: var(--green); color: var(--green); border-bottom-style: solid; }
.blank-word.wrong .blank-cell { border-color: var(--red); color: var(--red); border-bottom-style: solid; }

.blank-answer {
  font-size: 0.6em;
  color: var(--green);
  position: absolute;
  bottom: -1.4em;
  left: 0;
  white-space: nowrap;
}

/* ── Listen ── */
.listen-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.listen-voice {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 3px;
  border-radius: 8px;
}

.voice-sel {
  flex: 1;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-sel.active { background: var(--bg3); color: var(--text); }

.listen-player {
  display: flex;
  align-items: center;
  gap: 16px;
}

.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.play-btn:hover { background: #2563eb; }
.play-btn .hidden { display: none; }

.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.speed-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  flex-shrink: 0;
}

#speed-range {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}

#speed-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  min-width: 36px;
  text-align: right;
}

/* ===== Completion Effect ===== */
@keyframes celebrate {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.practice-area.celebrate {
  animation: celebrate 0.8s ease 2;
  border-color: var(--green);
}

.celebrate-msg {
  text-align: center;
  padding: 8px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.3s;
}

.celebrate-msg.show { opacity: 1; }

/* ===== Shortcut Hints ===== */
.shortcut-hints {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text3);
}

.shortcut-hints kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 10px;
  color: var(--text2);
}

/* ===== Chapter Grid ===== */
.chapter-grid-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chapter-grid-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
}

.ch-block {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.ch-block:hover { border-color: var(--accent); color: var(--accent); }
.ch-block.partial { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); color: var(--accent); }
.ch-block.done { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.3); color: var(--green); }

/* ===== Selector Done Mark ===== */
.selector-btn.practiced { position: relative; }
.selector-btn.practiced::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.selector-btn.all-done {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ===== Mode Transition ===== */
.practice-area { transition: opacity 0.2s ease; }
.practice-area.fading { opacity: 0; }
.home-screen { transition: opacity 0.2s ease; }
.home-screen.fading { opacity: 0; }

/* ===== Controls ===== */
.controls {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-control {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-control:hover { border-color: var(--text3); color: var(--text); }

.btn-next {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-next:hover { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ===== History ===== */
.history { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 20px; }

.history-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.history-ref { font-weight: 600; color: var(--text); }
.history-stats { color: var(--text3); font-variant-numeric: tabular-nums; }
.history-stats .perfect { color: var(--green); font-weight: 700; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.modal-header h3 { flex: 1; font-size: 16px; font-weight: 700; }

.modal-back, .modal-close {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
}

.modal-back:hover, .modal-close:hover { color: var(--text); }
.modal-back.hidden { display: none; }

.selector-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.selector-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 12px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.selector-btn:hover { border-color: var(--accent); color: var(--accent); }
.selector-btn.current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Wrong Answers ===== */
.wrong-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.wrong-section.hidden { display: none; }
.wrong-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.wrong-title { font-size: 14px; font-weight: 700; color: var(--text); }
.wrong-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.wrong-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
  border: 1px solid transparent;
}
.wrong-item:hover { border-color: var(--accent); }
.wrong-ref { font-weight: 600; color: var(--text); }
.wrong-count { color: var(--red); font-weight: 700; font-size: 12px; }
.wrong-preview { color: var(--text3); font-size: 12px; margin-left: 8px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Text Input Modal ===== */
.text-modal { max-width: 640px; }

.text-modal-body { padding: 20px; }

.text-modal-guide {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.guide-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.guide-example {
  font-size: 13px;
  color: var(--accent);
  font-family: monospace;
  line-height: 1.8;
  margin-bottom: 8px;
}

.guide-note {
  font-size: 12px;
  color: var(--text3);
}

.text-input-area {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.text-input-area:focus { border-color: var(--accent); }

.text-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.text-parse-info {
  font-size: 13px;
  color: var(--text3);
}

.text-parse-info.success { color: var(--green); }
.text-parse-info.error { color: var(--red); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; gap: 10px; }
  .bible-info { flex-direction: column; gap: 8px; align-items: center; }

  .mode-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mode-tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 12px;
    gap: 4px;
    white-space: nowrap;
  }
  .tab svg { width: 14px; height: 14px; }

  .practice-area { padding: 20px 16px; }
  .display-text { font-size: 20px; padding: 16px; line-height: 1.8; }
  .typing-input { font-size: 18px; padding: 14px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }
  .stats-bar { gap: 8px; }
  .tab { font-size: 12px; padding: 8px 6px; }
  .btn-control { font-size: 13px; padding: 12px; }

  .blank-toolbar { flex-direction: column; gap: 12px; }
  .blank-difficulty { justify-content: center; }

  .listen-player { flex-direction: column; }

  .chapter-grid { grid-template-columns: repeat(7, 1fr); }
  .shortcut-hints { display: none; }
  .today-card { padding: 20px 14px; }
  .today-text { font-size: 17px; }
  .today-actions { gap: 6px; }
  .today-btn { padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .progress-modes { grid-template-columns: repeat(2, 1fr); }

  .voice-difficulty { flex-wrap: nowrap; overflow-x: auto; }
  .listen-player { flex-direction: column; gap: 12px; }
  .listen-voice { flex-shrink: 0; }
  .voice-sel { white-space: nowrap; font-size: 12px; }
  .blank-toolbar { flex-wrap: nowrap; }
  .blank-diff-label { font-size: 12px; }
  .diff-btn, .vdiff-btn { width: 32px; height: 32px; font-size: 13px; }

  .selector-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}
