:root {
  --bg: #F4F7FB;
  --surface: #FFFFFF;
  --surface-alt: #EEF3FA;
  --surface-elevated: #FFFFFF;
  --border: #DDE5F0;
  --text: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --primary: #1D4ED8;
  --primary-deep: #1E3A8A;
  --primary-soft: #DBEAFE;
  --teal: #0D9488;
  --teal-soft: #CCFBF1;
  --amber: #D97706;
  --amber-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.09);
  --gradient-brand: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 52%, #0D9488 100%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1120;
    --surface: #131C31;
    --surface-alt: #1A2642;
    --surface-elevated: #1E293B;
    --border: #263451;
    --text: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --primary: #60A5FA;
    --primary-deep: #3B82F6;
    --primary-soft: rgba(59, 130, 246, 0.18);
    --teal: #2DD4BF;
    --teal-soft: rgba(45, 212, 191, 0.16);
    --amber: #FBBF24;
    --amber-soft: rgba(251, 191, 36, 0.16);
    --danger: #F87171;
    --danger-soft: rgba(248, 113, 113, 0.16);
    --success: #4ADE80;
    --success-soft: rgba(74, 222, 128, 0.16);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.42);
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

a { color: var(--primary); }
button, input, select, textarea { font-family: inherit; }

/* Loader */
.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.boot-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow-md); }
.boot-title { color: var(--text-muted); font-weight: 600; }

/* Confetti & Toasts */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}
.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  font-size: 0.92rem;
  font-weight: 500;
  animation: slideIn 0.25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--amber); }

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

/* ==================== AUTH / LANDING ==================== */
.landing-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.landing-main {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 20px 48px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 900px) {
  .landing-main { grid-template-columns: 1fr; padding-top: 24px; gap: 28px; }
}
.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.hero-brand img {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.hero-brand span {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero-h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.hero-h1 .accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 24px;
  max-width: 540px;
}
.feature-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
@media (max-width: 520px) {
  .feature-pills { grid-template-columns: 1fr; }
}
.feature-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.feature-pill-ico {
  font-size: 1.25rem;
  line-height: 1;
}
.feature-pill strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
.feature-pill small { color: var(--text-muted); font-size: 0.82rem; line-height: 1.4; }

/* Store Buttons */
.store-section { margin-top: 8px; }
.store-label { font-size: 0.84rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: #0F172A;
  color: #FFFFFF;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.store-btn.disabled { opacity: 0.72; cursor: default; }
.store-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.store-btn-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-btn-sub { font-size: 0.68rem; opacity: 0.82; letter-spacing: 0.02em; }
.store-btn-name { font-size: 0.98rem; font-weight: 700; }

/* Auth Card */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow-md);
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.segmented button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}
.field-hint { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.landing-footer .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-bottom: 6px; }
.landing-footer a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.landing-footer a:hover { color: var(--primary); }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--gradient-brand); color: #FFFFFF; box-shadow: 0 4px 14px rgba(29, 78, 216, 0.28); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-success { background: var(--success); color: #FFFFFF; }
.btn-amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(217,119,6,0.25); }
.btn-sm { padding: 7px 12px; font-size: 0.83rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* ==================== MAIN APP SHELL ==================== */
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; padding-bottom: 76px; }
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
@media (max-width: 960px) {
  .sidebar { display: none; }
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
}
.sidebar-brand img { width: 38px; height: 38px; border-radius: 10px; }
.sidebar-brand strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.sidebar-brand small { display: block; font-size: 0.74rem; color: var(--text-muted); }

.track-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 11px;
  gap: 4px;
}
.track-switcher button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.79rem;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.track-switcher button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.nav-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.14s, color 0.14s;
}
.nav-item:hover { background: var(--surface-alt); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-badge {
  margin-left: auto;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { display: block; font-size: 0.74rem; color: var(--text-muted); }

/* Mobile Header + Bottom Nav */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 960px) {
  .mobile-bar { display: flex; }
  .bottom-nav { display: grid; }
}
.bnav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 6px 4px;
  cursor: pointer;
}
.bnav-item span.ico { font-size: 1.2rem; line-height: 1; }
.bnav-item.active { color: var(--primary); font-weight: 700; }

/* Stage */
.stage {
  padding: 28px 32px 56px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}
@media (max-width: 720px) {
  .stage { padding: 18px 16px 44px; }
}

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-hero {
  background: var(--gradient-brand);
  color: #FFFFFF;
  border: none;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.card-hero p { color: rgba(255,255,255,0.88); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.kpi-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.kpi-val { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.kpi-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* Progress Ring */
.ring-wrap { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); width: 112px; height: 112px; }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ring-pct { font-size: 1.45rem; font-weight: 900; line-height: 1; }
.ring-lbl { font-size: 0.68rem; opacity: 0.85; font-weight: 600; margin-top: 2px; }

/* Progress Bar */
.bar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-brand);
  transition: width 0.35s ease;
}

/* Badges / Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}
.chip-blue { background: var(--primary-soft); color: var(--primary); }
.chip-teal { background: var(--teal-soft); color: var(--teal); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-green { background: var(--success-soft); color: var(--success); }
.chip-red { background: var(--danger-soft); color: var(--danger); }

/* Block Cards */
.block-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.block-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.block-top { display: flex; align-items: center; gap: 12px; }
.block-num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Block Study Stepper */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.step-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.step-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.step-tab.done {
  border-color: var(--success);
  color: var(--success);
}
.step-tab.active.done {
  background: var(--success);
  color: #fff;
}

/* Theory Cards */
.theory-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
}
.theory-card h3 { margin: 0 0 12px; font-size: 1.2rem; }
.theory-body { white-space: pre-line; line-height: 1.72; color: var(--text-secondary); margin-bottom: 16px; }
.callout {
  border-radius: 13px;
  padding: 13px 16px;
  margin-top: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
}
.callout-key { background: var(--teal-soft); border-left: 4px solid var(--teal); }
.callout-trap { background: var(--amber-soft); border-left: 4px solid var(--amber); }
.glossary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.glossary-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 0.82rem;
}
.glossary-pill strong { color: var(--primary); }

/* Flashcard 3D */
.flashcard-stage { max-width: 640px; margin: 0 auto; }
.flashcard-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 36px 28px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.flashcard-box.flipped { border-color: var(--teal); }
.flashcard-q { font-size: 1.25rem; font-weight: 800; line-height: 1.45; }
.flashcard-a { font-size: 1.05rem; line-height: 1.65; color: var(--text-secondary); margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.rating-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
@media (max-width: 540px) { .rating-row { grid-template-columns: repeat(2, 1fr); } }

/* Quiz & Exam */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.q-stem { font-size: 1.15rem; font-weight: 700; line-height: 1.5; margin: 12px 0 20px; }
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.45;
  cursor: pointer;
  transition: all 0.14s ease;
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); }
.option-btn.selected { border-color: var(--primary); background: var(--primary-soft); }
.option-btn.correct { border-color: var(--success); background: var(--success-soft); }
.option-btn.wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.explanation-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  line-height: 1.62;
}
.explanation-box.correct { border-left-color: var(--success); }
.explanation-box.wrong { border-left-color: var(--danger); }

/* Exam Navigator Grid */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 6px;
  margin-top: 14px;
}
.exam-dot {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.exam-dot.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.exam-dot.flagged { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.exam-dot.current { outline: 2px solid var(--text); }

/* Tables (Admin) */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.89rem; }
table.data-table th, table.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table.data-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  max-width: 560px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head h1, .section-head h2 { margin: 0; letter-spacing: -0.02em; }
.muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }
