/* ─── Theme palettes ────────────────────────────────────────── */

:root, [data-theme="clair"] {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e8e8e3;
  --accent: #1a1a1a;
  --rail: #e8e8e3;
  --good: #2d6a4f;
  --mid:  #b08900;
  --bad:  #9b2226;
}

[data-theme="sombre"] {
  --bg: #0f0f0e;
  --surface: #18181a;
  --ink: #f1f1ec;
  --muted: #8d8d87;
  --line: #2a2a28;
  --accent: #f1f1ec;
  --rail: #2a2a28;
  --good: #74c69d;
  --mid:  #f0c14b;
  --bad:  #ef6a6a;
}

[data-theme="foret"] {
  --bg: #f1f5ee;
  --surface: #ffffff;
  --ink: #1a2e22;
  --muted: #5e7064;
  --line: #d5e0d0;
  --accent: #2d6a4f;
  --rail: #d5e0d0;
  --good: #2d6a4f;
  --mid: #b08900;
  --bad: #9b2226;
}

[data-theme="couchant"] {
  --bg: #fdf4ec;
  --surface: #ffffff;
  --ink: #2a1810;
  --muted: #876857;
  --line: #f0dfca;
  --accent: #c2410c;
  --rail: #f0dfca;
  --good: #166534;
  --mid: #b08900;
  --bad: #9b2226;
}

[data-theme="ocean"] {
  --bg: #eff4f9;
  --surface: #ffffff;
  --ink: #0c1e2e;
  --muted: #5b7088;
  --line: #d2dde8;
  --accent: #0c4a6e;
  --rail: #d2dde8;
  --good: #166534;
  --mid: #b08900;
  --bad: #9b2226;
}

[data-theme="neon"] {
  --bg: #0a0a14;
  --surface: #14141f;
  --ink: #ffffff;
  --muted: #7a7a90;
  --line: #2a2a3a;
  --accent: #ff2d92;
  --rail: #2a2a3a;
  --good: #00ff9d;
  --mid:  #ffcc00;
  --bad:  #ff5577;
}

[data-theme="cyber"] {
  --bg: #0d0f1a;
  --surface: #161a2a;
  --ink: #e8f1ff;
  --muted: #7a8aab;
  --line: #2a3252;
  --accent: #00e5ff;
  --rail: #2a3252;
  --good: #a0ff00;
  --mid:  #ffcc00;
  --bad:  #ff5577;
}

[data-theme="bonbon"] {
  --bg: #fdf2f8;
  --surface: #ffffff;
  --ink: #4a1d3a;
  --muted: #8a6678;
  --line: #f8d4e6;
  --accent: #db2777;
  --rail: #f8d4e6;
  --good: #16a34a;
  --mid:  #b08900;
  --bad:  #9b2226;
}

/* ─── Theme picker — fixed pill, centered bottom ────────────── */

.theme-picker {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* On the calculator, push the picker out of the way to top-right (more vertical room for sliders) */
body.has-summary .theme-picker {
  top: 16px;
  right: 16px;
  bottom: auto;
  left: auto;
  transform: none;
  padding: 8px 10px;
  gap: 8px;
}
body.has-summary .swatch {
  width: 22px;
  height: 22px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* Default: subtle inner shadow for definition on any background */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.swatch:hover { transform: scale(1.18); }

.swatch.active {
  transform: scale(1.12);
  /* Ring around active swatch using current theme ink color, with a transparent gap */
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--ink),
    inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Solid color swatches — show the theme's accent directly */
.swatch.s-clair    { background: #ffffff; }
.swatch.s-sombre   { background: #18181a; }
.swatch.s-foret    { background: #2d6a4f; }
.swatch.s-couchant { background: #c2410c; }
.swatch.s-ocean    { background: #0c4a6e; }

/* Neon-style: bright color + matching glow */
.swatch.s-neon {
  background: #ff2d92;
  box-shadow: 0 0 12px rgba(255, 45, 146, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.swatch.s-neon.active {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--ink),
    0 0 14px rgba(255, 45, 146, 0.7);
}
.swatch.s-cyber {
  background: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.swatch.s-cyber.active {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--ink),
    0 0 14px rgba(0, 229, 255, 0.7);
}
.swatch.s-bonbon {
  background: #db2777;
}

/* Language toggle integrated into the picker pill */
.lang-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 999px;
  transition: background 0.12s ease, transform 0.12s ease;
  font-family: inherit;
}
.lang-btn:hover {
  background: var(--line);
  transform: scale(1.05);
}
.pill-divider {
  width: 1px;
  align-self: stretch;
  background: var(--line);
  margin: 2px 2px;
}
body.has-summary .lang-btn {
  font-size: 11px;
  padding: 3px 6px;
}
