/* ──────────────────────────────────────────────────────────────────
   BNE.LIVE — Tweaks panel CSS
   Pinned bottom-right runtime panel for theme/font/accent toggles.
   Loaded on BOTH the public site and the admin shell (the panel ships
   the same on both surfaces). Self-contained so it can't be broken by
   downstream stylesheets — every property is explicit, no token reads
   that might flip under .bne-light unexpectedly.
   ────────────────────────────────────────────────────────────────── */

.bne-tweaks {
  position: fixed; bottom: 16px; right: 16px;
  z-index: 9999;
  background: #0c0d10;
  color: #e8eaee;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 16px;
  min-width: 280px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.bne-tweaks-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.bne-tweaks-title {
  letter-spacing: 0.18em;
  opacity: 0.7;
}
.bne-tweaks-close {
  background: transparent; border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0; font-size: 16px;
  line-height: 1;
}
.bne-tweaks-close:hover { color: #fff; }

.bne-tweaks-section { margin-bottom: 14px; }
.bne-tweaks-section:last-child { margin-bottom: 0; }
.bne-tweaks-label {
  opacity: 0.55;
  margin-bottom: 6px;
  letter-spacing: 0.12em;
}

.bne-tweaks-pair { display: flex; gap: 4px; }
.bne-tweaks-btn {
  flex: 1;
  padding: 7px 0;
  background: transparent;
  color: #e8eaee;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.bne-tweaks-btn.is-active {
  background: #e8eaee;
  color: #0c0d10;
  font-weight: 700;
}

.bne-tweaks-stack { display: flex; flex-direction: column; gap: 4px; }
.bne-tweaks-font {
  padding: 8px 10px;
  background: transparent;
  color: #e8eaee;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  letter-spacing: -0.005em;
  font-size: 13px;
  font-weight: 600;
}
.bne-tweaks-font.is-active {
  background: #e8eaee;
  color: #0c0d10;
}
.bne-tweaks-tagline {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  opacity: 0.5;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.bne-tweaks-swatches { display: flex; gap: 6px; }
.bne-tweaks-swatch {
  width: 28px; height: 28px;
  border-radius: 99px;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
}
.bne-tweaks-swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.30);
}

@media (max-width: 640px) {
  .bne-tweaks { left: 16px; right: 16px; min-width: 0; }
}

/* ── Light mode ─────────────────────────────────────────────────────
   The base panel is dark (white text + 10%-white borders). In light
   mode the panel needs to flip to a white shell with dark text/borders,
   otherwise the close ×, "Dark" mode label, and inactive font/swatch
   options vanish into a white-on-white surface. */
html.bne-light .bne-tweaks {
  background: #ffffff;
  color: #0c0d10;
  border-color: rgba(12, 13, 16, 0.12);
  box-shadow: 0 12px 36px rgba(12, 13, 16, 0.12);
}
html.bne-light .bne-tweaks-close {
  color: rgba(12, 13, 16, 0.55);
}
html.bne-light .bne-tweaks-close:hover {
  color: #0c0d10;
}
html.bne-light .bne-tweaks-btn {
  color: #0c0d10;
  border-color: rgba(12, 13, 16, 0.18);
}
html.bne-light .bne-tweaks-btn.is-active {
  background: #0c0d10;
  color: #ffffff;
}
html.bne-light .bne-tweaks-font {
  color: #0c0d10;
  border-color: rgba(12, 13, 16, 0.18);
}
html.bne-light .bne-tweaks-font.is-active {
  background: #0c0d10;
  color: #ffffff;
}
html.bne-light .bne-tweaks-tagline {
  color: rgba(12, 13, 16, 0.45);
  opacity: 1;
}
html.bne-light .bne-tweaks-title,
html.bne-light .bne-tweaks-label {
  color: rgba(12, 13, 16, 0.55);
  opacity: 1;
}
html.bne-light .bne-tweaks-swatch.is-active {
  border-color: #0c0d10;
  box-shadow: 0 0 0 1px rgba(12, 13, 16, 0.30);
}
