/* ════════════════════════════════════════════════════
   EASYEXAMS v2 — STYLE.CSS
   Dark academic + modern dashboard aesthetic
   Fonts: Syne (display) + DM Sans (body) + DM Mono (numbers)
════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
  --bg: #050508;
  --bg-gradient: radial-gradient(circle at top right, #111326 0%, #050508 60%);
  --s1: rgba(18, 20, 31, 0.65);
  --s2: rgba(25, 28, 43, 0.7);
  --s3: rgba(33, 37, 56, 0.8);
  --s4: rgba(45, 50, 75, 0.9);
  --s-solid: #12141F;
  --brd: rgba(255, 255, 255, 0.04);
  --brd2: rgba(255, 255, 255, 0.08);
  --brd-glass: rgba(255, 255, 255, 0.12);
  --text: #f3f5f9;
  --muted: #9aa3bb;
  --muted2: #6b738e;
  --blue: #5b96f7;
  --blue-hover: #7baaff;
  --blue-dim: rgba(91, 150, 247, 0.15);
  --violet: #8e6ef5;
  --violet-dim: rgba(142, 110, 245, 0.15);
  --green: #2fe0a8;
  --green-dim: rgba(47, 224, 168, 0.13);
  --orange: #fca814;
  --orange-dim: rgba(252, 168, 20, 0.13);
  --pink: #f5559d;
  --pink-dim: rgba(245, 85, 157, 0.12);
  --cyan: #26e2fa;
  --red: #f25555;
  --yellow: #fcd051;
  --grad: linear-gradient(135deg, #5b96f7, #8e6ef5);
  --grad-hover: linear-gradient(135deg, #7baaff, #a98ef7);
  --grad2: linear-gradient(135deg, #2fe0a8, #26e2fa);
  --sidebar-w: 240px;
  --display: 'Outfit', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'Fira Code', monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(91, 150, 247, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--body);
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

button,
select,
input,
textarea {
  font-family: var(--body);
}

input,
select,
textarea {
  background: var(--s2);
  border: 1px solid var(--brd2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 16px;
  width: 100%;
  font-size: 0.9rem;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  outline: none;
  backdrop-filter: blur(8px);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(91, 150, 247, 0.15), inset 0 0 0 1px var(--s3);
  background: var(--s3);
  transform: translateY(-1px);
}

select option {
  background: var(--s-solid);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

/* App Layout */
.sidebar,
.main {
  display: none
}

body.app-active .sidebar,
body.app-active .main {
  display: flex
}

body.app-active {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--s1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--brd-glass);
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.logo-wrap {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--brd);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 9px
}

.logo-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.logo-name {
  font-family: var(--display);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Compact sidebar ── */
body.compact-sidebar .sidebar {
  width: 60px;
}

body.compact-sidebar .logo-name {
  display: none;
}

body.compact-sidebar .nav-label {
  display: none;
}

body.compact-sidebar .nav-item {
  padding: 10px 0;
  justify-content: center;
  gap: 0;
  font-size: 0;
}

body.compact-sidebar .nav-item .nav-icon {
  font-size: 1.1rem;
  margin: 0 auto;
}

body.compact-sidebar .nav-badge {
  display: none;
}

body.compact-sidebar .sb-xp-wrap {
  display: none;
}

body.compact-sidebar .user-name {
  display: none;
}

body.compact-sidebar .user-sub {
  display: none;
}

body.compact-sidebar .user-row .user-av {
  margin: 0 auto;
}

body.compact-sidebar .sb-collapse-btn {
  display: none;
}

body.compact-sidebar .main {
  margin-left: 60px;
  max-width: calc(100vw - 60px);
}

body.compact-sidebar .sidebar-footer {
  padding: 10px 6px;
}

body.compact-sidebar #sb-auth-status {
  display: none;
}

body.compact-sidebar #sb-sync-row {
  justify-content: center;
}

.logo-tag {
  font-size: .58rem;
  color: var(--muted2);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-left: 34px
}

.sb-collapse-btn {
  background: transparent;
  border: 1px solid var(--brd2);
  color: var(--muted2);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  transition: .15s;
  flex-shrink: 0;
}

.sb-collapse-btn:hover {
  background: var(--s3);
  color: var(--text);
}

nav {
  padding: 12px 10px;
  flex: 1
}

.nav-label {
  font-size: .58rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 10px 8px 5px;
  font-weight: 600
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--blue-dim);
  color: var(--blue);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(91, 150, 247, 0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background: var(--blue);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px var(--blue);
}

.nav-icon {
  font-size: .95rem;
  width: 20px;
  text-align: center
}

.nav-badge {
  margin-left: auto;
  font-size: .52rem;
  padding: 2px 6px;
  background: var(--grad);
  color: white;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase
}

.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid var(--brd)
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px
}

.user-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: .85rem;
  font-weight: 800;
  flex-shrink: 0
}

.user-name {
  font-size: .8rem;
  font-weight: 600
}

.user-sub {
  font-size: .63rem;
  color: var(--muted2)
}

.sidebar-reset {
  font-size: .65rem;
  color: var(--muted2);
  cursor: pointer;
  padding: 5px 0;
  transition: color .15s
}

.sidebar-reset:hover {
  color: var(--red)
}

.sidebar-report-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--brd2);
  border-radius: 7px;
  color: var(--muted);
  font-size: .67rem;
  padding: 6px 10px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all .15s;
  text-align: left
}

.sidebar-report-btn:hover {
  border-color: var(--blue);
  color: var(--text);
  background: rgba(79, 142, 247, .06)
}

/* Main */
.main {
  margin-left: var(--sidebar-w);
  padding: 28px 30px;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: calc(100vw - var(--sidebar-w))
}

.page {
  display: none;
  animation: fadeIn .25s ease
}

.page.active {
  display: block
}

.page-title {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -.3px
}

.page-sub {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 18px
}

/* Cards */
.card {
  background: var(--s2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--brd-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: all .25s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-width: 0;
  overflow-wrap: break-word;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), var(--shadow-glow);
  border-color: var(--brd2);
}

.card-title {
  font-family: var(--display);
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -.1px
}

/* Grids */
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px
}

.g3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px
}

.g4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px
}

/* Stat cards */
.stat-card {
  background: var(--s2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--brd-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
  transition: all .25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.stat-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 20px var(--accent);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--blue))
}

.stat-val {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent, var(--blue));
  margin: 6px 0 4px
}

.stat-lbl {
  font-size: .7rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1px
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px
}

button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px
}

a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 3px
}

.btn-primary {
  background: var(--grad);
  color: white;
  box-shadow: 0 4px 15px rgba(91, 150, 247, 0.3), inset 0 1px 1px rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(91, 150, 247, 0.5), inset 0 1px 1px rgba(255,255,255,0.3);
  transform: translateY(-2px);
  background: var(--grad-hover);
}

.btn-ghost {
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border: 1px solid var(--brd-glass);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--green);
  color: #001a12;
  font-weight: 600
}

.btn-danger {
  background: rgba(240, 72, 72, .15);
  color: var(--red);
  border: 1px solid rgba(240, 72, 72, .2)
}

.btn-lg {
  padding: 13px 26px;
  font-size: .95rem;
  border-radius: 10px
}

.btn-sm {
  padding: 5px 12px;
  font-size: .74rem
}

.btn-ai {
  background: linear-gradient(135deg, #7c5ff4, #ec4899);
  color: white;
  box-shadow: 0 2px 12px rgba(124, 95, 244, .35)
}

.btn-ai:hover {
  opacity: .9;
  transform: translateY(-1px)
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .63rem;
  font-weight: 600;
  letter-spacing: .3px
}

.badge-blue {
  background: var(--blue-dim);
  color: var(--blue)
}

.badge-green {
  background: var(--green-dim);
  color: var(--green)
}

.badge-violet {
  background: var(--violet-dim);
  color: var(--violet)
}

.badge-ai {
  background: linear-gradient(135deg, rgba(124, 95, 244, .2), rgba(236, 72, 153, .15));
  color: #b98ef8
}

/* Form */
.form-row {
  margin-bottom: 14px
}

.form-label {
  display: block;
  font-size: .72rem;
  color: var(--muted2);
  margin-bottom: 5px;
  font-weight: 500;
  letter-spacing: .3px;
  text-transform: uppercase
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 8, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal {
  background: var(--s2);
  border: 1px solid var(--brd-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 26px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease
}

.modal-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 18px
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px
}

/* Tabs */
.tab-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.tab-btn {
  padding: 6px 14px;
  border: 1px solid var(--brd2);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: .77rem;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--body)
}

.tab-btn:hover {
  background: var(--s3);
  color: var(--text)
}

.tab-btn.active {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: rgba(79, 142, 247, .3)
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--s4);
  border: 1px solid var(--brd2);
  color: var(--text);
  padding: 11px 22px;
  border-radius: 30px;
  font-size: .82rem;
  transition: transform .25s ease, opacity .25s;
  opacity: 0;
  z-index: 9000;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow)
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1
}

/* Helpers */
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between
}

.flex-gap {
  display: flex;
  align-items: center;
  gap: 8px
}

.hidden {
  display: none !important
}

.prog-bar {
  height: 5px;
  background: var(--s3);
  border-radius: 3px;
  overflow: hidden
}

.prog-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s ease
}

.empty-state {
  text-align: center;
  padding: 40px 20px
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: .5
}

.empty-text {
  color: var(--muted);
  font-size: .82rem
}

/* ════ LANDING PAGE ════ */
#landing {
  min-height: 100vh
}

/* Nav */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 48px;
  height: 70px;
  background: rgba(5, 5, 8, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--brd-glass);
}

.lp-nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0
}

.lp-nav-logo-icon {
  font-size: 1.25rem
}

.lp-nav-logo-name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800
}

.lp-nav-links {
  display: flex;
  gap: 6px;
  margin-left: 36px
}

.lp-nav-link {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: .82rem;
  color: var(--muted);
  transition: all .15s
}

.lp-nav-link:hover {
  background: var(--s2);
  color: var(--text)
}

.lp-nav-actions {
  display: flex;
  gap: 8px;
  margin-left: auto
}

.lp-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: auto;
  padding: 8px
}

.lp-mobile-menu {
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  background: var(--s1);
  border-bottom: 1px solid var(--brd);
  padding: 14px 20px;
  z-index: 199;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.lp-mobile-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .875rem;
  transition: all .15s
}

.lp-mobile-link:hover {
  background: var(--s2);
  color: var(--text)
}

/* Hero */
.lp-hero {
  padding: 100px 48px 80px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 10;
}

.lp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 30px;
  background: rgba(91, 150, 247, 0.1);
  border: 1px solid rgba(91, 150, 247, 0.3);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 30px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lp-hero-title {
  font-family: var(--display);
  font-size: clamp(3rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 24px;
}

.lp-hero-gradient {
  background: linear-gradient(135deg, var(--blue), var(--violet), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 8px;
}

.lp-hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text);
  opacity: 0.8;
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.lp-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 40px
}

.lp-hero-link {
  font-size: .85rem;
  color: var(--muted);
  transition: color .15s
}

.lp-hero-link:hover {
  color: var(--text)
}

.lp-cta-btn {
  padding: 14px 30px;
  font-size: 1rem;
  border-radius: 12px
}

/* Stats bar */
.lp-hero-stats {
  display: inline-flex;
  align-items: center;
  background: var(--s2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--brd-glass);
  border-radius: 16px;
  padding: 20px 32px;
  margin-bottom: 60px;
  flex-wrap: wrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.lp-hero-stat {
  text-align: center;
  padding: 0 18px
}

.lp-stat-num {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue)
}

.lp-stat-lbl {
  font-size: .65rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1px
}

.lp-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--brd);
  flex-shrink: 0
}

/* Mock preview */
.lp-hero-preview {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6), 0 0 40px rgba(91, 150, 247, 0.15);
  transform: perspective(1000px) rotateX(2deg);
  transition: transform 0.4s ease;
}

