/* =========================================
   LAKSHYAONE — Dashboard CSS
   ========================================= */

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

:root {
  /* ── Backgrounds ── */
  --bg:           #0D0D0D;
  --card:         #141414;
  --surface:      #1C1C1C;
  --elevated:     #242424;

  /* ── Typography ── */
  --text:         #F0F0F0;
  --secondary:    #888888;

  /* ── Structure ── */
  --border:       #2A2A2A;
  --border-hi:    #383838;

  /* ── Accent — Apple Blue ── */
  --primary:      #4E5FC0;
  --primary-hover:#0070E0;
  --primary-rgb:  78,95,192;

  /* ── Semantic status ── */
  --success:      #30D158;
  --warning:      #FFD60A;
  --danger:       #FF453A;

  /* ── Shape ── */
  --radius:       12px;
  --radius-sm:    8px;

  /* ── Shadows ── */
  --shadow:       0 1px 4px rgba(0,0,0,.6);
  --shadow-hover: 0 4px 16px rgba(0,0,0,.6);

  --nav-h:        60px;
  --font: 'Manrope', -apple-system, "SF Pro Display", "SF Pro Text", BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── NAVIGATION ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  /* Opaque, no backdrop-filter: a translucent sticky bar with backdrop-filter
     intermittently vanishes on scroll in Chrome. Solid background is stable. */
  background: #0D0D0D;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.nav-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 640px) {
  .nav-center { display: none; }
  .nav-inner  { justify-content: space-between; }
}

.nav-link {
  text-decoration: none;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}

.nav-link:hover  { color: var(--text); background: rgba(255,255,255,.04); }
.nav-link.active { color: var(--primary); background: rgba(78,95,192,.08); }

.nav-right { display: flex; align-items: center; gap: 10px; position: relative; }

.nav-avatar {
  width: 32px; height: 32px;
  background: var(--surface);
  color: var(--text);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s, box-shadow .15s;
}
.nav-avatar:hover { opacity: .85; }

.nav-logout-btn {
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  transition: background .15s, color .15s;
}
.nav-logout-btn:hover { background: rgba(255,69,58,.12); color: var(--danger); }

/* ── MAIN LAYOUT ── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── HERO ── */
.hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  position: relative;
}

.hero-left { flex: 1; position: relative; z-index: 1; }

.hero-exam-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--elevated);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--border-hi);
  letter-spacing: .2px;
}

