/* ========================================================
   C1 Cambridge Master - CSS Styling
   Mobile-First, Duolingo & Autoškola Inspired
   ======================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #131b2e;
  --bg-card: #182238;
  --bg-card-hover: #1f2c47;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent-blue: #2563eb;
  --accent-blue-light: #3b82f6;
  --accent-blue-dark: #1d4ed8;
  --accent-green: #22c55e;
  --accent-green-bg: rgba(34, 197, 94, 0.15);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.15);
  --accent-orange: #f97316;
  --accent-yellow: #facc15;
  --border-color: #273553;
  --border-focus: #3b82f6;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* App Main Container (Centered for Desktop, 100% for Mobile) */
.app-container {
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-primary);
  padding-bottom: 24px;
}

/* Header (Compact Single-Row Navigation) */
.app-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background-color: rgba(9, 13, 22, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-color);
}

/* 1) Hamburger Dropdown Button (3 minusy pod sebou) */
.hamburger-menu-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  max-width: 120px;
}

.hamburger-menu-btn:active {
  transform: scale(0.96);
  border-color: var(--accent-blue);
}

.hamburger-svg {
  color: #60a5fa;
  flex-shrink: 0;
}

.hamburger-topic-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2) Mode Toggle Button (Studovna <-> Testy) */
.mode-toggle-btn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(30, 58, 138, 0.4));
  border: 1.5px solid var(--accent-blue-light);
  color: #ffffff;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.mode-toggle-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.mode-toggle-btn:active {
  transform: scale(0.96);
}

.mode-toggle-btn.in-theory {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.25), rgba(21, 128, 61, 0.4));
  border-color: var(--accent-green);
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
}

/* 3) Header Stats & Sound (Kompaktní) */
.header-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.stat-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 800;
}

.sound-mini-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: all 0.15s;
  flex-shrink: 0;
}

.sound-mini-btn:hover, .sound-mini-btn:active {
  background: var(--bg-card);
  border-color: var(--accent-blue);
}

.streak-badge {
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.3);
  background: rgba(249, 115, 22, 0.08);
}

.streak-badge .badge-icon {
  animation: pulseFlame 1.8s infinite ease-in-out;
}

@keyframes pulseFlame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.goal-badge {
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

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

/* Session Progress Line */
.session-progress-container {
  width: 100%;
  height: 4px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.session-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  transition: width 0.3s ease-out;
}

/* Quiz Main Area */
.quiz-main {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease-out;
}

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

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.category-tag {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.counter-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.instruction-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 16px;
}

/* Transformation Prompt Box */
.prompt-context-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-blue);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
}

.prompt-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.prompt-text {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-main);
  margin-bottom: 8px;
}

.prompt-keyword-box {
  font-size: 0.85rem;
  color: var(--accent-yellow);
}

/* Question Sentence */
.question-text {
  font-size: 1.15rem;
  line-height: 1.55;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 24px;
}

.blank-highlight {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0 10px;
  margin: 0 4px;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.14);
  border-bottom: 2.5px solid #60a5fa;
  border-radius: 6px 6px 2px 2px;
  letter-spacing: 1px;
  vertical-align: baseline;
  white-space: nowrap;
}

/* Options Container (A, B, C, D) */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue-light);
  transform: translateY(-1px);
}

.option-btn:active {
  transform: scale(0.98);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #93c5fd;
  flex-shrink: 0;
}

/* Correct / Incorrect states for buttons */
.option-btn.selected-correct {
  background: var(--accent-green-bg) !important;
  border-color: var(--accent-green) !important;
  color: #4ade80 !important;
}
.option-btn.selected-correct .option-letter {
  background: var(--accent-green);
  color: #000;
  border-color: var(--accent-green);
}

