/* ═══════════════ THEME TOKENS ═══════════════ */
:root {
  --brand: #0d4a35;
  --brand-2: #116b4c;
  --brand-lime: #c9f26b;
  --brand-lime-soft: #eafbd0;

  --bg: #f4f5f2;
  --card: #ffffff;
  --text: #0a1a12;
  --text-2: #3a4a44;
  --muted: #6b7d77;
  --border: #e4e7e2;
  --hover: #f0f2ee;

  --accent: #22c55e;
  --danger: #ef4444;

  --radius: 16px;
  --radius-lg: 24px;
  --shadow-md: 0 4px 24px rgba(13,74,53,0.08);

  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #0a1512;
  --card: #101f1a;
  --text: #eaf6f0;
  --text-2: #b4c6bf;
  --muted: #7d918a;
  --border: #1c332b;
  --hover: #142723;
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
}

/* ═══════════════ RESET ═══════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  font-optical-sizing: auto;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
  overflow-x: hidden;
}

button { font-family: inherit; }
.hidden { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}

/* ═══════════════ LAYOUT ═══════════════ */
.app-shell { display: flex; min-height: 100vh; }

/* ═══════════════ SIDEBAR ═══════════════ */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: left 0.3s ease;
  z-index: 100;
}

.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 22px; margin-bottom: 6px; }

.brand-logo {
  width: 44px; height: 44px; border-radius: 12px; background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-logo span:nth-child(1) { color: #fff; }
.brand-logo span:nth-child(2) { color: var(--brand-lime); margin-left: 2px; }
.brand-logo span:nth-child(3) { color: #fff; margin-left: 2px; }

.brand-text h1 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.brand-text p { font-size: 0.65rem; letter-spacing: 0.14em; color: var(--muted); font-weight: 700; margin-top: 2px; }

.nav-label {
  font-size: 0.68rem; letter-spacing: 0.14em; color: var(--muted);
  font-weight: 700; padding: 8px 12px 4px; text-transform: uppercase;
}

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

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: none; background: transparent; color: var(--text-2);
  font-size: 0.92rem; font-weight: 500; border-radius: 10px;
  cursor: pointer; text-align: left; transition: all 0.15s;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--hover); color: var(--text); }

.nav-item.active { background: var(--brand-lime-soft); color: var(--brand); font-weight: 600; }
[data-theme="dark"] .nav-item.active { background: rgba(201,242,107,0.12); color: var(--brand-lime); }

/* ═══════════════ MAIN COLUMN ═══════════════ */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 64px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; z-index: 20;
  gap: 12px;
}

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

#sidebar-toggle { display: none; }

.icon-btn {
  width: 42px; height: 42px; border: 1px solid var(--border);
  background: var(--card); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: all 0.15s;
  flex-shrink: 0;
}

.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

.reminder-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-2); font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}

.reminder-btn:hover { background: var(--hover); color: var(--text); }
.reminder-btn svg { width: 18px; height: 18px; }

.streak-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: #fff1e0; color: #c2410c; font-weight: 700; font-size: 0.85rem;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s;
}

.streak-badge:hover { transform: scale(1.05); }

[data-theme="dark"] .streak-badge { background: rgba(251,146,60,0.12); color: #fb923c; }
.streak-badge svg { width: 14px; height: 14px; }

/* ═══════════════ CONTENT ═══════════════ */
.content { padding: 32px 40px 60px; max-width: 1240px; width: 100%; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; animation: fade 0.3s ease; }

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

.hero-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 28px; flex-wrap: wrap;
}

.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.14em; font-weight: 700;
  color: var(--brand); margin-bottom: 8px; text-transform: uppercase;
}

[data-theme="dark"] .eyebrow { color: var(--brand-lime); }

.eyebrow-mini {
  font-size: 0.68rem; letter-spacing: 0.14em; font-weight: 700;
  color: var(--muted); margin-bottom: 4px; text-transform: uppercase;
}

.greeting {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -0.035em;
  line-height: 1.08; margin-bottom: 8px; color: var(--text);
}

.subtitle { font-size: 0.98rem; color: var(--muted); line-height: 1.6; }
.sprint { text-align: right; }
.sprint-label { font-size: 1rem; font-weight: 700; color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; }
.mt-24 { margin-top: 24px; }

