/* ==========================================================================
   ZenZac - theme.css
   One calm, low-glare design system. No external fonts, no CDN, no ads.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b1422;
  --bg-2: #0f1d2f;
  --bg-deep: #0a111d;
  --shell: #0b1422;
  --toast-bg: rgba(11, 34, 40, 0.96);
  --inset: rgba(0, 0, 0, 0.18);
  --inset-strong: rgba(0, 0, 0, 0.3);
  --grad-a: #6ff0d4;
  --grad-b: #7fe3ff;
  --panel: color-mix(in srgb, var(--ink) 6%, transparent);
  --panel-2: color-mix(in srgb, var(--ink) 9%, transparent);
  --panel-solid: #142235;
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 20%, transparent);

  --ink: #f2f7fb;
  --ink-2: #c3d3e4;
  --muted: #a4b6cc;

  --mint: #4fe3c1;
  --mint-ink: #062421;
  --sky: #8fb4ff;
  --lilac: #b8a5ff;
  --coral: #ff9a86;
  --amber: #ffcc7a;

  --good: #6fe3b0;
  --warn: #ffc06b;
  --bad: #ff8f8a;

  --mood-happy: #5eead4;
  --mood-calm: #7ee2c4;
  --mood-ok: #ffd166;
  --mood-wobbly: #ffb86b;
  --mood-cross: #ff8f8a;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --pad: clamp(16px, 2.4vw, 28px);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.28);

  --sans: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI",
    system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --tap: 48px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}
html[data-bigtext="on"] { font-size: 112.5%; }

*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ico {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

/* ---------- background ---------- */

.aurora {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -8%, color-mix(in srgb, var(--mint) var(--glow-mint, 13%), transparent), transparent 60%),
    radial-gradient(900px 640px at 8% 4%, color-mix(in srgb, var(--sky) var(--glow-sky, 14%), transparent), transparent 62%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 45%, var(--bg-deep) 100%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-opacity, 0.5);
  animation: drift 26s ease-in-out infinite alternate;
}
.b1 { width: 44vw; height: 44vw; left: -12vw; top: -10vw; background: color-mix(in srgb, var(--mint) 20%, transparent); }
.b2 { width: 38vw; height: 38vw; right: -10vw; top: 18vh; background: color-mix(in srgb, var(--lilac) 18%, transparent); animation-delay: -8s; }
.b3 { width: 40vw; height: 40vw; left: 24vw; bottom: -22vw; background: color-mix(in srgb, var(--sky) 16%, transparent); animation-delay: -14s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, 4vh, 0) scale(1.12); }
}

/* ---------- shell ---------- */

.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100dvh;
}

.rail {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--shell) 55%, transparent);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink); text-decoration: none;
  padding: 4px 8px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  color: #0b2230;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  display: grid; place-items: center;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--mint) 22%, transparent);
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.3rem; letter-spacing: -0.02em; }
.brand-text small { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 12px;
  border-radius: 14px;
  color: var(--ink-2); font-weight: 600; font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-link:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.nav-link.is-active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--mint) 18%, transparent), color-mix(in srgb, var(--sky) 8%, transparent));
  border-color: color-mix(in srgb, var(--mint) 28%, transparent);
  color: var(--ink);
}
.nav-link.is-active .ico { color: var(--mint); }
.nav-link .ico { width: 20px; height: 20px; color: var(--muted); }

.rail-foot {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.content {
  display: flex; flex-direction: column;
  min-width: 0;
  padding: 0 var(--pad) 0;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 0 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--shell) 96%, transparent) 60%, transparent);
  backdrop-filter: blur(8px);
}
.brand--small { display: none; }
.brand--small strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.topbar-actions { display: flex; gap: 8px; margin-left: auto; }

.icon-btn {
  width: var(--tap); height: var(--tap);
  display: grid; place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  transition: background 0.18s var(--ease), transform 0.12s var(--ease);
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn[aria-pressed="false"] { color: var(--muted); background: transparent; }
.only-mobile { display: none; }

.view { flex: 1; padding-bottom: 40px; }
.view:focus { outline: none; }

.foot {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  padding: 22px 2px 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- page furniture ---------- */

.page-head { padding: 8px 0 22px; max-width: 70ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mint);
  margin-bottom: 8px;
}
.page-title {
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.6rem);
  line-height: 1.1; letter-spacing: -0.025em;
  font-weight: 800;
}
.page-sub { color: var(--ink-2); margin-top: 10px; font-size: 1.02rem; max-width: 62ch; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 28px 0 12px;
}
.section-title { font-size: 1.12rem; font-weight: 750; letter-spacing: -0.01em; }
.section-title .emoji { margin-right: 8px; }

.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.spacer { flex: 1; }

/* ---------- surfaces ---------- */

.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) var(--card-a, 5%), var(--panel-solid)), color-mix(in srgb, var(--ink) var(--card-b, 2%), var(--panel-solid)));
  border-radius: var(--r-lg);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--shadow-sm);
}
.card.tight { padding: 14px; border-radius: var(--r-md); }
.card-title { font-size: 1.05rem; font-weight: 750; letter-spacing: -0.01em; }
.card-sub { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.tile {
  display: flex; flex-direction: column; gap: 9px;
  padding: 18px;
  min-height: 116px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 4%, var(--panel-solid)), color-mix(in srgb, var(--ink) 1%, var(--panel-solid)));
  color: var(--ink); text-decoration: none;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.tile:hover { transform: translateY(-2px); border-color: var(--line-strong); background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 7%, var(--panel-solid)), color-mix(in srgb, var(--ink) 3%, var(--panel-solid))); text-decoration: none; }
.tile:active { transform: translateY(0); }
.tile-ico {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--mint);
  font-size: 1.25rem;
}
.tile-ico.lilac { background: color-mix(in srgb, var(--lilac) 16%, transparent); color: var(--lilac); }
.tile-ico.coral { background: color-mix(in srgb, var(--coral) 16%, transparent); color: var(--coral); }
.tile-ico.sky   { background: color-mix(in srgb, var(--sky) 16%, transparent); color: var(--sky); }
.tile-ico.amber { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.tile-title { font-weight: 750; font-size: 1.02rem; letter-spacing: -0.01em; }
.tile-sub { color: var(--muted); font-size: 0.86rem; line-height: 1.4; margin-top: -4px; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.stat-label { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.76rem; font-weight: 650; color: var(--ink-2);
}
.badge.mint { border-color: color-mix(in srgb, var(--mint) 35%, transparent); background: color-mix(in srgb, var(--mint) 12%, transparent); color: var(--ink); }
.badge.coral { border-color: color-mix(in srgb, var(--coral) 35%, transparent); background: color-mix(in srgb, var(--coral) 12%, transparent); color: var(--ink); }

.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700; font-size: 0.97rem;
  text-decoration: none;
  transition: transform 0.12s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:active { transform: scale(0.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn .ico { width: 19px; height: 19px; }

.btn.primary {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-color: transparent;
  color: var(--mint-ink);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--mint) 22%, transparent);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.soft { background: color-mix(in srgb, var(--mint) 12%, transparent); border-color: color-mix(in srgb, var(--mint) 30%, transparent); color: var(--ink); }
.btn.ghost { background: transparent; }
.btn.danger { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--ink); }
.btn.lg { min-height: 58px; padding: 0 28px; font-size: 1.05rem; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 0.85rem; }
.btn.wide { width: 100%; }
.btn.icon-only { padding: 0; width: var(--tap); border-radius: 14px; }

.pill-toggle {
  display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 4px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--inset);
}
.pill-toggle button {
  border: 0; background: transparent; color: var(--ink-2);
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  font-weight: 650; font-size: 0.9rem;
}
.pill-toggle button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--mint) 16%, transparent);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 32%, transparent);
}

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 0.82rem; font-weight: 650; color: var(--ink-2); }
.input, .textarea, .select {
  min-height: var(--tap);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--inset);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--mint);
  background: var(--inset-strong);
  outline: none;
}
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 14px) 20px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 40px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 0.88rem; font-weight: 600;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.chip:hover { background: var(--panel-2); color: var(--ink); }
.chip.is-on {
  background: color-mix(in srgb, var(--mint) 18%, transparent);
  border-color: color-mix(in srgb, var(--mint) 45%, transparent);
  color: var(--ink);
}
.chip.is-on::before { content: "✓ "; }

