/* ==========================================================================
   RECALLER — MINIMAL DUAL-TONE BLACK & WHITE THEME
   Sophisticated, timeless typography & high contrast layout
   ========================================================================== */

:root {
  /* DARK THEME (DEFAULT DUAL TONE) */
  --bg-primary: #050505;
  --bg-surface: #101012;
  --bg-subtle: #17171a;
  --bg-hover: #222226;
  
  --border-light: #242429;
  --border-strong: #38383e;
  
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --accent-contrast: #ffffff;
  --accent-contrast-inv: #000000;
  
  --ring-bg: #1c1c20;
  --ring-active: #ffffff;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Space Mono', Menlo, Monaco, Consolas, monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.6);
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  /* LIGHT THEME (STARK WHITE DUAL TONE) */
  --bg-primary: #ffffff;
  --bg-surface: #f9f9fb;
  --bg-subtle: #f0f0f4;
  --bg-hover: #e5e5ea;
  
  --border-light: #e4e4e7;
  --border-strong: #d4d4d8;
  
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  
  --accent-contrast: #09090b;
  --accent-contrast-inv: #ffffff;
  
  --ring-bg: #ebebf0;
  --ring-active: #09090b;
  
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.08);
}

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

html, body {
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Outer Layout */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.app-header {
  height: 64px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-glyph {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.glyph-circle {
  width: 8px;
  height: 8px;
  background: var(--accent-contrast);
  border-radius: 50%;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-primary);
  line-height: 1;
}

.brand-tag {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* Navigation Switcher */
.nav-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 3px;
  border-radius: var(--radius-full);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
}

.nav-icon {
  width: 15px;
  height: 15px;
}

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

.nav-btn.active {
  background: var(--accent-contrast);
  color: var(--accent-contrast-inv);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Header Action Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Theme Toggle specifics */
[data-theme="dark"] .theme-icon-sun {
  display: block;
}
[data-theme="dark"] .theme-icon-moon {
  display: none;
}
[data-theme="light"] .theme-icon-sun {
  display: none;
}
[data-theme="light"] .theme-icon-moon {
  display: block;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
}

.view-panel {
  display: none;
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

.view-panel.active {
  display: block;
}

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

/* ==========================================================================
   GENERIC BUTTONS & FORMS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent-contrast);
  color: var(--accent-contrast-inv);
  border-color: var(--accent-contrast);
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

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

.btn-subtle {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-subtle:hover {
  background: var(--bg-hover);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-large {
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.btn-danger-hover:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Inputs & Form Elements */
.clean-input, .clean-textarea, .clean-select {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  outline: none;
}

.clean-input:focus, .clean-textarea:focus, .clean-select:focus {
  border-color: var(--accent-contrast);
  background: var(--bg-surface);
}

.clean-textarea {
  resize: vertical;
}

.clean-select {
  cursor: pointer;
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field-item label, .field-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
}

.clean-divider {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 1.5rem 0;
}

/* ==========================================================================
   1. POMODORO VIEW
   ========================================================================== */
.pomodoro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  margin: 1rem auto 0;
  text-align: center;
}

.pomo-modes {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 3px;
  border-radius: var(--radius-full);
  margin-bottom: 2.5rem;
}

.pomo-mode-btn {
  padding: 0.4rem 1.1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-main);
}

.pomo-mode-btn:hover {
  color: var(--text-primary);
}

.pomo-mode-btn.active {
  background: var(--accent-contrast);
  color: var(--accent-contrast-inv);
  font-weight: 600;
}

/* Clock Dial */
.clock-display-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--ring-bg);
  stroke-width: 4px;
}

.progress-ring-bar {
  fill: none;
  stroke: var(--ring-active);
  stroke-width: 4px;
  stroke-linecap: round;
  stroke-dasharray: 879.6;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s linear;
}

.clock-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.time-readout {
  font-family: var(--font-mono);
  font-size: 3.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.time-label {
  margin-top: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--text-muted);
}

.pomo-counter {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.study-focus-target {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  text-align: left;
}

.target-title {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.target-selector-row {
  display: flex;
  gap: 0.6rem;
}

.keyboard-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-primary);
}

/* ==========================================================================
   2. FLASHCARDS VIEW
   ========================================================================== */
.flashcards-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.decks-header-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.deck-selector-area {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 280px;
}

.select-with-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.deck-dropdown {
  max-width: 260px;
}

.deck-actions-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Study Card Viewport */
.study-card-viewport {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.study-progress-row {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-counter-badge, .study-stats-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.progress-bar-track {
  flex: 1;
  height: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-contrast);
  transition: width 0.3s ease;
}

/* 3D Flip Card Scene */
.card-3d-scene {
  width: 100%;
  max-width: 680px;
  height: 380px;
  perspective: 1200px;
}

.flip-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  outline: none;
}