/* ═══════════════ FOCUS CARD ═══════════════ */
.focus-card {
  background: var(--brand); color: #fff;
  border-radius: var(--radius-lg); padding: 26px 28px;
  position: relative; overflow: hidden;
  min-height: 340px; display: flex; flex-direction: column;
}

.focus-top { display: flex; gap: 10px; margin-bottom: 40px; flex-wrap: wrap; position: relative; z-index: 2; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}

.pill-lime { background: var(--brand-lime); color: var(--brand); }
.pill-outline { border: 1px solid rgba(255,255,255,0.25); color: rgba(255,255,255,0.9); }

.focus-card h3 {
  font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.08; margin-bottom: 12px; position: relative; z-index: 2;
}

.focus-desc {
  font-size: 0.95rem; line-height: 1.6;
  color: rgba(255,255,255,0.8); max-width: 480px;
  margin-bottom: 22px; position: relative; z-index: 2;
}

.focus-meta {
  font-size: 0.82rem; color: rgba(255,255,255,0.7);
  margin-bottom: 26px; display: flex; flex-wrap: wrap; gap: 8px;
  position: relative; z-index: 2;
}

.dot { opacity: 0.5; }

.cta-btn {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 12px; border: none;
  background: var(--brand-lime); color: var(--brand);
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative; z-index: 2; font-family: var(--font-body);
}

.cta-btn svg { width: 18px; height: 18px; }
.cta-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(201,242,107,0.3); }

.focus-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.orb-1 { width: 260px; height: 260px; background: radial-gradient(circle, rgba(201,242,107,0.08), transparent 70%); top: -80px; right: -60px; }
.orb-2 { width: 180px; height: 180px; background: radial-gradient(circle, rgba(255,255,255,0.05), transparent 70%); bottom: -60px; right: 40px; }

/* ═══════════════ TARGET CARD ═══════════════ */
.target-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px 28px;
  display: flex; flex-direction: column;
}

.target-num {
  font-size: 4.6rem; font-weight: 800; letter-spacing: -0.05em;
  color: var(--text); line-height: 1; margin: 8px 0 22px;
}

.target-num em {
  font-size: 1.35rem; font-weight: 500; color: var(--muted);
  font-style: normal; margin-left: 4px;
}

.bar { height: 8px; background: var(--hover); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-lime)); border-radius: 999px; transition: width 0.8s ease; }
.bar-labels { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); margin-bottom: 22px; }
.bar-labels strong { color: var(--text); font-weight: 700; }

.target-cta {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  background: var(--brand-lime-soft); color: var(--brand);
  padding: 14px 16px; border-radius: 12px;
  font-size: 0.9rem; font-weight: 600;
}

[data-theme="dark"] .target-cta { background: rgba(201,242,107,0.1); color: var(--brand-lime); }
.target-cta svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ═══════════════ PANEL ═══════════════ */
.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}

.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); }

.panel-tag {
  font-size: 0.75rem; color: var(--muted); background: var(--hover);
  padding: 4px 10px; border-radius: 999px; font-weight: 600;
}

.donut-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
#progress-chart { max-width: 100%; height: auto; }

.legend {
  display: flex; justify-content: center; gap: 14px;
  font-size: 0.78rem; color: var(--muted); flex-wrap: wrap;
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

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

.subject-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 12px; background: var(--hover);
}

.subject-row .subj-name { font-size: 0.9rem; font-weight: 600; color: var(--text); flex: 1; }
.subject-row .subj-count { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.subject-row .subj-bar {
  width: 70px; height: 6px; background: var(--border);
  border-radius: 999px; overflow: hidden;
}

.subject-row .subj-bar i {
  display: block; height: 100%; background: var(--accent);
  border-radius: 999px; transition: width 0.6s;
}

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

.subject-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  cursor: pointer; transition: all 0.2s;
}

.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.subject-card h4 { font-size: 1.05rem; margin-bottom: 6px; }
.subject-card p { font-size: 0.85rem; color: var(--muted); }

.subject-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.subject-progress {
  font-size: 0.85rem; font-weight: 700; color: var(--muted);
  background: var(--hover); padding: 3px 10px; border-radius: 999px;
}

.subject-progress-bar {
  height: 6px; background: var(--hover); border-radius: 999px;
  overflow: hidden; margin-bottom: 14px;
}

.subject-progress-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-lime));
  border-radius: 999px; transition: width 0.5s;
}

.subject-next { font-size: 0.85rem; color: var(--muted); }
.subject-next strong { color: var(--text); font-weight: 600; }