.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; min-height: var(--tap); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 52px; height: 30px; border-radius: 999px; flex: none;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  border: 1px solid var(--line-strong);
  position: relative; transition: background 0.2s var(--ease);
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink-2);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.switch input:checked + .track { background: color-mix(in srgb, var(--mint) 55%, transparent); border-color: var(--mint); }
.switch input:checked + .track .thumb { transform: translateX(22px); background: var(--mint-ink); }
.switch input:focus-visible + .track { outline: 3px solid var(--mint); outline-offset: 3px; }
.switch-text { display: flex; flex-direction: column; gap: 1px; }
.switch-text strong { font-size: 0.96rem; font-weight: 650; }
.switch-text small { color: var(--muted); font-size: 0.8rem; line-height: 1.35; }

/* range */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 30px; background: transparent; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}
input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 16%, transparent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; margin-top: -8px;
  border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
}

/* ---------- home ---------- */

.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  padding: clamp(20px, 3vw, 34px);
  background:
    radial-gradient(520px 260px at 88% 8%, color-mix(in srgb, var(--mint) var(--hero-mint, 18%), transparent), transparent 70%),
    radial-gradient(420px 240px at 4% 100%, color-mix(in srgb, var(--lilac) var(--hero-lilac, 16%), transparent), transparent 70%),
    var(--hero-bg, linear-gradient(150deg, color-mix(in srgb, var(--ink) 10%, transparent), color-mix(in srgb, var(--ink) 4%, transparent)));
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(1.6rem, 1.1rem + 2.6vw, 2.7rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; }
.hero p { color: var(--ink-2); margin-top: 8px; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Wordmark - Z-e-n-Z-e-n in real type, one span per letter, each turning on
   its own axis: e reads as a upside down, n reads as itself or a u. */
.wordmark {
  display: flex; align-items: baseline;
  font-weight: 800; font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.1rem);
  line-height: 1; letter-spacing: -0.01em;
  color: var(--ink); margin: 0 0 14px;
}
.wordmark .wm-l {
  display: inline-block; width: 0.66em; text-align: center;
  transform-origin: 50% 55%;
  animation: wm-turn 11s linear infinite;
  animation-delay: calc(var(--p) * 0.55s);
}
@keyframes wm-turn {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
html[data-motion="calm"] .wordmark .wm-l { animation: none; }

.mood-check { margin-top: 22px; }
.mood-check > p { font-weight: 650; margin-bottom: 10px; }
.mood-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.mood-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink-2);
  font-size: 0.76rem; font-weight: 650;
  transition: transform 0.14s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.mood-btn:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.mood-btn.is-on { border-color: color-mix(in srgb, var(--mint) 55%, transparent); background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--ink); }
.mood-btn svg { width: 40px; height: 40px; }

.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; }
.today-item { padding: 14px; border-radius: var(--r-md); background: var(--inset); border: 1px solid var(--line); }

/* ---------- breathing ---------- */

.breath-wrap {
  display: grid; place-items: center; gap: 18px;
  padding: 18px 0 6px;
}
.orb-stage {
  position: relative;
  width: min(68vw, 300px); aspect-ratio: 1;
  display: grid; place-items: center;
}
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.orb-ring:nth-child(2) { inset: 10%; border-color: color-mix(in srgb, var(--ink) 8%, transparent); }
.orb-ring:nth-child(3) { inset: 20%; border-color: color-mix(in srgb, var(--ink) 6%, transparent); }
.orb {
  width: 66%; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.75), color-mix(in srgb, var(--ink) 0%, transparent) 42%),
    radial-gradient(circle at 50% 60%, var(--grad-a) 0%, var(--mint) 46%, var(--sky) 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent), 0 26px 70px color-mix(in srgb, var(--mint) 28%, transparent);
  transform: scale(0.82);
  transition: transform 4s linear;
  display: grid; place-items: center;
  color: #06231f;
  font-weight: 800;
  will-change: transform;
}
.orb.is-idle { transition: transform 1.2s var(--ease); }
.orb-count { font-size: clamp(1.5rem, 1rem + 3vw, 2.4rem); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.breath-phase {
  font-size: clamp(1.15rem, 1rem + 1vw, 1.5rem);
  font-weight: 750; letter-spacing: -0.01em;
  min-height: 1.6em; text-align: center;
}
.breath-meta { color: var(--muted); font-size: 0.85rem; }
.breath-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- sounds ---------- */

.sound-list { display: flex; flex-direction: column; gap: 10px; }
.sound-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.sound-row.is-playing { border-color: color-mix(in srgb, var(--mint) 40%, transparent); background: color-mix(in srgb, var(--mint) 8%, transparent); }
.sound-emoji { font-size: 1.4rem; width: 30px; text-align: center; }
.sound-name { font-weight: 650; font-size: 0.95rem; }
.sound-vol { width: 120px; }
.sound-play {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
}
.sound-play .ico { width: 18px; height: 18px; }
.sound-row.is-playing .sound-play { background: color-mix(in srgb, var(--mint) 90%, transparent); color: #06231f; border-color: transparent; }

/* ---------- routine ---------- */

.routine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slot {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px;
  min-height: 168px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}
.slot.now {
  border-color: color-mix(in srgb, var(--mint) 45%, transparent);
  background:
    radial-gradient(320px 160px at 90% 0%, color-mix(in srgb, var(--mint) 18%, transparent), transparent 70%),
    color-mix(in srgb, var(--mint) 7%, transparent);
}
.slot-label { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.slot.now .slot-label { color: var(--mint); }
.slot-task { font-size: clamp(1.2rem, 1rem + 1.4vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.slot-emoji { font-size: 1.9rem; }
.slot-empty { color: var(--muted); font-weight: 600; }
.slot-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }

.timer-big {
  font-family: var(--mono);
  font-size: clamp(2rem, 1.2rem + 3vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.timer-big.is-low { color: var(--amber); }

.calm-lead {
  margin: 14px 2px 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------- parent support ---------- */

.sup-section { margin-top: 26px; }
.sup-section:first-child { margin-top: 4px; }
.sup-section .comp-cat { margin-bottom: 12px; }
.sup-entry { background: var(--panel); }
.sup-head { flex: 1; min-width: 0; }
.sup-head strong { display: block; font-weight: 750; line-height: 1.3; }
.sup-sum { display: block; margin-top: 3px; color: var(--muted); font-size: 0.88rem; font-weight: 500; line-height: 1.45; }
.sup-block { margin-top: 16px; }
.sup-block:first-child { margin-top: 2px; }
.sup-block h3 { font-size: 0.95rem; font-weight: 750; margin: 0 0 6px; color: var(--ink); }
.sup-block p { line-height: 1.6; }
.sup-list { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; }
.sup-list li { position: relative; padding-left: 18px; line-height: 1.55; }
.sup-list li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--mint);
}
.sup-call {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 0 12px 12px 0;
  border-left: 3px solid var(--mint);
  background: color-mix(in srgb, var(--mint) 8%, transparent);
}
.sup-call > strong {
  display: block; font-size: 0.74rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mint);
}
.sup-call ul { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sup-call li { line-height: 1.55; }
.sup-try {
  border-left-color: var(--lilac);
  background: color-mix(in srgb, var(--lilac) 9%, transparent);
}
.sup-try > strong { color: var(--lilac); }

/* Now is one big card; Next is a quiet strip, not a second task */
.routine-plan { display: grid; gap: 10px; }
.now-card {
  display: grid; gap: 10px;
  padding: clamp(20px, 2.6vw, 28px);
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--mint) 45%, transparent);
  background:
    radial-gradient(320px 160px at 90% 0%, color-mix(in srgb, var(--mint) 18%, transparent), transparent 70%),
    color-mix(in srgb, var(--mint) 7%, transparent);
}
.now-card.is-empty {
  border-style: dashed;
  border-color: var(--line-strong, var(--line));
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.now-card .slot-label { color: var(--mint); }
.now-card.is-empty .slot-label { color: var(--muted); }
.now-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.now-emoji { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem); line-height: 1; }
.now-task {
  font-size: clamp(1.5rem, 1.2rem + 2.2vw, 2.3rem);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.08;
  overflow-wrap: anywhere;
}
.now-empty { color: var(--ink-2); font-weight: 600; margin: 0; }
.now-card .timer-big { margin: 2px 0 0; }

.timer-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
}
.timer-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--sky, var(--mint)));
  transition: width 0.9s linear;
}

