:root {
  --bg: #0f172a;
  --bg-elev: #1e293b;
  --bg-hi: #334155;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #10b981;
  --accent-hover: #059669;
  --border: #334155;
  --again: #ef4444;
  --hard: #f59e0b;
  --good: #10b981;
  --easy: #3b82f6;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 22px; }
.title { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }

.countdown-mini {
  background: var(--accent);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
}

nav {
  display: flex;
  padding: 0 24px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

nav button {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 18px;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

nav button:hover { color: var(--text); }
nav button.active { color: var(--accent); border-bottom-color: var(--accent); }

main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px;
  width: 100%;
}

h1 { font-size: 28px; margin-bottom: 16px; letter-spacing: -0.02em; }
h2 { font-size: 20px; margin: 28px 0 14px; color: var(--text); font-weight: 600; }
h3 { font-size: 17px; margin: 18px 0 10px; color: var(--text); font-weight: 600; }
h4 { font-size: 15px; margin: 14px 0 8px; color: var(--text); font-weight: 600; }

p { margin-bottom: 10px; color: var(--text); }
p.lead { color: var(--text-dim); font-size: 16px; margin-bottom: 20px; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--bg-elev) 0%, #2d3e5c 100%);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  border: 1px solid var(--border);
}

.phase-label {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.countdown-hero {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.subtitle { color: var(--text-dim); font-size: 16px; margin-bottom: 8px; }

.exam-banner {
  margin-top: 14px;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  display: inline-block;
}

/* ===== Day progress ===== */
.day-progress {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.day-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.total-time { color: var(--text-dim); }

.progress-bar-wrap {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

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

.done-today {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 20px;
}

.done-today h2 { color: var(--accent); margin: 0 0 6px 0; }
.done-today p { color: var(--text-dim); margin: 0; }

/* ===== Session block ===== */
.session-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
  transition: all 0.15s;
}

.session-block.current {
  border: 2px solid var(--accent);
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, var(--bg-elev) 0%, rgba(16, 185, 129, 0.05) 100%);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.session-block.done {
  opacity: 0.55;
  border-left-color: var(--text-faint);
}

.session-block.done .block-subject { text-decoration: line-through; text-decoration-color: var(--text-faint); }

.block-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

.block-icon { font-size: 26px; line-height: 1; padding-top: 2px; }

.block-title { flex: 1; }

.block-subject {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.block-topic { color: var(--text-dim); font-size: 15px; line-height: 1.35; }

.block-minutes {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-hi);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.now-tag {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.done-tag {
  background: var(--bg-hi);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.block-activity {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.block-ref {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.block-textbook {
  font-size: 13px;
  color: #fcd34d;
  margin-bottom: 14px;
  background: rgba(245, 158, 11, 0.08);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  line-height: 1.45;
}

.textbook-label { font-weight: 700; color: #fbbf24; }

.guide-section-focus {
  animation: flash-section 2.5s ease;
  box-shadow: 0 0 0 2px var(--accent);
}
@keyframes flash-section {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  30% { box-shadow: 0 0 0 3px var(--accent); }
  70% { box-shadow: 0 0 0 3px var(--accent); }
}

.ref-label { font-weight: 600; }

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

.btn-action {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hi);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  min-width: 120px;
}

.btn-action:hover { background: var(--border); }

.btn-read { background: var(--bg-hi); }
.btn-read:hover { background: var(--border); }
.btn-quiz { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; }
.btn-quiz:hover { background: rgba(59, 130, 246, 0.25); }
.btn-done { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
.btn-done:hover { background: rgba(16, 185, 129, 0.25); }
.btn-undo { background: var(--bg-hi); color: var(--text-dim); }

/* ===== Empty state ===== */
.empty-state {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius);
  text-align: center;
}

.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--text-dim); }

/* ===== Tomorrow preview ===== */
.tomorrow-preview { display: flex; flex-direction: column; gap: 6px; }

.tomorrow-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
}

.tomorrow-block .icon-sm { font-size: 18px; }
.minutes-sm { margin-left: auto; font-size: 12px; color: var(--text-faint); }

/* ===== Grid + subject button ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

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

.subject-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
  text-align: left;
}

.subject-btn:hover { background: var(--bg-hi); }
.subject-btn .icon-sm { font-size: 20px; }
.subject-btn .badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* ===== Quiz ===== */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.quiz-header .icon-sm { font-size: 22px; }
.quiz-header .counter { margin-left: auto; font-weight: 600; }

.flashcard {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin-bottom: 28px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.card-front {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.3;
}

.card-back {
  font-size: 18px;
  color: var(--text-dim);
  padding-top: 20px;
  border-top: 1px solid var(--border);
  width: 100%;
  line-height: 1.5;
}

.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s;
}

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

.btn-big {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 16px;
}

.btn-secondary { background: var(--bg-hi); }
.btn-secondary:hover { background: var(--border); }

.rating {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.btn-again { background: var(--again); }
.btn-hard { background: var(--hard); color: #1e293b; }
.btn-good { background: var(--good); }
.btn-easy { background: var(--easy); }
.btn-again:hover, .btn-hard:hover, .btn-good:hover, .btn-easy:hover { opacity: 0.9; }

.done {
  text-align: center;
  padding: 60px 20px;
}

.done h2 { font-size: 28px; margin-bottom: 16px; }

/* ===== Guide view ===== */
.subject-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.subject-tab {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
}

.subject-tab:hover { color: var(--text); background: var(--bg-hi); }
.subject-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.guide-header {
  padding: 20px 24px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  margin-bottom: 20px;
}

.guide-title {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.guide-icon { font-size: 28px; }
.guide-meta { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }
.guide-intro { color: var(--text); margin: 0; font-size: 15px; line-height: 1.6; }

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.section-link {
  padding: 6px 12px;
  background: var(--bg-hi);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
}

.section-link:hover {
  background: var(--accent);
  color: white;
}

.guide-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  scroll-margin-top: 100px;
}

.guide-section h2 {
  margin-top: 0;
  color: var(--accent);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.guide-body { line-height: 1.7; }
.guide-body h3 { margin-top: 18px; color: var(--text); }
.guide-body h4 { margin-top: 14px; color: var(--text-dim); }

.guide-body p { margin-bottom: 12px; }

.guide-body ul, .guide-body ol {
  margin: 10px 0 14px 22px;
}

.guide-body li {
  margin-bottom: 6px;
  color: var(--text);
}

.guide-body strong { color: var(--text); font-weight: 600; }
.guide-body em { color: var(--text-dim); }
.guide-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.guide-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}

.guide-body th, .guide-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.guide-body th {
  background: var(--bg-hi);
  color: var(--text);
  font-weight: 600;
}

.guide-body td { color: var(--text-dim); }

.guide-actions {
  text-align: center;
  margin: 24px 0;
}

/* ===== Plan view ===== */
.phase-heading {
  color: var(--accent);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.day-detail {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.day-detail.today { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2); }
.day-detail.past { opacity: 0.6; }
.day-detail.done { border-left: 4px solid var(--good); }

.day-detail summary {
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}

.day-detail summary::-webkit-details-marker { display: none; }

.day-label {
  font-weight: 600;
  font-size: 15px;
}

.day-detail.today .day-label::before {
  content: '▸ ';
  color: var(--accent);
}

.day-detail[open] .day-label::before { content: '▾ '; color: var(--accent); }

.day-count {
  color: var(--text-faint);
  font-size: 13px;
  margin-left: auto;
  white-space: nowrap;
}

.check { color: var(--good); font-size: 18px; font-weight: 700; }

.exam-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.exam-in-plan {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 10px;
}

.day-blocks {
  padding: 0 20px 16px;
  border-top: 1px solid var(--border);
}

.plan-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  margin-top: 10px;
}

.plan-block.done { opacity: 0.5; text-decoration: line-through; text-decoration-color: var(--text-faint); }

.plan-block .icon-sm { font-size: 20px; padding-top: 2px; }

.plan-block-content { flex: 1; }

.plan-block-topic {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 2px;
}

.plan-block-activity {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.4;
}

.plan-block-ref {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 4px;
}

.plan-block-time {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding-top: 2px;
}

.plan-block-done {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.plan-block-done:hover { border-color: var(--accent); color: var(--accent); }

.plan-block-done.active {
  background: var(--good);
  border-color: var(--good);
  color: white;
}

/* ===== Progress view ===== */
.points-projection {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  text-align: center;
}

.projection-value {
  font-size: 52px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.projection-label { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.stat-value { font-size: 26px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.stat-label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

.subject-progress {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 18px;
}

.subject-progress .name { font-weight: 600; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.subject-progress .bar-wrap { background: var(--bg); height: 6px; border-radius: 3px; overflow: hidden; }
.subject-progress .bar { height: 100%; transition: width 0.3s; }
.subject-progress .num { color: var(--text-dim); font-size: 13px; white-space: nowrap; }

/* ===== Footer ===== */
footer {
  padding: 14px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

footer .sep { margin: 0 8px; opacity: 0.5; }

kbd {
  background: var(--bg-hi);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'SF Mono', Menlo, monospace;
}

/* ===== Mission & Objectives ===== */
.mission-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-elev) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.mission-heading {
  margin: 0 0 10px 0;
  color: var(--accent);
  font-size: 18px;
}

.mission-intro {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
}

.objectives {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 12px;
}

.objectives h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.objectives-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.objectives-list li {
  padding: 6px 0 6px 24px;
  position: relative;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.objectives-list li::before {
  content: '✓';
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}

/* ===== Tomorrow intro ===== */
.tomorrow-intro {
  color: var(--text-dim);
  margin-bottom: 10px;
  font-style: italic;
  font-size: 14px;
}

/* ===== Guide overview ===== */
.guide-overview {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.guide-overview h2 {
  margin: 0 0 14px 0;
  color: var(--accent);
}

.guide-overview h3 {
  margin-top: 18px;
  color: var(--text);
}

.why-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.arc-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.arc-phase {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
}

.arc-phase-title {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 13px;
}

.arc-phase-hours {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 6px;
}

.arc-phase-focus {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.arc-goal {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: 14px;
  color: var(--text);
}

/* ===== Exam Review ===== */
.review-btn {
  margin-top: 12px;
  background: var(--accent);
  font-size: 15px;
  padding: 14px 24px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dim);
}

.review-counter { font-weight: 600; color: var(--text); }
.review-subject { font-weight: 600; }
.review-marks { font-weight: 700; color: var(--accent); font-size: 15px; }

.exam-question {
  background: #f8fafc;
  color: #0f172a;
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 18px;
  border: 1px solid #cbd5e1;
  position: relative;
}

.exam-question::before {
  content: 'EXAM PAPER';
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: #64748b;
  font-weight: 700;
}

.exam-question-body {
  font-size: 17px;
  line-height: 1.55;
  color: #1e293b;
  font-family: Georgia, 'Times New Roman', serif;
}

.exam-question-body strong { color: #0f172a; }
.exam-question-body p { margin: 0 0 10px 0; color: #1e293b; }

.exam-instructions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
  color: #475569;
  font-size: 14px;
  font-style: italic;
  font-family: Georgia, serif;
}

.exam-answer-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

.exam-label {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 14px;
}

.exam-answer-input {
  width: 100%;
  min-height: 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 14px;
}

.exam-answer-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.exam-reveal {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.user-answer-box, .model-answer-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.user-answer-box { border-left: 3px solid var(--text-faint); }
.model-answer-box { border-left: 3px solid var(--good); }

.answer-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 700;
}

.user-answer-box .answer-label { color: var(--text-faint); }
.model-answer-box .answer-label { color: var(--good); }

.answer-body {
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  white-space: pre-wrap;
}

.model-answer-box .answer-body { white-space: normal; }
.model-answer-box .answer-body p { margin-bottom: 8px; }
.model-answer-box .answer-body strong { color: var(--text); }

.self-rate {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.self-rate p { margin-bottom: 14px; color: var(--text); font-size: 16px; }

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

/* ===== Review summary ===== */
.review-summary {
  text-align: center;
  padding: 20px;
}

.review-score {
  font-size: 72px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin: 20px 0 6px;
}

.review-score-label {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 30px;
}

.review-followups {
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.followup-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0 0;
}

.followup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.followup.wrong { border-left: 3px solid var(--again); }
.followup.hard { border-left: 3px solid var(--hard); }

.followup-status {
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-hi);
}

.followup.wrong .followup-status { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.followup.hard .followup-status { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }

.followup-subject { font-weight: 600; }
.followup-topic { color: var(--text-dim); flex: 1; min-width: 120px; }

.followup-action {
  background: var(--bg-hi);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
}

.followup-action:hover { background: var(--border); }

/* ===== How To view ===== */
.howto-section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 16px;
}

.howto-section h2 {
  margin: 0 0 12px 0;
  color: var(--accent);
  font-size: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.howto-body { line-height: 1.7; font-size: 15px; }
.howto-body p { margin-bottom: 12px; color: var(--text); }
.howto-body strong { color: var(--text); }
.howto-body em { color: var(--text-dim); }
.howto-body ul, .howto-body ol { margin: 10px 0 14px 24px; }
.howto-body li { margin-bottom: 6px; color: var(--text); }

.howto-footer {
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-top: 24px;
}

.howto-footer h3 { margin: 0 0 16px 0; color: var(--text); }

/* ===== Plan intro/objectives in day ===== */
.plan-intro {
  color: var(--text-dim);
  font-style: italic;
  margin: 10px 0 8px;
  font-size: 13px;
  padding: 0 6px;
}

.plan-objectives {
  background: var(--bg);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0 12px;
  font-size: 13px;
}

.plan-obj-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 700;
}

.plan-objectives ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.plan-objectives li {
  padding: 3px 0 3px 18px;
  position: relative;
  color: var(--text);
  font-size: 13px;
}

.plan-objectives li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  header { padding: 10px 16px; }
  .title { font-size: 14px; }
  .countdown-mini { font-size: 11px; padding: 5px 10px; }
  nav button { padding: 11px 12px; font-size: 13px; }
  main { padding: 18px 14px; }
  .hero { padding: 22px; }
  .countdown-hero { font-size: 34px; }
  .card-front { font-size: 22px; }
  .flashcard { padding: 30px 22px; min-height: 200px; }
  .rating { grid-template-columns: repeat(2, 1fr); }
  .block-actions { flex-direction: column; }
  .btn-action { width: 100%; }
  .exam-question { padding: 20px; }
  .exam-question-body { font-size: 16px; }
  .self-rate-buttons { grid-template-columns: 1fr; }
  .review-score { font-size: 56px; }
  .subject-progress { grid-template-columns: 1fr auto; }
  .subject-progress .bar-wrap { grid-column: 1 / -1; }
  .projection-value { font-size: 40px; }
  .guide-section { padding: 18px; }
  .guide-title { font-size: 20px; }
  footer { font-size: 10px; padding: 10px 14px; }
}