.lp-hero-preview:hover {
  transform: perspective(1000px) rotateX(0deg) translateY(-8px);
}

.lp-preview-bar {
  background: var(--s3);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--brd)
}

.lp-preview-dots {
  display: flex;
  gap: 6px
}

.lp-preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--s4)
}

.lp-preview-dots span:nth-child(1) {
  background: #f04848
}

.lp-preview-dots span:nth-child(2) {
  background: var(--yellow)
}

.lp-preview-dots span:nth-child(3) {
  background: var(--green)
}

.lp-preview-url {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--muted2);
  background: var(--s2);
  padding: 3px 10px;
  border-radius: 4px
}

.lp-preview-body {
  display: flex;
  background: var(--bg);
  height: 230px
}

.lp-preview-sidebar {
  width: 140px;
  background: var(--s1);
  border-right: 1px solid var(--brd);
  padding: 12px 8px;
  flex-shrink: 0
}

.lp-ps-logo {
  font-size: .6rem;
  font-weight: 700;
  color: var(--muted2);
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--brd);
  margin-bottom: 6px
}

.lp-ps-item {
  padding: 5px 8px;
  border-radius: 5px;
  font-size: .6rem;
  color: var(--muted);
  margin-bottom: 2px
}

.lp-ps-active {
  background: var(--blue-dim);
  color: var(--blue)
}

.lp-preview-main {
  flex: 1;
  padding: 14px 16px;
  overflow: hidden
}

.lp-pm-greeting {
  font-family: var(--display);
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 10px
}

.lp-pm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px
}

.lp-pm-stat {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 6px;
  padding: 6px 8px;
  border-top: 1.5px solid var(--ac, #4f8ef7)
}

.lp-pm-stat-val {
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 800;
  color: var(--ac, var(--blue))
}

.lp-pm-stat-lbl {
  font-size: .5rem;
  color: var(--muted2)
}

.lp-pm-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px
}

.lp-pm-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 6px;
  padding: 8px 10px
}

.lp-pm-card-title {
  font-size: .6rem;
  font-weight: 700;
  margin-bottom: 6px
}

.lp-pm-subj {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .55rem;
  color: var(--muted);
  margin-bottom: 3px
}

.lp-pm-subj span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0
}

.lp-pm-exam-name {
  font-size: .62rem;
  font-weight: 600;
  margin-bottom: 2px
}

.lp-pm-exam-date {
  font-size: .52rem;
  color: var(--muted2)
}

.lp-pm-exam-days {
  font-family: var(--mono);
  font-size: .55rem;
  color: var(--orange);
  margin-top: 4px
}

/* Sections */
.lp-section {
  padding: 72px 48px
}

.lp-section-alt {
  background: var(--s1)
}

.lp-section-inner {
  max-width: 1100px;
  margin: 0 auto
}

.lp-section-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 10px
}

.lp-section-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.3px;
  margin-bottom: 12px;
  line-height: 1.15
}

.lp-section-sub {
  font-size: .9rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 40px;
  line-height: 1.6
}

/* Features */
.lp-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px
}

.lp-feature-card {
  background: var(--bg);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 20px;
  transition: all .2s
}

.lp-feature-card:hover {
  border-color: var(--brd2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3)
}

.lp-feature-lg {
  grid-column: span 2
}

.lp-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(79, 142, 247, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px
}

.lp-feature-ai-highlight {
  background: linear-gradient(135deg, rgba(124, 95, 244, .08), rgba(236, 72, 153, .06));
  border-color: rgba(124, 95, 244, .2)
}

.lp-feature-title {
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 7px
}

.lp-feature-desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 10px
}

.lp-feature-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap
}

.lp-feature-tags span {
  font-size: .6rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--s3);
  color: var(--muted);
  border: 1px solid var(--brd)
}

/* Subjects */
.lp-subjects-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px
}

.lp-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(79, 142, 247, .1);
  border: 1px solid rgba(79, 142, 247, .2);
  color: var(--blue);
  font-size: .78rem;
  font-weight: 500
}

.lp-pill-more {
  background: var(--s3);
  border-color: var(--brd);
  color: var(--muted)
}

.lp-boards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.lp-board {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--brd2);
  font-size: .72rem;
  font-family: var(--mono);
  color: var(--muted2)
}

/* Testimonials */
.lp-testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px
}

.lp-testimonial {
  background: var(--bg);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 22px
}

.lp-test-stars {
  color: var(--yellow);
  font-size: .85rem;
  margin-bottom: 12px
}

.lp-test-text {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
  font-style: italic
}

.lp-test-author {
  display: flex;
  align-items: center;
  gap: 10px
}

.lp-test-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 800
}

.lp-test-name {
  font-size: .78rem;
  font-weight: 600
}

.lp-test-meta {
  font-size: .63rem;
  color: var(--muted2)
}

/* How it works */
.lp-steps {
  display: flex;
  align-items: flex-start
}

.lp-step {
  flex: 1;
  padding: 0 20px 0 0
}

.lp-step-num {
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--blue);
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 8px
}

.lp-step-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 7px
}

.lp-step-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.55
}

.lp-step-arrow {
  font-size: 1.3rem;
  color: var(--muted2);
  flex-shrink: 0;
  padding: 32px 20px 0
}

/* Auth cards */
.lp-auth-section {
  padding: 60px 48px
}

.lp-auth-inner {
  max-width: 900px;
  margin: 0 auto
}

.lp-auth-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px
}

.lp-auth-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 16px;
  padding: 28px
}

.lp-auth-card-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px
}

.lp-auth-card-desc {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5
}

.auth-btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  border-radius: 9px;
  border: 1px solid var(--brd2);
  background: var(--s3);
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--body);
  margin-bottom: 8px
}

.auth-btn-google:hover {
  background: var(--s4);
  border-color: var(--brd2)
}

.auth-divider {
  text-align: center;
  font-size: .7rem;
  color: var(--muted2);
  margin: 12px 0;
  position: relative
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--brd)
}

.auth-divider::before {
  left: 0
}

.auth-divider::after {
  right: 0
}

.db-guide-notice {
  background: rgba(79, 142, 247, .07);
  border: 1px solid rgba(79, 142, 247, .18);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: .78rem;
  color: var(--muted);
  margin-top: 18px
}

.db-guide-notice strong {
  color: var(--blue)
}

.db-guide-btn {
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  font-size: .78rem;
  background: none;
  border: none;
  font-family: var(--body)
}

/* CTA */
.lp-cta-section {
  padding: 72px 48px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(79, 142, 247, .08) 0%, transparent 70%);
  border-top: 1px solid var(--brd)
}

.lp-cta-inner {
  max-width: 600px;
  margin: 0 auto
}

.lp-cta-badge {
  font-size: .7rem;
  color: var(--muted2);
  margin-bottom: 20px;
  letter-spacing: .3px
}

.lp-cta-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 12px
}

.lp-cta-sub {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 28px
}

/* Footer */
.lp-footer {
  padding: 28px 48px;
  border-top: 1px solid var(--brd);
  display: flex;
  align-items: center;
  gap: 16px
}

.lp-footer-logo {
  display: flex;
  align-items: center;
  gap: 8px
}

.lp-footer-text {
  font-size: .72rem;
  color: var(--muted2);
  margin-left: 8px
}

/* ════ ONBOARDING ════ */
#onboarding {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center
}

.ob-wrap {
  max-width: 580px;
  width: 100%;
  padding: 24px
}

.ob-step {
  display: none
}

.ob-step.active {
  display: block;
  animation: fadeIn .2s ease
}

.ob-logo-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px
}

.ob-logo-icon {
  font-size: 1.3rem
}

.ob-logo-name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800
}

.ob-tagline {
  font-size: .7rem;
  color: var(--muted2);
  margin-bottom: 22px
}

.ob-step-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 24px
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--s4)
}

.ob-dot.active {
  background: var(--blue);
  width: 20px;
  border-radius: 4px
}

.ob-dot.done {
  background: var(--green)
}

.ob-heading {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -.3px
}

.ob-sub {
  font-size: .83rem;
  color: var(--muted);
  margin-bottom: 22px;
  line-height: 1.55
}

.ob-auth-options {
  margin-bottom: 18px
}

.ob-auth-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted2);
  margin-bottom: 10px
}

.ob-auth-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px
}

.ob-auth-divider {
  text-align: center;
  font-size: .72rem;
  color: var(--muted2);
  margin: 14px 0;
  position: relative
}

.ob-auth-divider::before,
.ob-auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 44%;
  height: 1px;
  background: var(--brd)
}

.ob-auth-divider::before {
  left: 0
}

.ob-auth-divider::after {
  right: 0
}

/* Subject grid */
.subj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px
}

.subj-tile {
  background: var(--s2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--brd-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.subj-tile:hover {
  border-color: var(--brd2);
  background: var(--s3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.subj-tile.selected {
  border-color: rgba(91, 150, 247, 0.5);
  background: rgba(91, 150, 247, 0.1);
  box-shadow: 0 4px 20px rgba(91, 150, 247, 0.2);
}

.subj-tile-top {
  display: flex;
  align-items: center;
  gap: 9px
}

.subj-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0
}

.subj-name {
  font-size: .82rem;
  font-weight: 500
}

.subj-group {
  font-size: .6rem;
  color: var(--muted2)
}

.subj-check {
  margin-left: auto;
  color: var(--blue);
  font-size: .82rem;
  opacity: 0
}

.subj-tile.selected .subj-check {
  opacity: 1
}

.subj-board-row {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--brd)
}

.subj-tile.selected .subj-board-row {
  display: flex
}

.board-btn {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: .6rem;
  background: var(--s3);
  border: 1px solid var(--brd);
  color: var(--muted);
  cursor: pointer;
  transition: all .1s;
  font-family: var(--body)
}

.board-btn:hover {
  background: var(--s4);
  color: var(--text)
}

.board-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white
}

/* ════ DASHBOARD ════ */
.subject-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px solid var(--brd)
}

.subject-row:last-child {
  border-bottom: none
}

.subject-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0
}

.subject-name-sm {
  font-size: .79rem
}

.subject-board {
  font-size: .62rem;
  color: var(--muted2);
  margin-left: auto
}

.streak-day {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--s3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .55rem;
  color: var(--muted2)
}

.streak-day.filled {
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  color: #1a1000
}

.exam-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--s2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--brd-glass);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.exam-card:hover {
  border-color: var(--brd2);
  transform: translateX(2px);
  background: var(--s3);
}

.exam-days-big {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1
}

.exam-days-lbl {
  font-size: .56rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1px
}

.exam-info {
  flex: 1;
  min-width: 0
}

.exam-name {
  font-size: .83rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.exam-meta {
  font-size: .63rem;
  color: var(--muted2);
  margin-top: 2px
}

.urg-r {
  color: var(--red)
}

.urg-o {
  color: var(--orange)
}

.urg-b {
  color: var(--blue)
}

.urg-g {
  color: var(--green)
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--brd)
}

.stat-row:last-child {
  border-bottom: none
}

.stat-row-icon {
  font-size: .9rem;
  width: 24px;
  text-align: center
}

.stat-row-label {
  flex: 1;
  font-size: .78rem;
  color: var(--muted)
}

.stat-row-val {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text)
}

/* ════ TASKS ════ */
.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(18, 20, 31, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--brd-glass);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.task-item:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(25, 28, 43, 0.6);
  transform: translateX(2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.task-item.done {
  opacity: .45
}

.task-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--brd2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s
}

.task-item.done .task-check {
  background: var(--green);
  border-color: var(--green)
}

.task-text {
  flex: 1;
  font-size: .83rem
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: var(--muted)
}

.task-subj {
  font-size: .62rem;
  color: var(--muted2);
  background: var(--s3);
  padding: 2px 7px;
  border-radius: 3px;
  flex-shrink: 0
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--brd);
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--body)
}

.filter-btn.active {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: rgba(79, 142, 247, .3)
}

/* ════ POMODORO ════ */
.pm-mode-btn {
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--brd);
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--body)
}