.next-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.next-strip .slot-label { flex: none; }
.next-emoji { font-size: 1.25rem; }
.next-task { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-empty { flex: 1; min-width: 0; color: var(--muted); font-weight: 600; }
.next-strip .btn { margin-left: auto; }

.card.is-target {
  border-color: color-mix(in srgb, var(--mint) 60%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 16%, transparent);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.tasklist { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.task-emoji { font-size: 1.15rem; width: 26px; text-align: center; }
.task-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .icon-btn { width: 38px; height: 38px; border-radius: 11px; }
.task-row.is-done { opacity: 0.55; }
.task-row.is-done .task-name { text-decoration: line-through; }

.saved-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  background: var(--inset); border: 1px solid var(--line);
}

/* ---------- focus / games ---------- */

.spinner-stage {
  display: grid; place-items: center;
  padding: 10px 0 0;
  touch-action: none;
  user-select: none;
}
.wheel {
  width: min(74vw, 320px); aspect-ratio: 1;
  cursor: grab;
  filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.45));
}
.wheel:active { cursor: grabbing; }
.wheel-cap {
  fill: var(--panel-solid); stroke: color-mix(in srgb, var(--ink) 50%, transparent); stroke-width: 2;
}

.whack-hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.whack-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-width: 460px; margin: 0 auto;
}
.whack-picks { display: grid; gap: 10px; margin-top: 18px; }
.whack-picks .row-wrap { align-items: center; }
.whack-picks .label {
  min-width: 78px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.hole.is-bonus {
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--amber) 45%, transparent);
}
.hole.is-up .mole { animation: mole-pop 0.24s var(--ease); }
@keyframes mole-pop {
  0% { transform: translateY(70%) scale(0.7); }
  70% { transform: translateY(-6%) scale(1.08); }
  100% { transform: translateY(0) scale(1); }
}
.hole {
  position: relative;
  aspect-ratio: 1;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 78%, rgba(0, 0, 0, 0.55), var(--inset) 62%),
    color-mix(in srgb, var(--ink) 5%, transparent);
  overflow: hidden;
  padding: 0;
  display: grid; place-items: center;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
}
.hole:disabled { cursor: default; }
.mole {
  transform: translateY(120%);
  transition: transform 0.16s var(--ease);
  line-height: 1;
}
.hole.is-up .mole { transform: translateY(0); }
.hole.is-hit { background: radial-gradient(circle, color-mix(in srgb, var(--mint) 40%, transparent), color-mix(in srgb, var(--ink) 6%, transparent)); }
.hole.is-hit .mole { animation: bonk 0.3s var(--ease); }
@keyframes bonk {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10%) scale(1.25); }
  100% { transform: translateY(0) scale(1); }
}

/* ---------- journal ---------- */

.composer { display: flex; flex-direction: column; gap: 12px; }

/* Grown-ups gate - a deliberate hold, not a password. */
.journal-gate {
  border-color: color-mix(in srgb, var(--lilac) 28%, var(--line));
  background:
    radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--lilac) 12%, transparent), transparent 70%),
    var(--panel);
}
.journal-gate .btn { margin-top: 16px; }
.btn.is-holding {
  transform: scale(0.98);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 45%, transparent);
}
.mood-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-picker .mood-btn { flex: 1 1 88px; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.entry {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.entry-face { width: 34px; height: 34px; }
.entry-body { min-width: 0; }
.entry-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.entry-mood { font-weight: 750; font-size: 0.95rem; }
.entry-time { color: var(--muted); font-size: 0.78rem; }
.entry-note { color: var(--ink-2); font-size: 0.92rem; margin-top: 3px; overflow-wrap: anywhere; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.entry-tags .badge { font-size: 0.72rem; padding: 2px 8px; }

.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; }
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: end; }
.chart-bar {
  width: 100%; max-width: 40px; border-radius: 999px;
  background: linear-gradient(180deg, var(--mint), color-mix(in srgb, var(--sky) 75%, transparent));
  min-height: 5px;
  transition: height 0.4s var(--ease);
}
.chart-bar.is-empty { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.chart-day { font-size: 0.7rem; color: var(--muted); font-weight: 650; }

/* ---------- play ---------- */

.joke-card {
  display: flex; flex-direction: column; gap: 14px;
  align-items: center; text-align: center;
  padding: clamp(20px, 4vw, 36px);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(420px 220px at 20% 0%, color-mix(in srgb, var(--amber) 14%, transparent), transparent 70%),
    radial-gradient(420px 220px at 90% 100%, color-mix(in srgb, var(--coral) 14%, transparent), transparent 70%),
    color-mix(in srgb, var(--ink) 5%, transparent);
  min-height: 280px;
  justify-content: center;
}
.joke-setup { font-size: clamp(1.3rem, 1rem + 1.8vw, 2rem); font-weight: 800; letter-spacing: -0.02em; }
.joke-punch { font-size: clamp(1.1rem, 1rem + 1vw, 1.5rem); font-weight: 650; color: var(--ink); }
.joke-step { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.door-btn {
  width: 96px; height: 96px; border-radius: 26px;
  display: grid; place-items: center;
  font-size: 3rem;
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 14%, transparent), color-mix(in srgb, var(--ink) 4%, transparent));
  transition: transform 0.16s var(--ease);
}
.door-btn:hover { transform: scale(1.05) rotate(-2deg); }
.door-btn:active { transform: scale(0.94); }

.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.pad {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 84px; padding: 10px 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--ink) 4%, var(--panel-solid)), color-mix(in srgb, var(--ink) 1%, var(--panel-solid)));
  color: var(--ink); font-weight: 650; font-size: 0.84rem;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease);
}
.pad:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.pad:active { transform: scale(0.95); }
.pad.is-playing {
  background: color-mix(in srgb, var(--mint) 18%, transparent);
  border-color: color-mix(in srgb, var(--mint) 45%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 35%, transparent);
}
.sound-group { margin-top: 20px; }
.sound-group-title {
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.pad-emoji { font-size: 1.4rem; }

/* ---------- learn ---------- */

.guide {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  overflow: hidden;
}
.guide + .guide { margin-top: 10px; }
.guide > summary {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.guide > summary::-webkit-details-marker { display: none; }
.guide > summary::after {
  content: "";
  width: 10px; height: 10px; margin-left: auto; flex: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s var(--ease);
}
.guide[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.guide[open] > summary { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.guide-emoji { font-size: 1.3rem; }
.guide-body { padding: 4px 18px 20px; color: var(--ink-2); font-size: 0.95rem; }
.guide-body ul { display: flex; flex-direction: column; gap: 7px; margin: 10px 0 0; }
.guide-body li { padding-left: 20px; position: relative; }
.guide-body li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--mint);
}
.guide-tag {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 700; margin-left: auto;
}
.guide[open] .guide-tag { display: none; }

/* ---------- settings ---------- */

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-text strong { font-size: 0.97rem; font-weight: 650; }
.setting-text small { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.setting-control { flex: none; }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translate(-50%, 140%);
  z-index: 60;
  max-width: min(90vw, 460px);
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mint) 40%, transparent);
  background: var(--toast-bg);
  color: var(--ink);
  font-weight: 650; font-size: 0.9rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 900px) { .toast { bottom: 92px; } }