.option-btn.selected-wrong {
  background: var(--accent-red-bg) !important;
  border-color: var(--accent-red) !important;
  color: #f87171 !important;
}
.option-btn.selected-wrong .option-letter {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

.option-btn.highlight-correct {
  border-color: var(--accent-green) !important;
  background: rgba(34, 197, 94, 0.08);
}

/* Text Input Form */
.text-input-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.c1-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1.05rem;
  color: #ffffff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.c1-input:focus {
  border-color: var(--accent-blue-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.primary-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.primary-btn:active {
  transform: scale(0.98);
}

/* Feedback Drawer (Bottom Sheet) */
.feedback-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 100;
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.feedback-sheet.visible {
  transform: translateY(0);
  pointer-events: auto;
}

.feedback-sheet-content {
  width: 100%;
  max-width: 500px;
  background: #111827;
  border-top: 2px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 85vh;
  overflow-y: auto;
}

.feedback-sheet.is-correct .feedback-sheet-content {
  border-top-color: var(--accent-green);
  background: #0f1f18;
}

.feedback-sheet.is-wrong .feedback-sheet-content {
  border-top-color: var(--accent-red);
  background: #201115;
}

.feedback-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-icon {
  font-size: 1.8rem;
}

.status-text-group h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.feedback-sheet.is-correct .status-text-group h3 {
  color: #4ade80;
}

.feedback-sheet.is-wrong .status-text-group h3 {
  color: #f87171;
}

.correct-answer-display {
  font-size: 0.95rem;
  color: #e2e8f0;
  margin-top: 2px;
}

.correct-answer-display strong {
  color: #4ade80;
  font-size: 1.05rem;
}

/* Explanation Box */
.explanation-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
}

.explanation-header {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 6px;
}

.explanation-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #f1f5f9;
}

.tip-badge {
  margin-top: 10px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #fef08a;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.next-btn {
  margin-top: 4px;
  width: 100%;
}

.feedback-sheet.is-correct .next-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

/* Modal Overlay (Topic Selection & Celebration) */
.modal-overlay, .celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.visible, .celebration-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-width: 500px;
  background: #131b2e;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px;
  border-top: 1px solid var(--border-color);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.topic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.topic-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.topic-item:hover, .topic-item.active {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
}

.topic-item.active {
  box-shadow: 0 0 0 2px var(--accent-blue);
}

.topic-icon {
  font-size: 1.5rem;
}

.topic-info strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.topic-info small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Celebration Modal */
.celebration-overlay {
  align-items: center;
  padding: 20px;
}

.celebration-card {
  width: 100%;
  max-width: 400px;
  background: #111827;
  border: 2px solid var(--accent-orange);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(249, 115, 22, 0.4);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.celebration-flame {
  font-size: 4rem;
  margin-bottom: 10px;
  animation: pulseFlame 1.2s infinite ease-in-out;
}

.celebration-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.celebration-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.celebration-streak-number {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fb923c;
  background: rgba(249, 115, 22, 0.15);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.celebration-note {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 20px;
}

.celebration-btn {
  width: 100%;
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
}




/* ========================================================
   Theory / Learning Database Views
   ======================================================== */
.theory-view {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theory-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
}

.theory-header-card h2 {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 6px;
}

.theory-header-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.4;
}

.theory-search-bar {
  margin-bottom: 12px;
}

.theory-search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #fff;
  outline: none;
}

.theory-search-input:focus {
  border-color: var(--accent-blue-light);
}

.theory-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.75) rgba(255, 255, 255, 0.07);
}

.theory-chips.is-dragging {
  cursor: grabbing;
}

.theory-chips::-webkit-scrollbar {
  height: 7px;
}

.theory-chips::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-full);
}

.theory-chips::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.7);
  border-radius: var(--radius-full);
}

.theory-chips::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.95);
}

.chip {
  flex-shrink: 0;
  touch-action: pan-x pan-y;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover, .chip.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

/* Theory Cards Container */
.theory-cards-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theory-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.theory-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.theory-card-icon {
  font-size: 1.8rem;
}

.theory-card-title h3 {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 800;
  margin-bottom: 4px;
}

.theory-card-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.theory-formula-badge {
  background: rgba(37, 99, 235, 0.15);
  border: 1px dashed var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #93c5fd;
  margin-bottom: 16px;
  display: inline-block;
  width: 100%;
}

.theory-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  margin-top: 14px;
}