.pm-mode-btn.active {
  background: var(--blue-dim);
  color: var(--blue);
  border-color: rgba(79, 142, 247, .3)
}

.pomo-ring {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 16px auto
}

.pomo-svg {
  width: 220px;
  height: 220px;
  display: block
}

.ring-bg {
  fill: none;
  stroke: var(--s3);
  stroke-width: 14
}

.ring-fill {
  fill: none;
  stroke: url(#pomGrad);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 565.5;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .8s linear
}

.pomo-abs {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center
}

.pomo-time {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -1px
}

.pomo-phase-lbl {
  font-size: .63rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 2px
}

.pomo-ctrl {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 14px
}

.pomo-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--s3);
  border: 1px solid var(--brd);
  color: var(--text);
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s
}

.pomo-btn.main {
  width: 56px;
  height: 56px;
  background: var(--grad);
  border: none;
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(79, 142, 247, .35)
}

.pomo-btn:hover {
  background: var(--s4)
}

.pomo-btn.main:hover {
  opacity: .9
}

.pm-sess-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--s3)
}

.pm-sess-dot.done {
  background: var(--green)
}

/* ════ FLASHCARDS ════ */
.dk-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  transition: all .2s
}

.dk-card:hover {
  border-color: var(--brd2)
}

.dk-color-strip {
  width: 4px;
  height: 44px;
  border-radius: 3px;
  flex-shrink: 0
}

.dk-info {
  flex: 1;
  min-width: 0
}

.dk-name {
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 3px
}

.dk-count {
  font-size: .63rem;
  color: var(--muted2)
}

.fc-wrap {
  perspective: 1200px;
  height: 220px;
  margin-bottom: 18px;
  cursor: pointer
}

.fc-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.25, .1, .25, 1)
}

.fc-inner.flipped {
  transform: rotateY(180deg)
}

.fc-face {
  position: absolute;
  inset: 0;
  background: var(--s1);
  border: 1px solid var(--brd2);
  border-radius: 14px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px
}

.fc-back {
  transform: rotateY(180deg);
  background: var(--s2)
}

.fc-question {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px
}

.fc-answer {
  font-size: .88rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.6
}

.fc-hint {
  font-size: .62rem;
  color: var(--muted2);
  text-align: center;
  margin-top: 10px
}

.rate-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--brd);
  background: var(--s2);
  color: var(--text);
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--body)
}

.rate-wrong {
  border-color: rgba(240, 72, 72, .3)
}

.rate-wrong:hover {
  background: rgba(240, 72, 72, .15)
}

.rate-hard {
  border-color: rgba(245, 158, 11, .3)
}

.rate-hard:hover {
  background: rgba(245, 158, 11, .12)
}

.rate-good {
  border-color: rgba(45, 212, 160, .3)
}

.rate-good:hover {
  background: rgba(45, 212, 160, .12)
}

/* ════ QUIZ ════ */
.quiz-prog-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 18px
}

.qpd {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--s3);
  border: 1px solid var(--brd);
  transition: all .2s
}

.qpd.current {
  background: var(--blue-dim);
  border-color: var(--blue)
}

.qpd.done-c {
  background: var(--green);
  border-color: var(--green)
}

.qpd.done-w {
  background: var(--red);
  border-color: var(--red);
  opacity: .7
}

.quiz-question-text {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  line-height: 1.4
}

.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--brd2);
  border-radius: 9px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
  background: var(--s2)
}

.quiz-opt:hover {
  border-color: var(--blue);
  background: var(--blue-dim)
}

.quiz-opt.correct {
  border-color: var(--green);
  background: var(--green-dim)
}

.quiz-opt.wrong {
  border-color: var(--red);
  background: rgba(240, 72, 72, .1)
}

.quiz-opt.disabled {
  cursor: default;
  pointer-events: none
}

.opt-letter {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--s3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  flex-shrink: 0
}

.quiz-explain {
  background: var(--s3);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: .78rem;
  color: var(--muted);
  border-left: 3px solid var(--blue);
  display: none;
  margin-top: 10px;
  line-height: 1.55
}

/* ════ PAST PAPERS ════ */
.pp-card {
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 18px;
  overflow: hidden;
  transition: border-color .15s;
}

.pp-card:hover {
  border-color: var(--blue);
}

.pp-year {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--blue)
}

.pp-paper-name {
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 4px
}

.pp-board-tag {
  font-size: .68rem;
  color: var(--muted2);
  margin-bottom: 10px
}

.pp-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pp-link {
  padding: 8px 14px;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  transition: opacity .15s
}

.pp-q {
  background: var(--blue-dim);
  color: var(--blue)
}

.pp-ms {
  background: var(--green-dim);
  color: var(--green)
}

.pp-link:hover {
  opacity: .8
}

/* ════ RESOURCES ════ */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px
}

.res-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 28px;
  display: block;
  transition: all .2s
}

.res-card:hover {
  border-color: var(--brd2);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .25)
}

.res-type {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 6px
}

.res-title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 6px
}

.res-desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 14px
}

.res-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto
}

.res-open {
  font-size: .75rem;
  color: var(--blue)
}

/* ════ GRADES ════ */
.grade-subject-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 26px
}

.grade-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px
}

.grade-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0
}

.grade-subj-name {
  font-size: .95rem;
  font-weight: 700;
  flex: 1
}

.grade-sel {
  padding: 9px 12px;
  font-size: .85rem
}

/* ════ PLANNER ════ */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px
}

.day-col {
  min-height: 120px
}

.day-header {
  font-size: .72rem;
  font-weight: 600;
  text-align: center;
  padding: 6px;
  background: var(--s2);
  border-radius: 6px;
  margin-bottom: 6px;
  color: var(--muted)
}

.day-header.today {
  background: var(--blue-dim);
  color: var(--blue)
}

.plan-slot {
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: .68rem;
  margin-bottom: 4px;
  cursor: pointer;
  border-left-width: 3px;
  transition: opacity .15s;
  line-height: 1.4
}

.plan-slot:hover {
  opacity: .7
}

.plan-add {
  width: 100%;
  background: none;
  border: 1px dashed var(--brd);
  border-radius: 6px;
  padding: 6px;
  font-size: .65rem;
  color: var(--muted2);
  cursor: pointer;
  transition: all .15s;
  font-family: var(--body)
}

.plan-add:hover {
  background: var(--s2);
  color: var(--text);
  border-color: var(--brd2)
}

/* ════ ANALYTICS ════ */
.chart-wrap {
  height: 140px;
  display: flex;
  align-items: flex-end
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding-top: 10px
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%
}

.bar-val {
  font-family: var(--mono);
  font-size: .55rem;
  color: var(--muted2);
  height: 16px
}

.bar-body {
  width: 100%;
  max-width: 28px;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height .3s
}

.bar-lbl {
  font-size: .6rem;
  color: var(--muted2)
}

/* ════ NOTES ════ */
.note-area {
  width: 100%;
  min-height: 420px;
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text);
  resize: vertical;
  line-height: 1.7;
  transition: border-color .2s
}

.note-area:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, .12)
}

/* ════ AI PRACTICE ════ */
.pq-hero {
  background: linear-gradient(135deg, rgba(124, 95, 244, .1), rgba(236, 72, 153, .06));
  border: 1px solid rgba(124, 95, 244, .2);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 18px
}

.pq-hero-icon {
  font-size: 2.4rem
}

.pq-hero-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 4px
}

.pq-hero-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5
}

.pq-api-notice {
  background: rgba(245, 158, 11, .07);
  border: 1px solid rgba(245, 158, 11, .2);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: .76rem;
  color: var(--muted);
  margin-bottom: 18px
}

.pq-api-notice strong {
  color: var(--orange)
}

.pq-ai-free-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(45, 212, 160, .06);
  border: 1px solid rgba(45, 212, 160, .2);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: .76rem;
  color: var(--muted);
  margin-bottom: 18px
}

.pq-ai-free-notice strong {
  color: var(--green)
}

.pq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 24px
}

.pq-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 22px;
  transition: all .2s;
  cursor: pointer
}

.pq-card:hover {
  border-color: rgba(124, 95, 244, .3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3)
}

.pq-card-subject {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 7px
}

.pq-card-topic {
  font-size: .78rem;
  color: var(--muted2);
  margin-bottom: 10px
}

.pq-card-q {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
  margin-bottom: 14px;
  line-clamp: 3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pq-card-meta {
  display: flex;
  align-items: center;
  gap: 6px
}

.pq-marks-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .62rem;
  font-weight: 600;
  background: rgba(124, 95, 244, .15);
  color: #b98ef8
}

.pq-type-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .62rem;
  background: var(--s3);
  color: var(--muted)
}

.pq-workspace {
  max-width: 700px;
  margin: 0 auto
}

.pq-ws-header {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px
}

.pq-ws-subject {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 5px
}

.pq-ws-question {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.45
}

.pq-ws-hints {
  margin-top: 10px
}

.pq-ws-hints summary {
  font-size: .73rem;
  color: var(--blue);
  cursor: pointer
}

.pq-ws-hints ul {
  margin-top: 8px;
  padding-left: 16px;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.9
}

.pq-marks-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: var(--muted2);
  margin-bottom: 14px
}

.pq-answer-area {
  min-height: 160px;
  font-size: .85rem;
  margin-bottom: 12px
}

.pq-word-count {
  font-size: .65rem;
  color: var(--muted2);
  text-align: right;
  margin-bottom: 12px
}

.pq-submit-row {
  display: flex;
  gap: 10px;
  align-items: center
}

.ai-feedback-wrap {
  background: linear-gradient(135deg, rgba(124, 95, 244, .06), rgba(236, 72, 153, .04));
  border: 1px solid rgba(124, 95, 244, .2);
  border-radius: 12px;
  padding: 20px 22px;
  margin-top: 18px
}

.ai-feedback-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px
}

.ai-feedback-title {
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 700
}

.ai-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--s1);
  border-radius: 9px
}

.ai-score-val {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 800
}

.ai-score-grade {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  font-family: var(--mono)
}

.ai-score-a {
  background: rgba(45, 212, 160, .15);
  color: var(--green)
}

.ai-score-b {
  background: rgba(79, 142, 247, .15);
  color: var(--blue)
}

.ai-score-c {
  background: rgba(245, 158, 11, .12);
  color: var(--orange)
}

.ai-score-d {
  background: rgba(240, 72, 72, .12);
  color: var(--red)
}

.ai-feedback-section {
  margin-bottom: 14px
}

.ai-feedback-section-title {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted2);
  margin-bottom: 7px
}

.ai-feedback-text {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.65
}

.ai-feedback-list {
  list-style: none
}

.ai-feedback-list li {
  font-size: .81rem;
  color: var(--muted);
  padding: 4px 0 4px 18px;
  position: relative;
  line-height: 1.5
}

.ai-feedback-list li::before {
  content: '•';
  position: absolute;
  left: 0
}

.ai-feedback-list li.pos::before {
  content: '✓';
  color: var(--green)
}

.ai-feedback-list li.neg::before {
  content: '✗';
  color: var(--red)
}

.ai-feedback-list li.imp::before {
  content: '→';
  color: var(--blue)
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--s1);
  border-radius: 12px;
  margin-top: 14px
}

.ai-loading-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(124, 95, 244, .2);
  border-top-color: var(--violet);
  animation: spin .7s linear infinite;
  flex-shrink: 0
}

.ai-loading-text {
  font-size: .82rem;
  color: var(--muted)
}

code {
  font-family: var(--mono);
  background: var(--s3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .85em
}

/* DB Guide */
.db-guide-steps {
  list-style: none;
  counter-reset: step
}

.db-guide-steps li {
  counter-increment: step;
  padding: 12px 0 12px 44px;
  border-bottom: 1px solid var(--brd);
  position: relative;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.55
}

.db-guide-steps li:last-child {
  border-bottom: none
}

.db-guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue-dim);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  font-family: var(--mono)
}

.db-guide-steps strong {
  color: var(--text)
}

.db-guide-steps a {
  color: var(--blue)
}