.hero-exam-dot {
  width: 7px; height: 7px;
  background: #30D158;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

.hero-headline {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
}

.hero-days {
  font-size: 80px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -4px;
  color: var(--text);
}

.hero-days-label {
  font-size: 22px;
  font-weight: 300;
  color: var(--secondary);
}

.hero-subtext {
  color: var(--secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

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

.hero-progress-bar {
  flex: 1;
  max-width: 260px;
  height: 3px;
  background: var(--elevated);
  border-radius: 2px;
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width .6s ease;
}

.hero-progress-label {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.hero-right { position: relative; z-index: 1; text-align: center; }

.hero-clock { display: flex; align-items: center; gap: 4px; }

.hero-clock-unit { display: flex; flex-direction: column; align-items: center; }

.hero-clock-num {
  font-size: 42px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: center;
}

.hero-clock-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

.hero-clock-sep {
  font-size: 36px;
  color: var(--border-hi);
  font-weight: 300;
  line-height: 1;
  margin-bottom: 16px;
}

.hero-clock-label {
  color: var(--secondary);
  font-size: 12px;
  margin-top: 8px;
}

/* ── STAT ROW ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 22px 18px;
  transition: border-color .15s;
}

.stat-card:hover { border-color: var(--border-hi); }

/* PYQ Rank is a 5th card in a 4-column grid — span the full row instead of
   wrapping alone with empty space beside it, and center its content so it
   reads as an intentional highlight banner rather than a stretched tile. */
#pyq-rank-card { grid-column: 1 / -1; }
#pyq-rank-card .stat-value,
#pyq-rank-card .stat-sub,
#pyq-rank-card .stat-footer { text-align: center; }

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

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.stat-icon { font-size: 18px; }

.stat-value {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-value-denom {
  font-size: 22px;
  font-weight: 400;
  color: var(--secondary);
  letter-spacing: -1px;
}

.stat-sub { font-size: 13px; color: var(--secondary); margin-bottom: 14px; }

.stat-footer { font-size: 12px; color: var(--secondary); margin-top: 8px; }
.stat-footer strong { color: var(--text); }
.success-text { color: var(--success) !important; font-weight: 500; }
.warning-text { color: var(--warning) !important; font-weight: 500; }

/* Streak dots */
.streak-dots { display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0 6px; }

.streak-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.streak-dot.active { background: var(--warning); }
.streak-dot.today  { background: var(--primary); }

/* Readiness ring */
.readiness-ring-wrap {
  position: relative;
  width: 100px;
  margin: 4px auto 4px;
}

.readiness-ring { display: block; }

.ring-bg  { fill: none; stroke: var(--border); stroke-width: 10; }

.ring-fill {
  fill: none;
  stroke: var(--warning);
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset .8s ease;
}

.readiness-score-inner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.readiness-num {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.readiness-denom { font-size: 11px; color: var(--secondary); font-weight: 500; }
.readiness-status { text-align: center; }

/* Mini bars */
.tasks-mini-bar-wrap { margin: 12px 0 6px; }

.tasks-mini-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.tasks-mini-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width .5s ease;
}

/* ── BOTTOM GRID ── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  align-items: start;
}

/* ── CARD BASE ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px;
  transition: border-color .15s;
}

.card:hover {
  border-color: var(--border-hi);
}

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

.card-title { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -0.3px; }
.card-subtitle { font-size: 13px; color: var(--secondary); margin-top: 3px; }

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tasks-complete-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── ADD TASK BUTTON ── */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}

.btn-add:hover  { background: var(--primary-hover); }
.btn-add:active { transform: scale(.97); }

.task-add-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.task-add-form.hidden { display: none; }

.task-input {
  flex: 1;
  min-width: 180px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 0 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}

.task-input:focus { border-color: var(--primary); }

.task-subject-select {
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  outline: none;
  cursor: pointer;
}

.task-subject-select:focus { border-color: var(--primary); }

.btn-confirm {
  height: 38px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

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

.btn-cancel {
  height: 38px;
  padding: 0 14px;
  background: transparent;
  color: var(--secondary);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.btn-cancel:hover { background: var(--bg); color: var(--text); }

/* ── TASK LIST ── */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Empty state */
.task-empty {
  list-style: none;
  text-align: center;
  padding: 32px 16px;
  color: var(--secondary);
  font-size: 14px;
}

/* Per-subject score inputs inside the Log Mock modal */
.mock-subject-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

/* ── Mock modal: type chooser + chapter-wise flow ──────────────────────── */

.mock-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .mock-type-grid { grid-template-columns: 1fr; } }

.mock-type-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: var(--card2, #1C1C1F);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 18px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text, #F5F5F7);
  transition: border-color .15s, background .15s, transform .1s;
}
.mock-type-card:hover {
  border-color: var(--primary, #4E5FC0);
  background: rgba(78,95,192,.08);
  transform: translateY(-1px);
}
.mock-type-emoji { font-size: 26px; }
.mock-type-name  { font-size: 14.5px; font-weight: 700; }
.mock-type-sub   { font-size: 12px; color: var(--secondary, #8E8EA0); line-height: 1.4; }

.chmock-hint { font-size: 12.5px; color: var(--secondary, #8E8EA0); margin: 0 0 12px; line-height: 1.5; }

/* Subject checklists (collapsible) */
.chmock-subject {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.chmock-subject summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px; font-weight: 600;
  list-style: none;
  user-select: none;
}
.chmock-subject summary::-webkit-details-marker { display: none; }
.chmock-subject[open] summary { border-bottom: 1px solid rgba(255,255,255,.07); }
.chmock-count { font-size: 11.5px; color: var(--primary, #4E5FC0); font-weight: 700; }

.chmock-chapter-list {
  max-height: 220px; overflow-y: auto;
  padding: 6px 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
@media (max-width: 560px) { .chmock-chapter-list { grid-template-columns: 1fr; } }

.chmock-chapter-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
}
.chmock-chapter-item:hover { background: rgba(255,255,255,.05); }
.chmock-chapter-item input { accent-color: var(--primary, #4E5FC0); flex-shrink: 0; }

/* Marks entry rows */
.chmock-marks-subject { margin-bottom: 14px; }
.chmock-marks-subject-name {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--secondary, #8E8EA0);
  margin-bottom: 6px;
}
.chmock-marks-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
}
.chmock-marks-chapter {
  flex: 1; min-width: 0; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chmock-marks-row input {
  width: 72px; flex-shrink: 0;
  background: var(--card2, #1C1C1F);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text, #F5F5F7);
  font-size: 13px; font-family: inherit;
}
.chmock-marks-row input:focus { outline: none; border-color: var(--primary, #4E5FC0); }
.chmock-slash { color: var(--secondary, #8E8EA0); }

.chmock-total-row {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 8px; padding-top: 12px;
  font-size: 14px;
}
.chmock-total-row strong { font-size: 17px; color: var(--primary, #4E5FC0); }

/* Skeleton loading rows — shown in place of "Loading…" text while a card's
   real data is still in flight (task list, revision-due card). Self-cleaning:
   the owning render function (renderTasks, renderDueReviews) replaces this
   markup with real content once data arrives, so no JS cleanup is needed. */
.lo-skel-row {
  list-style: none;
  height: 44px;
  border-radius: var(--radius-sm, 10px);
  margin-bottom: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.09) 37%, rgba(255,255,255,.04) 63%);
  background-size: 400% 100%;
  animation: lo-skel-shimmer 1.4s ease-in-out infinite;
}
.lo-skel-review { padding: 4px 4px 8px; }
.lo-skel-review .lo-skel-row:last-child { margin-bottom: 0; width: 70%; }
@keyframes lo-skel-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Teacher-assigned task: amber left border */
.task-source-teacher {
  border-left: 3px solid rgba(255,159,10,.6) !important;
  padding-left: 9px !important;
}

.teacher-task-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--warning, #FF9F0A);
  background: rgba(255,159,10,.1);
  border: 1px solid rgba(255,159,10,.2);
  border-radius: 8px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}

.task-item:hover { background: var(--bg); }

.task-checkbox {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}

.task-item.done .task-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.task-item.done .task-checkbox::after {
  content: '';
  width: 6px; height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.task-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  transition: color .15s;
}

.task-item.done .task-text {
  color: var(--secondary);
  text-decoration: line-through;
}

.task-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .3px;
}

.tag-physics   { background: rgba(90,200,250,.12);  color: #5AC8FA; }
.tag-chemistry { background: rgba(255,214,10,.12);  color: #FFD60A; }
.tag-maths     { background: rgba(48,209,88,.12);   color: #30D158; }
.tag-biology   { background: rgba(62,78,168,.12);  color: #3E4EA8; }
.tag-general   { background: var(--border); color: var(--secondary); }

/* Delete task button */
.task-delete-btn {
  width: 24px; height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.task-item:hover .task-delete-btn { color: var(--secondary); }
.task-delete-btn:hover { background: rgba(255,69,58,.12); color: var(--danger) !important; }

/* ── WEEKLY CARD ── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.badge-green  { background: rgba(48,209,88,.12);  color: var(--success); }
.badge-yellow { background: rgba(255,214,10,.12); color: var(--warning); }

.weekly-goals-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.weekly-goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.weekly-goal-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.weekly-goal-meta  { font-size: 12px; color: var(--secondary); font-weight: 500; }

.weekly-goal-bar {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.weekly-goal-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* Bar chart */
.chart-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 14px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 70px;
}

.bar-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
  justify-content: flex-end;
}

.bar-fill-wrap { width: 100%; display: flex; align-items: flex-end; flex: 1; }

.bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--border);
  transition: height .4s ease;
  min-height: 4px;
}

.bar-fill.today-bar { background: var(--primary); }
.bar-fill.done-bar  { background: rgba(78,95,192,.3); }

.bar-day-label { font-size: 10px; color: var(--secondary); font-weight: 500; }
.bar-day-label.today { color: var(--primary); font-weight: 700; }

/* ── SUBJECTS GRID ── */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.subject-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 18px 20px;
  transition: background .15s, transform .15s;
}

.subject-item:hover { background: #1C1C1E; transform: translateY(-1px); }

.subject-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.subject-emoji { font-size: 22px; }
.subject-pct   { font-size: 13px; font-weight: 700; color: var(--text); }
.subject-name  { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.subject-hrs   { font-size: 12px; color: var(--secondary); margin-bottom: 12px; }

.subject-bar { height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.subject-bar-fill { height: 100%; border-radius: 2px; transition: width .5s ease; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .stat-row    { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .main { padding: 20px 16px 48px; gap: 16px; }

  /* Hero */
  .hero { flex-direction: column; padding: 24px 20px; gap: 20px; text-align: center; border-radius: 16px; }
  .hero-progress-bar-wrap { justify-content: center; }
  .hero-headline { justify-content: center; }
  .hero-days { font-size: 56px; letter-spacing: -3px; }
  .hero-days-label { font-size: 22px; }
  .hero-exam-badge { margin: 0 auto 14px; }
  .hero-clock-num { font-size: 30px; min-width: 46px; }
  .hero-clock-sep { font-size: 28px; }
  .hero-subtext { font-size: 14px; margin-bottom: 16px; }

  /* Stats */
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px 16px 14px; }
  .stat-value { font-size: 34px; }

  /* Cards */
  .card { padding: 18px 16px; }
  .card-header { margin-bottom: 16px; }

  /* Task form — stack vertically on mobile */
  .task-add-form { flex-direction: column; gap: 8px; }
  .task-input { min-width: 0; width: 100%; }
  .task-subject-select { width: 100%; }
  .btn-confirm, .btn-cancel { flex: 1; }

  /* Task header — wrap buttons */
  .tasks-header-actions { flex-wrap: wrap; gap: 6px; }
  .btn-generate-plan, .btn-add { font-size: 12px; padding: 6px 11px; }

  /* Nav */
  .nav-center { display: none; }

  /* Heatmap */
  .heatmap-cell { width: 9px; height: 9px; }
  .heatmap-col  { gap: 2px; }
  .heatmap-grid { gap: 2px; }
  .heatmap-month-row { grid-template-columns: repeat(53, 11px); }
  .heatmap-day-labels { width: 20px; grid-template-rows: repeat(7, 9px); }
  /* Rows shrink to 9px on mobile, so the label line-height has to follow or
     the text overflows its row and the days stop lining up with the cells. */
  .heatmap-day-labels span { line-height: 9px; font-size: 8px; }

  /* Subjects card on dashboard */
  .subjects-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 440px) {
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 28px; letter-spacing: -1px; }
  .stat-value-denom { font-size: 18px; }
  .hero-days { font-size: 48px; }
  .subjects-grid { grid-template-columns: 1fr; }
  .card-title { font-size: 15px; }

  /* Full-width generate button on tiny screens */
  .tasks-header-actions { width: 100%; }
  .btn-generate-plan    { flex: 1; justify-content: center; }
}

/* ── STUDY HEATMAP ── */
.heatmap-card { overflow: hidden; }

/* Months + grid share one scroll column so they stay aligned when scrolled. */
.heatmap-scroll-col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.heatmap-month-row {
  display: grid;
  grid-template-columns: repeat(53, 13px);
  gap: 2px;
  margin-bottom: 3px;
  min-height: 16px;
}

.heatmap-month-row span {
  font-size: 10px;
  color: var(--secondary);
  line-height: 16px;
  white-space: nowrap;
}

.heatmap-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.heatmap-wrapper::-webkit-scrollbar       { height: 3px; }
.heatmap-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.heatmap-day-labels {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  gap: 2px;
  flex-shrink: 0;
  width: 24px;
  /* Pinned while the grid scrolls sideways, so you can always tell which row
     is which day. Pushed down to clear the month-label row above the grid. */
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card, #141414);
  margin-top: 19px;
}

.heatmap-day-labels span {
  font-size: 9px;
  color: var(--secondary);
  line-height: 13px;
  text-align: right;
}

.heatmap-grid {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.heatmap-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.heatmap-cell {
  width: 11px; height: 11px;
  border-radius: 2px;
  background: var(--border);
  transition: opacity .15s;
  cursor: default;
}

.heatmap-cell.active { background: var(--primary); }
.heatmap-cell:hover  { outline: 1px solid rgba(255,255,255,.3); outline-offset: 1px; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 12px;
  justify-content: flex-end;
}

.heatmap-legend-text { font-size: 11px; color: var(--secondary); margin: 0 3px; }

/* ── AI PLAN BUTTON ── */

.tasks-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-generate-plan {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(78,95,192,.1);
  border: 1.5px solid rgba(78,95,192,.25);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}

.btn-generate-plan:hover {
  background: rgba(78,95,192,.18);
  border-color: rgba(78,95,192,.4);
}

.btn-generate-plan.generating {
  opacity: .7;
  cursor: not-allowed;
}

.btn-generate-plan:disabled {
  cursor: not-allowed;
}

/* AI-generated task indicator */
.task-item.ai-task .task-text::after {
  content: ' ✦';
  color: var(--primary);
  font-size: 11px;
  opacity: 0.6;
}

/* ── AI TASK FEEDBACK ── */

.task-item.ai-task {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  cursor: default;
}

.task-main-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 2px 0;
}

.task-feedback-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px 32px;
}

.fb-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-family: var(--font);
  white-space: nowrap;
}

.fb-btn:hover { background: var(--bg); color: var(--text); }

.fb-skip.fb-active    { background: rgba(255,214,10,.12); color: var(--warning); border-color: rgba(255,214,10,.3); }
.fb-useful.fb-active  { background: rgba(48,209,88,.12);  color: var(--success); border-color: rgba(48,209,88,.3); }
.fb-notuseful.fb-active { background: rgba(255,69,58,.12); color: var(--danger);  border-color: rgba(255,69,58,.3); }

.task-item.ai-task.skipped .task-text {
  color: var(--secondary);
  text-decoration: line-through;
  opacity: 0.6;
}

/* ── TASK REVIEW ROW ── */

.task-review-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px 32px;
  flex-wrap: wrap;
}

.review-label {
  font-size: 11px;
  color: var(--secondary);
  font-weight: 500;
  margin-right: 2px;
  white-space: nowrap;
}

.review-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  font-family: var(--font);
  white-space: nowrap;
}

.review-btn:hover  { background: var(--bg); color: var(--text); border-color: rgba(255,255,255,.15); }
.review-btn:active { transform: scale(.95); }

/* Rating: Struggled */
.review-btn[data-rating="struggled"]:hover { background: rgba(255,69,58,.1); color: var(--danger); border-color: rgba(255,69,58,.3); }
/* Rating: Okay */
.review-btn[data-rating="okay"]:hover     { background: rgba(255,214,10,.1); color: var(--warning); border-color: rgba(255,214,10,.3); }
/* Rating: Got it */
.review-btn[data-rating="got_it"]:hover   { background: rgba(78,95,192,.1); color: var(--primary); border-color: rgba(78,95,192,.3); }
/* Rating: Nailed it */
.review-btn[data-rating="nailed_it"]:hover{ background: rgba(48,209,88,.1);  color: var(--success); border-color: rgba(48,209,88,.3); }

.review-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
}

/* ── AI INSIGHTS ── */

.insights-card { margin-top: 0; }

.insights-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

.insight-icon { font-size: 16px; flex-shrink: 0; line-height: 1.4; }

.insight-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.insights-empty {
  font-size: 14px;
  color: var(--secondary);
  text-align: center;
  padding: 24px 0;
}

/* ── TRAJECTORY CARD ── */

.trajectory-card {
  margin-bottom: 0;
}

.btn-log-mock {
  background: rgba(78,95,192,.1);
  color: var(--primary);
  border: 1.5px solid rgba(78,95,192,.25);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}

.btn-log-mock:hover {
  background: rgba(78,95,192,.18);
  border-color: rgba(78,95,192,.4);
}

.traj-scores {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  flex-wrap: wrap;
}

.traj-score-block {
  text-align: center;
  flex: 1;
  min-width: 70px;
}

.traj-score-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.traj-score-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
}

.traj-score-arrow {
  font-size: 18px;
  color: var(--border);
  flex-shrink: 0;
}

.traj-ok   { color: var(--success) !important; }
.traj-warn { color: var(--danger)  !important; }
.traj-target-val { color: var(--primary); }

/* Mock pills */
.traj-mock-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.traj-mock-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  min-width: 64px;
}

.traj-mock-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 2px;
}

.traj-mock-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.traj-trend-pill { border-color: transparent; }
.traj-trend-improving .traj-mock-score { color: var(--success); }
.traj-trend-declining .traj-mock-score { color: var(--danger);  }
.traj-trend-flat .traj-mock-score      { color: var(--secondary); }

.traj-no-mock {
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 12px;
  padding: 10px 0;
}

/* Status line */
.traj-status {
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.4;
}

.traj-status-ahead   { background: rgba(48,209,88,.1);   color: var(--success); border: 1px solid rgba(48,209,88,.2); }
.traj-status-behind  { background: rgba(255,69,58,.1);   color: var(--danger);  border: 1px solid rgba(255,69,58,.2); }
.traj-status-neutral { background: rgba(78,95,192,.07); color: var(--primary); border: 1px solid rgba(78,95,192,.18); }

/* Score progress bar */
.traj-bar-wrap {
  margin: 14px 0 10px;
  position: relative;
}
.traj-bar-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,.07);
  position: relative;
  overflow: visible;
}
.traj-bar-fill-current {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 99px;
  background: var(--primary);
  transition: width .6s ease;
}
.traj-bar-fill-projected {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 99px;
  background: rgba(48,209,88,.45);
  transition: width .6s ease;
}
.traj-bar-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}
.traj-bar-marker-target {
  background: var(--success);
  z-index: 2;
}
.traj-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 11px;
  color: var(--secondary);
  font-weight: 500;
  position: relative;
}
/* Daily target badge */
.traj-daily-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,159,10,.1);
  border: 1px solid rgba(255,159,10,.25);
  color: #FF9F0A;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
/* Coaching action box */
.traj-action {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.traj-action.traj-action-ok    { border-left-color: var(--success); }
.traj-action.traj-action-warn  { border-left-color: var(--danger);  }
.traj-action strong { color: inherit; }

/* ── SPACED REPETITION ── */

.review-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--danger);
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}

.review-go-subjects {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  opacity: .8;
  flex-shrink: 0;
}
.review-go-subjects:hover { opacity: 1; }

.review-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.review-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: opacity .3s;
}
.review-item:last-child { border-bottom: none; }

.review-item-info { flex: 1; min-width: 0; }
.review-chapter-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.review-chapter-meta {
  font-size: 12px;
  color: var(--secondary);
  margin-top: 2px;
}

.review-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.review-stage-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(78,95,192,.1);
  border: 1px solid rgba(78,95,192,.2);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
}

.review-overdue-label {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.overdue-now  { background: rgba(48,209,88,.1);   color: var(--success); border: 1px solid rgba(48,209,88,.2);   }
.overdue-med  { background: rgba(255,159,10,.1);  color: var(--warning); border: 1px solid rgba(255,159,10,.2);  }
.overdue-high { background: rgba(255,69,58,.1);   color: var(--danger);  border: 1px solid rgba(255,69,58,.2);   }

.btn-reviewed {
  background: rgba(48,209,88,.1);
  border: 1px solid rgba(48,209,88,.25);
  color: var(--success);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.btn-reviewed:hover    { background: rgba(48,209,88,.2); }
.btn-reviewed:disabled { opacity: .5; cursor: not-allowed; }

/* Empty state */
.review-empty {
  text-align: center;
  padding: 28px 20px;
}
.review-empty-icon  { font-size: 30px; margin-bottom: 10px; }
.review-empty-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.review-empty-sub   { font-size: 13px; color: var(--secondary); line-height: 1.5; }

/* ── POMODORO TIMER ── */

/* Nav timer button */
.nav-timer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(78,95,192,.1);
  border: 1px solid rgba(78,95,192,.25);
  color: var(--primary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.nav-timer-btn:hover { background: rgba(78,95,192,.18); }

/* Modal inner */
.timer-modal-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Close button */
.timer-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.timer-close:hover { color: var(--text); }

/* Mode tabs */
.timer-mode-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 4px;
  width: 100%;
}
.timer-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.timer-tab.active {
  background: var(--primary);
  color: #fff;
}

/* Ring */
.timer-ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}
.timer-ring-svg {
  width: 200px;
  height: 200px;
}
.timer-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,.06);
  stroke-width: 10;
}
.timer-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 552.9;   /* 2πr where r=88 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .9s linear;
}
.timer-display-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.timer-time {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timer-mode-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Subject select */
.timer-subject-row { width: 100%; }
.timer-subject-select {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
.timer-subject-select:focus { border-color: var(--primary); }

/* Controls */
.timer-controls {
  display: flex;
  gap: 10px;
  width: 100%;
}
.timer-btn-start {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.timer-btn-start:hover { opacity: .88; }
.timer-btn-start.paused { background: #FF9F0A; }
.timer-btn-stop {
  background: rgba(255,69,58,.12);
  color: var(--danger);
  border: 1px solid rgba(255,69,58,.2);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.timer-btn-stop:hover { background: rgba(255,69,58,.22); }

/* Session log */
.timer-sessions-today {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.timer-sessions-header {
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.timer-sessions-header strong { color: var(--text); }
.timer-session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px;
}
.timer-session-subject { color: var(--text); font-weight: 500; }
.timer-session-mins    { color: var(--secondary); }
.timer-no-sessions {
  font-size: 13px;
  color: var(--secondary);
  text-align: center;
  padding: 8px 0;
  margin: 0;
}

/* Toast notification */
.timer-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #2c2c2e;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 20000;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.timer-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.timer-toast-warn { border-color: rgba(255,159,10,.3); color: #FF9F0A; }

/* ── MOCK LOG MODAL ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Generic utility — used by readiness modal, tutorial overlay, and any new modals */
.hidden { display: none !important; }

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

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

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

.modal-close-btn {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  font-family: var(--font);
}

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

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.field-optional-inline {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: .7;
}

.modal-field input {
  width: 100%;
  height: 42px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}

.modal-field input:focus { border-color: var(--primary); }

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}

.btn-modal-cancel {
  flex: 1;
  height: 42px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.btn-modal-cancel:hover { border-color: rgba(255,255,255,.2); color: var(--text); }

.btn-modal-save {
  flex: 1;
  height: 42px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s;
}

.btn-modal-save:hover    { background: var(--primary-hover); }
.btn-modal-save:disabled { opacity: .5; cursor: not-allowed; }

/* ── MOCK MODAL: side-by-side score inputs ── */

.mock-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mock-subj-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding-top: 4px;
}

.mock-subject-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.mock-subj-input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 5px;
}

.mock-subj-score-input {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}

.mock-subj-score-input:focus { border-color: var(--primary); }

/* ── SUBJECT READINESS BREAKDOWN ── */

.srb-wrap { padding: 0; }

.srb-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0 12px;
}

.srb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.srb-emoji { font-size: 14px; flex-shrink: 0; }

.srb-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  width: 68px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srb-bar-wrap {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}

.srb-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
  min-width: 2px;
}

.srb-pct {
  font-size: 11px;
  font-weight: 700;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.srb-risk {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #FF6B6B;
  background: rgba(255,107,107,.08);
  border: 1px solid rgba(255,107,107,.2);
  border-radius: 8px;
  padding: 5px 10px;
  text-align: center;
}

/* ── STREAK SHARE BUTTON ── */

.streak-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  transition: color .15s, border-color .15s;
}

.streak-share-btn:hover {
  color: var(--primary);
  border-color: var(--border-hi);
}

/* ── MOCK ANALYSIS CARD ── */

.mock-analysis-card {
  margin-bottom: 20px;
  border: 1px solid var(--border-hi);
  background: var(--card);
  position: relative;
}

.btn-dismiss-analysis {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 6px;
  transition: color .15s;
}

.btn-dismiss-analysis:hover { color: var(--text); }

.mock-analysis-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.analysis-chapter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color .15s;
}

.analysis-chapter-row:hover { border-color: var(--border-hi); }

.analysis-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(78,95,192,.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.analysis-chapter-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-chapter-meta {
  font-size: 11px;
  color: var(--secondary);
}

.analysis-pct-badge {
  font-weight: 700;
}

.analysis-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .2px;
}

/* ── MOBILE BOTTOM NAV ── */

.mobile-bottom-nav {
  display: none; /* hidden on desktop */
}

@media (max-width: 640px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(13,13,13,.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  }

  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--secondary);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 0;
    transition: color .15s;
  }

  .mbn-item svg {
    stroke: currentColor;
    transition: stroke .15s;
  }

  .mbn-item.mbn-active,
  .mbn-item:active {
    color: var(--primary);
  }

  /* Push page content above the tab bar */
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
}