/* ═══════════════ PRACTICE ═══════════════ */
.selector { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }

select, input[type="text"] {
  flex: 1; min-width: 140px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 1rem;
  font-family: var(--font-body); transition: border-color 0.2s;
}

select:focus, input[type="text"]:focus { outline: none; border-color: var(--brand); }
select option:disabled { color: var(--muted); opacity: 0.5; }

.btn-ghost {
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); font-size: 0.85rem; cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover { color: var(--danger); border-color: var(--danger); }

#question-text {
  font-size: 1.05rem; margin-bottom: 18px;
  line-height: 1.55; font-weight: 600;
}

#options { display: flex; flex-direction: column; gap: 10px; }

.option-btn {
  padding: 14px 16px; text-align: left;
  border: 1.5px solid var(--border); background: var(--bg);
  color: var(--text); border-radius: 10px; cursor: pointer;
  font-size: 1rem; font-family: var(--font-body);
  transition: all 0.15s; line-height: 1.4;
}

.option-btn:hover:not(:disabled) { border-color: var(--brand); transform: translateX(2px); }
.option-btn.correct { background: var(--accent); color: #fff; border-color: var(--accent); }
.option-btn.wrong { background: var(--danger); color: #fff; border-color: var(--danger); }
.option-btn:disabled { cursor: not-allowed; }

#feedback { margin-top: 16px; font-weight: 600; min-height: 24px; line-height: 1.5; }

.unlock-msg {
  margin-top: 16px; padding: 12px 14px;
  background: var(--brand-lime-soft); color: var(--brand);
  border-radius: 10px; font-size: 0.9rem; font-weight: 600;
}

[data-theme="dark"] .unlock-msg { background: rgba(201,242,107,0.1); color: var(--brand-lime); }
.unlock-msg.warn { background: #fff1e0; color: #c2410c; }
[data-theme="dark"] .unlock-msg.warn { background: rgba(251,146,60,0.12); color: #fb923c; }

/* ═══════════════ MODAL ═══════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide {
  max-width: 460px;
}

.modal-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--hover);
  color: var(--text-2);
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 10;
}

.modal-x:hover {
  background: var(--danger);
  color: #fff;
}

.modal-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.modal-label input[type="time"] {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-actions .cta-btn {
  margin-top: 0;
  flex: 1;
}

.modal-actions .btn-ghost {
  flex-shrink: 0;
  padding: 12px 16px;
}

/* ═══════════════════════════════════════════════════════
   SETTINGS MODAL — Consolidated Styles
   ═══════════════════════════════════════════════════════ */

/* ─── Profile row (avatar + name side-by-side) ─── */
.settings-profile-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 14px !important;
  margin-bottom: 16px !important;
}

.settings-avatar {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  border-radius: 50% !important;
  background-color: #6b4423 !important;
  background-size: cover !important;
  background-position: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 1.4rem !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.settings-profile-info {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.settings-profile-name {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  line-height: 1.2 !important;
}

.settings-profile-email {
  font-size: 0.82rem !important;
  color: var(--muted) !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

/* Verified tick inside profile name */
.settings-profile-name .verified-tick {
  width: 18px !important;
  height: 18px !important;
  margin-left: 2px !important;
  vertical-align: middle !important;
}

/* ─── Settings rows (label left, toggle right) ─── */
.settings-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 12px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.settings-row-label {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: var(--text) !important;
}

.settings-icon {
  font-size: 1.15rem !important;
  width: 24px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
}

/* ─── Toggle switch (single definition) ─── */
.toggle-switch {
  position: relative !important;
  width: 46px !important;
  height: 26px !important;
  border-radius: 999px !important;
  border: none !important;
  background: var(--border) !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: background 0.2s !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  margin-left: auto !important;
}

.toggle-switch .toggle-knob {
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
  transition: transform 0.2s !important;
  margin: 0 !important;
}

.toggle-switch.on {
  background: var(--brand) !important;
}

.toggle-switch.on .toggle-knob {
  transform: translateX(20px) !important;
}

.settings-sub {
  padding: 6px 0 4px 36px !important;
  margin-bottom: 4px !important;
}

/* ─── Settings buttons — full width, consistent style ─── */
.settings-signout,
#gcal-btn,
.settings-danger,
#reset-all-btn {
  display: block !important;
  width: 100% !important;
  padding: 12px 16px !important;
  margin: 6px 0 10px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-align: left !important;
  box-sizing: border-box !important;
  transition: all 0.15s !important;
}

.settings-signout:hover,
#gcal-btn:hover {
  background: var(--hover) !important;
  border-color: var(--text-2) !important;
}

.settings-danger:hover,
#reset-all-btn:hover {
  background: var(--danger) !important;
  color: #ffffff !important;
  border-color: var(--danger) !important;
}
/* ═══════════════ STREAK CALENDAR ═══════════════ */
.calendar-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.calendar-stats span {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--hover);
  border-radius: 999px;
  color: var(--text-2);
}

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

.calendar-nav h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.calendar-arrow {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

.calendar-arrow svg {
  width: 18px;
  height: 18px;
  transition: transform 0.15s ease;
}

.calendar-arrow:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.calendar-arrow:hover svg {
  transform: scale(1.1);
}

.calendar-arrow:active {
  transform: scale(0.95);
}

.calendar-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 18px;
}

.cal-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
  text-transform: uppercase;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  transition: all 0.15s;
}

.cal-cell.empty {
  visibility: hidden;
}

.cal-cell.practiced {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.35);
}

