/* ============================================================
   Shule Timetable — Ultra Premium Glassmorphism
   Aesthetic: Kilimanjaro dawn — deep indigo night giving way to
   savanna emerald and a warm gold sunrise glow, with frosted
   glass panels floating above.
   ============================================================ */
:root {
  --ink-900:     #16140F;
  --ink-700:     #3A362C;
  --ink-500:     #6B6659;

  --emerald-900: #0B2A1F;
  --emerald-700: #16513B;
  --emerald-500: #1B5E3F;
  --gold-600:    #C99A2E;
  --gold-400:    #E8C468;
  --indigo-900:  #0A0E1A;
  --teal-500:    #2E6F95;

  --glass-light:      rgba(255, 255, 255, 0.68);
  --glass-light-hi:   rgba(255, 255, 255, 0.88);
  --glass-border:     rgba(255, 255, 255, 0.55);
  --glass-dark:       rgba(8, 14, 12, 0.38);
  --glass-dark-hi:    rgba(8, 14, 12, 0.55);
  --glass-dark-border: rgba(255, 255, 255, 0.12);

  --green-100:   #E4EFE7;
  --red-600:     #B3261E;
  --red-100:     #FBE9E7;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 8px 32px rgba(11, 42, 31, .16), 0 2px 8px rgba(11, 42, 31, .10);
  --shadow-lift: 0 16px 44px rgba(11, 42, 31, .24), 0 4px 12px rgba(11, 42, 31, .14);

  /* Theme-system vars — override in [data-theme="..."] blocks */
  --aurora-gold-glow: 201, 154, 46;
  --aurora-teal-glow: 46, 111, 149;
  --aurora-bg-end: #2B4A2E;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- Aurora background ---------- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 8% 8%, rgba(var(--aurora-gold-glow), .20), transparent 60%),
    radial-gradient(ellipse 60% 50% at 95% 15%, rgba(var(--aurora-teal-glow), .22), transparent 60%),
    linear-gradient(160deg, var(--indigo-900) 0%, var(--emerald-900) 48%, var(--emerald-700) 78%, var(--aurora-bg-end) 100%);
}
.bg-aurora .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  will-change: transform;
}
.bg-aurora .blob-1 {
  width: 520px; height: 520px; top: -120px; left: -100px;
  background: radial-gradient(circle, rgba(var(--aurora-gold-glow), .55), transparent 70%);
  animation: driftA 26s ease-in-out infinite alternate;
}
.bg-aurora .blob-2 {
  width: 620px; height: 620px; bottom: -180px; right: -140px;
  background: radial-gradient(circle, rgba(var(--aurora-teal-glow), .65), transparent 70%);
  animation: driftB 32s ease-in-out infinite alternate;
}
.bg-aurora .blob-3 {
  width: 420px; height: 420px; top: 40%; left: 55%;
  background: radial-gradient(circle, rgba(var(--aurora-teal-glow), .45), transparent 70%);
  animation: driftC 22s ease-in-out infinite alternate;
}
@keyframes driftA { from { transform: translate(0,0) scale(1); } to { transform: translate(60px,40px) scale(1.12); } }
@keyframes driftB { from { transform: translate(0,0) scale(1); } to { transform: translate(-50px,-30px) scale(1.08); } }
@keyframes driftC { from { transform: translate(0,0) scale(1); } to { transform: translate(-40px,50px) scale(0.92); } }

@media (prefers-reduced-motion: reduce) {
  .bg-aurora .blob { animation: none; }
}

h1, h2, h3 { font-family: var(--font-display); color: var(--emerald-900); margin: 0 0 .3em; letter-spacing: -.01em; }
h1 { font-size: 1.8rem; font-weight: 600; }
h2 { font-size: 1.2rem; font-weight: 600; }
p { color: var(--ink-500); }
a { color: inherit; }

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

.sidebar {
  width: 252px;
  flex-shrink: 0;
  background: var(--glass-dark);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-right: 1px solid var(--glass-dark-border);
  color: #fff;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--emerald-900);
  font-family: var(--font-display);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(var(--aurora-gold-glow), .4);
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.2; }
.brand-sub { font-size: .74rem; color: rgba(255,255,255,.58); margin-top: 2px; }
.sidebar-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}
.sidebar-menu-toggle svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.sidebar-menu-toggle:hover { background: rgba(255,255,255,.14); }

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 14px 12px 4px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  text-decoration: none;
  color: rgba(255,255,255,.8);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .15s ease;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.nav a.active {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--emerald-900);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(var(--aurora-gold-glow), .35);
}
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: 4px 0; }

