/* Gratitude Moments — mobile-first, warm, accessible. */

:root {
  --bg: #fff8f3;
  --bg-accent-1: rgba(255, 196, 168, 0.45);
  --bg-accent-2: rgba(206, 188, 255, 0.45);
  --surface: #ffffff;
  --surface-2: #f6f0ff;
  --surface-3: #fff1e8;
  --border: #ebe1f6;
  --text: #241936;
  --muted: #5f5472;
  --primary: #5b34c4;
  --primary-ink: #4a27a8;
  --primary-soft: #ece4ff;
  --btn-grad: linear-gradient(135deg, #5b34c4 0%, #8a3ac0 100%);
  --coral: #e8664f;
  --coral-ink: #b23d29;
  --coral-soft: #ffe4dc;
  --peach: #ffd9c4;
  --yellow-soft: #fff1c7;
  --yellow-ink: #7a5300;
  --teal: #1a9e95;
  --teal-ink: #0b6b65;
  --teal-soft: #d6f5f2;
  --pink-soft: #ffe0ec;
  --danger: #b4233f;
  --danger-soft: #fde7ec;
  --hero: linear-gradient(140deg, #4b2aae 0%, #7536bf 38%, #a8408f 72%, #c4513f 100%);
  --hero-text: #ffffff;
  --shadow: 0 12px 32px -16px rgba(76, 40, 140, 0.35), 0 2px 6px -2px rgba(76, 40, 140, 0.08);
  --shadow-lg: 0 24px 48px -20px rgba(76, 40, 140, 0.45);
  --radius: 22px;
  --radius-sm: 14px;
  --focus: 0 0 0 3px var(--surface), 0 0 0 6px #8a5cff;
  --tabbar-h: 68px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #14101d;
  --bg-accent-1: rgba(196, 81, 63, 0.18);
  --bg-accent-2: rgba(117, 54, 191, 0.25);
  --surface: #1f192d;
  --surface-2: #2a2240;
  --surface-3: #2c2030;
  --border: #3a3052;
  --text: #f4eefc;
  --muted: #c2b7d6;
  --primary: #b9a2ff;
  --primary-ink: #c9b6ff;
  --primary-soft: #33295a;
  --btn-grad: linear-gradient(135deg, #6a43d6 0%, #9440c6 100%);
  --coral-ink: #ffab98;
  --coral-soft: #4a2626;
  --yellow-soft: #3d3216;
  --yellow-ink: #ffd88a;
  --teal-ink: #7fe3da;
  --teal-soft: #173b39;
  --pink-soft: #3d2133;
  --danger: #ff8fa5;
  --danger-soft: #42202a;
  --hero: linear-gradient(140deg, #34207a 0%, #57288f 40%, #7f2f6e 75%, #8e3b30 100%);
  --shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, 0.8);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px #b9a2ff;
  color-scheme: dark;
}

:root[data-text-size='large'] { font-size: 112.5%; }
:root[data-text-size='larger'] { font-size: 125%; }

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(60rem 30rem at 110% -10%, var(--bg-accent-1), transparent 60%),
    radial-gradient(50rem 30rem at -20% 40%, var(--bg-accent-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--primary-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.icon { width: 1.35em; height: 1.35em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.link { color: var(--primary-ink); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.small-gap { gap: 4px 14px; margin-top: 6px; }

/* ---------- layout ---------- */
.layout { min-height: 100vh; }
main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); outline: none; }
.page { max-width: 680px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar ul { list-style: none; margin: 0 auto; padding: 6px 6px; display: grid; grid-template-columns: repeat(5, 1fr); max-width: 680px; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; border-radius: 16px; text-decoration: none; color: var(--muted); font-size: 0.75rem; font-weight: 600;
  transition: color 0.2s, background 0.2s;
}
.tab .icon { width: 24px; height: 24px; }
.tab.is-active { color: var(--primary-ink); background: var(--primary-soft); }
.tab:hover { color: var(--primary-ink); }

@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: 220px 1fr; }
  .tabbar {
    position: sticky; top: 0; height: 100vh; inset: auto; border-top: 0; border-right: 1px solid var(--border);
    padding: 24px 12px;
  }
  .tabbar ul { display: flex; flex-direction: column; gap: 6px; padding: 0; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 16px; font-size: 1rem; min-height: 52px; }
  main { padding-bottom: 48px; }
  .tabbar[hidden] + main { grid-column: 1 / -1; }
}

/* ---------- hero header (Home) ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--hero-text); background: var(--hero);
  padding: calc(18px + env(safe-area-inset-top)) 20px 30px;
  border-radius: 0 0 32px 32px; margin-bottom: 18px; box-shadow: var(--shadow-lg);
}
@media (min-width: 720px) { .hero { max-width: 712px; margin: 16px auto 20px; border-radius: 32px; padding: 26px 28px 34px; } }
.hero > *:not(.hero-blobs) { position: relative; }
.hero-blobs span { position: absolute; border-radius: 50%; filter: blur(30px); opacity: 0.55; }
.hero-blobs span:nth-child(1) { width: 220px; height: 220px; right: -70px; top: -80px; background: #ffb38a; }
.hero-blobs span:nth-child(2) { width: 180px; height: 180px; right: 30px; bottom: -110px; background: #ffd66b; opacity: 0.4; }
.hero-blobs span:nth-child(3) { width: 160px; height: 160px; left: -80px; bottom: -90px; background: #3fd1c4; opacity: 0.35; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; font-size: 22px;
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.3);
}
.brand-name { margin: 0; font-weight: 700; letter-spacing: 0.01em; }
.brand-date { margin: 0; font-size: 0.85rem; opacity: 0.95; }
.hero-actions { display: flex; gap: 8px; }
.hero-icon {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px;
  color: #fff; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.32);
  transition: background 0.2s, transform 0.2s var(--ease);
}
.hero-icon:hover { background: rgba(255, 255, 255, 0.26); }
.hero-icon:active { transform: scale(0.95); }
.hero-icon:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(36, 25, 54, 0.6); }
.bell.is-off { background: rgba(0, 0, 0, 0.18); }
.bell-dot { position: absolute; top: 10px; right: 11px; width: 10px; height: 10px; border-radius: 50%; background: #ffd66b; border: 2px solid #8a3ac0; }
.greeting { font-family: var(--font-display); font-size: clamp(1.75rem, 6vw, 2.25rem); font-weight: 600; margin: 0 0 6px; outline: none; }
.hero-quote { font-size: 1.05rem; opacity: 0.97; margin: 0 0 16px; font-style: italic; }
.next-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.next-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 600; font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(6px);
}
.next-chip:hover { background: rgba(255, 255, 255, 0.28); }
.next-chip:focus-visible, .chip-btn:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(36, 25, 54, 0.6); }
.next-chip.state-off, .next-chip.state-paused { background: rgba(0, 0, 0, 0.2); }
.chip-btn {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 0; font-weight: 700;
  background: #fff; color: #4a27a8;
}

/* ---------- page header (other pages) ---------- */
.page-header {
  background: var(--hero); color: #fff; padding: calc(22px + env(safe-area-inset-top)) 20px 26px;
  border-radius: 0 0 28px 28px; margin-bottom: 18px; box-shadow: var(--shadow);
}
@media (min-width: 720px) { .page-header { max-width: 712px; margin: 16px auto 20px; border-radius: 28px; } }
.page-header-inner { max-width: 680px; margin: 0 auto; }
.page-title { font-family: var(--font-display); font-size: clamp(1.6rem, 5.5vw, 2rem); font-weight: 600; margin: 0; outline: none; }
.page-subtitle { margin: 4px 0 0; opacity: 0.95; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: #fff; text-decoration: none; font-weight: 600; margin-bottom: 8px; min-height: 40px; }
.back-link .icon { width: 18px; height: 18px; }
.back-link:focus-visible { box-shadow: 0 0 0 3px #fff; border-radius: 8px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
/* Entrance animation only when arriving on a page, not on every update. */
main.entering .card, main.entering .entry-card { animation: rise 0.45s var(--ease) both; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2 .icon { width: 1.1em; height: 1.1em; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- composer ---------- */
.compose { padding: 22px 20px 20px; border: 0; position: relative; }
.compose::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: linear-gradient(135deg, #b79cff, #ffb39e, #ffe08a, #7fdcd2);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.9;
}
.compose-title { font-family: var(--font-display); font-size: clamp(1.35rem, 5vw, 1.6rem); font-weight: 600; margin-bottom: 14px; }
.input-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mode-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 16px;
  border: 2px solid transparent; font-weight: 700; font-size: 1rem; transition: transform 0.15s var(--ease), background 0.2s;
  background: var(--primary-soft); color: var(--primary-ink);
}
.mode-btn.mic { background: var(--coral-soft); color: var(--coral-ink); }
.mode-btn:active { transform: scale(0.97); }
.mode-btn.is-listening { background: #c9442f; color: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 102, 79, 0.45); } 50% { box-shadow: 0 0 0 10px rgba(232, 102, 79, 0); } }
.btn-icon { display: inline-flex; }

.textarea, .input, .select {
  width: 100%; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface);
  padding: 12px 14px; transition: border-color 0.2s, box-shadow 0.2s; min-height: 48px;
}
.textarea { resize: vertical; line-height: 1.5; }
.textarea.big { font-size: 1.15rem; min-height: 132px; background: var(--surface-2); border-color: transparent; padding: 16px; }
.textarea:focus, .input:focus, .select:focus { border-color: #8a5cff; outline: none; box-shadow: 0 0 0 4px rgba(138, 92, 255, 0.18); }
.textarea::placeholder, .input::placeholder { color: var(--muted); opacity: 0.85; }
.input.big { font-size: 1.15rem; min-height: 56px; }
.input.time { width: auto; min-width: 8.5rem; }
.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) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }

.voice-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 14px;
  border-radius: 14px; background: var(--coral-soft); color: var(--coral-ink);
}
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #d4402a; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.interim { font-style: italic; opacity: 0.9; }
.voice-message { margin: 10px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--yellow-soft); color: var(--yellow-ink); }
.hint { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted); }

.prompt-context {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 12px;
  padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--yellow-soft); color: var(--yellow-ink); font-weight: 600;
}
.compose-extras { margin: 14px 0 6px; display: grid; gap: 6px; }
.field-label { display: block; font-weight: 700; margin: 12px 0 6px; }
.field-label.small { font-size: 0.9rem; margin-top: 0; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 14px; border-radius: 12px; margin: 10px 0; font-weight: 600; }

.save-ack {
  margin: 12px 0 0; min-height: 1.5em; text-align: center; font-weight: 600; color: var(--teal-ink);
  opacity: 0; transform: translateY(4px); transition: opacity 0.35s, transform 0.35s var(--ease);
}
.save-ack.show { opacity: 1; transform: none; }
.save-ack.is-hint { color: var(--muted); }

/* ---------- mood picker ---------- */
.mood-picker { border: 0; padding: 0; margin: 10px 0 4px; min-width: 0; }
.mood-picker legend { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; padding: 0; }
.mood-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); cursor: pointer; min-height: 64px; text-align: center; transition: transform 0.15s, background 0.2s; }
.mood-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mood-face { font-size: 1.5rem; line-height: 1.2; }
.mood-label { font-size: 0.72rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
.mood-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.mood-option:has(input:checked) .mood-label { color: var(--primary-ink); }
.mood-option:has(input:focus-visible) { box-shadow: var(--focus); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 999px; border: 2px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.2s, background 0.2s; white-space: normal; text-align: center;
  padding-block: 8px; line-height: 1.25; max-width: 100%;
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn-primary { background: var(--btn-grad); color: #fff; box-shadow: 0 10px 22px -12px rgba(91, 52, 196, 0.8); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary.is-empty { filter: saturate(0.5); opacity: 0.6; box-shadow: none; }
.btn-xl { width: 100%; min-height: 58px; font-size: 1.1rem; border-radius: 18px; margin-top: 12px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 1.05rem; }
.btn-soft { background: var(--primary-soft); color: var(--primary-ink); }
.btn-soft:hover { filter: brightness(0.97); }
.btn-ghost { background: transparent; color: var(--primary-ink); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-ghost-light { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 0.9rem; }
.btn-danger { background: #b4233f; color: #fff; }
.btn-danger-outline { background: transparent; color: var(--danger); border-color: currentColor; }
.btn-danger-outline:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 8px 0; min-height: 44px; color: var(--primary-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 0;
  background: transparent; color: var(--muted); transition: background 0.2s, color 0.2s, transform 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--primary-ink); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.light { color: #fff; background: rgba(255, 255, 255, 0.16); }
.icon-btn.light:hover:not(:disabled) { background: rgba(255, 255, 255, 0.28); color: #fff; }
.fav-btn.is-fav, .fav-btn.is-fav:hover:not(:disabled) { color: #e0457b; }
.fav-btn:active { transform: scale(1.2); }

/* ---------- inspiration ---------- */
.inspire { background: linear-gradient(160deg, var(--surface) 0%, var(--surface) 55%, var(--surface-3) 100%); }
.prompt-text { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.4; margin: 6px 0 14px; color: var(--text); }
.chips-title { font-size: 0.9rem; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.chip:hover { border-color: #b79cff; background: var(--surface-2); }
.chip:active { transform: scale(0.96); }
.chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- today / stats ---------- */
.today-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.stat { display: flex; flex-direction: column; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.stat.streak { background: var(--yellow-soft); }
.stat-num { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.stat.streak .stat-label { color: var(--yellow-ink); }
.encourage { color: var(--teal-ink); font-weight: 600; }
.sub-title { font-size: 0.9rem; color: var(--muted); margin: 14px 0 8px; }

.memory { background: linear-gradient(150deg, var(--teal-soft), var(--surface) 70%); }
.memory-text { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.45; }
.reflect-nudge { display: flex; flex-direction: column; gap: 8px; background: linear-gradient(150deg, var(--primary-soft), var(--surface) 75%); }

/* ---------- entries ---------- */
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry-card {
  background: var(--surface); border-radius: 18px; padding: 12px 14px 10px 16px; border: 1px solid var(--border);
  position: relative;
}
.entry-card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: linear-gradient(#a98bff, #ff9f8a); }
.today .entry-card, .card .entry-card { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.entry-head { display: flex; justify-content: space-between; align-items: center; margin: -4px -6px 0 0; }
.entry-time { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.entry-text { font-size: 1.05rem; margin: 2px 0 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.entry-prompt { font-size: 0.82rem; color: var(--muted); font-style: italic; margin-bottom: 6px; }
.entry-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-actions { display: flex; margin-right: -6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); }
.tag-mood { background: var(--yellow-soft); color: var(--yellow-ink); }
.tag-soft { background: var(--teal-soft); color: var(--teal-ink); }

/* ---------- journal ---------- */
.journal-tools { display: flex; flex-direction: column; gap: 12px; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search-wrap .input { padding-left: 46px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-row .filter:last-child { grid-column: 1 / -1; }
@media (min-width: 560px) { .filter-row { grid-template-columns: 1fr 1fr 1fr; } .filter-row .filter:last-child { grid-column: auto; } }
.toggle-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; text-decoration: none; color: var(--text); font-size: 0.92rem;
}
.toggle-pill .icon { width: 1.1em; height: 1.1em; }
.toggle-pill[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.day-nav { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border-radius: 14px; padding: 2px; font-weight: 700; }
.result-count { color: var(--muted); font-weight: 600; margin: 0 4px; }
.day-group { display: flex; flex-direction: column; gap: 10px; }
.day-title { font-size: 1rem; color: var(--muted); margin: 10px 4px 0; text-transform: none; }
.day-group .entry-card { box-shadow: var(--shadow); }
.reflection-card { background: linear-gradient(150deg, var(--primary-soft), var(--surface)); border-radius: 18px; padding: 14px 16px; border: 1px solid var(--border); }
.reflection-label { font-weight: 700; margin-bottom: 4px; }
.reflection-text { margin-bottom: 4px; }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-emoji { font-size: 2.4rem; margin: 0; }

.calendar { padding: 14px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-title { font-size: 1.05rem; margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell {
  position: relative; aspect-ratio: 1; min-height: 40px; border-radius: 12px; border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; color: var(--text);
}
.cal-cell.empty { visibility: hidden; }
.cal-cell[data-empty] { color: var(--muted); }
.cal-cell.has { background: var(--primary-soft); color: var(--primary-ink); }
.cal-cell.is-today { outline: 2px solid var(--coral); outline-offset: -2px; }
.cal-cell.is-selected { background: var(--btn-grad); color: #fff; }
.cal-dot { font-size: 0.6rem; line-height: 1; min-width: 6px; height: 6px; border-radius: 6px; background: currentColor; margin-top: 2px; color: inherit; }
.cal-dot:not(:empty) { height: auto; background: none; font-weight: 800; }

/* ---------- insights ---------- */
.streak-card { background: linear-gradient(150deg, var(--yellow-soft), var(--surface) 70%); }
.streak-big { font-size: 1.5rem; font-weight: 800; margin-bottom: 2px; }
.week-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--text); background: linear-gradient(130deg, var(--pink-soft), var(--primary-soft)); }
.week-link:hover { filter: brightness(0.98); }
.week-link h2 { margin-bottom: 2px; }
.week-link p { margin: 0; }
.week-link-arrow { font-size: 1.6rem; color: var(--primary-ink); }
.milestones { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.milestone { display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.milestone .ms-emoji { grid-row: 1 / 3; font-size: 1.5rem; text-align: center; filter: grayscale(1); opacity: 0.55; }
.milestone.is-done .ms-emoji { filter: none; opacity: 1; }
.ms-label { font-weight: 700; }
.ms-state { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.milestone.is-done .ms-state { color: var(--teal-ink); }
.ms-bar { grid-column: 2 / 4; height: 6px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 6px; }
.ms-bar span { display: block; height: 100%; background: linear-gradient(90deg, #a98bff, #ff9f8a); border-radius: inherit; }
.bars { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(7.5rem, 40%) 1fr 2rem; align-items: center; gap: 10px; }
.bar-label { font-weight: 600; font-size: 0.92rem; }
.bar-track { height: 12px; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8a5cff, #e0617f); transition: width 0.6s var(--ease); }
.bar-fill.mood-great { background: #1a9e95; } .bar-fill.mood-good { background: #5fbf6a; } .bar-fill.mood-okay { background: #e5b53b; } .bar-fill.mood-low { background: #e58a4f; } .bar-fill.mood-difficult { background: #b26ad6; }
.bar-value { text-align: right; font-weight: 700; }
.mood-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; }
.mood-strip li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ms-face { font-size: 1.1rem; line-height: 1.4; }
.ms-day { font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.disclaimer { font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; margin: 14px 0 0; }

/* ---------- week ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.week-range { margin: 0; font-weight: 700; text-align: center; }
.week-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.week-tile { padding: 16px; display: flex; flex-direction: column; justify-content: center; }
.week-tile:first-child { grid-column: 1 / -1; }
.week-tile p { margin: 0; }
.tile-label { font-size: 0.88rem; font-weight: 600; }
.tile-big { font-size: 3rem; font-weight: 800; line-height: 1.1; }
.tile-mid { font-size: 1.35rem; font-weight: 800; margin: 2px 0 !important; }
.tile-purple { background: linear-gradient(140deg, #ece4ff, #ffe0ec); color: #2c1b4f; border: 0; }
.tile-peach { background: linear-gradient(140deg, #ffe4d4, #fff1c7); color: #4a2a12; border: 0; }
.tile-teal { background: linear-gradient(140deg, #d6f5f2, #e6f0ff); color: #12403d; border: 0; }
.theme-list { margin: 4px 0 0; padding-left: 1.2rem; font-weight: 700; }
@media (min-width: 560px) { .week-grid { grid-template-columns: 1.2fr 1fr 1fr; } .week-tile:first-child { grid-column: auto; } }
.day-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 170px; }
.day-bars li { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.day-bar { width: 100%; max-width: 36px; height: 110px; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.day-bar span { display: block; width: 100%; background: linear-gradient(#ff9f8a, #8a5cff); border-radius: 10px; min-height: 0; transition: height 0.6s var(--ease); }
.day-bar-count { font-weight: 800; font-size: 0.9rem; }
.day-bar-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; }

/* ---------- reflection ---------- */
.reflect-form { display: flex; flex-direction: column; gap: 10px; }
.numbered-field { display: flex; align-items: center; gap: 10px; }
.num { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--btn-grad); color: #fff; font-weight: 800; }

/* ---------- settings ---------- */
.settings .card { display: flex; flex-direction: column; gap: 4px; }
.group { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
.group legend { padding: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-text { display: flex; flex-direction: column; cursor: pointer; }
.switch-label { font-weight: 700; }
.switch-desc { font-size: 0.85rem; color: var(--muted); }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 56px; height: 34px; border-radius: 34px; margin: 0;
  background: #b9b0c9; position: relative; cursor: pointer; transition: background 0.2s;
}
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease); }
.switch:checked { background: #5b34c4; }
.switch:checked::after { transform: translateX(22px); }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }
:root[data-theme='dark'] .switch { background: #5a4f70; }
:root[data-theme='dark'] .switch:checked { background: #7b55e6; }
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-grid.three { grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); }
.radio-grid > * { min-width: 0; overflow-wrap: anywhere; }
.radio-pill { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--border); font-weight: 600; cursor: pointer; background: var(--surface); }
.radio-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio-pill:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.radio-pill:has(input:focus-visible) { box-shadow: var(--focus); }
.preview { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin: 8px 0; }
.preview p { margin: 0; }
.preview-next { font-weight: 700; }
.pause-box { padding: 4px 0 8px; }
.pause-box .field-label { margin-top: 4px; }
.time-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.time-list li { display: flex; align-items: center; gap: 8px; }
.time-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.time-range.big { font-size: 1.1rem; font-weight: 700; margin: 12px 0; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-btn { min-height: 48px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); font-weight: 700; font-size: 0.85rem; color: var(--muted); padding: 0; }
.day-btn[aria-pressed='true'] { background: var(--btn-grad); color: #fff; border-color: transparent; }
.perm-box { margin-top: 14px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.perm-box.perm-denied { background: var(--yellow-soft); }
.perm-box.perm-denied .muted { color: var(--yellow-ink); }
.perm-head { font-weight: 700; margin-bottom: 4px; }
.privacy-text p { font-size: 0.95rem; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.about { text-align: center; margin: 8px 0; }

/* ---------- onboarding ---------- */
.onboarding { min-height: 100vh; display: grid; place-items: center; padding: calc(20px + env(safe-area-inset-top)) 16px 24px; background: var(--hero); }
.ob-card { width: 100%; max-width: 520px; padding: 26px 22px; border: 0; box-shadow: var(--shadow-lg); }
.ob-progress { display: flex; gap: 6px; margin-bottom: 22px; }
.ob-progress span { flex: 1; height: 6px; border-radius: 6px; background: var(--border); transition: background 0.3s; }
.ob-progress span.on { background: var(--btn-grad); }
.ob-body { min-height: 290px; }
.ob-art { font-size: 3.2rem; line-height: 1; margin-bottom: 12px; color: var(--primary); }
.ob-title { font-family: var(--font-display); font-size: clamp(1.6rem, 6vw, 2rem); font-weight: 600; outline: none; }
.ob-lead { font-size: 1.1rem; color: var(--muted); }
.ob-steps { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ob-steps li { padding: 8px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 0.92rem; }
.ob-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; }
.radio-stack { display: grid; gap: 8px; }
.radio-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--border); font-weight: 700; cursor: pointer; }
.radio-card input { width: 22px; height: 22px; accent-color: #5b34c4; margin: 0; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.badge { font-style: normal; font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); margin-left: 6px; }
.perm-result { margin-top: 14px; font-weight: 600; }

/* ---------- toast / banner / dialog ---------- */
.toast-region { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 60; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
@media (min-width: 960px) { .toast-region { bottom: 24px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: 520px; padding: 12px 16px 12px 18px; border-radius: 16px; background: #2a1f3f; color: #fff; box-shadow: var(--shadow-lg); animation: rise 0.3s var(--ease); font-weight: 600; }
.toast-action { background: none; border: 0; color: #ffd66b; font-weight: 800; min-height: 40px; padding: 0 6px; }
.reminder-banner { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 0; right: 0; z-index: 70; display: flex; justify-content: center; padding: 0 12px; }
.reminder-banner-card { width: 100%; max-width: 560px; background: var(--hero); color: #fff; border-radius: 22px; padding: 16px 18px; box-shadow: var(--shadow-lg); animation: drop 0.45s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
.rb-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 2px; }
.rb-body { margin-bottom: 12px; }
.rb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rb-actions .btn-primary { background: #fff; color: #4a27a8; }
.dialog { border: 0; padding: 0; border-radius: 24px; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(22, 12, 40, 0.5); backdrop-filter: blur(3px); }
.dialog-card { padding: 22px 20px 18px; }
.dialog-card h2 { font-size: 1.25rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.storage-warning { margin: 0; padding: 10px 16px; background: var(--yellow-soft); color: var(--yellow-ink); font-weight: 600; text-align: center; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
:root[data-reduce-motion='true'] *, :root[data-reduce-motion='true'] *::before, :root[data-reduce-motion='true'] *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important;
}

@media (forced-colors: active) {
  .btn, .chip, .mode-btn, .radio-pill, .day-btn, .switch { border: 2px solid ButtonText; }
}

/* Headings receive programmatic focus for screen readers; no visible ring needed. */
h1[tabindex='-1']:focus, h1[tabindex='-1']:focus-visible { box-shadow: none; outline: none; }

/* ---------- tap-to-add words ---------- */
.word-ideas { margin-top: 12px; }
.word-ideas-title { font-size: 0.85rem; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
  min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 0; font-weight: 600; font-size: 0.92rem;
  background: var(--primary-soft); color: var(--primary-ink); transition: transform 0.15s var(--ease), filter 0.2s;
}
.word-chip:nth-child(4n + 2) { background: var(--teal-soft); color: var(--teal-ink); }
.word-chip:nth-child(4n + 3) { background: var(--coral-soft); color: var(--coral-ink); }
.word-chip:nth-child(4n + 4) { background: var(--yellow-soft); color: var(--yellow-ink); }
.word-chip:hover { filter: brightness(0.96); }
.word-chip:active { transform: scale(0.95); }
.heart-btn { width: 100%; margin-top: 8px; }

/* ---------- bell menu ---------- */
.bell.is-quiet { background: rgba(255, 214, 107, 0.28); }
.bell.is-off { background: rgba(0, 0, 0, 0.18); }
.bell-opts { border: 0; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.bell-opt {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px;
  border: 2px solid var(--border); cursor: pointer; background: var(--surface);
}
.bell-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.bell-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.bell-opt:has(input:focus-visible) { box-shadow: var(--focus); }
.bell-opt-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--primary-ink); flex: none; }
.bell-opt-text { display: flex; flex-direction: column; }
.bell-opt-text span { font-size: 0.88rem; color: var(--muted); }

/* ---------- gratitude pause ---------- */
.pause-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(140deg, var(--teal-soft), var(--surface) 70%); }
.pause-card-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--btn-grad); color: #fff; flex: none; }
.pause-card-text { flex: 1 1 180px; min-width: 0; }
.pause-card-text h2 { margin: 0 0 2px; }
.pause-card-text p { margin: 0; }
body.no-scroll { overflow: hidden; }
.pause-overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; color: #fff; text-align: center;
  background: radial-gradient(circle at 50% 35%, #6a3fc9 0%, #3a2280 45%, #1b1240 100%);
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  animation: fade-in 0.6s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.pause-inner { max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pause-title { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin: 0; }
.breath { position: relative; width: 200px; height: 200px; display: grid; place-items: center; }
.breath-ring, .breath-core { position: absolute; border-radius: 50%; }
.breath-ring { inset: 0; border: 2px solid rgba(255, 255, 255, 0.35); animation: breathe 10s ease-in-out infinite; }
.breath-core { width: 110px; height: 110px; background: radial-gradient(circle at 35% 30%, #ffe3a3, #f2a35e 60%, #e0617f); box-shadow: 0 0 60px rgba(255, 190, 120, 0.6); animation: breathe 10s ease-in-out infinite; }
.breath.still .breath-ring, .breath.still .breath-core { animation: none; }
@keyframes breathe { 0%, 100% { transform: scale(0.72); } 40% { transform: scale(1.12); } 55% { transform: scale(1.12); } }
.pause-step { font-size: 1.2rem; line-height: 1.5; min-height: 3em; margin: 0; }
.pause-time { font-variant-numeric: tabular-nums; opacity: 0.8; margin: 0; font-weight: 700; }
.pause-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pause-done { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn-light { background: #fff; color: #4a27a8; }
.pause-music { color: #ffe3a3; font-weight: 700; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.pause-music:hover { text-decoration: underline; }
.pause-overlay :focus-visible { box-shadow: 0 0 0 3px #1b1240, 0 0 0 6px #ffe3a3; }

/* ---------- share cards ---------- */
.share-after { margin: 4px auto 0; display: flex; }
.share-card-dialog { display: flex; flex-direction: column; gap: 12px; }
.card-preview { width: 100%; max-width: 320px; aspect-ratio: 1080 / 1350; height: auto; align-self: center; border-radius: 18px; box-shadow: var(--shadow); background: var(--surface-2); }

/* ---------- challenges ---------- */
.eyebrow { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.section-title { font-size: 1.1rem; margin: 6px 4px 0; }
.challenge-list { display: flex; flex-direction: column; gap: 12px; }
.challenge-option { display: flex; gap: 16px; align-items: flex-start; }
.challenge-option h3 { margin: 0 0 4px; font-size: 1.1rem; }
.challenge-badge { flex: none; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.6rem; position: relative; background: linear-gradient(140deg, var(--primary-soft), var(--pink-soft)); }
.challenge-badge span { position: absolute; right: -6px; bottom: -6px; font-size: 0.75rem; font-weight: 800; background: var(--btn-grad); color: #fff; border-radius: 999px; padding: 2px 8px; }
.challenge-bar { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
.challenge-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8a5cff, #ff9f8a, #ffd66b); }
.challenge-prompt { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.4; margin: 8px 0 12px; }
.challenge-today { background: var(--surface-2); border-radius: 16px; padding: 14px; margin: 10px 0; }
.challenge-home { background: linear-gradient(140deg, var(--yellow-soft), var(--surface) 70%); }
.challenge-active.finished { background: linear-gradient(140deg, var(--yellow-soft), var(--pink-soft)); }
.challenge-dots { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; }
.challenge-dots li { display: grid; place-items: center; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.challenge-dots li.done { background: var(--btn-grad); color: #fff; }
.challenge-dots li.next { outline: 2px dashed var(--primary); outline-offset: -2px; color: var(--primary-ink); }
.challenge-link { background: linear-gradient(130deg, var(--yellow-soft), var(--teal-soft)); }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }

/* ---------- bell sounds ---------- */
.sound-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 8px; }
.sound-row { display: flex; align-items: center; gap: 8px; }
.sound-pill { flex: 1; justify-content: flex-start; text-align: left; }
.sound-pill span { display: flex; flex-direction: column; }
.sound-pill small { color: var(--muted); font-weight: 500; }
.play-btn { background: var(--primary-soft); color: var(--primary-ink); font-size: 0.95rem; }

/* ---------- language switch (welcome screen) ---------- */
.lang-switch { display: flex; justify-content: flex-end; gap: 6px; margin: -6px 0 6px; }
.lang-btn { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.lang-btn[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- From Gemrhythm card ---------- */
.from-brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(140deg, var(--primary-soft), var(--teal-soft)); }
.from-brand-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--btn-grad); color: #fff; flex: none; }
.from-brand-text { flex: 1 1 180px; min-width: 0; }
.from-brand-text h2 { margin: 0 0 2px; }
.from-brand-text p { margin: 0; }

/* ---------- nudges (install / backup) ---------- */
.nudge h2 { font-size: 1.1rem; }
.install-nudge { background: linear-gradient(140deg, var(--primary-soft), var(--surface) 75%); }
.backup-nudge { background: linear-gradient(140deg, var(--yellow-soft), var(--surface) 75%); }
.install-steps { margin: 6px 0 4px; padding-left: 1.3rem; display: grid; gap: 4px; }