.cal-cell.today {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.cal-cell.practiced.today {
  outline-color: var(--brand-lime);
  outline-width: 2px;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .sidebar { width: 220px; padding: 18px 14px; }
  .content { padding: 28px 28px 60px; }
  .greeting { font-size: 2.1rem; }
  .focus-card h3 { font-size: 1.85rem; }
  .target-num { font-size: 4rem; }
  .grid-2 { grid-template-columns: 1.3fr 1fr; gap: 16px; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; left: -300px;
    width: 280px; height: 100vh;
    box-shadow: 0 0 40px rgba(0,0,0,0.25);
  }
  .sidebar.open { left: 0; }
  .sidebar.open::before {
    content: '';
    position: fixed;
    inset: 0;
    left: 280px;
    background: rgba(0,0,0,0.35);
    z-index: -1;
  }
  #sidebar-toggle { display: flex; }
  .topbar { padding: 0 18px; }
  .content { padding: 24px 20px 60px; }
  .grid-2 { grid-template-columns: 1fr; }
  .greeting { font-size: 1.9rem; }
  .focus-card { min-height: 300px; padding: 22px; }
  .focus-card h3 { font-size: 1.65rem; }
  .target-num { font-size: 3.6rem; }
  .hero-head { margin-bottom: 22px; }
  .sprint { text-align: left; }
  .subjects-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 600px) {
  .topbar { height: 58px; padding: 0 14px; gap: 8px; }
  .topbar-right { gap: 6px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .reminder-btn { padding: 8px 12px; font-size: 0.8rem; }
  .reminder-btn span { display: inline; }
  .streak-badge { padding: 6px 10px; font-size: 0.78rem; }
  .content { padding: 20px 16px 80px; }
  .greeting { font-size: 1.55rem; letter-spacing: -0.03em; }
  .subtitle { font-size: 0.9rem; }
  .focus-card { padding: 20px; min-height: auto; border-radius: 20px; }
  .focus-card h3 { font-size: 1.35rem; margin-bottom: 10px; }
  .focus-desc { font-size: 0.88rem; margin-bottom: 16px; }
  .focus-top { margin-bottom: 24px; }
  .focus-meta { font-size: 0.75rem; margin-bottom: 20px; }
  .cta-btn { padding: 12px 20px; font-size: 0.9rem; width: 100%; justify-content: center; }
  .target-card { padding: 22px 20px; }
  .target-num { font-size: 3rem; margin: 6px 0 18px; }
  .target-num em { font-size: 1rem; }
  .target-cta { padding: 12px 14px; font-size: 0.85rem; }
  .panel { padding: 18px; border-radius: 20px; }
  .panel-head { margin-bottom: 14px; }
  .panel-head h3 { font-size: 0.95rem; }
  .subject-row { padding: 10px 12px; gap: 10px; }
  .subject-row .subj-name { font-size: 0.85rem; }
  .subject-row .subj-count { font-size: 0.75rem; }
  .subject-row .subj-bar { width: 50px; }
  .selector { flex-direction: column; gap: 8px; }
  .selector select,
  .selector input,
  .selector .btn-ghost { width: 100%; flex: none; }
  .btn-ghost { padding: 10px 14px; }
  .option-btn { padding: 12px 14px; font-size: 0.95rem; }
  #question-text { font-size: 1rem; }
  .subjects-grid { grid-template-columns: 1fr; gap: 12px; }
  .subject-card { padding: 16px; }
  .legend { font-size: 0.72rem; gap: 10px; }
  .modal-wide { max-width: 100%; }
  .cal-cell { font-size: 0.78rem; }
  .calendar-stats span { font-size: 0.75rem; padding: 5px 10px; }
}

@media (max-width: 380px) {
  .greeting { font-size: 1.35rem; }
  .focus-card h3 { font-size: 1.2rem; }
  .target-num { font-size: 2.6rem; }
  .brand-text h1 { font-size: 0.95rem; }
  .brand-logo { width: 40px; height: 40px; }
  .avatar { width: 34px; height: 34px; font-size: 0.78rem; }
  .pill { font-size: 0.65rem; padding: 5px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════ BOOKMARKS ═══════════════ */
.bookmark-star {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
  z-index: 5;
}

.bookmark-star:hover {
  border-color: #eab308;
  color: #eab308;
  transform: scale(1.05);
}

.bookmark-star svg {
  width: 20px;
  height: 20px;
  transition: all 0.2s;
}

.bookmark-star.saved {
  background: #fef3c7;
  border-color: #eab308;
  color: #eab308;
}

[data-theme="dark"] .bookmark-star.saved {
  background: rgba(234,179,8,0.15);
  border-color: #eab308;
  color: #facc15;
}

.bookmark-star.saved svg {
  fill: #eab308;
  stroke: #eab308;
}

[data-theme="dark"] .bookmark-star.saved svg {
  fill: #facc15;
  stroke: #facc15;
}

/* Star animation on toggle */
@keyframes starPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.bookmark-star.pop {
  animation: starPop 0.3s ease;
}

/* Make quiz-area relative so the star positions correctly */
#quiz-area {
  position: relative;
}

/* Make room for star in question text */
#question-text {
  padding-right: 60px;
}

/* ═══════════════ BOOKMARKS LIST ═══════════════ */
.bookmarks-empty {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
}

.bookmarks-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.bookmarks-empty h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.bookmarks-empty p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

.bookmarks-group {
  margin-bottom: 28px;
}

.bookmarks-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bookmarks-group-title .bookmarks-count {
  background: var(--hover);
  color: var(--text-2);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.bookmark-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.bookmark-card:hover {
  border-color: var(--brand);
  transform: translateX(3px);
  box-shadow: var(--shadow-md);
}

.bookmark-card-star {
  flex-shrink: 0;
  color: #eab308;
  margin-top: 2px;
}

.bookmark-card-star svg {
  width: 18px;
  height: 18px;
  fill: #eab308;
  stroke: #eab308;
}

.bookmark-card-body {
  flex: 1;
  min-width: 0;
}

.bookmark-card-q {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bookmark-card-meta {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bookmark-card-topic {
  color: var(--brand);
  font-weight: 600;
}

[data-theme="dark"] .bookmark-card-topic {
  color: var(--brand-lime);
}

/* ═══════════════ MOBILE ═══════════════ */
@media (max-width: 600px) {
  .bookmark-star {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
  }
  .bookmark-star svg {
    width: 18px;
    height: 18px;
  }
  #question-text {
    padding-right: 50px;
  }
  .bookmarks-empty {
    padding: 36px 20px;
  }
  .bookmark-card {
    padding: 14px 16px;
  }
  .bookmark-card-q {
    font-size: 0.88rem;
  }
}

/* ═══════════════ WELCOME MODAL ═══════════════ */
.welcome-card {
  max-width: 440px;
  padding: 32px 30px 26px;
}

.welcome-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.welcome-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.welcome-logo span:nth-child(1) { color: #fff; }
.welcome-logo span:nth-child(2) { color: var(--brand-lime); margin-left: 2px; }
.welcome-logo span:nth-child(3) { color: #fff; margin-left: 2px; }

.welcome-switch {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.83rem;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}

.welcome-switch:hover {
  color: var(--text);
  background: var(--hover);
}

.welcome-switch strong {
  color: var(--brand);
  font-weight: 700;
}

[data-theme="dark"] .welcome-switch strong {
  color: var(--brand-lime);
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text);
}

.welcome-subtitle {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 26px;
}

.welcome-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.welcome-google:hover {
  border-color: var(--brand);
  background: var(--hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.welcome-google svg {
  flex-shrink: 0;
}

.welcome-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.welcome-divider::before,
.welcome-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.welcome-guest {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  background: var(--brand-lime);
  color: var(--brand);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.welcome-guest:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(201,242,107,0.3);
}

.welcome-footnote {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 20px;
  text-align: center;
}

@media (max-width: 480px) {
  .welcome-card {
    padding: 26px 22px 22px;
  }
  .welcome-title {
    font-size: 1.5rem;
  }
  .welcome-subtitle {
    font-size: 0.88rem;
  }
  .welcome-switch {
    font-size: 0.75rem;
    padding: 5px 8px;
  }
}

/* ═══════════════ WELCOME MODAL FORM ═══════════════ */
.welcome-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }

.welcome-label { display: flex; flex-direction: column; gap: 6px; }
.welcome-label > span {
  font-size: 0.82rem; font-weight: 600; color: var(--text-2);
}
.welcome-label input {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.15s;
}
.welcome-label input:focus { outline: none; border-color: var(--brand); }
[data-theme="dark"] .welcome-label input:focus { border-color: var(--brand-lime); }

.welcome-status {
  font-size: 0.85rem; line-height: 1.5;
  min-height: 20px; margin: 0 0 4px;
}
.welcome-status.error { color: var(--danger); }
.welcome-status.success { color: var(--accent); }

.welcome-guest-ghost {
  width: 100%;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 12px;
}
.welcome-guest-ghost:hover {
  color: var(--text);
  border-color: var(--text-2);
  background: var(--hover);
}

/* ═══════════════ PASSWORD SHOW/HIDE TOGGLE ═══════════════ */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  width: 100%;
  padding-right: 48px;   /* leave room for the eye button */
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--hover);
}

.password-toggle.revealed {
  color: var(--brand);
}

[data-theme="dark"] .password-toggle.revealed {
  color: var(--brand-lime);
}

/* ═══════════════════════════════════════════════════════
   SUBSCRIPTION BADGE — Responsive Placement
   Desktop: topbar badge | Mobile: sidebar badge
   ═══════════════════════════════════════════════════════ */

/* Default: hide sidebar version on desktop */
.sidebar-sub {
  display: none;
}

/* Show sidebar version on mobile & hide topbar version */
@media (max-width: 900px) {
  #sub-status {
    display: none !important;
  }

  .sidebar-sub {
    display: block;
    margin: 4px 0 12px 0;
    padding: 0 12px;
  }

  .sidebar-sub-label {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 12px;
  }

  .sidebar-sub .sub-badge {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, background 0.15s;
    text-align: center;
    box-sizing: border-box;
  }
}

/* Base styles for sidebar badge (shown on mobile only) */
.sidebar-sub .sub-badge.pro {
  background: var(--brand-lime-soft);
  color: var(--brand);
  cursor: default;
}
[data-theme="dark"] .sidebar-sub .sub-badge.pro {
  background: rgba(201,242,107,0.14);
  color: var(--brand-lime);
}

.sidebar-sub .sub-badge.cta {
  background: var(--brand);
  color: #ffffff;
}
.sidebar-sub .sub-badge.cta:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
}

/* ═══════════════ MOCK EXAM ═══════════════ */
.exam-field { margin-bottom: 22px; }
.exam-label {
  display: block; font-size: 0.82rem; font-weight: 700;
  color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 10px;
}
.exam-subjects { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-subject-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; font-size: 0.9rem; font-weight: 600;
  color: var(--text-2); transition: all 0.15s; user-select: none;
}
.exam-subject-chip:hover { border-color: var(--brand); }
.exam-subject-chip input { display: none; }
.exam-subject-chip:has(input:checked) {
  border-color: var(--brand); background: var(--brand-lime-soft); color: var(--brand);
}
[data-theme="dark"] .exam-subject-chip:has(input:checked) {
  background: rgba(201,242,107,0.12); color: var(--brand-lime);
}
.exam-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-pill {
  padding: 10px 18px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--bg);
  color: var(--text-2); font-family: inherit; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.exam-pill:hover { border-color: var(--brand); }
.exam-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.exam-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.exam-timer {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.exam-timer.warning { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.exam-progress { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.exam-calc-btn {
  padding: 8px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-2); font-family: inherit; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.exam-calc-btn:hover { border-color: var(--brand); color: var(--brand); }

.exam-question-wrap { margin-bottom: 20px; }
#exam-question {
  font-size: 1.05rem; font-weight: 600; line-height: 1.55;
  margin-bottom: 16px; color: var(--text);
}
#exam-options { display: flex; flex-direction: column; gap: 10px; }
#exam-options .option-btn.selected {
  border-color: var(--brand); background: var(--brand-lime-soft); color: var(--brand);
}
[data-theme="dark"] #exam-options .option-btn.selected {
  background: rgba(201,242,107,0.12); color: var(--brand-lime); border-color: var(--brand-lime);
}

.exam-nav-btns {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: space-between; margin-bottom: 20px;
}
.exam-nav-btns .cta-btn { margin-top: 0; }
#exam-flag-btn.active { color: #eab308; border-color: #eab308; }

.exam-navigator {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px; margin-bottom: 20px; padding: 14px;
  background: var(--bg); border-radius: 12px;
  border: 1px solid var(--border);
}
.exam-nav-btn {
  aspect-ratio: 1; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-2); font-family: inherit; font-size: 0.82rem;
  font-weight: 700; cursor: pointer; transition: all 0.12s;
}
.exam-nav-btn:hover { border-color: var(--brand); }
.exam-nav-btn.answered { background: var(--brand-lime-soft); color: var(--brand); border-color: var(--brand); }
[data-theme="dark"] .exam-nav-btn.answered { background: rgba(201,242,107,0.12); color: var(--brand-lime); border-color: var(--brand-lime); }
.exam-nav-btn.flagged { box-shadow: inset 0 -3px 0 #eab308; }
.exam-nav-btn.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.exam-submit { width: 100%; padding: 12px; text-align: center; }

.exam-result-score {
  font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em;
  margin: 8px 0; color: var(--text);
}
.exam-result-score span { font-size: 1.3rem; color: var(--muted); font-weight: 500; }
.exam-result-breakdown {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px; padding: 16px;
  background: var(--bg); border-radius: 12px;
}
.exam-result-row {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; font-weight: 600; color: var(--text);
}

/* ═══════════════ CALCULATOR ═══════════════ */
.calc-panel {
  position: fixed; bottom: 24px; right: 24px;
  width: 280px; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  z-index: 400; overflow: hidden;
  animation: calcIn 0.2s ease;
}
@keyframes calcIn { from { opacity: 0; transform: translateY(12px); } }
.calc-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase;
}
.calc-close {
  border: none; background: transparent; color: var(--muted);
  font-size: 1.3rem; cursor: pointer; line-height: 1;
  padding: 0; width: 24px; height: 24px;
}
.calc-close:hover { color: var(--danger); }
.calc-display {
  padding: 18px 20px; text-align: right;
  font-size: 2rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); background: var(--card);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  min-height: 74px; overflow-x: auto; white-space: nowrap;
}
.calc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
}
.calc-btn {
  padding: 16px 0; border: none; background: var(--card);
  color: var(--text); font-family: inherit; font-size: 1.05rem;
  font-weight: 600; cursor: pointer; transition: background 0.1s;
}
.calc-btn:hover { background: var(--hover); }
.calc-btn:active { background: var(--brand-lime-soft); }
.calc-fn { color: var(--muted); font-size: 0.95rem; }
.calc-op { color: var(--brand); font-weight: 800; }
[data-theme="dark"] .calc-op { color: var(--brand-lime); }
.calc-eq { background: var(--brand); color: #fff; }
.calc-eq:hover { background: var(--brand-2); }
.calc-zero { grid-column: span 2; }

@media (max-width: 480px) {
  .calc-panel { width: calc(100vw - 24px); right: 12px; bottom: 12px; }
}

/* ═══════════════ TOPBAR GO PRO BUTTON ═══════════════ */
#sub-status {
  display: inline-flex;
  align-items: center;
}

#sub-status .sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: all 0.18s ease;
  text-decoration: none;
}

/* ─── Go Pro button (non-Pro users) ─── */
#sub-status .sub-badge.cta {
  background: linear-gradient(135deg, #c9f26b 0%, #a8e04a 100%);
  color: #0d4a35;
  box-shadow:
    0 1px 2px rgba(13,74,53,0.15),
    0 4px 12px rgba(201,242,107,0.35);
}

#sub-status .sub-badge.cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 2px 4px rgba(13,74,53,0.2),
    0 6px 18px rgba(201,242,107,0.5);
}

#sub-status .sub-badge.cta:active {
  transform: translateY(0);
}

/* ─── Pro badge (already-Pro users) ─── */
#sub-status .sub-badge.pro {
  background: linear-gradient(135deg, #1877F2 0%, #0a5fd6 100%);
  color: #ffffff;
  cursor: default;
  box-shadow: 0 2px 8px rgba(24,119,242,0.3);
}

/* ─── Sign in to go Pro (signed-out state) ─── */
#sub-status .sub-badge.cta.signed-out {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

#sub-status .sub-badge.cta.signed-out:hover {
  background: var(--hover);
  border-color: var(--text-2);
  box-shadow: none;
  transform: none;
}

/* ─── Mobile: hide entirely (moved to sidebar) ─── */
@media (max-width: 900px) {
  #sub-status {
    display: none !important;
  }
}