.main {
  flex: 1;
  padding: 38px 46px 60px;
  max-width: 1220px;
  animation: pageIn .5s ease both;
  overflow-y: auto;
  min-height: 0;
}

.main::-webkit-scrollbar {
  width: 8px;
}

.main::-webkit-scrollbar-track {
  background: rgba(58,54,44,.08);
}

.main::-webkit-scrollbar-thumb {
  background: rgba(58,54,44,.25);
  border-radius: 4px;
}

.main::-webkit-scrollbar-thumb:hover {
  background: rgba(58,54,44,.35);
}
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 14px;
}
.page-head h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.25); }
.page-head p { color: rgba(255,255,255,.72); max-width: 60ch; }

/* ---------- Glass cards ---------- */
.card {
  background: var(--glass-light);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 24px 26px;
  margin-bottom: 22px;
  animation: cardIn .5s ease both;
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: var(--shadow-lift); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.main .card:nth-of-type(1) { animation-delay: .03s; }
.main .card:nth-of-type(2) { animation-delay: .09s; }
.main .card:nth-of-type(3) { animation-delay: .15s; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--glass-light);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: cardIn .5s ease both;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.stat .num {
  font-family: var(--font-display); font-size: 2.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--emerald-500), var(--teal-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .label { color: var(--ink-500); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700));
  color: #fff;
  box-shadow: 0 6px 18px rgba(27,94,63,.35);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 24px rgba(27,94,63,.45); transform: translateY(-1px); }
.btn-primary:disabled { background: #A7ADA3; box-shadow: none; cursor: not-allowed; filter: none; transform: none; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--emerald-900);
  box-shadow: 0 6px 18px rgba(var(--aurora-gold-glow), .35);
}
.btn-gold:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(var(--aurora-gold-glow), .45); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.5); border-color: var(--glass-border); color: var(--ink-900); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--emerald-500); color: var(--emerald-700); background: rgba(255,255,255,.75); }
.btn-danger { background: rgba(255,255,255,.6); border-color: var(--red-600); color: var(--red-600); }
.btn-danger:hover { background: var(--red-100); }
.btn-sm { padding: 7px 14px; font-size: .8rem; }

.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); transform: scale(0); animation: rippleAnim .55s ease-out; pointer-events: none; }
@keyframes rippleAnim { to { transform: scale(3.2); opacity: 0; } }