.flip-card:focus-visible {
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 2px var(--accent-contrast);
}

.flip-card.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  user-select: none;
}

.card-back {
  transform: rotateY(180deg);
  background: var(--bg-subtle);
  border-color: var(--accent-contrast);
}

.card-face-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-side-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--text-muted);
}

.card-deck-name-tag {
  font-size: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.card-body-text {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  text-align: center;
  max-height: 200px;
  overflow-y: auto;
  padding: 0 1rem;
}

.card-hint-row {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px dashed var(--border-strong);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.hint-label {
  font-weight: 600;
  color: var(--text-muted);
}

.card-face-footer {
  text-align: center;
}

.card-flip-prompt {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Card Navigation & Assessment */
.card-nav-controls {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.assessment-buttons {
  display: flex;
  gap: 0.5rem;
}

.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dot-review {
  background: #f59e0b;
}

.dot-mastered {
  background: var(--accent-contrast-inv);
}

/* Empty State */
.empty-state-card {
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  margin-top: 1rem;
}

.empty-glyph {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.empty-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   3. QUIZZES VIEW
   ========================================================================== */
.quizzes-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Quiz Hub Grid */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.quiz-hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.quiz-hub-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.quiz-hub-top {
  margin-bottom: 1.25rem;
}

.quiz-card-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.quiz-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.4rem 0 0.5rem;
  color: var(--text-primary);
}

.quiz-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.quiz-hub-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.quiz-count-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Active Quiz Runner */
.quiz-runner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.quiz-meta-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quiz-title-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.quiz-counter-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.quiz-score-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.quiz-active-question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-card);
}

.question-header {
  margin-bottom: 0.75rem;
}

.question-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--text-muted);
}

.question-prompt {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 1.75rem;
}

/* Options */
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-option-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent-contrast);
  transform: translateX(3px);
}

.option-key-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  flex-shrink: 0;
}

.quiz-option-btn.selected-correct {
  background: var(--accent-contrast);
  color: var(--accent-contrast-inv);
  border-color: var(--accent-contrast);
  font-weight: 600;
}

.quiz-option-btn.selected-correct .option-key-badge {
  background: var(--accent-contrast-inv);
  color: var(--accent-contrast);
  border-color: transparent;
}

.quiz-option-btn.selected-wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: var(--text-primary);
}

.quiz-option-btn.correct-reveal {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* Feedback box */
.answer-feedback-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-primary);
}

.feedback-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.feedback-badge.correct {
  color: #10b981;
}

.feedback-badge.incorrect {
  color: #ef4444;
}

.feedback-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.feedback-action {
  display: flex;
  justify-content: flex-end;
}

/* Quiz Summary Card */
.quiz-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.summary-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.summary-score-title {
  font-size: 3.5rem;
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}

.summary-score-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.summary-grade-message {
  display: inline-block;
  margin: 1.25rem 0 2rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 500;
}

.summary-breakdown {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.breakdown-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.breakdown-q {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.breakdown-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.summary-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  height: 48px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-primary);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.75rem;
  transition: color var(--transition-fast);
}

.footer-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.footer-version {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ==========================================================================
   MODAL / DIALOGS
   ========================================================================== */
.modal-dialog {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 0;
  max-width: 520px;
  width: calc(100% - 2rem);
  margin: auto;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.modal-dialog.modal-large {
  max-width: 780px;
}

.modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-content {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-primary);
}

/* Settings Specifics */
.setting-group {
  margin-bottom: 1.5rem;
}

.setting-subtitle {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.durations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 0.875rem;
  cursor: pointer;
}

.clean-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-contrast);
  cursor: pointer;
}

.setting-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

/* Manage Cards Table */
.manage-cards-toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
}

.cards-table-container {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-height: 360px;
  overflow-y: auto;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.clean-table th {
  background: var(--bg-subtle);
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  position: sticky;
  top: 0;
}

.clean-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.clean-table tr:last-child td {
  border-bottom: none;
}

.table-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  border-radius: 4px;
}

.table-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.table-action-btn.btn-danger:hover {
  color: #ef4444;
}

/* Quiz Builder Questions */
.questions-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.builder-questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.builder-q-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.builder-q-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.builder-q-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.builder-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.builder-option-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.builder-radio {
  accent-color: var(--accent-contrast);
  cursor: pointer;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 0 1rem;
    height: auto;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 0.75rem;
  }
  
  .nav-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .card-3d-scene {
    height: 320px;
  }

  .card-face {
    padding: 1.5rem;
  }

  .card-body-text {
    font-size: 1.15rem;
  }

  .builder-options-grid {
    grid-template-columns: 1fr;
  }

  .durations-grid {
    grid-template-columns: 1fr;
  }

  .app-footer {
    padding: 0 1rem;
    flex-direction: column;
    height: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 0.5rem;
    text-align: center;
  }
}