/* ═══════════════ LEADERBOARD ═══════════════ */
.lb-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 4px;
  overflow-x: auto;
}

.lb-filter {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.lb-filter:hover { border-color: var(--brand); }
.lb-filter.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ─── Podium (top 3) ─── */
.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
  align-items: end;
}

.lb-podium-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 12px 16px;
  text-align: center;
  position: relative;
  transition: transform 0.2s;
}

.lb-podium-card:hover { transform: translateY(-3px); }

.lb-podium-card.gold {
  grid-column: 2;
  padding-top: 28px;
  padding-bottom: 22px;
  background: linear-gradient(180deg, rgba(255,215,0,0.08), var(--card));
  border-color: rgba(255,215,0,0.4);
}

.lb-podium-card.silver { grid-column: 1; }
.lb-podium-card.bronze { grid-column: 3; }

.lb-medal {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.lb-podium-card.gold .lb-medal { font-size: 2.2rem; top: -20px; }

.lb-podium-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #6b4423;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 auto 10px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.lb-podium-card.gold .lb-podium-avatar {
  width: 68px;
  height: 68px;
  font-size: 1.5rem;
  border: 2px solid #ffd700;
}

.lb-podium-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  max-width: 100%;
}

.lb-podium-name .verified-tick {
  width: 14px;
  height: 14px;
  margin-left: 0;
}