/* ---------- Forms ---------- */
label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
select, input[type=text], input[type=email], input[type=tel], input[type=time], input[type=number] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(58,54,44,.16);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .92rem;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  color: var(--ink-900);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
select:focus, input:focus {
  outline: none;
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 4px rgba(27,94,63,.14);
  background: rgba(255,255,255,.92);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

/* ---------- Checkbox grid (subject pickers) ---------- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.check-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(58,54,44,.14);
  background: rgba(255,255,255,.55);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.check-chip:hover { background: rgba(255,255,255,.85); }
.check-chip input { width: auto; accent-color: var(--emerald-500); }
.check-chip.checked-compulsory { border-color: var(--gold-600); background: rgba(var(--aurora-gold-glow), .12); }
.chip-periods { margin-left: auto; font-size: .72rem; color: var(--ink-500); font-weight: 600; }

/* ---------- Status / collision badge (signature element) ---------- */
.status-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  margin: 18px 0;
  border: 1px solid rgba(58,54,44,.12);
  background: rgba(255,255,255,.5);
  color: var(--ink-500);
  transition: background .3s ease, border-color .3s ease, color .3s ease;
}
.status-check .dot { width: 11px; height: 11px; border-radius: 50%; background: #C9C4B4; flex-shrink: 0; transition: background .3s ease; }
.status-check.is-clear { background: rgba(228,239,231,.85); color: var(--emerald-900); border-color: #9FD1B4; }
.status-check.is-clear .dot { background: var(--emerald-500); box-shadow: 0 0 0 5px rgba(27,94,63,.16); }
.status-check.is-conflict { background: rgba(251,233,231,.9); color: var(--red-600); border-color: #F0C6C2; }
.status-check.is-conflict .dot { background: var(--red-600); animation: pulse 1.1s infinite; }
.status-check.is-checking .dot { background: var(--gold-600); animation: pulse 1.1s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(179,38,30,.35); }
  70%  { box-shadow: 0 0 0 9px rgba(179,38,30,0); }
  100% { box-shadow: 0 0 0 0 rgba(179,38,30,0); }
}
.conflict-list { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }

/* ---------- Alerts ---------- */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: .9rem;
  font-weight: 500;
  border: 1px solid transparent;
  backdrop-filter: blur(14px);
  animation: alertIn .35s ease both;
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-success { background: rgba(228,239,231,.85); color: var(--emerald-900); border-color: #9FD1B4; }
.alert-error { background: rgba(251,233,231,.9); color: var(--red-600); border-color: #F0C6C2; }

/* ---------- Tidy timetable grid ---------- */
.tt-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--glass-border); }
table.timetable { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.55); font-size: .85rem; }
table.timetable th, table.timetable td { border: 1px solid rgba(58,54,44,.1); padding: 11px 13px; text-align: left; vertical-align: top; }
table.timetable thead th {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700));
  color: #fff; font-weight: 600; position: sticky; top: 0; white-space: nowrap;
}
table.timetable td.period-col { background: rgba(var(--aurora-gold-glow), .14); font-weight: 600; color: var(--emerald-900); white-space: nowrap; }
table.timetable tr.break-row td {
  background: repeating-linear-gradient(45deg, rgba(58,54,44,.05), rgba(58,54,44,.05) 6px, rgba(58,54,44,.09) 6px, rgba(58,54,44,.09) 12px);
  color: var(--ink-500); font-style: italic; text-align: center;
}
table.timetable td.slot-filled { background: rgba(255,255,255,.85); position: relative; transition: background .15s ease; }
table.timetable td.slot-filled:hover { background: #fff; }
.subject-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.tt-subject { font-weight: 600; color: var(--emerald-900); display: inline-flex; align-items: center; }
.tt-teacher { color: var(--ink-500); font-size: .82rem; display: block; margin-top: 2px; }
.tt-empty { color: #C9C4B4; }
.source-tag { font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; margin-left: 6px; vertical-align: middle; }
.source-tag.auto { background: rgba(var(--aurora-teal-glow), .15); color: var(--teal-500); }
.source-tag.manual { background: rgba(var(--aurora-gold-glow), .15); color: var(--gold-600); }

/* ---------- Plain data tables ---------- */
table.data-table { width: 100%; border-collapse: collapse; background: transparent; }
table.data-table th, table.data-table td { padding: 13px 14px; border-bottom: 1px solid rgba(58,54,44,.1); text-align: left; font-size: .9rem; }
table.data-table th { color: var(--ink-500); font-weight: 600; text-transform: uppercase; font-size: .74rem; letter-spacing: .05em; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr { transition: background .15s ease; }
table.data-table tbody tr:hover { background: rgba(255,255,255,.4); }

.tag-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(27,94,63,.1); color: var(--emerald-700); font-size: .74rem; font-weight: 600; margin: 2px 3px 2px 0; }
.level-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: var(--emerald-900); font-size: .74rem; font-weight: 700; }

.toolbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }

/* ---------- Progress bars (generation report) ---------- */
.report-row { padding: 14px 0; border-bottom: 1px solid rgba(58,54,44,.1); }
.report-row:last-child { border-bottom: none; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; gap: 6px; }
.report-title { font-weight: 600; color: var(--ink-900); }
.report-meta { font-size: .8rem; color: var(--ink-500); }
.progress-bar { height: 8px; border-radius: 999px; background: rgba(58,54,44,.1); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--emerald-500), var(--gold-600)); transition: width .6s ease; }
.progress-fill.short { background: linear-gradient(90deg, var(--red-600), var(--gold-600)); }
.report-warning { font-size: .82rem; color: var(--red-600); margin-top: 6px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-500); }
.empty-state .icon { font-size: 2.2rem; margin-bottom: 10px; opacity: .6; display:flex; align-items:center; justify-content:center; }


/* ---------- Toast ---------- */
#toastHost { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--glass-dark-hi); backdrop-filter: blur(20px); color: #fff;
  padding: 12px 18px; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 500;
  box-shadow: var(--shadow-lift); border: 1px solid rgba(255,255,255,.14);
  animation: toastIn .35s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Custom scrollbar for glass containers */