/* ---------- tabbar (mobile) ---------- */

.tabbar { display: none; }

/* ---------- empty states ---------- */

.empty {
  padding: 26px 18px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  background: color-mix(in srgb, var(--ink) 2%, transparent);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.empty strong { color: var(--ink-2); display: block; margin-bottom: 4px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .content { padding: 0 16px; }
  .brand--small { display: flex; gap: 10px; padding: 0; }
  .brand--small .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .only-mobile { display: grid; }
  .topbar { padding-top: 10px; }

  .view { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); font-size: 0.72rem; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--shell);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px;
    border-radius: 14px;
    color: var(--muted); text-decoration: none;
    font-size: 0.66rem; font-weight: 650; letter-spacing: 0.01em;
  }
  .tab .ico { width: 22px; height: 22px; }
  .tab.is-active { color: var(--mint); background: color-mix(in srgb, var(--mint) 10%, transparent); }
  .tab:hover { text-decoration: none; }

  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routine-grid { grid-template-columns: 1fr; }
  .slot { min-height: 140px; }
  .sound-vol { width: 84px; }
  .chart { height: 120px; }
}

@media (max-width: 460px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .mood-row { gap: 6px; }
  .mood-btn { font-size: 0.68rem; padding: 8px 2px 6px; }
  .mood-btn svg { width: 34px; height: 34px; }
  .sound-row { grid-template-columns: auto 1fr; row-gap: 8px; }
  .sound-vol { grid-column: 1 / -1; width: 100%; }
  .card { border-radius: var(--r-md); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Calm motion switch (in Settings) */
html[data-motion="calm"] .blob { animation: none; }
html[data-motion="calm"] .tile,
html[data-motion="calm"] .btn,
html[data-motion="calm"] .icon-btn,
html[data-motion="calm"] .mood-btn { transition: none; }
html[data-motion="calm"] .tile:hover,
html[data-motion="calm"] .mood-btn:hover { transform: none; }
html[data-motion="calm"] .orb { transition-duration: 1.2s; }

@media print {
  .rail, .tabbar, .topbar, .aurora, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .hero { border-color: #ccc; background: #fff; box-shadow: none; }
}

/* ==========================================================================
   Palettes - six soft options. Base tokens above are "Dusk".
   ========================================================================== */

/* ---------- Light palettes ---------- */

:root[data-theme="meadow"] {
  --mood-happy: #0f766e;
  --mood-calm: #4d7c0f;
  --mood-ok: #9a6700;
  --mood-wobbly: #b45309;
  --mood-cross: #b91c1c;
  --hero-mint: 8%;
  --hero-lilac: 7%;
  --hero-bg: linear-gradient(150deg, color-mix(in srgb, var(--ink) 3%, var(--panel-solid)), color-mix(in srgb, var(--ink) 1%, var(--panel-solid)));
  --glow-mint: 8%;
  --glow-sky: 8%;
  --blob-opacity: 0.22;
  --card-a: 3%;
  --card-b: 1%;
  color-scheme: light;
  --bg: #f4efe4;
  --bg-2: #fcf8ef;
  --bg-deep: #e9e1d2;
  --shell: #faf6ec;
  --panel-solid: #fffdf8;
  --panel: color-mix(in srgb, var(--panel-solid) 84%, transparent);
  --panel-2: color-mix(in srgb, var(--panel-solid) 96%, transparent);
  --ink: #24312a;
  --ink-2: #405049;
  --muted: #4c5a52;
  --mint: #1f6f5b;
  --mint-ink: #06241d;
  --sky: #335f8a;
  --lilac: #62528f;
  --coral: #944b38;
  --amber: #795515;
  --good: #1f6b50;
  --warn: #795515;
  --bad: #943d37;
  --grad-a: #a9d8c2;
  --grad-b: #dfe4bd;
  --toast-bg: #fffdf8;
  --inset: rgba(36, 49, 42, 0.055);
  --inset-strong: rgba(36, 49, 42, 0.09);
  --line: rgba(36, 49, 42, 0.16);
  --line-strong: rgba(36, 49, 42, 0.32);
  --shadow: 0 18px 40px rgba(60, 70, 56, 0.12);
  --shadow-sm: 0 8px 20px rgba(60, 70, 56, 0.08);
}

:root[data-theme="blossom"] {
  --mood-happy: #0f766e;
  --mood-calm: #4d7c0f;
  --mood-ok: #9a6700;
  --mood-wobbly: #b45309;
  --mood-cross: #b91c1c;
  --hero-mint: 8%;
  --hero-lilac: 7%;
  --hero-bg: linear-gradient(150deg, color-mix(in srgb, var(--ink) 3%, var(--panel-solid)), color-mix(in srgb, var(--ink) 1%, var(--panel-solid)));
  --glow-mint: 8%;
  --glow-sky: 8%;
  --blob-opacity: 0.22;
  --card-a: 3%;
  --card-b: 1%;
  color-scheme: light;
  --bg: #fbf0f1;
  --bg-2: #fff8f8;
  --bg-deep: #f0dfe3;
  --shell: #fff7f8;
  --panel-solid: #fffafa;
  --panel: color-mix(in srgb, var(--panel-solid) 84%, transparent);
  --panel-2: color-mix(in srgb, var(--panel-solid) 96%, transparent);
  --ink: #362830;
  --ink-2: #513b45;
  --muted: #5c454f;
  --mint: #8f3457;
  --mint-ink: #2b0f1a;
  --sky: #4a5f92;
  --lilac: #6c4f93;
  --coral: #9c4f3d;
  --amber: #7d5518;
  --good: #28664f;
  --warn: #7d5518;
  --bad: #993934;
  --grad-a: #f3c3d1;
  --grad-b: #e6d2f2;
  --toast-bg: #fffafa;
  --inset: rgba(54, 40, 48, 0.05);
  --inset-strong: rgba(54, 40, 48, 0.085);
  --line: rgba(54, 40, 48, 0.16);
  --line-strong: rgba(54, 40, 48, 0.32);
  --shadow: 0 18px 40px rgba(78, 54, 64, 0.12);
  --shadow-sm: 0 8px 20px rgba(78, 54, 64, 0.08);
}

:root[data-theme="seaglass"] {
  --mood-happy: #0f766e;
  --mood-calm: #4d7c0f;
  --mood-ok: #9a6700;
  --mood-wobbly: #b45309;
  --mood-cross: #b91c1c;
  --hero-mint: 8%;
  --hero-lilac: 7%;
  --hero-bg: linear-gradient(150deg, color-mix(in srgb, var(--ink) 3%, var(--panel-solid)), color-mix(in srgb, var(--ink) 1%, var(--panel-solid)));
  --glow-mint: 8%;
  --glow-sky: 8%;
  --blob-opacity: 0.22;
  --card-a: 3%;
  --card-b: 1%;
  color-scheme: light;
  --bg: #edf4f3;
  --bg-2: #f9fcfb;
  --bg-deep: #dce9e7;
  --shell: #f4faf9;
  --panel-solid: #fcfffe;
  --panel: color-mix(in srgb, var(--panel-solid) 84%, transparent);
  --panel-2: color-mix(in srgb, var(--panel-solid) 96%, transparent);
  --ink: #1e3033;
  --ink-2: #395156;
  --muted: #465e63;
  --mint: #17636d;
  --mint-ink: #042327;
  --sky: #2f5f88;
  --lilac: #525d92;
  --coral: #92513f;
  --amber: #795c1b;
  --good: #1c6855;
  --warn: #795c1b;
  --bad: #923f3a;
  --grad-a: #b4ddda;
  --grad-b: #cfe0ee;
  --toast-bg: #fcfffe;
  --inset: rgba(30, 48, 51, 0.055);
  --inset-strong: rgba(30, 48, 51, 0.09);
  --line: rgba(30, 48, 51, 0.16);
  --line-strong: rgba(30, 48, 51, 0.32);
  --shadow: 0 18px 40px rgba(50, 75, 80, 0.12);
  --shadow-sm: 0 8px 20px rgba(50, 75, 80, 0.08);
}

/* ---------- Dark palettes ---------- */

:root[data-theme="twilight"] {
  color-scheme: dark;
  --bg: #15111f;
  --bg-2: #1c1729;
  --bg-deep: #110d18;
  --shell: #171221;
  --panel-solid: #241e33;
  --ink: #f4efff;
  --ink-2: #d3c8e8;
  --muted: #b5a8cb;
  --mint: #c9b6ff;
  --mint-ink: #211636;
  --sky: #9dc4ff;
  --lilac: #ffb3c7;
  --coral: #ffae9c;
  --amber: #ffd49a;
  --good: #b9e8c9;
  --warn: #ffd49a;
  --bad: #ffb3ad;
  --grad-a: #d8c8ff;
  --grad-b: #ffc9d8;
  --toast-bg: rgba(24, 18, 34, 0.96);
  --inset: rgba(0, 0, 0, 0.22);
  --inset-strong: rgba(0, 0, 0, 0.34);
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 24%, transparent);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.32);
}

:root[data-theme="forest"] {
  color-scheme: dark;
  --bg: #0d1712;
  --bg-2: #132019;
  --bg-deep: #0a120e;
  --shell: #0e1a14;
  --panel-solid: #16241c;
  --ink: #eef7ef;
  --ink-2: #c9dbcd;
  --muted: #adc0b1;
  --mint: #9adcb0;
  --mint-ink: #0c2318;
  --sky: #8fbfd2;
  --lilac: #c3b3e0;
  --coral: #e8a98f;
  --amber: #e6c07a;
  --good: #a7e6bb;
  --warn: #e6c07a;
  --bad: #f0a9a2;
  --grad-a: #a9e3bd;
  --grad-b: #cfe6a8;
  --toast-bg: rgba(14, 26, 20, 0.96);
  --inset: rgba(0, 0, 0, 0.2);
  --inset-strong: rgba(0, 0, 0, 0.32);
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 24%, transparent);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.3);
}