.theory-section h4 {
  font-size: 0.98rem;
  color: #facc15;
  margin-bottom: 8px;
}

.theory-section-content {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.rule-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--accent-blue-light);
  padding: 10px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 10px 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.trap-box {
  background: rgba(239, 68, 68, 0.12);
  border-left: 3px solid var(--accent-red);
  padding: 10px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 10px 0;
  font-size: 0.85rem;
  color: #fca5a5;
  line-height: 1.45;
}

.example-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 6px 0;
}

.example-item .en {
  color: #67e8f9;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.example-item .cz {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

.table-container, .table-wrap {
  overflow-x: auto;
  margin: 10px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

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

.theory-table th {
  background: var(--bg-secondary);
  color: #93c5fd;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
}

.theory-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

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

.practice-topic-btn {
  margin-top: 14px;
  width: 100%;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid var(--accent-blue);
  color: #93c5fd;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.practice-topic-btn:hover {
  background: var(--accent-blue);
  color: #fff;
}

/* ========================================================
   Certin90 Additions: Badges, State Cards, Diagnostics & Left Settings Menu
   ======================================================== */

.meta-left-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.level-mini-tag {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.level-mini-tag.is-b2 {
  background: linear-gradient(135deg, #059669, #047857);
}

.phase-banner {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.secondary-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}

.secondary-btn:hover {
  background: #1e293b;
  border-color: var(--accent-blue-light);
}

/* Round Summary / Repair / Completion State Card */
.state-card, .diagnostic-card {
  text-align: center;
  padding: 26px 20px;
}

.state-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.state-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.state-desc {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.state-stats-pill {
  display: inline-block;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 20px;
}

.state-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* Diagnostic Results */
.diagnostic-card {
  text-align: left;
}

.diagnostic-header {
  text-align: center;
  margin-bottom: 14px;
}

.diagnostic-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.diag-overall-score {
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 14px;
}

.diag-recommendations {
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: #fde68a;
  line-height: 1.45;
  margin-bottom: 16px;
}

.diag-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.diag-row {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.diag-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #f8fafc;
}

.diag-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.diag-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.35s ease;
}

.diag-bar-fill.is-weak { background: #ef4444; }
.diag-bar-fill.is-mid { background: #f59e0b; }
.diag-bar-fill.is-strong { background: #22c55e; }

.theory-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

/* Full-Page Left Menu & Settings Overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  z-index: 250;
  display: flex;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.menu-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.menu-page {
  width: 100%;
  max-width: 560px;
  height: 100%;
  background: #0d1323;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transform: translateX(-24px);
  transition: transform 0.22s ease;
}

.menu-overlay.visible .menu-page {
  transform: translateX(0);
}

.menu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: #131b2e;
  border-bottom: 1px solid var(--border-color);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-size: 1.7rem;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.3px;
}

.brand-tagline {
  font-size: 0.74rem;
  color: #93c5fd;
  font-weight: 600;
}

.menu-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 16px));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 800;
  padding-left: 4px;
}

.level-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.level-pill {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.15s;
}

.level-pill strong {
  font-size: 0.96rem;
  color: #fff;
}

.level-pill small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.level-pill.active[data-level="b2"] {
  background: rgba(5, 150, 105, 0.18);
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
}

.level-pill.active[data-level="c1"] {
  background: rgba(37, 99, 235, 0.22);
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.topic-item {
  width: 100%;
  text-align: left;
}

.topic-info {
  flex: 1;
  min-width: 0;
}

.topic-status-pill {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  white-space: nowrap;
}

.topic-status-pill.is-done {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.topic-progress-wrap {
  margin-top: 6px;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.topic-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: var(--radius-full);
}

.topic-progress-fill.is-mastered {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.settings-row-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-row-info strong {
  font-size: 0.9rem;
  color: #fff;
}

.settings-row-info small {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.mini-action-btn {
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid var(--accent-blue);
  color: #93c5fd;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.coming-soon-pill {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #d8b4fe;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.danger-card {
  border-color: rgba(239, 68, 68, 0.28);
}

.danger-mini-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* Onboarding Modal */
.onboarding-card {
  max-width: 440px;
}

.onboarding-levels {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.onboarding-level-btn {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, transform 0.1s;
}

.onboarding-level-btn:hover {
  border-color: var(--accent-blue-light);
  transform: translateY(-1px);
}

.onboarding-level-btn strong {
  font-size: 1.02rem;
  color: #ffffff;
}

.onboarding-level-btn span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================================
   Cloud Sync & AI Essay Lab Styles
   ======================================================== */

.cloud-sync-card {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.cloud-sync-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sync-status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  white-space: nowrap;
}

.sync-status-pill.is-online {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.sync-status-pill.is-pro {
  background: rgba(250, 204, 21, 0.2);
  color: #fde047;
}

.cloud-auth-form,
.cloud-signed-in-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-inputs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.auth-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #f8fafc;
  padding: 9px 11px;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.auth-input:focus {
  border-color: var(--accent-blue-light);
}

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

.secondary-mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cloud-user-line {
  font-size: 0.84rem;
  color: #93c5fd;
  font-weight: 600;
  word-break: break-all;
}

.cloud-auth-msg {
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #bfdbfe;
  line-height: 1.4;
  text-align: left;
}

.cloud-auth-msg.is-error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.cloud-auth-msg.is-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

/* AI Essay Lab Modal */
.essay-modal-card {
  max-width: 560px;
  width: 94%;
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.essay-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.essay-modal-top h2 {
  font-size: 1.2rem;
  margin: 0;
}

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

.essay-auth-notice {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #fde68a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.essay-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.essay-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.45;
}

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

.essay-word-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.essay-submit-btn {
  width: auto;
  padding: 10px 16px;
  font-size: 0.88rem;
}

.essay-result-container {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.essay-scores-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.essay-score-pill {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #e2e8f0;
}

.essay-score-pill strong {
  color: #60a5fa;
}

.essay-upgrade-item {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent-blue-light);
  padding: 7px 9px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 6px;
}

.essay-history-container {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.essay-history-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text-primary);
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.essay-history-item strong {
  color: #60a5fa;
  white-space: nowrap;
}

.essay-history-item:hover {
  border-color: var(--accent-blue-light);
  background: rgba(59, 130, 246, 0.12);
}

/* ========================================================
   PWA Update Banner, Auth Extras, Writing Lab 2.0 & Legal
   ======================================================== */

.pwa-update-banner {
  background: rgba(37, 99, 235, 0.22);
  border-bottom: 1px solid rgba(96, 165, 250, 0.45);
  color: #e0f2fe;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.google-oauth-btn {
  width: 100%;
  background: #ffffff;
  color: #111827;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}

.google-oauth-btn:hover {
  opacity: 0.94;
}

.google-oauth-btn:active {
  transform: scale(0.99);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
  margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.link-mini-btn {
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  margin-left: auto;
}

.legal-inline-note {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.legal-inline-note a,
.menu-legal-links a {
  color: #93c5fd;
  text-decoration: none;
}

.legal-inline-note a:hover,
.menu-legal-links a:hover {
  text-decoration: underline;
}

.menu-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 6px 0 4px;
}

.essay-prompt-bar {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.essay-prompt-bar .auth-input {
  flex: 1;
  min-width: 0;
}

.essay-word-count.is-target {
  color: #4ade80;
}

.essay-word-count.is-over {
  color: #fbbf24;
}

.essay-orig-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.essay-orig-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: #93c5fd;
}

.essay-orig-text {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  line-height: 1.45;
}

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

/* ========================================================
   Landing Page (Single-Domain Public Entry)
   ======================================================== */

.landing-view {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.18), transparent 42%),
    radial-gradient(circle at 85% 22%, rgba(16, 185, 129, 0.11), transparent 36%),
    var(--bg-primary);
  color: var(--text-primary);
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(9, 13, 22, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.landing-nav-inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.08rem;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.landing-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.landing-links a:hover {
  color: #fff;
}

.landing-cta-sm {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 15px;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.landing-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 42px 20px 64px;
}

.landing-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 56px;
}

.landing-eyebrow {
  display: inline-block;
  padding: 5px 13px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.landing-hero h1 {
  font-size: clamp(1.85rem, 4.4vw, 2.85rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 16px;
}

.landing-lead {
  font-size: 1.03rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 26px;
}

.landing-hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.landing-hero-btn {
  width: auto;
  min-width: 230px;
  padding: 13px 22px;
}

.landing-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.landing-stats-strip > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.landing-stats-strip strong {
  font-size: 1.15rem;
  color: #fff;
}

.landing-stats-strip span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.landing-section {
  margin-top: 56px;
}

.landing-section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 24px;
}

.landing-section-head h2 {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 8px;
}

.landing-section-head p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.landing-demo-card {
  max-width: 620px;
  margin: 0 auto;
}

.landing-demo-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.5;
}

.landing-demo-feedback.is-ok {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #dcfce7;
}

.landing-demo-feedback.is-wrong {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fee2e2;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.landing-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.landing-feature-card h3 {
  font-size: 1.02rem;
  color: #fff;
  margin-bottom: 8px;
}

.landing-feature-card p {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 780px;
  margin: 0 auto;
}

.landing-price-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.landing-price-card.is-pro-card {
  border-color: rgba(168, 85, 247, 0.45);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), var(--bg-card));
}

.price-tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.price-tier {
  font-size: 0.92rem;
  font-weight: 800;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.price-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}

.price-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.price-list li {
  font-size: 0.87rem;
  color: #cbd5e1;
  padding-left: 18px;
  position: relative;
  line-height: 1.4;
}

.price-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #4ade80;
  font-weight: 800;
}

.landing-faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.landing-faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.landing-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.94rem;
  color: #fff;
}

.landing-faq-item p {
  margin-top: 10px;
  font-size: 0.87rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.landing-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 20px 36px;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.landing-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.landing-footer-links a {
  color: #93c5fd;
  text-decoration: none;
}

.landing-footer-links a:hover {
  text-decoration: underline;
}

@media (max-width: 680px) {
  .landing-links {
    display: none;
  }
  .landing-stats-strip,
  .landing-features-grid,
  .landing-pricing-grid {
    grid-template-columns: 1fr;
  }
  .essay-prompt-bar {
    flex-direction: column;
  }
}

/* ========================================================
   Legal Documents (terms.html, privacy.html)
   ======================================================== */

.legal-page-body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 24px 16px 56px;
}

.legal-shell {
  max-width: 780px;
  margin: 0 auto;
}

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

.legal-back-link,
.legal-alt-link {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.legal-back-link:hover,
.legal-alt-link:hover {
  text-decoration: underline;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  line-height: 1.65;
}

.legal-card h1 {
  font-size: 1.55rem;
  color: #fff;
  margin-bottom: 6px;
}

.legal-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.legal-notice-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.86rem;
  color: #fde68a;
  margin-bottom: 20px;
}

.legal-card h2 {
  font-size: 1.08rem;
  color: #93c5fd;
  margin: 22px 0 8px;
}

.legal-card p,
.legal-card li {
  font-size: 0.92rem;
  color: #e2e8f0;
  margin-bottom: 10px;
}

.legal-card ul {
  padding-left: 20px;
}

.legal-card a {
  color: #60a5fa;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 0.84rem;
  color: #e2e8f0;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--border-color);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.legal-table td {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.45);
}

.legal-table th {
  background: rgba(37, 99, 235, 0.15);
  color: #93c5fd;
}