.db-code {
  background: var(--s3);
  border: 1px solid var(--brd);
  border-radius: 7px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: .73rem;
  color: var(--text);
  margin: 7px 0;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slideUp {
  from {
    transform: translateY(16px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .5
  }
}

.animate-pulse {
  animation: pulse 1.5s infinite
}

/* Responsive */
@media(max-width:1100px) {
  .lp-features-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .lp-feature-lg {
    grid-column: span 1
  }

  .g4 {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:900px) {
  :root {
    --sidebar-w: 210px;
  }

  .lp-nav {
    padding: 0 24px
  }

  .lp-nav-links {
    display: none
  }

  .lp-hamburger {
    display: block
  }

  .lp-hero {
    padding: 50px 24px 40px
  }

  .lp-section {
    padding: 48px 24px
  }

  .lp-auth-section {
    padding: 40px 24px
  }

  .lp-cta-section {
    padding: 48px 24px
  }

  .lp-footer {
    padding: 20px 24px
  }

  .lp-testimonials {
    grid-template-columns: 1fr
  }

  .lp-auth-cards {
    grid-template-columns: 1fr
  }

  .week-grid {
    grid-template-columns: repeat(4, 1fr)
  }

  .lp-steps {
    flex-direction: column;
    gap: 16px
  }

  .lp-step-arrow {
    display: none
  }
}

@media(max-width:768px) {

  /* Sidebar — slide off-screen on mobile */
  .sidebar {
    transform: translateX(-100%)
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, .5)
  }

  /* Main content — full width on mobile */
  .main {
    margin-left: 0;
    padding: 64px 14px 14px;
    max-width: 100vw
  }

  /* Grids collapse to single column */
  .g2,
  .g3,
  .g4 {
    grid-template-columns: 1fr
  }

  /* Landing responsive */
  .lp-features-grid {
    grid-template-columns: 1fr
  }

  .lp-hero-stats {
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px
  }

  .lp-stat-divider {
    width: 60px;
    height: 1px
  }

  .lp-preview-sidebar {
    display: none
  }

  /* Mobile menu button always visible */
  #mobile-menu-btn {
    display: block !important;
  }

  /* Pomodoro — fix ring on mobile */
  .pomo-ring {
    width: 200px;
    height: 200px;
    margin: 10px auto
  }

  .pomo-svg {
    width: 200px;
    height: 200px
  }

  .pomo-time {
    font-size: 2rem
  }

  .pomo-ctrl {
    flex-wrap: wrap;
    gap: 14px
  }

  /* Page headers — don't let title + button overflow */
  .flex-between {
    flex-wrap: wrap;
    gap: 8px
  }

  .page-title {
    font-size: 1.2rem
  }

  /* Streak days — ensure they wrap */
  #d-streak-days {
    flex-wrap: wrap
  }

  .streak-day {
    min-width: 28px
  }

  /* Tab rows — scroll horizontally */
  .tab-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch
  }

  .tab-row::-webkit-scrollbar {
    height: 2px
  }

  /* Modals — full width on mobile */
  .modal {
    max-width: 100% !important;
    margin: 0;
    border-radius: 16px 16px 0 0
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0
  }

  /* Week grid */
  .week-grid {
    grid-template-columns: repeat(3, 1fr)
  }

  /* Practice questions — pq-hero layout on mobile */
  .pq-hero {
    flex-direction: column;
    gap: 10px;
    text-align: center
  }

  .pq-submit-row {
    flex-wrap: wrap
  }

  /* AI marking workspace */
  .pq-workspace {
    max-width: 100%
  }

  /* Grade tracker */
  .grade-header {
    flex-wrap: wrap;
    gap: 4px
  }

  /* Flashcard */
  .fc-wrap {
    height: 180px
  }

  .fc-question {
    font-size: .95rem
  }

  /* Quiz options text */
  .quiz-opt {
    padding: 10px 12px
  }

  /* Bottom padding for mobile nav breathing room */
  body.app-active .main {
    padding-bottom: 30px
  }
}

@media(max-width:520px) {
  .pq-grid {
    grid-template-columns: 1fr
  }

  .week-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .lp-hero-title {
    font-size: 1.8rem
  }

  .lp-hero-sub {
    font-size: .85rem
  }

  .lp-hero-stats {
    gap: 6px
  }

  .lp-hero-stat {
    padding: 0 10px
  }

  .lp-stat-num {
    font-size: 1.1rem
  }

  .main {
    padding-top: 60px
  }

  /* Stat cards stacked better */
  .stat-card {
    padding: 12px 14px
  }

  .stat-val {
    font-size: 1.5rem
  }

  /* Pomodoro even smaller screens */
  .pomo-ring {
    width: 180px;
    height: 180px
  }

  .pomo-svg {
    width: 180px;
    height: 180px
  }

  .pomo-time {
    font-size: 1.75rem
  }

  /* Dashboard greeting */
  #d-greet {
    font-size: 1.2rem
  }
}

/* ═══════════════════════════════════
   IMPROVED POMODORO
═══════════════════════════════════ */
.pomo-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 22px;
  align-items: start;
  max-width: 1000px
}

.pomo-main-col {
  text-align: center
}

.pomo-side-col {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.pomo-stat-mini {
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 9px;
  padding: 16px 12px;
  text-align: center
}

.pomo-stat-val {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text)
}

.pomo-stat-lbl {
  font-size: .62rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 2px
}

.pomo-tip-card {
  background: linear-gradient(135deg, rgba(79, 142, 247, .06), rgba(124, 95, 244, .06));
  border-color: rgba(79, 142, 247, .2)
}

.ambient-btn {
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: .72rem;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s
}

.ambient-btn:hover,
.ambient-btn.active {
  background: rgba(79, 142, 247, .1);
  border-color: var(--blue);
  color: var(--text)
}

@media(max-width:720px) {
  .pomo-layout {
    grid-template-columns: 1fr
  }

  .pomo-side-col {
    display: none
  }
}

/* ═══════════════════════════════════
   STUDY METHODS PAGE
═══════════════════════════════════ */
.methods-hero {
  background: linear-gradient(135deg, rgba(79, 142, 247, .1), rgba(124, 95, 244, .08), rgba(45, 212, 160, .06));
  border: 1px solid rgba(79, 142, 247, .2);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 20px
}

.methods-hero-inner {
  max-width: 700px
}

.methods-hero-badge {
  display: inline-block;
  background: rgba(79, 142, 247, .15);
  border: 1px solid rgba(79, 142, 247, .3);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 14px
}

.methods-hero-title {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--text)
}

.methods-hero-sub {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px
}

.methods-hero-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap
}

.methods-hero-stat {
  display: flex;
  flex-direction: column
}

.mhs-val {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent
}

.mhs-lbl {
  font-size: .7rem;
  color: var(--muted2)
}

.methods-xp-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, .08), rgba(245, 166, 35, .06));
  border: 1px solid rgba(251, 191, 36, .25);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap
}

.mxp-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px
}

.mxp-icon {
  font-size: 2rem
}

.mxp-title {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 2px
}

.mxp-sub {
  font-size: .72rem;
  color: var(--muted2)
}

.mxp-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  flex: 1
}

.mxp-level {
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 800;
  color: var(--orange)
}

.mxp-bar-wrap {
  height: 8px;
  background: var(--s3);
  border-radius: 20px;
  overflow: hidden
}

.mxp-bar {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f5a623);
  border-radius: 20px;
  transition: width .5s ease
}

.mxp-pts {
  font-size: .7rem;
  color: var(--muted2)
}

.methods-earn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 24px
}

.mea-item {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px
}

.mea-icon {
  font-size: 1.1rem;
  flex-shrink: 0
}

.mea-pts {
  font-family: var(--display);
  font-size: .8rem;
  font-weight: 800;
  color: var(--green);
  flex-shrink: 0;
  min-width: 42px
}

.mea-lbl {
  font-size: .68rem;
  color: var(--muted2);
  line-height: 1.3
}

.methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-top: 8px
}

.method-card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 16px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .15s, box-shadow .15s
}

.method-card:hover {
  border-color: var(--brd2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25)
}

.method-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px
}

.method-sr::before {
  background: linear-gradient(90deg, #4f8ef7, #7c5ff4)
}

.method-ar::before {
  background: linear-gradient(90deg, #f5a623, #f04848)
}

.method-fe::before {
  background: linear-gradient(90deg, #2dd4a0, #1fd1e8)
}

.method-po::before {
  background: linear-gradient(90deg, #e85d9e, #7c5ff4)
}

.method-il::before {
  background: linear-gradient(90deg, #84cc16, #2dd4a0)
}

.method-ei::before {
  background: linear-gradient(90deg, #fbbf24, #f5a623)
}

.method-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px
}

.method-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.method-icon-sr {
  background: rgba(79, 142, 247, .12)
}

.method-icon-ar {
  background: rgba(245, 166, 35, .12)
}

.method-icon-fe {
  background: rgba(45, 212, 160, .12)
}

.method-icon-po {
  background: rgba(232, 93, 158, .12)
}

.method-icon-il {
  background: rgba(132, 204, 22, .12)
}

.method-icon-ei {
  background: rgba(251, 191, 36, .12)
}

.method-icon {
  font-size: 1.6rem
}

.method-head-text {
  flex: 1
}

.method-label {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px
}

.method-eff {
  font-size: .7rem;
  color: var(--muted2)
}

.method-desc {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px
}

.method-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px
}

.method-tags span {
  font-size: .65rem;
  border-radius: 20px;
  padding: 3px 10px;
  font-weight: 500
}

.tag-sr {
  background: rgba(79, 142, 247, .1);
  border: 1px solid rgba(79, 142, 247, .25);
  color: #7eb3fb
}

.tag-ar {
  background: rgba(245, 166, 35, .1);
  border: 1px solid rgba(245, 166, 35, .25);
  color: #f5c842
}

.tag-fe {
  background: rgba(45, 212, 160, .1);
  border: 1px solid rgba(45, 212, 160, .25);
  color: #2dd4a0
}

.tag-po {
  background: rgba(232, 93, 158, .1);
  border: 1px solid rgba(232, 93, 158, .25);
  color: #e85d9e
}

.tag-il {
  background: rgba(132, 204, 22, .1);
  border: 1px solid rgba(132, 204, 22, .25);
  color: #a3e635
}

.tag-ei {
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .25);
  color: #fbbf24
}

.method-how {
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  margin-bottom: 14px
}

.method-how-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted2);
  margin-bottom: 10px
}

.method-steps {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.method-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.55
}

.ms-num {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  font-size: .85rem;
  flex-shrink: 0;
  min-width: 28px;
  padding-top: 1px
}

.method-science {
  font-size: .74rem;
  color: var(--muted2);
  background: var(--s3);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.55;
  border-left: 3px solid var(--blue)
}

.method-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px
}

.method-xp-tag {
  font-size: .67rem;
  background: rgba(45, 212, 160, .15);
  border: 1px solid rgba(45, 212, 160, .3);
  color: #2dd4a0;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px
}

/* Feynman tool */
.feynman-tool-wrap {
  background: var(--s1);
  border: 1px solid rgba(45, 212, 160, .3);
  border-radius: 16px;
  padding: 28px;
  max-width: 780px;
  margin: 0 auto
}

.feynman-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px
}

.feynman-steps-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.feynman-step-badge {
  background: var(--s3);
  border: 1px solid var(--brd);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .2s
}

.feynman-step-badge.active {
  background: rgba(45, 212, 160, .15);
  border-color: rgba(45, 212, 160, .4);
  color: #2dd4a0
}

.feynman-step-arrow {
  color: var(--muted2);
  font-size: .8rem
}

/* Sidebar XP */
.sb-xp-wrap {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 10px
}

.sb-xp-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px
}

.sb-xp-level {
  font-size: .72rem;
  font-weight: 700;
  color: var(--orange)
}

.sb-xp-pts {
  font-size: .68rem;
  color: var(--muted2)
}

.sb-xp-track {
  height: 6px;
  background: var(--s3);
  border-radius: 20px;
  overflow: hidden
}

