/*
 * Mindful Companion design tokens.
 * Neutrals: cool mist (hue 230), never cream. One accent: apricot (hue 50-62).
 * Mood colors share one lightness and chroma, so no mood looks "louder" than another.
 */
:root {
  --bg: oklch(0.975 0.006 225);
  --surface: oklch(0.995 0.003 225);
  --surface-2: oklch(0.952 0.01 225);
  --ink: oklch(0.25 0.022 240);
  --muted: oklch(0.47 0.02 240);
  --line: oklch(0.9 0.012 230);
  --accent: oklch(0.53 0.12 45);
  --accent-soft: oklch(0.84 0.09 62);
  --shadow: 0 1px 2px oklch(0.3 0.03 240 / 0.05), 0 10px 28px -14px oklch(0.3 0.04 240 / 0.22);

  --mood-great: oklch(0.52 0.1 80);
  --mood-calm: oklch(0.52 0.085 160);
  --mood-angry: oklch(0.53 0.13 25);
  --mood-tired: oklch(0.52 0.05 255);
  --mood-stressed: oklch(0.53 0.12 45);
  --mood-sad: oklch(0.52 0.1 265);
  --mood-unmotivated: oklch(0.51 0.025 70);

  /* Google Sans: the only rounded humanist sans on Google Fonts with Armenian, Cyrillic and Latin. */
  --sans: "Google Sans", "Noto Sans Armenian", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Literata (book serif, optical sizes) for hy/ru/en quotes; Armenian glyphs fall to Noto Serif Armenian. */
  --serif: "Literata", "Noto Serif Armenian", Georgia, "Sylfaen", serif;

  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;

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

  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-breath: cubic-bezier(0.45, 0, 0.55, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.18 0.02 250);
    --surface: oklch(0.22 0.022 250);
    --surface-2: oklch(0.25 0.024 250);
    --ink: oklch(0.93 0.01 230);
    --muted: oklch(0.74 0.016 235);
    --line: oklch(0.31 0.022 250);
    --accent: oklch(0.82 0.1 62);
    --accent-soft: oklch(0.82 0.1 62);
    --shadow: none;

    --mood-great: oklch(0.78 0.1 80);
    --mood-calm: oklch(0.76 0.08 160);
    --mood-angry: oklch(0.74 0.11 25);
    --mood-tired: oklch(0.76 0.045 255);
    --mood-stressed: oklch(0.76 0.1 45);
    --mood-sad: oklch(0.74 0.08 265);
    --mood-unmotivated: oklch(0.75 0.022 70);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: oklch(0.18 0.02 250);
  --surface: oklch(0.22 0.022 250);
  --surface-2: oklch(0.25 0.024 250);
  --ink: oklch(0.93 0.01 230);
  --muted: oklch(0.74 0.016 235);
  --line: oklch(0.31 0.022 250);
  --accent: oklch(0.82 0.1 62);
  --accent-soft: oklch(0.82 0.1 62);
  --shadow: none;
  --mood-great: oklch(0.78 0.1 80);
  --mood-calm: oklch(0.76 0.08 160);
  --mood-angry: oklch(0.74 0.11 25);
  --mood-tired: oklch(0.76 0.045 255);
  --mood-stressed: oklch(0.76 0.1 45);
  --mood-sad: oklch(0.74 0.08 265);
  --mood-unmotivated: oklch(0.75 0.022 70);
  color-scheme: dark;
}

/* ---------- Sky of the hour (scene palettes) ---------- */

[data-sky="dawn"] {
  --sky-top: oklch(0.8 0.06 300);
  --sky-bottom: oklch(0.92 0.06 65);
  --sun: oklch(0.86 0.11 65);
  --far: oklch(0.72 0.045 300);
  --mid: oklch(0.6 0.05 290);
  --near: oklch(0.46 0.05 280);
  --sky-ink: oklch(0.25 0.03 290);
}