/* ---------- High contrast ---------- */

:root[data-theme="contrast"] {
  --mood-happy: #63ffb0;
  --mood-calm: #b8ff9e;
  --mood-ok: #ffe14d;
  --mood-wobbly: #ffb36b;
  --mood-cross: #ff8a8a;
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #000000;
  --bg-deep: #000000;
  --shell: #000000;
  --panel-solid: #111111;
  --panel: #111111;
  --panel-2: #1a1a1a;
  --ink: #ffffff;
  --ink-2: #f2f2f2;
  --muted: #e8e8e8;
  --mint: #ffe14d;
  --mint-ink: #000000;
  --sky: #7fe8ff;
  --lilac: #ffb3ff;
  --coral: #ffb36b;
  --amber: #ffe14d;
  --good: #63ffb0;
  --warn: #ffe14d;
  --bad: #ff8a8a;
  --grad-a: #ffe14d;
  --grad-b: #7fe8ff;
  --toast-bg: #000000;
  --inset: #0b0b0b;
  --inset-strong: #161616;
  --line: rgba(255, 255, 255, 0.55);
  --line-strong: #ffffff;
  --shadow: none;
  --shadow-sm: none;
}

:root[data-theme="contrast"] .aurora { background: #000000; }
:root[data-theme="contrast"] .hero { background: #0b0b0b; }
:root[data-theme="contrast"] .support-banner {
  grid-template-columns: 1fr;
  background: #000000;
  color: #ffffff;
  border-color: #ffffff;
}
:root[data-theme="contrast"] .support-banner-img { display: none; }
:root[data-theme="contrast"] .support-banner-kicker span { color: #ffe600; }
:root[data-theme="contrast"] .support-banner-tag,
:root[data-theme="contrast"] .support-banner-line { color: #ffffff; }
:root[data-theme="contrast"] .support-banner-cta { background: #ffe600; color: #000000; }
:root[data-theme="contrast"] .blob { display: none; }
:root[data-theme="contrast"] .card { border-width: 2px; background: #0b0b0b; }
:root[data-theme="contrast"] .btn { border-width: 2px; }
:root[data-theme="contrast"] .btn.primary {
  background: #ffe14d;
  border-color: #ffe14d;
  color: #000000;
}
:root[data-theme="contrast"] .nav-link.is-active {
  background: #1a1a1a;
  border-color: #ffe14d;
  color: #ffffff;
}
:root[data-theme="contrast"] .topbar { background: #000000; }
:root[data-theme="contrast"] .view a:not(.btn):not(.tile):not(.saved-row):not(.support-banner) { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Settings: appearance modes ---------- */

.appearance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.appearance-btn {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 88px; padding: 14px; text-align: left;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.appearance-btn:hover { border-color: var(--line-strong); }
.appearance-btn.is-on {
  border-color: color-mix(in srgb, var(--mint) 62%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 34%, transparent);
  background: color-mix(in srgb, var(--mint) 9%, var(--panel));
}
.appearance-swatch {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 1px solid var(--line-strong);
}
.appearance-swatch.light { background: linear-gradient(135deg, #fffdf8 50%, #dfe4bd); }
.appearance-swatch.dark { background: linear-gradient(135deg, #0b1422 50%, #4fe3c1); }
.appearance-swatch.contrast { background: linear-gradient(135deg, #000 50%, #ffe14d 50%); border-color: #000; }
.appearance-copy { display: flex; flex-direction: column; gap: 2px; }
.appearance-copy strong { font-size: 0.95rem; }
.appearance-copy small { color: var(--muted); font-size: 0.76rem; line-height: 1.35; }
@media (max-width: 720px) {
  .appearance-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Plan, house rules, set-up wizard
   ========================================================================== */

.plan-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
}
.plan-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.plan-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mint) 34%, transparent);
  background: color-mix(in srgb, var(--mint) 11%, transparent);
  color: var(--ink); font-size: 0.84rem; font-weight: 700;
}
.plan-note { color: var(--muted); font-size: 0.82rem; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.setup-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  margin-top: 16px;
  border-color: color-mix(in srgb, var(--mint) 30%, var(--line));
  background:
    radial-gradient(420px 180px at 100% 0%, color-mix(in srgb, var(--mint) 12%, transparent), transparent 70%),
    var(--panel);
}
.setup-cta-text { max-width: 62ch; }

.rules-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px 22px; margin-top: 14px;
}
.rules-list li {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 0.92rem; line-height: 1.45; color: var(--ink-2);
}
.rule-tick {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center; margin-top: 2px;
  background: color-mix(in srgb, var(--mint) 16%, transparent);
  color: var(--mint);
}
.rule-tick .ico { width: 12px; height: 12px; stroke-width: 2.8; }

.rule-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.rule-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 0.8rem; font-weight: 600;
}
.rule-chip .ico { width: 13px; height: 13px; color: var(--mint); stroke-width: 2.8; }
.rule-chip.ghost { color: var(--mint); border-style: dashed; text-decoration: none; }
.rule-chip.ghost:hover { background: color-mix(in srgb, var(--mint) 8%, transparent); }

.setup-wrap { max-width: 860px; margin: 0 auto; }
.setup-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.setup-progress {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}
.setup-progress span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--sky));
  transition: width 0.3s var(--ease);
}
.setup-card {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(20px, 3vw, 34px);
  background:
    radial-gradient(520px 220px at 100% 0%, color-mix(in srgb, var(--mint) 7%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--ink) 5%, transparent), color-mix(in srgb, var(--ink) 2%, transparent));
  box-shadow: var(--shadow);
}
.setup-body { margin-top: 20px; }
.setup-grid { display: flex; flex-direction: column; gap: 18px; max-width: 540px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.big { min-height: 46px; padding: 8px 16px; font-size: 0.92rem; }
.input-lg { min-height: 56px; font-size: 1.05rem; }
.setup-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.setup-jump {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 18px;
}
.setup-jump .tiny { margin-right: 2px; }
.chip.sm { min-height: 34px; padding: 4px 12px; font-size: 0.8rem; border-color: var(--line); }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mode-card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  text-align: left; padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.mode-card:hover { border-color: var(--line-strong); }
.mode-card .mode-emoji { font-size: 1.6rem; }
.mode-card .mode-name { font-weight: 750; font-size: 1.02rem; letter-spacing: -0.01em; }
.mode-card .mode-note { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.mode-card .mode-tick {
  position: absolute; top: 14px; right: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  color: transparent;
}
.mode-card .mode-tick .ico { width: 14px; height: 14px; stroke-width: 3; }
.mode-card.is-on {
  border-color: color-mix(in srgb, var(--mint) 55%, transparent);
  background: color-mix(in srgb, var(--mint) 9%, var(--panel));
}
.mode-card.is-on .mode-tick { background: var(--mint); border-color: transparent; color: var(--mint-ink); }

.rule-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
}
.rule-item.is-on {
  border-color: color-mix(in srgb, var(--mint) 32%, transparent);
  background: color-mix(in srgb, var(--mint) 6%, var(--panel));
}
.rule-item .switch { flex: 1; min-height: 0; }
.icon-btn.sm { width: 38px; height: 38px; border-radius: 11px; }

.plan-summary {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  background: var(--panel);
}
.plan-summary-head { display: flex; align-items: center; gap: 14px; }
.plan-emoji { font-size: 2rem; line-height: 1; }
.plan-summary h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-summary p { color: var(--muted); font-size: 0.9rem; }
.plan-list { display: grid; gap: 10px; margin-top: 18px; }
.plan-list div {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px;
  padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.plan-list dt { color: var(--muted); font-weight: 650; }
.plan-list dd { margin: 0; color: var(--ink); }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 10px; }
.theme-btn {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px; text-align: left;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.theme-btn:hover { border-color: var(--line-strong); }
.theme-btn.is-on {
  border-color: color-mix(in srgb, var(--mint) 55%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 32%, transparent);
}
.theme-swatch {
  display: flex; height: 34px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line);
}
.theme-swatch i { flex: 1; }
.theme-name { font-weight: 700; font-size: 0.9rem; }
.theme-note { color: var(--muted); font-size: 0.75rem; line-height: 1.35; }
.plan-card { margin-bottom: 0; }

/* ==========================================================================
   Compendium
   ========================================================================== */

.comp-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: min(100%, 300px);
  padding: 0 16px; min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}
.search-box .ico { flex: none; }
.search-box input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  color: var(--ink); font-size: 0.98rem;
  padding: 13px 0; outline: none;
}
.search-box:focus-within { border-color: var(--mint); }

.comp-count { margin: 12px 2px 4px; }
.comp-section { margin-top: 24px; }
.comp-cat {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.comp-cat-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--mint) 13%, transparent);
  font-size: 1.15rem;
}
.comp-cat h2 { font-size: 1.02rem; font-weight: 750; letter-spacing: -0.01em; }
.comp-cat p { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }

.comp-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin-top: 12px; align-items: start;
}
.comp-entry {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  overflow: hidden;
}
.comp-entry > summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; min-height: 56px;
  list-style: none; cursor: pointer;
  font-weight: 650; font-size: 0.95rem;
}
.comp-entry > summary::-webkit-details-marker { display: none; }
.comp-entry > summary:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.comp-entry-emoji { font-size: 1.15rem; flex: none; }
.comp-entry-title { flex: 1; min-width: 0; }
.comp-entry-tag {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 700; white-space: nowrap;
}
.comp-entry-caret {
  width: 9px; height: 9px; flex: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s var(--ease);
}
.comp-entry[open] .comp-entry-caret { transform: rotate(225deg) translateY(-2px); }
.comp-entry[open] > summary { background: color-mix(in srgb, var(--mint) 6%, transparent); }
.comp-entry-body { padding: 2px 16px 18px; color: var(--ink-2); font-size: 0.92rem; }
.comp-entry-sum { margin-bottom: 10px; }
.comp-entry-body ul { display: flex; flex-direction: column; gap: 8px; }
.comp-entry-body li { position: relative; padding-left: 18px; line-height: 1.5; }
.comp-entry-body li::before {
  content: ""; position: absolute; left: 2px; top: 0.58em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--mint);
}
.comp-entry-body .btn { margin-top: 14px; }