.sb-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f5a623);
  border-radius: 20px;
  transition: width .6s ease
}

@media(max-width:680px) {
  .methods-grid {
    grid-template-columns: 1fr
  }

  .methods-hero {
    padding: 24px
  }

  .methods-hero-title {
    font-size: 1.4rem
  }

  .methods-earn-grid {
    grid-template-columns: 1fr 1fr
  }
}

/* ════════════════════════════════════════════════════
   NEW PAGES — ACTIVE RECALL, MIND MAPS, REVISION HELP
════════════════════════════════════════════════════ */

/* Mind map viewer */
#mm-viewer::-webkit-scrollbar {
  width: 6px
}

#mm-viewer::-webkit-scrollbar-thumb {
  background: var(--s4);
  border-radius: 3px
}

/* Revision help article styling */
#revhelp-content {
  animation: fadeIn .2s ease
}

/* Recall countdown urgency */
#recall-countdown {
  transition: color .3s
}

/* Task subject tag (was missing) */
.task-subject-tag {
  font-size: .62rem;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0
}

/* ════ IMPROVED UI CLARITY ════ */
/* Better card hover states */
.card:hover {
  border-color: var(--brd2)
}

/* Clearer nav sections */
.nav-label {
  margin-top: 4px
}

/* Pomodoro motivation toast */
.toast {
  max-width: 420px;
  text-align: center;
  white-space: normal;
  line-height: 1.4
}

/* Scrollbar styling for main */
.main::-webkit-scrollbar {
  width: 5px
}

.main::-webkit-scrollbar-track {
  background: transparent
}

.main::-webkit-scrollbar-thumb {
  background: var(--s4);
  border-radius: 3px
}

/* Mobile padding fix for main */
@media(max-width:768px) {
  .main {
    padding: 64px 14px 60px;
    height: 100vh
  }
}

/* Smoother sidebar transition */
.sidebar {
  transition: transform .28s cubic-bezier(.4, 0, .2, 1)
}

/* Print styles for mind maps */
@media print {
  body>*:not(#mm-print-frame) {
    display: none !important;
    visibility: hidden !important;
  }

  #mm-print-frame {
    display: block !important;
    visibility: visible !important;
    position: fixed;
    inset: 0;
    background: white;
    color: black;
    padding: 24px;
    z-index: 99999;
  }

  #mm-print-frame svg {
    width: 100% !important;
    height: auto !important;
    max-height: 90vh;
    page-break-inside: avoid;
  }

  #mm-print-frame div {
    font-family: sans-serif;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* Recall session card */
#recall-sessions-html .card {
  transition: border-color .2s
}

/* Mind map branch cards */
.mm-branch-card {
  transition: transform .15s
}

.mm-branch-card:hover {
  transform: translateY(-2px)
}

/* ════════════════════════════════════════════════════
   MAJOR UI IMPROVEMENTS v3
════════════════════════════════════════════════════ */

/* Better landing page preview */
.lp-hero-preview {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--brd2);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);
}

.lp-hero-preview img {
  display: block;
  width: 100%;
}

/* ═══ POMODORO FIXES ═══ */
.pomo-ring {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 12px auto;
  overflow: visible !important;
}

.pomo-svg {
  width: 280px;
  height: 280px;
  display: block;
  overflow: visible;
}

.pomo-play-btn {
  width: 68px !important;
  height: 68px !important;
  font-size: 1.35rem !important;
  background: var(--grad) !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(79, 142, 247, .4) !important;
}

.pomo-play-btn:hover {
  transform: scale(1.06) !important;
}

.pomo-ctrl {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  overflow: visible;
}

.pomo-btn {
  overflow: visible;
  flex-shrink: 0;
}

.pomo-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  overflow: visible;
}

.pomo-main-col {
  text-align: center;
  overflow: visible;
}

@media(max-width:720px) {
  .pomo-layout {
    grid-template-columns: 1fr
  }

  .pomo-ring {
    width: 240px;
    height: 240px;
  }

  .pomo-svg {
    width: 240px;
    height: 240px;
  }
}

/* ═══ SIDEBAR SETTINGS ═══ */
.sb-settings-panel {
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  animation: slideUp .15s ease;
}

.sb-settings-item {
  padding: 9px 13px;
  font-size: .77rem;
  color: var(--muted);
  cursor: pointer;
  transition: all .12s;
  display: block;
}

.sb-settings-item:hover {
  background: var(--s3);
  color: var(--text);
}

.sb-settings-divider {
  height: 1px;
  background: var(--brd);
  padding: 0;
  cursor: default;
  margin: 2px 0;
}

.sb-settings-divider:hover {
  background: var(--brd);
}

.sb-gear-btn {
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: .9rem;
  transition: all .12s;
}

.sb-gear-btn:hover {
  background: var(--s3);
  color: var(--text);
}

#sb-sync-row {
  min-height: 24px;
}

/* ═══ AI CHAT ═══ */
.ai-chat-container {
  min-height: 380px;
  max-height: 500px;
  overflow-y: auto;
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ai-chat-container::-webkit-scrollbar {
  width: 4px;
}

.ai-chat-container::-webkit-scrollbar-thumb {
  background: var(--s4);
  border-radius: 2px;
}

.ai-chat-welcome {
  text-align: center;
  margin: auto;
  padding: 20px;
}

.ai-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.ai-chat-suggestion {
  background: var(--s3);
  border: 1px solid var(--brd2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .75rem;
  color: var(--blue);
  cursor: pointer;
  transition: all .15s;
}

.ai-chat-suggestion:hover {
  background: var(--blue-dim);
  border-color: rgba(79, 142, 247, .4);
}

.ai-chat-msg {
  display: flex;
  gap: 10px;
  animation: fadeIn .2s ease;
}

.ai-chat-msg.user {
  flex-direction: row-reverse;
}

.ai-chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 3px;
}

.ai-chat-avatar.bot {
  background: linear-gradient(135deg, #7c5ff4, #ec4899);
}

.ai-chat-bubble {
  max-width: 75%;
  padding: 11px 15px;
  border-radius: 12px;
  font-size: .83rem;
  line-height: 1.65;
  background: var(--s2);
  border: 1px solid var(--brd);
  color: var(--text);
}

.ai-chat-msg.user .ai-chat-bubble {
  background: var(--blue-dim);
  border-color: rgba(79, 142, 247, .3);
  color: var(--text);
  border-radius: 12px 12px 3px 12px;
}

.ai-chat-msg.bot .ai-chat-bubble {
  border-radius: 3px 12px 12px 12px;
}

.ai-chat-bubble code {
  background: var(--s3);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .8em;
}

.ai-chat-bubble strong {
  color: var(--text);
}

.ai-chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ai-chat-input-row textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 140px;
  border-radius: 10px;
  font-size: .85rem;
}

.ai-send-btn {
  padding: 11px 20px;
  flex-shrink: 0;
  align-self: flex-end;
  height: 46px;
}

.ai-typing-indicator {
  display: flex;
  gap: 5px;
  padding: 14px;
  align-items: center;
}

.ai-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--violet);
  animation: typingBounce .9s ease infinite;
}

.ai-typing-dot:nth-child(2) {
  animation-delay: .2s;
}

.ai-typing-dot:nth-child(3) {
  animation-delay: .4s;
}

@keyframes typingBounce {

  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }

  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* ═══ SETTINGS MODAL ═══ */
.settings-group {
  margin-bottom: 20px;
  background: var(--s2);
  border: 1px solid var(--brd);
  border-radius: 10px;
  overflow: hidden;
}

.settings-group-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted2);
  font-weight: 700;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--brd);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--brd);
  gap: 12px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row-label {
  font-size: .8rem;
  color: var(--text);
  flex: 1;
}

.settings-row-sub {
  font-size: .68rem;
  color: var(--muted2);
  margin-top: 2px;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s;
}

.color-swatch.active {
  border-color: white;
  transform: scale(1.2);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--s4);
  border-radius: 22px;
  transition: .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--blue);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(18px);
}

/* ═══ MIND MAP - CIRCULAR SVG ═══ */
.mindmap-svg-container {
  width: 100%;
  overflow: auto;
  background: var(--s2);
  border-radius: 12px;
  padding: 10px;
}

.mindmap-svg-container svg {
  display: block;
  margin: 0 auto;
}

/* ═══ INTERLEAVING ═══ */
.il-session-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all .15s;
}

.il-session-block:hover {
  border-color: var(--brd2);
}

.il-session-num {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted2);
  width: 24px;
  flex-shrink: 0;
}

.il-session-time {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted2);
  min-width: 60px;
  flex-shrink: 0;
}

.il-session-subject {
  flex: 1;
  font-size: .85rem;
  font-weight: 600;
}

.il-session-task {
  font-size: .73rem;
  color: var(--muted2);
}

.il-break-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  color: var(--muted2);
  font-size: .72rem;
  font-style: italic;
}

/* ═══ ACTIVE RECALL IMPROVEMENTS ═══ */
.recall-step-indicator {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--brd);
}

.recall-step {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: .72rem;
  font-weight: 600;
  background: var(--s2);
  color: var(--muted2);
  border-right: 1px solid var(--brd);
  transition: all .2s;
}

.recall-step:last-child {
  border-right: none;
}

.recall-step.active {
  background: var(--blue-dim);
  color: var(--blue);
}

.recall-step.done {
  background: rgba(45, 212, 160, .1);
  color: var(--green);
}

/* ═══ REVISION HELP FULL SCREEN ═══ */
.revhelp-article-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 400;
  overflow-y: auto;
  animation: fadeIn .2s ease;
}

.revhelp-article-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.revhelp-article-close {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 401;
}

/* ═══ UI IMPROVEMENTS ═══ */
/* Cleaner card styles */
.card {
  background: var(--s1);
  border: 1px solid var(--brd);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s, box-shadow .2s;
}

/* Gradient accent lines on stat cards */
.stat-card {
  background: var(--s1);
}

/* Better nav active state */
.nav-item.active {
  background: var(--blue-dim);
  color: var(--blue);
  font-weight: 600;
}

/* Improved mobile menu button */
#mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--s2);
  border: 1px solid var(--brd2);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
  transition: all .15s;
}

#mobile-menu-btn:hover {
  background: var(--s3);
}

@media(max-width:768px) {
  #mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* Improved page titles */
.page-title {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -.4px;
}

/* Better empty states */
.empty-state {
  background: var(--s1);
  border: 1px dashed var(--brd2);
  border-radius: var(--radius);
}

/* Smoother transitions on hover */
.nav-item,
.btn,
.card,
.res-card,
.task-item {
  transition: all .15s ease;
}

/* Remove double scrollbars */
.page.active {
  display: block;
}


/* ═══ ACTIVE RECALL TIME BUTTONS ═══ */
.recall-time-btn {
  background: var(--s2);
  border: 1px solid var(--brd);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
}

.recall-time-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.recall-time-btn.active {
  background: var(--blue-dim);
  border-color: rgba(79, 142, 247, .5);
  color: var(--blue);
  font-weight: 600;
}

.recall-countdown {
  display: inline-block;
  padding: 20px 40px;
  background: var(--s2);
  border-radius: 16px;
  border: 1px solid var(--brd);
  margin-bottom: 8px;
}

/* ═══ SIDEBAR HIDDEN MODE ═══ */
@media(min-width:769px) {
  aside.sidebar.hidden {
    transform: translateX(-100%);
    width: 0;
    min-width: 0;
    overflow: hidden;
    position: absolute;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .main.sidebar-hidden {
    margin-left: 0 !important;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ═══ AI BADGE ═══ */
.badge-ai {
  background: linear-gradient(135deg, #7c5ff4, #ec4899);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .5px;
}

/* ═══ PQ HERO ═══ */
.pq-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--blue-dim);
  border: 1px solid rgba(79, 142, 247, .3);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.pq-hero-icon {
  font-size: 2rem;
}

.pq-hero-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.pq-hero-desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ═══ IMPROVED MODAL ═══ */
.modal-overlay .modal {
  max-height: 92vh;
  overflow-y: auto;
}

.modal-overlay .modal::-webkit-scrollbar {
  width: 4px;
}

.modal-overlay .modal::-webkit-scrollbar-thumb {
  background: var(--s4);
  border-radius: 2px;
}

/* ═══ BTN DANGER ═══ */
.btn-danger {
  background: rgba(240, 72, 72, .12);
  color: var(--red);
  border: 1px solid rgba(240, 72, 72, .3);
}

.btn-danger:hover {
  background: rgba(240, 72, 72, .2);
}

/* ═══ REVHELP ARTICLES ═══ */
.revhelp-article-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 400;
  overflow-y: auto;
  padding: 0;
}

.revhelp-article-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 32px 80px;
  font-size: .9rem;
  line-height: 1.85;
  color: var(--text);
}

.revhelp-article-inner h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 28px 0 12px;
  color: var(--text);
}

.revhelp-article-inner h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--blue);
}

