/* ─── EdenGlot / Edentron Theme Engine ──────────────────────────────────────
   Four curated brand-aligned themes.
   html[data-theme] selectors are the CSS-only fallback; theme.js also writes
   vars as inline styles on <html> so they beat any page-level :root blocks.  */

/* ── Immutable structural brand tokens ───────────────────────────────────── */
:root {
  --brand-dark:     #0D2060;
  --brand-mid:      #1B5ABA;
}

/* ── 1. Edentron Dark (Default) ──────────────────────────────────────────── */
:root,
html[data-theme="edentron-dark"] {
  --bg:         #0B0E11;
  --surface:    #111418;
  --surface-2:  #181C22;
  --surface-3:  #1E2229;
  --border:     #1C1F24;
  --border-2:   #252930;
  --text:       #E6EAF0;
  --text-2:     #9AA3B2;
  --text-3:     #5A6270;
  --muted:      #9AA3B2;
  --dim:        #5A6270;
  --blue:       #4F8BFF;
  --blue-bg:    #0D1529;
  --accent:     #00E0FF;
  --brand-sky:  #4F8BFF;
  --brand-gradient:      linear-gradient(135deg, #0D1529 0%, #1A3060 55%, #4F8BFF 100%);
  --brand-gradient-text: linear-gradient(130deg, #00E0FF, #4F8BFF);
  --brand-glow:          rgba(79,139,255,0.18);
  --brand-glow-mid:      rgba(26,48,96,0.25);
  --green:      #3ecf6e;  --green-bg:  #0a2218;
  --orange:     #f08c42;  --orange-bg: #271608;
  --red:        #f05252;  --red-bg:    #2a0f0f;
}

/* ── 2. EdenGlot Midnight Neon ───────────────────────────────────────────── */
html[data-theme="midnight-neon"] {
  --bg:         #05060A;
  --surface:    #0D0F14;
  --surface-2:  #131620;
  --surface-3:  #191C28;
  --border:     #1A1C22;
  --border-2:   #22252E;
  --text:       #F2F5FF;
  --text-2:     #8C92A3;
  --text-3:     #555C70;
  --muted:      #8C92A3;
  --dim:        #555C70;
  --blue:       #7B5CFF;
  --blue-bg:    #130F2A;
  --accent:     #FF3CF0;
  --brand-sky:  #7B5CFF;
  --brand-gradient:      linear-gradient(135deg, #130F2A 0%, #2A1A60 55%, #7B5CFF 100%);
  --brand-gradient-text: linear-gradient(130deg, #FF3CF0, #7B5CFF);
  --brand-glow:          rgba(123,92,255,0.18);
  --brand-glow-mid:      rgba(42,26,96,0.25);
  --green:      #3ecf6e;  --green-bg:  #0a2218;
  --orange:     #f08c42;  --orange-bg: #271608;
  --red:        #f05252;  --red-bg:    #2a0f0f;
}

/* ── 3. Nordic Light ─────────────────────────────────────────────────────── */
html[data-theme="nordic-light"] {
  --bg:         #F7F9FB;
  --surface:    #FFFFFF;
  --surface-2:  #EDF0F5;
  --surface-3:  #E3E8EF;
  --border:     #E3E6EB;
  --border-2:   #CDD2DA;
  --text:       #1A1D21;
  --text-2:     #6A717C;
  --text-3:     #9CA3AD;
  --muted:      #6A717C;
  --dim:        #9CA3AD;
  --blue:       #3A6DFF;
  --blue-bg:    #E6EEFF;
  --accent:     #00C6D8;
  --brand-sky:  #3A6DFF;
  --brand-gradient:      linear-gradient(135deg, #1A3CC0 0%, #3A6DFF 55%, #00C6D8 100%);
  --brand-gradient-text: linear-gradient(130deg, #00C6D8, #3A6DFF);
  --brand-glow:          rgba(58,109,255,0.14);
  --brand-glow-mid:      rgba(26,60,192,0.18);
  --green:      #1a9458;  --green-bg:  #d0f5e4;
  --orange:     #d97020;  --orange-bg: #fff0da;
  --red:        #d62e2e;  --red-bg:    #fde0e0;
}

/* ── 4. Fjord Mist ───────────────────────────────────────────────────────── */
html[data-theme="fjord-mist"] {
  --bg:         #E9EEF2;
  --surface:    #F4F7FA;
  --surface-2:  #E3E8EF;
  --surface-3:  #D8DDE5;
  --border:     #D5D9DE;
  --border-2:   #C4C9D1;
  --text:       #1A1D21;
  --text-2:     #5E6672;
  --text-3:     #8C939E;
  --muted:      #5E6672;
  --dim:        #8C939E;
  --blue:       #4A7BFF;
  --blue-bg:    #E4EAFF;
  --accent:     #009FB8;
  --brand-sky:  #4A7BFF;
  --brand-gradient:      linear-gradient(135deg, #1A3CC0 0%, #4A7BFF 55%, #009FB8 100%);
  --brand-gradient-text: linear-gradient(130deg, #009FB8, #4A7BFF);
  --brand-glow:          rgba(74,123,255,0.14);
  --brand-glow-mid:      rgba(26,60,192,0.18);
  --green:      #1a9458;  --green-bg:  #d0f5e4;
  --orange:     #d97020;  --orange-bg: #fff0da;
  --red:        #d62e2e;  --red-bg:    #fde0e0;
}

/* ─── Theme Picker Widget ────────────────────────────────────────────────────
   Self-contained floating widget injected by theme.js                        */

#eden-tp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, 'Inter', system-ui, sans-serif;
}

#eden-tp-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2, #252930);
  background: var(--surface-2, #181C22);
  color: var(--text-2, #9AA3B2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .18s, color .18s, transform .18s, box-shadow .18s;
  box-shadow: 0 4px 18px rgba(0,0,0,.38);
  outline: none;
}
#eden-tp-btn:hover {
  border-color: var(--blue, #4F8BFF);
  color: var(--blue, #4F8BFF);
  transform: scale(1.09);
  box-shadow: 0 6px 22px rgba(0,0,0,.46);
}
#eden-tp-btn:focus-visible {
  outline: 2px solid var(--blue, #4F8BFF);
  outline-offset: 2px;
}

/* Panel */
#eden-tp-panel {
  position: absolute;
  bottom: 50px;
  right: 0;
  width: 260px;
  background: var(--surface, #111418);
  border: 1px solid var(--border-2, #252930);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.65);
  transform-origin: bottom right;
  animation: eden-tp-pop .17s cubic-bezier(.32,1.2,.6,1);
}
@keyframes eden-tp-pop {
  from { opacity: 0; transform: scale(.88) translateY(10px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);    }
}

.eden-tp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #1C1F24);
}
.eden-tp-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3, #5A6270);
}
.eden-tp-current {
  font-size: .7rem;
  font-weight: 600;
  color: var(--blue, #4F8BFF);
  background: var(--blue-bg, #0D1529);
  padding: 2px 8px;
  border-radius: 20px;
}

/* 2-column grid (4 themes → 2×2) */
.eden-tp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.eden-tp-opt {
  border: 1.5px solid var(--border, #1C1F24);
  background: var(--surface-2, #181C22);
  border-radius: 10px;
  padding: 10px 6px 9px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: border-color .15s, background .15s, transform .12s;
  outline: none;
}
.eden-tp-opt:hover {
  border-color: var(--blue, #4F8BFF);
  background: var(--surface-3, #1E2229);
  transform: translateY(-1px);
}
.eden-tp-opt:focus-visible {
  outline: 2px solid var(--blue, #4F8BFF);
  outline-offset: 2px;
}
.eden-tp-opt.active {
  border-color: var(--blue, #4F8BFF);
  background: var(--blue-bg, #0D1529);
}

/* Swatch: 2×2 color grid */
.eden-tp-preview {
  width: 44px;
  height: 28px;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  border: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.eden-tp-preview span {
  display: block;
}

.eden-tp-label {
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-2, #9AA3B2);
  line-height: 1.2;
  text-align: center;
}
.eden-tp-opt.active .eden-tp-label {
  color: var(--blue, #4F8BFF);
}