@media (max-width: 900px) {
  .comp-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { overflow-y: auto; }
}
@media (max-width: 520px) {
  .comp-entry-tag { display: none; }
  .plan-list div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .setup-foot { flex-direction: column-reverse; align-items: stretch; }
  .setup-foot .btn { width: 100%; }
}

/* ---------- spinner choices ---------- */
.spinner-card { padding-bottom: 18px; }
.spinner-card .spinner-stage { margin-top: 6px; }
.spin-result {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 68px; margin: 4px auto 0; max-width: 440px;
  padding: 10px 16px; border-radius: 18px;
  border: 1px dashed var(--line); background: var(--inset); text-align: left;
}
.spin-result.is-set {
  border-style: solid;
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, var(--inset));
}
.spin-result-emoji { font-size: 2.1rem; line-height: 1; }
.spin-result-text { display: flex; flex-direction: column; gap: 2px; }
.spin-result-text small {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.spin-result-text strong { font-size: 1.22rem; }

/* ---------- Wac-A-Zac targets ---------- */
.whack-legend {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
  font-size: 0.82rem; color: var(--ink-2);
}
.whack-legend span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--inset); border: 1px solid var(--line);
}
.hole.is-mover { border-color: color-mix(in srgb, #8fb4ff 60%, transparent); }
.hole.is-mover .mole {
  animation: mole-pop 0.24s var(--ease), mole-wiggle 0.9s ease-in-out 0.24s infinite;
}
@keyframes mole-wiggle {
  0%, 100% { transform: translateX(-10%) rotate(-6deg); }
  50% { transform: translateX(10%) rotate(6deg); }
}
.hole.is-grump {
  border-color: color-mix(in srgb, #ff8f8a 65%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #ff8f8a 38%, transparent);
}
.whack-board { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.whack-board li {
  display: grid; grid-template-columns: 22px 46px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--inset); border: 1px solid var(--line); font-size: 0.9rem;
}
.whack-rank { color: var(--muted); font-size: 0.78rem; }
.whack-board strong { font-size: 1.05rem; }
.whack-who { color: var(--ink-2); }
.whack-board small { color: var(--muted); font-size: 0.75rem; }
@media (max-width: 520px) {
  .whack-board li { grid-template-columns: 18px 40px 1fr; }
  .whack-board small { display: none; }
}

/* ---------- support email & official sources ---------- */
.sup-email { margin: 12px 0 0; font-size: 1.05rem; font-weight: 600; }
.sup-email a { text-decoration: underline; text-underline-offset: 3px; }
.learn-sources { margin-top: 0; }
.source-group { margin-top: 14px; }
.source-group h3 {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.source-list li {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px; border-radius: 12px;
  background: var(--inset); border: 1px solid var(--line);
}
.source-list a { font-weight: 600; }
.source-list span { color: var(--ink-2); font-size: 0.86rem; }

/* ==========================================================================
   Icon (emoji) finishes - Basic, Soft, Matt, Gloss
   Applied through html[data-emoji], so the choice survives a reload.
   ========================================================================== */

:is(.tile-ico, .section-title .emoji, .entry-face, .sound-emoji, .pad-emoji,
    .guide-emoji, .comp-entry-emoji, .spin-result-emoji, .now-emoji,
    .slot-emoji, .plan-emoji, .mode-emoji, .ground-pick-img, .creator-avatar) {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

html[data-emoji="soft"] :is(.tile-ico, .section-title .emoji, .entry-face, .sound-emoji,
    .pad-emoji, .guide-emoji, .comp-entry-emoji, .spin-result-emoji, .now-emoji,
    .slot-emoji, .plan-emoji, .mode-emoji, .ground-pick-img, .creator-avatar) {
  border-radius: 28%;
  border: 1px solid color-mix(in srgb, var(--mint) 24%, transparent);
  background: color-mix(in srgb, var(--mint) 14%, var(--panel-solid));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--mint) 16%, transparent);
}

html[data-emoji="matt"] :is(.tile-ico, .section-title .emoji, .entry-face, .sound-emoji,
    .pad-emoji, .guide-emoji, .comp-entry-emoji, .spin-result-emoji, .now-emoji,
    .slot-emoji, .plan-emoji, .mode-emoji, .ground-pick-img, .creator-avatar) {
  border-radius: 22%;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  box-shadow: none;
}

html[data-emoji="gloss"] :is(.tile-ico, .section-title .emoji, .entry-face, .sound-emoji,
    .pad-emoji, .guide-emoji, .comp-entry-emoji, .spin-result-emoji, .now-emoji,
    .slot-emoji, .plan-emoji, .mode-emoji, .ground-pick-img, .creator-avatar) {
  border-radius: 26%;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--mint) 34%, transparent),
    color-mix(in srgb, var(--sky) 20%, transparent) 55%,
    color-mix(in srgb, var(--lilac) 16%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 8px rgba(0, 0, 0, 0.12),
    0 8px 18px color-mix(in srgb, var(--ink) 18%, transparent);
}

/* ---------- settings: icon style picker ---------- */

.emoji-style-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.emoji-style-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 12px; text-align: left;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.emoji-style-btn:hover { border-color: var(--line-strong); }
.emoji-style-btn.is-on {
  border-color: color-mix(in srgb, var(--mint) 55%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 32%, transparent);
}
.emoji-style-sample { display: flex; gap: 7px; align-items: center; min-height: 50px; }
.emoji-style-sample span {
  flex: none;
  width: 46px; height: 46px; display: grid; place-items: center;
  font-size: 1.2rem; line-height: 1; box-sizing: border-box;
  border-radius: 12px;
}
.emoji-style-name { font-weight: 700; font-size: 0.9rem; }
.emoji-style-note { color: var(--muted); font-size: 0.75rem; line-height: 1.35; }

.emoji-style-btn.s-soft .emoji-style-sample span {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--mint) 24%, transparent);
  background: color-mix(in srgb, var(--mint) 14%, var(--panel-solid));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--mint) 16%, transparent);
}
.emoji-style-btn.s-matt .emoji-style-sample span {
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.emoji-style-btn.s-gloss .emoji-style-sample span {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--mint) 34%, transparent),
    color-mix(in srgb, var(--sky) 20%, transparent) 55%,
    color-mix(in srgb, var(--lilac) 16%, transparent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 8px rgba(0, 0, 0, 0.12),
    0 8px 18px color-mix(in srgb, var(--ink) 18%, transparent);
}