.revhelp-article-inner p {
  margin-bottom: 14px;
}

.revhelp-article-inner ul {
  margin: 8px 0 14px 20px;
}

.revhelp-article-inner li {
  margin-bottom: 5px;
}

.revhelp-article-inner blockquote {
  border-left: 3px solid var(--blue);
  padding: 10px 16px;
  margin: 16px 0;
  background: var(--blue-dim);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}

.revhelp-article-inner .key-point {
  background: rgba(45, 212, 160, .08);
  border: 1px solid rgba(45, 212, 160, .25);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0;
}

.revhelp-article-close-bar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--brd);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1;
}

.revhelp-article-close-bar .article-title-bar {
  font-family: var(--display);
  font-size: .9rem;
  font-weight: 800;
  flex: 1;
}


/* ═══ HORIZONTAL MIND MAP STYLE ═══ */
.mm-horizontal-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 20px 0;
  background: var(--s2);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.mm-horizontal-svg {
  display: block;
  min-width: 900px;
  width: 100%;
}

.mm-hnode-center {
  /* rx: 12px; (SVG attr, removed to fix linter warning) */
  fill: var(--blue-dim);
  stroke: var(--blue);
  stroke-width: 2.5;
}

/* ═══ PAGE FILL — grades, analytics, tasks ═══ */
#pg-grades,
#pg-analytics,
#pg-tasks,
#pg-planner,
#pg-notes {
  min-height: calc(100vh - 80px);
}

#grades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.analytics-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.analytics-full .card {
  margin: 0;
}

@media(max-width:900px) {
  .analytics-full {
    grid-template-columns: 1fr;
  }
}

/* ═══ EXAM DETAIL MODAL ═══ */
.exam-card {
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.exam-card:hover {
  background: var(--s3);
  border-color: var(--blue);
}

.exam-notes-area {
  width: 100%;
  min-height: 80px;
  background: var(--s2);
  border: 1px solid var(--brd2);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: .82rem;
  font-family: var(--mono);
  resize: vertical;
}

/* ═══ NOTES PAGE REDESIGN ═══ */
.notes-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  height: calc(100vh - 160px);
}

.notes-list-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notes-list-panel .card {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.note-list-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--brd);
  transition: background .12s;
}

.note-list-item:hover {
  background: var(--s2);
}

.note-list-item.active {
  background: var(--blue-dim);
  border-left: 3px solid var(--blue);
}

.note-list-item .note-item-title {
  font-weight: 700;
  font-size: .82rem;
  margin-bottom: 3px;
}

.note-list-item .note-item-preview {
  font-size: .7rem;
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-import-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: .75rem;
  color: var(--blue);
  cursor: pointer;
  border-top: 1px solid var(--brd);
  background: var(--s1);
  transition: background .12s;
}

.note-import-btn:hover {
  background: var(--blue-dim);
}

.note-editor-area {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.note-editor-area textarea {
  flex: 1;
  min-height: calc(100vh - 240px);
  resize: none;
}

@media(max-width:900px) {
  .notes-layout {
    grid-template-columns: 1fr;
  }

  .notes-list-panel {
    display: none;
  }
}

/* ═══ TASK/PLANNER SUGGESTIONS ═══ */
.suggestions-strip {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.suggestion-chip {
  background: var(--s2);
  border: 1px solid var(--brd2);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .73rem;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.suggestion-chip:hover {
  background: var(--blue-dim);
  border-color: var(--blue);
  color: var(--blue);
}

.suggestions-label {
  font-size: .65rem;
  color: var(--muted2);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ═══ ACTIVE RECALL FILE IMPORT ═══ */
.file-import-zone {
  border: 2px dashed var(--brd2);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 10px;
}

.file-import-zone:hover,
.file-import-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.file-import-zone p {
  font-size: .79rem;
  color: var(--muted);
  margin: 0;
}

/* ═══ REVISION HELP FULL WIDTH ═══ */
#pg-revhelp {
  min-height: calc(100vh - 80px);
}

.revhelp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.revhelp-grid .res-card {
  min-height: 160px;
  font-size: .88rem;
}

/* ═══ NOTIFICATION STATUS ═══ */
.notif-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(239, 68, 68, .12);
  color: var(--red);
}

.notif-status-badge.granted {
  background: rgba(45, 212, 160, .12);
  color: var(--green);
}

/* ═══ PLANNER WEEK NAVIGATION ═══ */
.planner-week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.planner-week-nav button {
  background: var(--s2);
  border: 1px solid var(--brd2);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: .8rem;
  transition: all .15s;
}

.planner-week-nav button:hover {
  background: var(--s3);
  color: var(--text);
}

/* ═══ MIND MAP VIEWER BIGGER ═══ */
#mm-viewer-content .mm-horizontal-container {
  min-height: 420px;
}

#mm-viewer-content svg {
  min-height: 400px;
}

#mm-viewer-content {
  min-height: 480px;
}

/* ═══ PP SCORE TRACKER ═══ */
.pp-score-input {
  width: 60px;
  padding: 4px 8px;
  font-size: .75rem;
  border-radius: 5px;
  background: var(--s3);
  border: 1px solid var(--brd2);
  color: var(--text);
  text-align: center;
}

.pp-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--brd);
  flex-wrap: wrap;
}

.pp-score-saved {
  font-size: .68rem;
  color: var(--green);
}

/* ═══ ANALYTICS GRADE HISTORY ═══ */
.grade-history-chart {
  height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding-top: 20px;
  position: relative;
}

.grade-history-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.grade-history-bar-body {
  width: 100%;
  border-radius: 5px 5px 0 0;
  min-height: 3px;
  transition: height .3s;
}

.grade-history-bar-lbl {
  font-size: .58rem;
  color: var(--muted2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50px;
}

.grade-history-bar-val {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--muted2);
  height: 14px;
}

/* ═══ QUIZ BANK CARDS IN SELECTOR ═══ */
#quiz-grid .res-card {
  min-height: 110px;
}

.quiz-bank-count {
  font-size: .7rem;
  color: var(--muted2);
  margin-top: 4px;
}


/* ═══ SPECIFICATIONS PAGE ═══ */
#pg-specs {
  min-height: calc(100vh - 80px);
}

.spec-section-card {
  margin-bottom: 14px;
  padding: 18px 20px;
}

.spec-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 7px;
}

.spec-topic-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  background: var(--s2);
  border: 1px solid var(--brd);
  transition: all .15s;
  min-width: 0;
}

.spec-topic-item:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.spec-topic-item.spec-topic-done {
  opacity: 0.65;
}

.spec-topic-item input[type="checkbox"] {
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.spec-topic-text {
  font-size: .78rem;
  line-height: 1.4;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.spec-topic-done-text {
  text-decoration: line-through;
  color: var(--muted2);
}

button[id^="spec-emoji-"]:hover {
  background: var(--s3) !important;
  border-color: var(--blue) !important;
  transform: scale(1.08);
}

/* ═══ REVISION CHECKLIST — Grid layout to prevent text rendering bugs ═══ */
/* Use CSS Grid (not flex) so column widths are explicit and cannot collapse */
.rev-checklist-item {
  display: grid !important;
  grid-template-columns: 18px 1fr auto !important;
  grid-template-rows: auto !important;
  align-items: start !important;
  gap: 0 10px !important;
  padding: 10px 14px !important;
  border-radius: 8px;
  background: var(--s2);
  border: 1px solid var(--brd);
  transition: border-color .15s, background .15s;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.rev-checklist-item:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.rev-checklist-item.spec-topic-done {
  opacity: 0.65;
}

/* Checkbox — column 1 */
.rev-checklist-item input[type="checkbox"] {
  grid-column: 1;
  grid-row: 1;
  width: 16px !important;
  height: 16px !important;
  margin: 2px 0 0 0;
  cursor: pointer;
  flex-shrink: 0;
  display: block;
  -webkit-appearance: checkbox;
  appearance: checkbox;
}

/* Text — column 2, forced horizontal, all text properties explicit */
.rev-checklist-item .rev-cl-text {
  grid-column: 2;
  grid-row: 1;
  display: block !important;
  -webkit-box-orient: horizontal !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal !important;
  min-width: 0;
  width: 100%;
  padding: 1px 0;
  cursor: pointer;
}

.rev-checklist-item .rev-cl-text.done {
  text-decoration: line-through;
  color: var(--muted2);
}

/* Button — column 3 */
.rev-checklist-item .rev-cl-btn {
  grid-column: 3;
  grid-row: 1;
  white-space: nowrap;
  align-self: start;
  font-size: .72rem !important;
  padding: 3px 8px !important;
}

/* Outer wrapper is always a simple flex column */
.rev-checklist-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

/* On very small screens hide the button */
@media (max-width: 500px) {
  .rev-checklist-item {
    grid-template-columns: 18px 1fr !important;
  }

  .rev-checklist-item .rev-cl-btn {
    display: none !important;
  }
}

/* ═══ NOTES RECORDER ═══ */
#note-recorder-panel {
  animation: fadeIn .2s ease;
}

/* ═══ MIND MAP VIEWER FIX ═══ */
#mm-viewer {
  overflow: auto;
}

#mm-viewer>div {
  overflow-x: auto;
}

#mm-viewer-content {
  overflow: visible;
  min-height: 500px;
}

#mm-viewer-content .mm-horizontal-container {
  min-height: 450px;
  overflow-x: auto;
  overflow-y: visible;
}

#mm-viewer-content svg {
  min-height: 450px;
}

/* ═══ GRADE TRACKER BIGGER ═══ */
.grade-sel {
  font-size: .85rem;
  padding: 8px 10px;
}

.grade-header {
  margin-bottom: 14px;
}

.grade-dot {
  width: 12px;
  height: 12px;
}

.grade-subj-name {
  font-size: .92rem;
  font-weight: 700;
}

/* ═══ POMODORO BIGGER ═══ */
.pomo-stat-lbl {
  font-size: .68rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 3px;
}


/* ═══════════════════════════════════════════════════
   IMPROVEMENTS BUNDLE
═══════════════════════════════════════════════════ */

/* ── MINDMAP FULL-VIEWPORT VIEWER ── */
#mm-viewer {
  overflow-x: hidden;
  overflow-y: auto;
}

#mm-viewer>div {
  width: 100%;
  max-width: 100%;
}

#mm-viewer-content {
  overflow-x: auto;
  overflow-y: visible;
  min-height: 80vh;
}

#mm-viewer-content .mm-horizontal-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#mm-viewer-content svg {
  min-width: 1200px;
  width: 100%;
  height: auto;
  display: block;
}

/* ── MINDMAP PRINT (only mindmap) ── */
@media print {
  body>*:not(#mm-print-frame) {
    display: none !important;
  }

  #mm-print-frame {
    display: block !important;
  }

  #mm-print-frame svg {
    width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }
}