.tt-scroll::-webkit-scrollbar, .sidebar::-webkit-scrollbar { height: 8px; width: 6px; }
.tt-scroll::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: rgba(58,54,44,.25); border-radius: 999px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    min-height: 0;
    position: sticky;
    z-index: 20;
    padding: 16px 18px;
    gap: 14px;
    max-height: 100vh;
    overflow-y: auto;
  }
  .sidebar::-webkit-scrollbar {
    width: 6px;
  }
  .sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,.05);
  }
  .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border-radius: 3px;
  }
  .sidebar .brand { flex: 1 1 auto; min-width: 0; }
  .sidebar .brand > div { min-width: 0; }
  .brand-name, .brand-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-menu-toggle { display: inline-flex; position: absolute; top: 17px; right: 18px; }
  .sidebar .nav { display: none; padding-top: 8px; }
  .sidebar.is-open .nav { display: flex; }
  .main { padding: 24px 18px 50px; }
}

/* Ultra-small phones */
@media (max-width: 480px) {
  .main { padding: 16px 12px 40px; }
  .card { padding: 18px 14px; }

  h1 { font-size: 1.45rem; }
  h2 { font-size: 1.05rem; }

  .stat .num { font-size: 1.8rem; }
  .stat { padding: 16px 14px; }

  .sidebar { padding: 14px 12px; gap: 12px; }
  .sidebar-menu-toggle { top: 14px; right: 12px; }
  .nav a { padding: 10px 10px; font-size: .88rem; }

  table.timetable { font-size: .78rem; }
  table.timetable th, table.timetable td { padding: 9px 10px; }

  .tt-scroll { border-radius: 14px; }
}

/* ============================================================
   Theme Presets — applied via data-theme="..." on <html>
   ============================================================ */

/* -- Ocean Blue -- */
[data-theme="ocean"] {
  --emerald-900: #0B1E2E;
  --emerald-700: #0F3B5E;
  --emerald-500: #1A6B9E;
  --gold-600: #17A2B8;
  --gold-400: #20C4D4;
  --indigo-900: #080D1A;
  --teal-500: #2E6F95;
  --aurora-gold-glow: 23, 162, 184;
  --aurora-teal-glow: 46, 111, 149;
  --aurora-bg-end: #1A2E3E;
}

/* -- Sunset Orange -- */
[data-theme="sunset"] {
  --emerald-900: #2E1C0B;
  --emerald-700: #5E3C0F;
  --emerald-500: #C96A2E;
  --gold-600: #E8A83E;
  --gold-400: #F4C87A;
  --indigo-900: #1E120A;
  --teal-500: #95722E;
  --aurora-gold-glow: 232, 168, 62;
  --aurora-teal-glow: 149, 114, 46;
  --aurora-bg-end: #3E2E1A;
}

/* -- Forest Green -- */
[data-theme="forest"] {
  --emerald-900: #0D2B1A;
  --emerald-700: #1A5233;
  --emerald-500: #2D8A4E;
  --gold-600: #6BBF59;
  --gold-400: #9DD97A;
  --indigo-900: #0A1A0E;
  --teal-500: #2E9570;
  --aurora-gold-glow: 107, 191, 89;
  --aurora-teal-glow: 46, 149, 112;
  --aurora-bg-end: #1A2E1E;
}

/* -- Royal Purple -- */
[data-theme="royal"] {
  --emerald-900: #1A0B2E;
  --emerald-700: #35165E;
  --emerald-500: #5E2EC9;
  --gold-600: #A83EE8;
  --gold-400: #C97AF4;
  --indigo-900: #0E0A1E;
  --teal-500: #6E2E95;
  --aurora-gold-glow: 168, 62, 232;
  --aurora-teal-glow: 110, 46, 149;
  --aurora-bg-end: #1E1A2E;
}

/* -- Cherry Red -- */
[data-theme="cherry"] {
  --emerald-900: #2B0D0A;
  --emerald-700: #5E1A16;
  --emerald-500: #C92E2E;
  --gold-600: #E85959;
  --gold-400: #F47A7A;
  --indigo-900: #1E0A0A;
  --teal-500: #952E2E;
  --aurora-gold-glow: 232, 89, 89;
  --aurora-teal-glow: 149, 46, 46;
  --aurora-bg-end: #2E1A1A;
}

/* ---------- Theme swatches (sidebar) ---------- */
.theme-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 14px 12px 4px;
}
.theme-swatches {
  display: flex;
  gap: 6px;
  padding: 4px 12px;
  flex-wrap: wrap;
}
.theme-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  cursor: pointer; padding: 0;
  transition: border-color .15s ease, transform .15s ease;
  position: relative;
  outline: none;
}
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.theme-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.theme-swatch.active::after {
  content: '';
  position: absolute; inset: 5px; border-radius: 50%;
  background: rgba(255,255,255,.6);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