/* ---------- palette previews ---------- */

.theme-mini {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 74px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
}
.theme-mini-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-mini-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }
.theme-mini-copy { font-size: 0.72rem; font-weight: 600; }
.theme-mini-pill { font-size: 0.62rem; font-weight: 750; padding: 3px 9px; border-radius: 999px; }

/* ---------- Journal: edit controls and top lists ---------- */

.entry-actions { display: flex; gap: 6px; flex: none; }
.icon-btn.sm { width: 40px; height: 40px; border-radius: 12px; }
.icon-btn.sm .ico { width: 18px; height: 18px; }
.entry-editing { grid-template-columns: minmax(0, 1fr); }
.entry-edit { display: flex; flex-direction: column; gap: 12px; }
.entry-edit .entry-mood { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.entry-edit .textarea { min-height: 78px; }
.top-group { margin-top: 14px; }
.mini-title {
  font-size: 0.72rem; font-weight: 750; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.top-list { display: flex; flex-direction: column; gap: 7px; }
.top-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top-count { color: var(--muted); font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Calm: look around ---------- */

.ground-card { overflow: hidden; }
.ground-top { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.ground-badge {
  flex: none; padding: 6px 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--mint) 32%, transparent);
  background: color-mix(in srgb, var(--mint) 10%, transparent);
  font-weight: 750; font-size: 0.86rem; letter-spacing: 0.08em;
}
.ground-how {
  margin-top: 16px; padding: 14px 16px;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--inset);
}
.ground-how ol { list-style: none; counter-reset: ground; display: grid; gap: 8px; margin-top: 8px; }
.ground-how li {
  counter-increment: ground; position: relative; padding-left: 32px;
  color: var(--ink-2); font-size: 0.92rem; line-height: 1.45;
}
.ground-how li::before {
  content: counter(ground); position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--mint) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--mint) 28%, transparent);
  color: var(--ink); font-size: 0.72rem; font-weight: 800;
}
.ground-stage {
  margin-top: 16px; padding: clamp(16px, 3vw, 28px);
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background:
    radial-gradient(520px 240px at 50% 0%, color-mix(in srgb, var(--mint) 10%, transparent), transparent 70%),
    color-mix(in srgb, var(--ink) 3%, transparent);
  text-align: center;
}
.ground-num {
  font-size: clamp(3.4rem, 14vw, 5.5rem); font-weight: 800;
  line-height: 1; letter-spacing: -0.05em; margin-top: 4px;
}
.ground-tip { color: var(--ink-2); max-width: 52ch; margin: 10px auto 0; font-size: 0.95rem; }
.ground-pick-label { margin: 20px auto 10px; text-align: center; }
.ground-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; max-width: 660px; margin: 0 auto; }
.ground-pick {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  color: var(--ink-2); font-size: 0.86rem; font-weight: 650;
}
.ground-pick:hover { border-color: var(--line-strong); color: var(--ink); }
.ground-pick.is-on {
  border-color: color-mix(in srgb, var(--mint) 50%, transparent);
  background: color-mix(in srgb, var(--mint) 12%, transparent);
  color: var(--ink);
}
.ground-pick-img {
  width: 52px; height: 52px; border-radius: 18px;
  font-size: 1.7rem; display: grid; place-items: center;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--mint) 16%, transparent),
    color-mix(in srgb, var(--sky) 12%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px color-mix(in srgb, var(--ink) 10%, transparent);
}
.ground-tick { position: absolute; top: 8px; right: 10px; color: var(--mint); font-weight: 800; }
.ground-dots { display: flex; gap: 6px; justify-content: center; margin: 16px 0; }
.ground-dots span { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 20%, transparent); }
.ground-dots span.is-on { background: var(--mint); transform: scale(1.25); }
.ground-nav { justify-content: center; }
.ground-done { text-align: center; padding: 24px 10px 8px; }
.ground-done-mark { font-size: 2.6rem; display: block; margin-bottom: 8px; }