/* ── LEVEL UP ANIMATION ── */
.level-up-card {
  background: linear-gradient(135deg, #4f8ef7, #8b6fe8);
  border-radius: 20px;
  padding: 40px 50px;
  text-align: center;
  box-shadow: 0 0 60px rgba(79, 142, 247, .6);
  animation: levelUpPop .5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: none;
}

.level-up-emoji {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.level-up-text {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 900;
  color: rgba(255, 255, 255, .8);
  letter-spacing: 4px;
  text-transform: uppercase;
}

.level-up-num {
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 900;
  color: white;
  line-height: 1.1;
  margin: 4px 0;
}

.level-up-sub {
  font-size: .82rem;
  color: rgba(255, 255, 255, .75);
  margin-top: 6px;
}

#level-up-overlay {
  display: none !important;
}

#level-up-overlay.show {
  display: flex !important;
}

@keyframes levelUpPop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  70% {
    transform: scale(1.08);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── XP BAR FLASH ── */
@keyframes xpFlash {
  0% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(2);
    box-shadow: 0 0 12px var(--blue);
  }

  100% {
    filter: brightness(1);
  }
}

.xp-flash {
  animation: xpFlash .5s ease;
}

/* ── PLANNER TASK INDICATOR ── */
.task-planner-badge {
  font-size: .58rem;
  background: rgba(79, 142, 247, .15);
  color: var(--blue);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── SPEC DETAIL MODAL ── */
.spec-detail-topic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.spec-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--s2);
  border-radius: 8px;
  border: 1px solid var(--brd);
  cursor: pointer;
  transition: border-color .15s;
}

.spec-detail-item:hover {
  border-color: var(--blue);
}

.spec-detail-item.done {
  border-color: var(--green) !important;
  opacity: .7;
}

.spec-detail-item input[type=checkbox] {
  margin-top: 2px;
  accent-color: var(--blue);
  flex-shrink: 0;
}

.spec-detail-item-text {
  font-size: .82rem;
  line-height: 1.5;
}

/* ── NOTES PANEL TOGGLE ── */
.notes-panel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  color: var(--muted2);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--s2);
  border: 1px solid var(--brd);
  transition: background .15s;
}

.notes-panel-toggle:hover {
  background: var(--s3);
  color: var(--text);
}

.notes-list-panel.collapsed {
  width: 0;
  overflow: hidden;
  min-width: 0;
  padding: 0;
  margin: 0;
}

/* ── TRANSCRIPTION STATUS ── */
.transcription-status {
  font-size: .75rem;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--s2);
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.transcription-status.active {
  background: rgba(79, 142, 247, .1);
  color: var(--blue);
}

.transcription-status.error {
  background: rgba(239, 68, 68, .1);
  color: var(--red);
}

/* ── SM-2 FLASHCARD RATINGS ── */
.fc-rating-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.fc-rating-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  transition: transform .1s, opacity .15s;
}

.fc-rating-btn:hover {
  transform: translateY(-2px);
}

.fc-rating-btn.wrong {
  background: rgba(239, 68, 68, .2);
  color: #ef4444;
}

.fc-rating-btn.hard {
  background: rgba(245, 158, 11, .2);
  color: #f59e0b;
}

.fc-rating-btn.good {
  background: rgba(45, 212, 160, .2);
  color: #2dd4a0;
}

.fc-rating-btn.easy {
  background: rgba(79, 142, 247, .2);
  color: #4f8ef7;
}

/* ── POMO NOTIFICATION PULSE ── */
@keyframes notifPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(79, 142, 247, .4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(79, 142, 247, 0);
  }
}

/* ── FREE TRANSCRIPTION ── */
.transcribe-progress {
  height: 4px;
  background: var(--s3);
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0;
}

.transcribe-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 2px;
  width: 0;
  transition: width .3s;
  animation: transcribeIndeterminate 1.5s infinite ease-in-out;
}

@keyframes transcribeIndeterminate {
  0% {
    width: 0;
    margin-left: 0;
  }

  50% {
    width: 60%;
    margin-left: 20%;
  }

  100% {
    width: 0;
    margin-left: 100%;
  }
}

/* ── HEATMAP & PIE CHART POLISH ── */
#study-heatmap svg rect {
  transition: opacity .1s;
}

#study-heatmap svg rect:hover {
  opacity: .8;
}

#pie-svg path {
  cursor: pointer;
}

/* Make the heatmap card look wide and clean */
#pg-analytics .card {
  background: var(--s1);
}

/* Analytics grid responsive fixes */
@media (max-width: 600px) {
  #study-heatmap {
    font-size: 0;
  }

  #subject-pie-chart>div {
    flex-direction: column;
    align-items: center;
  }
}

/* ═══ SEARCH / COMMAND PALETTE ═══ */
.search-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 40px;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}

.search-palette-overlay.open {
  opacity: 1;
  visibility: visible;
}

.search-palette-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--s1);
  border: 1px solid var(--brd2);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
  overflow: hidden;
  z-index: 1;
}

.search-palette-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--brd);
}

.search-palette-icon {
  font-size: 1.1rem;
  opacity: .8;
}

.search-palette-header input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: .95rem;
  outline: none;
}

.search-palette-header input::placeholder {
  color: var(--muted2);
}

.search-palette-hint {
  font-size: .65rem;
  color: var(--muted2);
  white-space: nowrap;
}

.search-palette-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.sp-section-label {
  font-size: .65rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 10px 4px;
}

.sp-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.sp-result:hover {
  background: var(--s2);
}

.sp-result-icon {
  font-size: 1rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.sp-result-label {
  font-size: .85rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-result-sub {
  font-size: .68rem;
  color: var(--muted2);
}

.sp-result-sub2 {
  font-size: .72rem;
  color: var(--muted2);
  margin-top: 2px;
}

/* Top-right search button */
.top-search-btn {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  background: var(--s1);
  border: 1px solid var(--brd2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .3);
  transition: all .15s;
}

.top-search-btn:hover {
  background: var(--s2);
  color: var(--blue);
  border-color: var(--blue);
  transform: scale(1.05);
}

body.app-active .top-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

@media(max-width:768px) {
  .top-search-btn {
    top: 12px;
    right: 12px;
    padding: 8px 12px;
  }
}

#sb-sync-row {
  gap: 8px;
}

#sb-sync-row #sb-auth-status {
  flex: 1;
  min-width: 0;
}

/* ═══ MOBILE BOTTOM NAV BAR ═══ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--s1);
  border-top: 1px solid var(--brd);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }

  body.app-active .main {
    padding-bottom: 70px;
  }
}

.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  background: none;
  border: none;
  color: var(--muted2);
  font-size: .68rem;
  cursor: pointer;
  font-family: var(--body);
  transition: all .15s;
  border-radius: 8px;
  flex: 1;
  max-width: 80px;
}

.mbn-item span {
  font-size: .62rem;
}

.mbn-item {
  font-size: 1.2rem;
}

.mbn-item:hover {
  color: var(--text);
  background: var(--s2);
}

.mbn-item.active {
  color: var(--blue);
  font-weight: 600;
}

.mbn-item.mbn-search {
  color: var(--blue);
}

/* Weekly digest grid */
.weekly-digest-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.wd-stat {
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding: 8px;
  background: var(--s2);
  border-radius: 8px;
  border: 1px solid var(--brd);
}

.wd-val {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue);
}

.wd-lbl {
  font-size: .62rem;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

/* ── SQL / Markdown Table Readability ── */
.note-area-rendered table,
.analytics-table-wrap table,
.note-rendered table,
table.data-table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: .82rem;
}

.note-area-rendered table th,
.note-area-rendered table td,
.analytics-table-wrap table th,
.analytics-table-wrap table td,
table.data-table th,
table.data-table td {
  border: 1px solid var(--brd2, var(--brd));
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.note-area-rendered table th,
.analytics-table-wrap table th,
table.data-table th {
  background: var(--s2);
  font-weight: 700;
  color: var(--text);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.note-area-rendered table tr:nth-child(even),
.analytics-table-wrap table tr:nth-child(even),
table.data-table tr:nth-child(even) {
  background: var(--s2);
}

.note-area-rendered table tr:hover,
.analytics-table-wrap table tr:hover,
table.data-table tr:hover {
  background: var(--s3, var(--s2));
}

/* ── Markdown rendered note styles ── */
.note-rendered h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 16px 0 8px;
  color: var(--text);
  border-bottom: 1px solid var(--brd);
  padding-bottom: 4px;
}

.note-rendered h3 {
  font-size: .88rem;
  font-weight: 700;
  margin: 14px 0 6px;
  color: var(--blue);
}

.note-rendered p {
  margin: 6px 0;
  font-size: .82rem;
  line-height: 1.65;
}

.note-rendered ul,
.note-rendered ol {
  margin: 6px 0 6px 18px;
  font-size: .82rem;
  line-height: 1.65;
}

.note-rendered li {
  margin: 3px 0;
}

.note-rendered code {
  background: var(--s2);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .78rem;
}

.note-rendered pre {
  background: var(--s2);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
}

.note-rendered pre code {
  background: none;
  padding: 0;
}

.note-rendered strong {
  font-weight: 700;
}

.note-rendered hr {
  border: none;
  border-top: 1px solid var(--brd);
  margin: 14px 0;
}

.note-rendered blockquote {
  border-left: 3px solid var(--blue);
  padding: 6px 12px;
  background: var(--blue-dim, var(--s2));
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
  font-style: italic;
  font-size: .82rem;
}

/* ════════════════════════════════════════════════════
   EASYEXAMS — UI ENHANCEMENT PATCH
   Vivid glassmorphism, animated cards, premium feel
   ════════════════════════════════════════════════════ */

/* ── Enhanced Root Variables ── */
:root {
  --glow-blue: 0 0 30px rgba(79, 142, 247, .25);
  --glow-violet: 0 0 30px rgba(124, 95, 244, .25);
  --glow-green: 0 0 30px rgba(45, 212, 160, .2);
  --glass: rgba(255, 255, 255, .03);
  --glass-border: rgba(255, 255, 255, .08);
  --grad3: linear-gradient(135deg, #4f8ef7, #7c5ff4, #ec4899);
  --grad-green: linear-gradient(135deg, #2dd4a0, #22d3ee);
  --grad-warm: linear-gradient(135deg, #f59e0b, #f97316);
  --transition-smooth: all .25s cubic-bezier(.4, 0, .2, 1);
}

/* ── Enhanced Sidebar ── */
.sidebar {
  background: linear-gradient(180deg, #0a0e18 0%, #0d1220 100%);
  border-right: 1px solid rgba(79, 142, 247, .1);
}

.logo-mark {
  background: linear-gradient(135deg, rgba(79, 142, 247, .15), rgba(124, 95, 244, .1));
  border-radius: 10px;
  padding: 8px 10px;
  margin: -4px -4px;
}

.nav-item {
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background: rgba(255, 255, 255, .05);
  color: white;
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79, 142, 247, .2), rgba(124, 95, 244, .12));
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(79, 142, 247, .2);
}

.nav-item.active::before {
  background: linear-gradient(to bottom, var(--blue), var(--violet));
  width: 3px;
  border-radius: 3px;
}

/* ── Enhanced Stat Cards ── */
.stat-card {
  background: linear-gradient(145deg, var(--s1) 0%, var(--s2) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4), var(--glow-blue);
  border-color: rgba(79, 142, 247, .2);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(79, 142, 247, .05) 0%, transparent 60%);
  pointer-events: none;
}

.stat-val {
  font-size: 2.4rem;
  background: var(--grad3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Enhanced Cards (general) ── */
.card {
  background: linear-gradient(145deg, #0d1017 0%, #111520 100%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: rgba(255, 255, 255, .1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}

/* ── Premium Flashcard Design ── */
.fc-wrap {
  height: 260px;
  perspective: 1400px;
  cursor: pointer;
  margin-bottom: 22px;
}

.fc-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}

.fc-inner.flipped {
  transform: rotateY(180deg);
}

.fc-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  flex-direction: column;
}

/* Front face — question */
.fc-face:not(.fc-back) {
  background: linear-gradient(145deg, #0f1422 0%, #141928 50%, #0f1422 100%);
  border: 1px solid rgba(79, 142, 247, .2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 20px 60px rgba(0, 0, 0, .5);
}

.fc-face:not(.fc-back)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  border-radius: 18px 18px 0 0;
}

/* Back face — answer */
.fc-back {
  background: linear-gradient(145deg, #0e1a18 0%, #131f1d 50%, #0e1a18 100%);
  border: 1px solid rgba(45, 212, 160, .2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04) inset, 0 20px 60px rgba(0, 0, 0, .5);
}

.fc-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad2);
  border-radius: 18px 18px 0 0;
}

.fc-question {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 12px;
}

.fc-answer {
  font-size: .9rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.65;
}

.fc-hint {
  font-size: .65rem;
  color: var(--muted2);
  text-align: center;
  margin-top: 12px;
  letter-spacing: .5px;
}

/* Flashcard tap indicator */
.fc-face:not(.fc-back)::after {
  content: 'Tap to reveal answer';
  position: absolute;
  bottom: 14px;
  font-size: .62rem;
  color: var(--muted2);
  letter-spacing: .5px;
  animation: pulseOp 2.5s ease infinite;
}

@keyframes pulseOp {

  0%,
  100% {
    opacity: .5;
  }

  50% {
    opacity: 1;
  }
}

/* ── Enhanced Rating Buttons ── */
.rate-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid var(--brd);
  background: var(--s2);
  color: var(--text);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--body);
}

.rate-wrong {
  border-color: rgba(240, 72, 72, .25);
}

.rate-wrong:hover {
  background: rgba(240, 72, 72, .15);
  border-color: rgba(240, 72, 72, .5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(240, 72, 72, .2);
}

.rate-hard {
  border-color: rgba(245, 158, 11, .25);
}

.rate-hard:hover {
  background: rgba(245, 158, 11, .15);
  border-color: rgba(245, 158, 11, .5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, .2);
}

.rate-good {
  border-color: rgba(45, 212, 160, .25);
}

.rate-good:hover {
  background: rgba(45, 212, 160, .15);
  border-color: rgba(45, 212, 160, .5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(45, 212, 160, .2);
}

/* Easy button enhancement */
.rate-easy {
  border-color: rgba(79, 142, 247, .25);
}

.rate-easy:hover {
  background: rgba(79, 142, 247, .15);
  border-color: rgba(79, 142, 247, .5);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(79, 142, 247, .2);
}

/* ── Enhanced Quiz Options ── */
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: linear-gradient(135deg, rgba(255, 255, 255, .02), transparent);
  font-size: .88rem;
}

.quiz-opt:hover {
  border-color: rgba(79, 142, 247, .4);
  background: rgba(79, 142, 247, .08);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

.quiz-opt.correct {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(45, 212, 160, .12), rgba(45, 212, 160, .06));
  box-shadow: 0 0 20px rgba(45, 212, 160, .15);
}

.quiz-opt.wrong {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(240, 72, 72, .12), rgba(240, 72, 72, .06));
}

.opt-letter {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  transition: var(--transition-smooth);
}

.quiz-opt.correct .opt-letter {
  background: var(--green);
  color: #001a12;
  border-color: var(--green);
}

.quiz-opt.wrong .opt-letter {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.quiz-question-text {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 22px;
  line-height: 1.45;
  color: var(--text);
}

.quiz-explain {
  background: linear-gradient(135deg, rgba(79, 142, 247, .08), rgba(124, 95, 244, .05));
  border-radius: 10px;
  padding: 14px 16px;
  font-size: .82rem;
  color: var(--muted);
  border-left: 3px solid var(--blue);
  display: none;
  margin-top: 12px;
  line-height: 1.6;
  animation: fadeIn .3s ease;
}

/* ── Enhanced Exam Cards ── */
.exam-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--s2) 0%, rgba(13, 16, 23, .9) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.exam-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--grad);
  border-radius: 3px 0 0 3px;
}