[data-sky="day"] {
  --sky-top: oklch(0.8 0.07 235);
  --sky-bottom: oklch(0.95 0.025 210);
  --sun: oklch(0.95 0.08 95);
  --far: oklch(0.8 0.035 235);
  --mid: oklch(0.66 0.05 200);
  --near: oklch(0.5 0.06 170);
  --sky-ink: oklch(0.25 0.03 240);
}

[data-sky="dusk"] {
  --sky-top: oklch(0.48 0.08 295);
  --sky-bottom: oklch(0.82 0.1 55);
  --sun: oklch(0.8 0.13 50);
  --far: oklch(0.52 0.06 305);
  --mid: oklch(0.4 0.06 295);
  --near: oklch(0.29 0.05 285);
  --sky-ink: oklch(0.97 0.01 60);
}

[data-sky="night"] {
  --sky-top: oklch(0.2 0.04 262);
  --sky-bottom: oklch(0.33 0.05 275);
  --sun: oklch(0.93 0.03 90);
  --far: oklch(0.31 0.04 268);
  --mid: oklch(0.25 0.035 266);
  --near: oklch(0.19 0.03 264);
  --sky-ink: oklch(0.95 0.01 250);
}

.scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-lg);
  background: var(--sky-bottom);
}

.scene-svg { display: block; width: 100%; height: 100%; }
.sc-top { stop-color: var(--sky-top); }
.sc-bottom { stop-color: var(--sky-bottom); }
.sc-sun { fill: var(--sun); }
.sc-halo { fill: var(--sun); opacity: 0.22; }
.sc-cut { fill: var(--sky-top); }
.sc-star { fill: var(--sun); opacity: 0.8; }
.sc-far { fill: var(--far); }
.sc-snow { fill: var(--sun); opacity: 0.55; }
.sc-mid { fill: var(--mid); }
.sc-near { fill: var(--near); }

/* Fine grain so the sky reads as light, not as a flat vector. */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.sc-halo { transform-box: fill-box; transform-origin: center; animation: halo 8s var(--ease-breath) infinite alternate; }