/* ---------- Settings: creator ---------- */

.creator-card {
  border-color: color-mix(in srgb, var(--sky) 26%, var(--line));
  background:
    radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--sky) 12%, transparent), transparent 70%),
    var(--panel);
}
.creator-head { display: flex; gap: 14px; align-items: center; }
.creator-avatar {
  width: 54px; height: 54px; flex: none;
  border-radius: 17px; font-size: 1.6rem;
  background: color-mix(in srgb, var(--sky) 16%, transparent);
}
.creator-story { margin-top: 14px; color: var(--ink-2); font-size: 0.95rem; line-height: 1.6; max-width: 72ch; }
.creator-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.creator-links .btn { max-width: 100%; overflow-wrap: anywhere; }

@media (max-width: 460px) {
  .ground-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-links .btn { width: 100%; }
}

/* Settings quick navigation, so deeper sections are easy to find */
.settings-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.settings-jump .chip { min-height: 36px; font-size: 0.82rem; padding: 4px 12px; }
#setIcons, #setColours, #setCreator, #setData { scroll-margin-top: 92px; }

/* ==========================================================================
   Font choice - four clear, child-friendly options. No downloads, no CDN.
   ========================================================================== */

:root[data-font="clear"] {
  --sans: "Atkinson Hyperlegible", Verdana, Tahoma, "Segoe UI", system-ui, sans-serif;
}
:root[data-font="simple"] {
  --sans: system-ui, -apple-system, "Segoe UI", Arial, "Helvetica Neue", sans-serif;
}
:root[data-font="friendly"] {
  --sans: "Comic Sans MS", "Comic Sans", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
html[data-font="clear"] body { line-height: 1.62; letter-spacing: 0.004em; }
html[data-font="friendly"] body { line-height: 1.6; letter-spacing: 0.006em; }

.font-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.font-btn {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 12px; text-align: left;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink);
}
.font-btn:hover { border-color: var(--line-strong); }
.font-btn.is-on {
  border-color: color-mix(in srgb, var(--mint) 55%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 32%, transparent);
}
.font-sample {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 1.45rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1;
}
.font-sample small { font-size: 0.78rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.font-btn.f-default .font-sample { font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; }
.font-btn.f-clear .font-sample { font-family: "Atkinson Hyperlegible", Verdana, Tahoma, "Segoe UI", sans-serif; }
.font-btn.f-simple .font-sample { font-family: system-ui, -apple-system, "Segoe UI", Arial, "Helvetica Neue", sans-serif; }
.font-btn.f-friendly .font-sample { font-family: "Comic Sans MS", "Comic Sans", "Trebuchet MS", "Segoe UI", sans-serif; }
.font-name { font-weight: 700; font-size: 0.9rem; }
.font-note { color: var(--muted); font-size: 0.75rem; line-height: 1.35; }

/* ==========================================================================
   Support ZenZac banner (Creator)
   ========================================================================== */

.support-banner {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch; gap: 0; margin: 0 0 18px;
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--sky) 32%, transparent);
  background: linear-gradient(120deg, #eef8ff, #d9ecff);
  color: #0b2b46; text-decoration: none;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--ink) 14%, transparent);
}
.support-banner:hover { text-decoration: none; filter: brightness(1.02); }
.support-banner-copy { display: flex; flex-direction: column; gap: 6px; justify-content: center; padding: 18px 20px; }
.support-banner-kicker { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.support-banner-kicker span { color: #1f7ae0; }
.support-banner-tag { font-style: italic; font-weight: 700; color: #245a86; font-size: 0.9rem; }
.support-banner-line { font-size: 0.85rem; line-height: 1.45; color: #24506f; max-width: 38ch; }
.support-banner-cta {
  align-self: flex-start; margin-top: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: #1f7ae0; color: #fff; font-weight: 750; font-size: 0.82rem;
}
.support-banner-img { width: 100%; height: 100%; min-height: 190px; object-fit: cover; display: block; }

@media (max-width: 560px) {
  .support-banner { grid-template-columns: 1fr; }
  .support-banner-img { order: -1; min-height: 140px; max-height: 160px; }
  .support-banner-copy { padding: 16px; }
}

/* Inline emoji paint their background around the text box, not the glyph.
   Give them a square that is always larger than the drawn emoji, so nothing
   spills over the edge of its tile. Fixed-size tiles are already big enough. */
html:is([data-emoji="soft"], [data-emoji="matt"], [data-emoji="gloss"]) :is(
    .section-title .emoji, .sound-emoji, .pad-emoji, .guide-emoji,
    .comp-entry-emoji, .spin-result-emoji, .now-emoji, .slot-emoji,
    .plan-emoji, .mode-emoji) {
  min-width: 1.65em;
  min-height: 1.65em;
  padding: 0.08em;
}

/* Sound control inside the joke card, so a run of jokes can be muted there. */
.joke-tools {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; width: 100%; margin-bottom: -2px;
}

/* Joke deck picker above the card, so the four sets are obvious at a glance. */
.joke-decks { margin-bottom: 14px; }
.joke-decks .chips { margin-top: 8px; }

/* Shared volume control inside the Sounds tab. */
.sound-volume {
  margin: 16px 0 18px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}
.sound-volume .label { margin: 0; }
.sound-volume input[type="range"] { margin-top: 6px; }