.exam-card:hover {
  border-color: rgba(79, 142, 247, .25);
  transform: translateX(3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

.exam-days-big {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 42px;
  text-align: center;
}

/* ── Enhanced Buttons ── */
.btn-primary {
  background: linear-gradient(135deg, #4f8ef7, #7c5ff4);
  color: white;
  box-shadow: 0 4px 15px rgba(79, 142, 247, .35);
  border: none;
  font-weight: 600;
  letter-spacing: .2px;
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 142, 247, .5);
  opacity: 1;
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn {
  border-radius: 10px;
  font-weight: 500;
}

/* ── Enhanced Deck Cards ── */
.dk-card {
  background: linear-gradient(145deg, var(--s1) 0%, var(--s2) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.dk-card:hover {
  border-color: rgba(79, 142, 247, .25);
  transform: translateX(4px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  background: linear-gradient(145deg, var(--s2) 0%, var(--s3) 100%);
}

.dk-color-strip {
  width: 5px;
  height: 50px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 12px currentColor;
  opacity: .8;
}

.dk-name {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.dk-count {
  font-size: .66rem;
  color: var(--muted2);
  letter-spacing: .3px;
}

/* ── Enhanced Progress Bar ── */
.prog-bar {
  height: 6px;
  background: var(--s3);
  border-radius: 4px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--grad);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 0 8px rgba(79, 142, 247, .4);
}

/* ── Passt Papers Enhanced ── */
.pp-card {
  background: linear-gradient(145deg, var(--s2) 0%, var(--s1) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px;
  transition: var(--transition-smooth);
  overflow: hidden;
  position: relative;
}

.pp-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
}

.pp-card:hover {
  border-color: rgba(79, 142, 247, .3);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}

.pp-year {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Enhanced Quiz Progress Dots ── */
.qpd {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--s3);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: var(--transition-smooth);
}

.qpd.current {
  background: rgba(79, 142, 247, .2);
  border-color: var(--blue);
  box-shadow: 0 0 10px rgba(79, 142, 247, .3);
  transform: scale(1.2);
}

.qpd.done-c {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(45, 212, 160, .3);
}

.qpd.done-w {
  background: var(--red);
  border-color: var(--red);
  opacity: .8;
}

/* ── Enhanced Page Headers ── */
.page-title {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.4px;
  background: linear-gradient(135deg, var(--text) 0%, rgba(237, 240, 247, .7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-sub {
  font-size: .8rem;
  color: var(--muted2);
  margin-bottom: 22px;
}

/* ── Enhanced Badges ── */
.badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .5px;
  border-radius: 5px;
  padding: 3px 9px;
}

.badge-blue {
  background: rgba(79, 142, 247, .15);
  color: var(--blue);
  border: 1px solid rgba(79, 142, 247, .2);
}

.badge-green {
  background: rgba(45, 212, 160, .12);
  color: var(--green);
  border: 1px solid rgba(45, 212, 160, .2);
}

/* ── Glow effects for XP/Streak ── */
.sb-xp-fill {
  background: linear-gradient(90deg, var(--violet), var(--blue));
  box-shadow: 0 0 8px rgba(124, 95, 244, .4);
}

.streak-day.filled {
  background: linear-gradient(135deg, #f59e0b, #f7c948);
  box-shadow: 0 0 8px rgba(245, 158, 11, .4);
}

/* ── Enhanced Hero Section (landing) ── */
.lp-hero-badge {
  background: linear-gradient(135deg, rgba(79, 142, 247, .15), rgba(124, 95, 244, .1));
  border: 1px solid rgba(79, 142, 247, .3);
  box-shadow: 0 0 20px rgba(79, 142, 247, .1);
}

.lp-hero-preview {
  box-shadow: 0 40px 100px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
}

/* ── Subject tiles on onboarding ── */
.subj-tile {
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.subj-tile:hover {
  transform: scale(1.02);
  border-color: rgba(79, 142, 247, .3);
}

.subj-tile.selected {
  background: linear-gradient(135deg, rgba(79, 142, 247, .12), rgba(124, 95, 244, .08));
  box-shadow: 0 0 0 1px rgba(79, 142, 247, .3) inset;
}

/* ── Modal enhancements ── */
.modal {
  background: linear-gradient(145deg, #0d1017 0%, #111520 100%);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .8), 0 0 0 1px rgba(79, 142, 247, .05) inset;
}

/* ── Task items ── */
.task-item {
  border-radius: 11px;
  transition: var(--transition-smooth);
}

.task-item:hover {
  transform: translateX(3px);
  border-color: rgba(79, 142, 247, .2);
}

.task-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .1);
  transition: var(--transition-smooth);
}

.task-item.done .task-check {
  background: linear-gradient(135deg, var(--green), #22d3ee);
  border-color: transparent;
  box-shadow: 0 0 10px rgba(45, 212, 160, .4);
}

/* ── Resources cards ── */
.res-card {
  border-radius: 14px;
  transition: var(--transition-smooth);
  background: linear-gradient(145deg, var(--s1) 0%, var(--s2) 100%);
}

.res-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 142, 247, .25);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .4), 0 0 0 1px rgba(79, 142, 247, .08) inset;
}

/* ── AI Practice section ── */
.pq-hero {
  background: linear-gradient(135deg, rgba(124, 95, 244, .12), rgba(236, 72, 153, .08), rgba(79, 142, 247, .08));
  border: 1px solid rgba(124, 95, 244, .25);
  box-shadow: 0 8px 40px rgba(124, 95, 244, .12);
}

/* ── Pomodoro ring enhancement ── */
.pomo-btn.main {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 6px 24px rgba(79, 142, 247, .4);
  width: 60px;
  height: 60px;
}

.pomo-btn.main:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(79, 142, 247, .55);
}

.pomo-time {
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--text), rgba(237, 240, 247, .8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── XP Level bar ── */
.xp-bar-outer {
  height: 5px;
  background: var(--s3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.xp-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border-radius: 3px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 0 10px rgba(124, 95, 244, .5);
}

/* ── Enhanced notification toast ── */
.toast {
  background: linear-gradient(135deg, var(--s4), var(--s3));
  border: 1px solid rgba(79, 142, 247, .2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .04) inset;
  border-radius: 40px;
  font-size: .85rem;
  letter-spacing: .1px;
}

/* ── Grade tracker cards ── */
.grade-subject-card {
  border-radius: 14px;
  background: linear-gradient(145deg, var(--s1), var(--s2));
  transition: var(--transition-smooth);
}

.grade-subject-card:hover {
  border-color: rgba(79, 142, 247, .2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
}

/* ── Content note area ── */
.note-area {
  background: linear-gradient(145deg, #0d1017, #111520);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font-family: var(--mono);
  line-height: 1.8;
}

.note-area:focus {
  border-color: rgba(79, 142, 247, .4);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, .1), 0 0 30px rgba(79, 142, 247, .08);
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .08);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 142, 247, .3);
}

/* ── Floating subject tag on deck cards ── */
.dk-card .dk-subj-tag {
  font-size: .58rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted2);
  margin-left: auto;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Smooth page transitions ── */
.page.active {
  animation: pageFadeIn .3s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Loading shimmer for empty states ── */
.empty-state {
  padding: 52px 20px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(79, 142, 247, .03) 0%, transparent 70%);
  border-radius: 16px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: .4;
  filter: drop-shadow(0 0 12px rgba(79, 142, 247, .3));
}

.empty-text {
  color: var(--muted2);
  font-size: .85rem;
  line-height: 1.6;
}

/* ── Edexcel History colour tag ── */
.history-tag {
  background: linear-gradient(135deg, rgba(232, 93, 158, .15), rgba(232, 93, 158, .08));
  border: 1px solid rgba(232, 93, 158, .25);
  color: #e85d9e;
  font-size: .65rem;
  padding: 3px 9px;
  border-radius: 5px;
  font-weight: 700;
  letter-spacing: .5px;
}

/* ── Responsive tweaks ── */
@media (max-width: 768px) {
  .fc-wrap {
    height: 220px;
  }

  .fc-question {
    font-size: 1rem;
  }

  .fc-answer {
    font-size: .84rem;
  }

  .exam-days-big {
    font-size: 1.6rem;
  }

  .stat-val {
    font-size: 2rem;
  }

  .quiz-opt {
    padding: 12px 14px;
  }
}