@keyframes halo {
  from { transform: scale(0.92); opacity: 0.16; }
  to { transform: scale(1.06); opacity: 0.26; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .scene:not([data-sky="night"]) .scene-svg { filter: brightness(0.82) saturate(0.9); }
}
:root[data-theme="dark"] .scene:not([data-sky="night"]) .scene-svg { filter: brightness(0.82) saturate(0.9); }

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  max-width: 30rem;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 1.125rem max(2rem, env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Onboarding ---------- */

.onboarding {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.5rem;
  animation: rise 0.6s var(--ease-out) both;
}

.mark {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.onboarding-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.3;
  text-wrap: balance;
  display: grid;
  gap: 0.2rem;
}

.onboarding-title span + span { color: var(--muted); }

.lang-list { display: grid; gap: 0.6rem; }

.lang-option {
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
  transition: border-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.lang-option:hover { border-color: var(--accent); }
.lang-option:active { transform: scale(0.98); }

/* ---------- Home ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.date {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.date::first-letter { text-transform: uppercase; }

.lang-toggle {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.lang-menu {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.6rem;
  animation: rise 0.2s var(--ease-out) both;
}

.lang-menu button {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
}

.lang-menu button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.quote {
  padding: 1.5rem 0 2.5rem;
  animation: rise 0.7s var(--ease-out) both;
}

.quote .scene {
  height: 9.5rem;
  margin: 0 0 1.75rem;
  box-shadow: var(--shadow);
}

.quote-day {
  position: absolute;
  top: 0.85rem;
  left: 1.1rem;
  z-index: 1;
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--sky-ink);
}

.quote-text {
  margin: 0;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.4rem, 5.4vw, 1.8rem);
  line-height: 1.45;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.quote-source {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.quote-source .dot { margin: 0 0.45rem; }
.quote-source cite { font-style: italic; }

.checkin {
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
  animation: rise 0.7s 0.15s var(--ease-out) both;
}

.checkin-q {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 500;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mood {
  --c: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.94rem;
  transition: border-color 0.2s var(--ease-out), background-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.mood:hover { border-color: var(--c); }
.mood:active { transform: scale(0.97); }

.mood[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
}

.mood-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

.mood--great { --c: var(--mood-great); }
.mood--calm { --c: var(--mood-calm); }
.mood--angry { --c: var(--mood-angry); }
.mood--none { --c: var(--muted); }
.mood--tired { --c: var(--mood-tired); }
.mood--stressed { --c: var(--mood-stressed); }
.mood--sad { --c: var(--mood-sad); }
.mood--unmotivated { --c: var(--mood-unmotivated); }

.response {
  margin-top: 1.25rem;
  padding: 1.25rem 1.25rem 1.3rem;
  border-radius: var(--r-md);
  background: color-mix(in oklch, var(--c) 11%, var(--surface));
  animation: rise 0.45s var(--ease-out) both;
}

.response p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.breathe-btn {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--c);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Profiles ---------- */

.topbar-actions { display: flex; align-items: center; gap: 0.4rem; }

.greeting {
  margin: 0 0 0.1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  max-width: 100%;
  padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: border-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.user-btn:hover, .user-btn[aria-expanded="true"] { border-color: var(--accent); }
.user-btn:active { transform: scale(0.97); }
.user-btn svg { flex: none; color: var(--accent); }
.user-name { overflow-wrap: anywhere; text-align: left; }

.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }

.profile-panel {
  margin-top: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 0.2s var(--ease-out) both;
}

.profile-k { margin: 0; color: var(--muted); font-size: var(--text-xs); font-weight: 600; }

.profile-name {
  margin: 0.15rem 0 0.4rem;
  font-family: var(--serif);
  font-size: var(--text-xl);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.confirm-box {
  margin-top: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-sm);
  background: color-mix(in oklch, var(--mood-angry) 9%, var(--surface));
  line-height: 1.55;
}

.confirm-box p { margin: 0; }

.keep-list { margin: 0.6rem 0 0; padding-left: 1.2rem; font-weight: 600; overflow-wrap: anywhere; }

.btn-danger {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: var(--mood-angry);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.btn-danger:hover { opacity: 0.9; }
.btn-danger:active { transform: scale(0.97); }

.name-form { display: grid; gap: 1rem; }

.name-form input {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
}

.name-form input:focus { outline: none; border-color: var(--accent); }

.onboarding .btn-ghost { justify-self: start; }

.link-danger {
  margin-top: 0.75rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--mood-angry);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 1rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.tabs button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px oklch(0.3 0.03 240 / 0.1), 0 2px 8px -2px oklch(0.3 0.03 240 / 0.1);
}

/* ---------- Quote actions (♥ / share) ---------- */

.quote-foot, .mq-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.quote-foot .quote-source { margin-top: 1.25rem; }
.mq-foot .mq-source { margin-top: 0.9rem; }

.q-actions {
  display: flex;
  gap: 0.15rem;
  flex: none;
  align-self: flex-end;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
}

.icon-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.icon-btn.fav[aria-pressed="true"] { color: var(--mood-angry); }

/* ---------- Check-in steps ---------- */

.step {
  margin-top: 1.25rem;
  animation: rise 0.35s var(--ease-out) both;
}

.step-q {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

.chips--small { gap: 0.4rem; }

.chip {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 0.85rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.chip:hover { border-color: var(--c, var(--muted)); }

.chip[aria-pressed="true"] {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
}

.chip--static { display: inline-block; cursor: default; }

.emotion-info {
  margin: 0.85rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 7%, var(--surface));
  font-size: 0.92rem;
  line-height: 1.55;
}

.emotion-info dt {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c);
}

.emotion-info dd { margin: 0.2rem 0 0; }
.emotion-info dd + dt { margin-top: 0.75rem; }

.support-note {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------- Section headings ---------- */

.section-h {
  margin: 0 0 0.85rem;
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--ink);
  text-wrap: balance;
}

/* ---------- Mood quotes carousel ---------- */

.mq {
  margin-top: 2.5rem;
  animation: rise 0.45s var(--ease-out) both;
}

.mq-card {
  padding: 1.5rem 1.25rem 0.75rem;
  border-radius: var(--r-md);
  background: color-mix(in oklch, var(--c) 8%, var(--surface));
  touch-action: pan-y;
  user-select: none;
  overflow: hidden;
}

.mq-body { min-height: 7.5rem; }

.mq-text {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.mq-source {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.mq-source .dot { margin: 0 0.4rem; }
.mq-source cite { font-style: italic; }

.mq-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.75rem -0.6rem 0;
}

.mq-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
}

.mq-next {
  color: var(--c);
  font-weight: 500;
}

.mq-btn:hover { background: color-mix(in srgb, var(--c) 10%, transparent); }

.slide-next { animation: slide-next 0.35s var(--ease-out) both; }
.slide-prev { animation: slide-prev 0.35s var(--ease-out) both; }

@keyframes slide-next {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-prev {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Journal ---------- */

.journal {
  margin-top: 2.5rem;
  animation: rise 0.45s var(--ease-out) both;
}

.card {
  padding: 1.25rem;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.journal-tag {
  margin: 0 0 0.4rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c);
}

.journal-q {
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.45;
}

.journal textarea {
  width: 100%;
  resize: vertical;
  min-height: 6.5rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.55;
}

.journal textarea:focus {
  outline: none;
  border-color: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent);
}

.journal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.btn-primary {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-ghost {
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-primary, .btn-ghost, .breathe-btn { transition: transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out), border-color 0.2s var(--ease-out); }
.btn-primary:hover, .breathe-btn:hover { opacity: 0.9; }
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary:active, .btn-ghost:active, .breathe-btn:active { transform: scale(0.97); }

.journal-hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.notes-h {
  margin: 1.75rem 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.note {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 7%, var(--surface));
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.note-del {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.note-del:hover { color: var(--ink); }

.note-q {
  margin: 0.4rem 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.note-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Journal summary ---------- */

.summary-h {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-size: var(--text-lg);
  font-weight: 400;
}

.sum-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.sum-list li {
  font-size: var(--text-base);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.sum-label { color: var(--muted); }

.sum-k {
  margin: 1rem 0 0.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c, var(--accent));
}

.sum-p {
  margin: 0;
  line-height: 1.6;
  text-wrap: pretty;
}

.sum-tip {
  padding: 0.85rem 1rem;
  border-radius: var(--r-sm);
  background: color-mix(in oklch, var(--c, var(--accent)) 10%, var(--surface));
}

.btn-text {
  padding: 0.6rem 0.4rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text:hover { color: var(--ink); }

/* ---------- Rest quiz ---------- */

.quiz { --c: var(--accent); }

.quiz-q {
  margin: 0 0 1rem;
  min-height: 3.1em;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.quiz-opt { min-width: 5.5rem; padding: 0.6rem 1rem; font-size: 0.94rem; }

.quiz-res {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.quiz-res li { display: grid; gap: 0.15rem; line-height: 1.55; }
.quiz-res strong { font-weight: 600; }

/* ---------- Evening ---------- */

.evening { --c: var(--accent); }

.evening-done {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.evening-step {
  align-self: center;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.evening .notes { margin-top: 0.75rem; }

/* ---------- My days (dashboard) ---------- */

.days {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
  animation: rise 0.4s var(--ease-out) both;
}

.muted { margin: 0; color: var(--muted); font-size: 0.9rem; }

.streak-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.streak-n { margin: 0; font-weight: 600; }
.streak-total { margin: 0; color: var(--muted); font-size: 0.85rem; }

.week {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin: 1rem 0 0;
  padding: 0;
  text-align: center;
}

.wd { display: grid; justify-items: center; gap: 0.35rem; }

.wd-dot {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 1.5px dashed var(--line);
}

.wd.has .wd-dot { border: none; background: var(--c); }
.wd.is-today .wd-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.wd-l { font-size: 0.7rem; color: var(--muted); }

.streak-note { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.82rem; }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -0.4rem -0.4rem 0.75rem;
}

.cal-title { margin: 0; font-size: 1rem; font-weight: 600; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
}

.cal-week span {
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
  padding-bottom: 0.2rem;
}

.cal-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0;
}

.cal-cell.is-empty { background: transparent; }
.cal-cell.has {
  background: color-mix(in oklch, var(--c) 30%, var(--surface));
  box-shadow: inset 0 0 0 1.5px var(--c);
  color: var(--ink);
  font-weight: 600;
}
.cal-cell:disabled { opacity: 0.35; cursor: default; }
.cal-cell.is-today { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.cal-cell.is-sel { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.day-detail { padding: 0 0.25rem; }
.day-detail .notes-h { margin-top: 0.5rem; }

.day-mood {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-weight: 500;
}

.day-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.75rem; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }

.bar-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr 1.5rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}

.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.bar-val { text-align: right; color: var(--muted); }

.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.insights li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.insights .mood-dot { transform: translateY(-1px); }

.saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.saved li + li { padding-top: 1.1rem; border-top: 1px solid var(--line); }

.saved blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.5;
}

.reminder-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.reminder-row input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.days .data-links { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 0.5rem 0 0; }

/* ---------- Footer ---------- */

.footnote {
  margin-top: auto;
  padding-top: 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.footnote p { margin: 0; }

.data-links { margin-top: 0.6rem !important; }

.data-links button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Breathing overlay ---------- */

.breath-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: linear-gradient(var(--sky-top) 0 72%, var(--sky-bottom));
  color: var(--sky-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 1rem;
  animation: fade 0.4s var(--ease-out) both;
}

.breath-circle {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sun) 0 38%, color-mix(in oklch, var(--sun) 35%, transparent) 62%, transparent 72%);
  transform: scale(0.55);
  transition-property: transform, opacity;
  transition-timing-function: var(--ease-breath);
  opacity: 0.75;
}

.breath-circle.is-in { transform: scale(1); opacity: 1; }

.breath-label {
  margin: 0;
  min-height: 3em;
  max-width: 20rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.4rem;
}

.breath-progress {
  width: 10rem;
  height: 2px;
  background: color-mix(in oklch, var(--sky-ink) 22%, transparent);
  border-radius: 2px;
  overflow: hidden;
}

.breath-progress span {
  display: block;
  height: 100%;
  background: var(--sky-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition-property: transform;
  transition-timing-function: linear;
}

.breath-overlay.is-done .breath-circle { transform: scale(0.8); opacity: 0.9; }

.breath-close {
  border: 1px solid color-mix(in oklch, var(--sky-ink) 40%, transparent);
  background: transparent;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  color: var(--sky-ink);
  font-size: 0.9rem;
}

/* Entrance animation plays once; later re-renders (mood tap, language) stay still. */
.settled .quote,
.settled .checkin,
.settled .journal { animation: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
  .breath-circle { transform: scale(0.8) !important; }
  .sc-halo { animation: none; }
}

/* ---------- v2: workday features ---------- */

.pause-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  border: none;
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 14%, var(--surface));
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.pause-btn:hover { background: color-mix(in oklch, var(--accent) 24%, var(--surface)); }
.pause-btn:active { transform: scale(0.97); }

.tag-group {
  margin: 0.75rem 0 0.4rem;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
}

.tag-group:first-of-type { margin-top: 0; }

.try-k {
  margin: 1rem 0 0.5rem !important;
  font-size: var(--text-sm) !important;
  font-weight: 600;
  color: var(--c);
}

.try-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.5rem;
}

.try-btn {
  display: grid;
  gap: 0.1rem;
  min-height: 3.25rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid color-mix(in oklch, var(--c) 35%, transparent);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.try-btn small { color: var(--muted); font-size: var(--text-xs); font-weight: 400; }
.try-btn:hover { border-color: var(--c); }
.try-btn:active { transform: scale(0.98); }

.fb-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }

.fb-btn {
  min-height: 2.25rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
}

.fb-btn[aria-pressed="true"] {
  border-color: var(--c, var(--accent));
  background: color-mix(in oklch, var(--c, var(--accent)) 12%, var(--surface));
  color: var(--ink);
}

/* Your week */

.week-card { --c: var(--accent); }

.balance {
  display: flex;
  height: 0.6rem;
  margin: 0.85rem 0 0.4rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--mood-stressed);
}

.balance-good { display: block; height: 100%; background: var(--mood-calm); }

.balance-legend {
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.bright { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; line-height: 1.5; }

.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Pause sheet */

.pause-sheet { justify-content: flex-end; padding: 0; }

.sheet {
  width: min(34rem, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 1.5rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 -10px 40px -10px oklch(0.2 0.04 260 / 0.35);
  animation: rise 0.35s var(--ease-out) both;
  display: grid;
  gap: 0.75rem;
}

.sheet-h { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--text-xl); }
.sheet-intro { margin: 0; color: var(--muted); line-height: 1.55; }

.reset-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.reset-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  text-align: left;
  transition: border-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
}

.reset-item:hover { border-color: var(--accent); }
.reset-item:active { transform: scale(0.99); }
.reset-name { font-weight: 600; }
.reset-name em { margin-left: 0.35rem; font-style: normal; font-size: var(--text-xs); font-weight: 600; color: var(--accent); }
.reset-about { grid-column: 1; color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.reset-time { grid-column: 2; grid-row: 1; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.sheet .breath-close { justify-self: center; color: var(--muted); border-color: var(--line); }

/* Practice player */

.practice-name { margin: 0; font-size: var(--text-sm); font-weight: 600; opacity: 0.85; }
.practice--steps .breath-circle { transition-duration: 1.6s; }

.practice--steps .breath-circle::after {
  content: attr(data-step);
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--sky-top);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dump-input {
  width: min(30rem, 100%);
  padding: 1rem;
  border: 1px solid color-mix(in oklch, var(--sky-ink) 30%, transparent);
  border-radius: var(--r-md);
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  color: var(--ink);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.practice-end { text-align: center; }
.practice-q { margin: 0 0 0.6rem; font-weight: 500; }
.practice-fb { display: flex; gap: 0.5rem; justify-content: center; }

.practice-fb button {
  min-width: 5.5rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid color-mix(in oklch, var(--sky-ink) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in oklch, var(--sky-ink) 8%, transparent);
  color: var(--sky-ink);
}

.practice-fb button:hover { background: color-mix(in oklch, var(--sky-ink) 16%, transparent); }

/* Toast (break reminder) */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: rise 0.35s var(--ease-out) both;
}

.toast button {
  min-height: 2.25rem;
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: var(--accent-soft);
  color: oklch(0.25 0.03 60);
  font-weight: 600;
}

.toast button + button { padding: 0.35rem 0.7rem; background: transparent; color: var(--bg); }

.kbd-hint { display: none; margin-top: 0.4rem !important; font-size: var(--text-xs); }

/* ---------- Desktop / web layout ---------- */

@media (min-width: 1024px) {
  .app {
    max-width: 72rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .topbar, .profile-panel, .lang-menu { max-width: none; }
  .profile-panel { max-width: 30rem; margin-left: auto; }
  .tabs { max-width: 26rem; }

  .today-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 3.5rem;
    align-items: start;
  }

  .today-grid > .col-a { grid-column: 1; }
  .today-grid > .col-b { grid-column: 2; grid-row: 1 / span 2; padding-top: 1.5rem; }
  .today-grid > .col-b .checkin { border-top: none; padding-top: 0; }
  .quote .scene { height: 13rem; }
  .quote-text { font-size: 2rem; max-width: 30ch; }

  .days {
    display: block;
    columns: 2;
    column-gap: 1.25rem;
  }

  .days > * { break-inside: avoid; margin-bottom: 1.25rem; }
  .days > .data-links { column-span: all; }

  .breath-overlay.pause-sheet { justify-content: center; }
  .sheet { border-radius: var(--r-lg); }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .kbd-hint { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .toast { animation: none; }
}