.lb-podium-score {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
}

[data-theme="dark"] .lb-podium-score { color: var(--brand-lime); }

.lb-podium-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
}

/* ─── List (rank 4+) ─── */
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.15s;
}

.lb-row:hover {
  border-color: var(--brand);
  transform: translateX(2px);
}

.lb-row.me {
  background: var(--brand-lime-soft);
  border-color: var(--brand);
}

[data-theme="dark"] .lb-row.me {
  background: rgba(201,242,107,0.12);
  border-color: var(--brand-lime);
}

.lb-rank {
  width: 32px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  flex-shrink: 0;
}

.lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #6b4423;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.lb-name {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.lb-name .verified-tick {
  width: 15px;
  height: 15px;
  margin-left: 0;
  flex-shrink: 0;
}

.lb-score {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

[data-theme="dark"] .lb-score { color: var(--brand-lime); }

.lb-streak {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e07b1f;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ─── "You" pinned row ─── */
.lb-you {
  position: sticky;
  bottom: 12px;
  margin-top: 8px;
}

.lb-you .lb-row {
  border-width: 2px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ─── Empty / Loading state ─── */
.lb-empty {
  padding: 40px 20px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.lb-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.lb-loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ─── Mobile tweaks ─── */
@media (max-width: 600px) {
  .lb-podium { gap: 6px; }
  .lb-podium-card { padding: 16px 8px 12px; border-radius: 12px; }
  .lb-podium-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
  .lb-podium-card.gold .lb-podium-avatar { width: 54px; height: 54px; font-size: 1.3rem; }
  .lb-podium-name { font-size: 0.75rem; }
  .lb-podium-score { font-size: 0.95rem; }
  .lb-podium-sub { font-size: 0.65rem; }
  .lb-medal { font-size: 1.4rem; top: -12px; }
  .lb-podium-card.gold .lb-medal { font-size: 1.7rem; top: -16px; }
  .lb-row { padding: 10px 12px; gap: 10px; }
  .lb-avatar { width: 36px; height: 36px; font-size: 0.85rem; }
  .lb-name { font-size: 0.85rem; }
  .lb-score { font-size: 0.85rem; }
  .lb-streak { font-size: 0.72rem; }
  .lb-rank { width: 24px; font-size: 0.8rem; }
}