/* ── CHAPTER BUMP TOAST ── */

.chapter-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--elevated);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

.chapter-toast.chapter-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.chapter-toast strong {
  color: var(--primary);
}

.toast-arrow {
  color: var(--secondary);
  font-size: 12px;
  margin: 0 2px;
}

@media (max-width: 480px) {
  .chapter-toast {
    font-size: 13px;
    padding: 10px 14px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}

/* ── MOBILE OVERRIDES ── */

@media (max-width: 640px) {

  /* ── CUT SCROLL: hide low-priority sections on mobile ── */
  .hero-right    { display: none !important; }   /* redundant HH:MM:SS clock */
  .insights-card { display: none !important; }   /* AI insights: desktop-only */

  /* Heatmap stays visible on mobile. It scrolls horizontally (the wrapper
     already has overflow-x: auto) and dashboard.js scrolls it to the most
     recent weeks on load, so the useful end is what you see first rather
     than a year-old empty stretch. */
  .heatmap-legend { justify-content: flex-start; }

  /* ── HERO: ultra-compact ── */
  .hero {
    padding: 18px 18px 22px;
    border-radius: var(--radius);
    gap: 0;
  }
  .hero-headline      { justify-content: center; }
  .hero-days          { font-size: 46px; letter-spacing: -2px; }
  .hero-days-label    { font-size: 18px; }
  .hero-exam-badge    { margin: 0 auto 10px; font-size: 12px; }
  .hero-subtext       { font-size: 13px; margin-bottom: 12px; }
  .hero-progress-bar  { max-width: none; flex: 1; }
  .hero-progress-bar-wrap { justify-content: center; }

  /* ── STATS: compact 2×2 ── */
  .stat-row  { gap: 10px; }
  .stat-card { padding: 14px 14px 12px; }
  .stat-value { font-size: 28px; letter-spacing: -1px; }
  .stat-label { font-size: 10px; letter-spacing: .4px; }
  .stat-sub   { font-size: 12px; }
  .stat-value-denom { font-size: 16px; }

  /* ── CARDS: tighter padding ── */
  .card        { padding: 16px 14px; border-radius: 16px; }
  .card-header { margin-bottom: 14px; }
  .card-title  { font-size: 15px; }

  /* ── TIMER MODAL: bottom sheet ── */
  #timer-modal { align-items: flex-end; padding: 0; }
  #timer-modal .timer-modal-inner {
    border-radius: 24px 24px 0 0;
    max-width: 100%;
    width: 100%;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  /* ── NAV TIMER BTN ── */
  .nav-timer-btn { padding: 5px 10px; font-size: 12px; gap: 4px; }

  /* ── REVIEW ITEMS: wrap badges ── */
  .review-item         { flex-wrap: wrap; gap: 8px; }
  .review-item-actions { flex-wrap: wrap; gap: 6px; width: 100%; justify-content: flex-end; }
  .review-stage-label, .review-overdue-label { font-size: 10px; padding: 2px 7px; }

  /* ── TRAJECTORY: compress ── */
  .traj-score-val   { font-size: 22px; letter-spacing: -0.5px; }
  .traj-score-arrow { font-size: 14px; }
  .traj-score-block { min-width: 56px; }

  /* ── FEEDBACK ROWS: wrap ── */
  .task-feedback-row { flex-wrap: wrap; padding-left: 20px; }
  .task-review-row   { flex-wrap: wrap; padding-left: 20px; }

  /* ── TOASTS: above bottom nav ── */
  .timer-toast   { bottom: 80px; }
  .chapter-toast { bottom: 84px; }

  /* ── PREMIUM BOTTOM NAV ── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(13,13,13,.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 0 max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  }

  .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--secondary);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2px;
    padding: 4px 0;
    transition: color .15s;
    position: relative;
  }

  .mbn-item svg { stroke: currentColor; transition: stroke .15s; }

  .mbn-item.mbn-active { color: var(--primary); }

  /* Clean top-line indicator for active tab */
  .mbn-item.mbn-active::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
  }

  /* Body: push above tab bar */
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

  /* ── MOCK MODAL: stack score inputs on very small screens ── */
  .mock-score-row { grid-template-columns: 1fr; }
  .mock-subject-score-grid { grid-template-columns: 1fr 1fr; }

  /* ── MOCK ANALYSIS CARD ── */
  .analysis-chapter-row { flex-wrap: wrap; gap: 8px; }
  .analysis-status-badge { margin-left: 36px; }

  /* ── SRB: tighten name width ── */
  .srb-name { width: 52px; font-size: 10px; }
}
