/* ==========================================================================
   Mindfulness — design system & components
   Drop-in replacement for src/styles.css. Plain CSS, no build step.
   Theme: follows prefers-color-scheme; [data-theme="light|dark"] forces one.
   Motion: every animation sits inside (prefers-reduced-motion: no-preference);
           the un-animated state is the calm static fallback.
   ========================================================================== */
/* Self-hosted fonts (SIL Open Font License, see ../fonts/OFL.txt). No requests to Google. */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/nunito-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2"); }

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* Raw palette (theme-independent) */
  --sage: #a9bea0; --matcha: #a4bf72; --eucalyptus: #82a99b; --moss: #5e7b47; --forest: #24432f;
  --oat: #ede6d6; --cream: #faf7ee; --mist: #e7ece3;
}
:root, [data-theme="light"] {
  /* Type */
  --font-display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;  /* headings, buttons, chips */
  --font-tip: "Nunito", ui-rounded, system-ui, sans-serif;                 /* tip text @800 */
  --font-body: "Nunito", ui-rounded, system-ui, sans-serif;                /* secondary @500–600 */

  /* Radii */
  --r-xs: 10px; --r-sm: 14px; --r-md: 20px; --r-lg: 24px; --r-xl: 28px; --r-pill: 999px;
  /* Spacing — 4px base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;

  /* Motion */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);   /* overshoot: presses, toggles, entrances */
  --ease-soft: cubic-bezier(.22, .8, .24, 1);       /* settle: fades, reveals */
  --ease-breath: cubic-bezier(.45, 0, .55, 1);      /* sine in-out: breathing */
  --ease-sink: cubic-bezier(.5, 0, .75, .3);        /* exits */
  --d-fast: 160ms; --d-base: 280ms; --d-slow: 520ms; --d-scrim: 350ms; --d-enter: 720ms;

  /* Category hues — muted pastels kept inside the green family */
  --cat-breathing: oklch(.86 .055 215);       /* sky */
  --cat-gratitude: oklch(.88 .07 95);         /* butter */
  --cat-body-scan: oklch(.85 .05 305);        /* lavender mist */
  --cat-present-moment: oklch(.87 .06 165);   /* mint */
  --cat-compassion: oklch(.86 .055 15);       /* blush */
  --cat-movement: oklch(.86 .065 55);         /* peach */
  --cat-nature: oklch(.85 .075 135);          /* matcha leaf */
  --cat-journaling: oklch(.86 .045 75);       /* oat clay */
  --cat-focus: oklch(.85 .05 190);            /* eucalyptus */
  --cat-letting-go: oklch(.86 .045 265);      /* periwinkle cloud */

  /* Light semantic tokens (AA verified, see design-system page) */
  --bg: #f2eee3;
  --surface: #fbf9f2;
  --surface-2: #ebeee2;
  --text: #1e3326;            /* 12.9:1 on surface */
  --text-muted: #53655a;      /* 5.8:1 on surface, 5.1:1 on surface-2 */
  --accent: #2d5a3d;          /* 7.6:1 vs accent-contrast */
  --accent-hover: #234a31;
  --accent-mid: #5a9169;      /* toggle "on" track */
  --accent-contrast: #f7f5ec;
  --ring: #4f8a62;            /* focus ring, 3.9:1 non-text */
  --line: rgba(30, 51, 38, .12);

  --card-fill: rgba(251, 249, 242, .80);
  --toggle-off: #d6dccd;
  --knob: #fffdf6;
  --paused-bg: oklch(.93 .04 92);

  /* Glass material */
  --glass-fill: rgba(247, 245, 236, .64);
  --glass-edge: rgba(255, 255, 255, .7);
  --glass-blur: blur(28px) saturate(1.6);
  --spec: rgba(255, 255, 255, .9);
  --spec-2: rgba(255, 255, 255, .35);
  --glow: rgba(255, 255, 255, .35);
  --shade: 30, 66, 42;        /* rgb of the green-tinted shadow */

  --shadow-1: 0 1px 2px rgba(var(--shade), .06), 0 3px 8px -2px rgba(var(--shade), .08);
  --shadow-2: 0 2px 4px rgba(var(--shade), .05), 0 10px 26px -8px rgba(var(--shade), .18);
  --shadow-3: 0 34px 70px -24px rgba(var(--shade), .45), 0 14px 28px -14px rgba(var(--shade), .28);
  --inset-pillow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 3px rgba(var(--shade), .08);
  --inset-well: inset 0 2px 4px rgba(var(--shade), .12), inset 0 -1px 0 rgba(255, 255, 255, .7);

  /* Breathing orb */
  --orb-core: #f6f9ee;
  --orb-mid: oklch(.86 .07 150);
  --orb-edge: oklch(.72 .06 170);
  --orb-ring: rgba(45, 90, 61, .28);
  --orb-ink: #1e3326;

  /* Focus scrim */
  --scrim-rgb: 34, 72, 48;
  --scrim-strength: .32;

  /* Mockup surfaces (desk, windows, dock) — tokens so the nearest [data-theme] wins */
  --desk-bg: radial-gradient(55% 65% at 18% 30%, #cfe1c3, transparent 70%), radial-gradient(50% 60% at 82% 18%, #ece4c9, transparent 70%), radial-gradient(70% 70% at 70% 95%, #95bba2, transparent 70%), radial-gradient(40% 40% at 40% 70%, #c9dcd6, transparent 70%), #dbe5d2;
  --menubar-bg: rgba(250, 248, 240, .5); --menubar-ink: #1c241f; --tray-open: rgba(0, 0, 0, .14);
  --win-bg: #fbfbf9; --win-shadow: 0 24px 50px -16px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .15); --win-rule: rgba(0, 0, 0, .07); --win-line: rgba(0, 0, 0, .08);
  --dock-bg: rgba(250, 248, 240, .4); --dock-edge: rgba(255, 255, 255, .5);
  --nsmenu-bg: rgba(244, 244, 240, .82); --nsmenu-ink: #1c1c1c; --nsmenu-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 12px 30px -6px rgba(0, 0, 0, .25); --nsmenu-sep: rgba(0, 0, 0, .1);

  color-scheme: light;
}

/* Dark — deep forest night, luminous desaturated greens */
[data-theme="dark"] {
  --bg: #0d1812; --surface: #14221a; --surface-2: #1c2e24;
  --text: #e3ecdd; --text-muted: #a0b3a4;
  --accent: #a5d39f; --accent-hover: #b9dfb3; --accent-mid: #5e9e70; --accent-contrast: #0e2217;
  --ring: #8fcb9c; --line: rgba(227, 236, 221, .1);
  --card-fill: rgba(28, 46, 36, .74); --toggle-off: #2a3d32; --knob: #e8f0e3;
  --paused-bg: oklch(.33 .03 92);
  --glass-fill: rgba(17, 31, 23, .62); --glass-edge: rgba(200, 235, 205, .14);
  --spec: rgba(220, 255, 225, .3); --spec-2: rgba(220, 255, 225, .08); --glow: rgba(160, 220, 170, .08);
  --shade: 0, 8, 4;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 3px 8px -2px rgba(0, 0, 0, .3);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .25), 0 12px 28px -8px rgba(0, 0, 0, .5);
  --shadow-3: 0 34px 70px -24px rgba(0, 0, 0, .75), 0 0 60px -20px rgba(120, 200, 140, .18);
  --inset-pillow: inset 0 1px 0 rgba(220, 255, 225, .1), inset 0 -2px 3px rgba(0, 0, 0, .25);
  --inset-well: inset 0 2px 4px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(220, 255, 225, .06);
  --cat-breathing: oklch(.5 .05 215); --cat-gratitude: oklch(.52 .06 95); --cat-body-scan: oklch(.5 .05 305);
  --cat-present-moment: oklch(.5 .055 165); --cat-compassion: oklch(.5 .05 15); --cat-movement: oklch(.52 .06 55);
  --cat-nature: oklch(.52 .07 135); --cat-journaling: oklch(.5 .04 75); --cat-focus: oklch(.5 .05 190);
  --cat-letting-go: oklch(.5 .045 265);
  --orb-core: #5f9a74; --orb-mid: #3a6a50; --orb-edge: #23463a; --orb-ring: rgba(165, 211, 159, .3); --orb-ink: #eef5ea;
  --scrim-rgb: 4, 16, 9; --scrim-strength: .46;

    --desk-bg: radial-gradient(55% 65% at 18% 30%, #1f3d2e, transparent 70%), radial-gradient(50% 60% at 82% 18%, #2c3a22, transparent 70%), radial-gradient(70% 70% at 70% 95%, #12352b, transparent 70%), #0a1510;
    --menubar-bg: rgba(8, 18, 12, .5); --menubar-ink: #e8eee5; --tray-open: rgba(255, 255, 255, .2);
    --win-bg: #1e2320; --win-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7), 0 0 0 .5px rgba(255, 255, 255, .1); --win-rule: rgba(255, 255, 255, .07); --win-line: rgba(255, 255, 255, .08);
    --dock-bg: rgba(20, 30, 24, .45); --dock-edge: rgba(255, 255, 255, .1);
    --nsmenu-bg: rgba(38, 42, 40, .82); --nsmenu-ink: #ececec; --nsmenu-shadow: 0 0 0 .5px rgba(255, 255, 255, .15), 0 12px 30px -6px rgba(0, 0, 0, .6); --nsmenu-sep: rgba(255, 255, 255, .12);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1812; --surface: #14221a; --surface-2: #1c2e24;
    --text: #e3ecdd; --text-muted: #a0b3a4;
    --accent: #a5d39f; --accent-hover: #b9dfb3; --accent-mid: #5e9e70; --accent-contrast: #0e2217;
    --ring: #8fcb9c; --line: rgba(227, 236, 221, .1);
    --card-fill: rgba(28, 46, 36, .74); --toggle-off: #2a3d32; --knob: #e8f0e3;
    --paused-bg: oklch(.33 .03 92);
    --glass-fill: rgba(17, 31, 23, .62); --glass-edge: rgba(200, 235, 205, .14);
    --spec: rgba(220, 255, 225, .3); --spec-2: rgba(220, 255, 225, .08); --glow: rgba(160, 220, 170, .08);
    --shade: 0, 8, 4;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 3px 8px -2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, .25), 0 12px 28px -8px rgba(0, 0, 0, .5);
    --shadow-3: 0 34px 70px -24px rgba(0, 0, 0, .75), 0 0 60px -20px rgba(120, 200, 140, .18);
    --inset-pillow: inset 0 1px 0 rgba(220, 255, 225, .1), inset 0 -2px 3px rgba(0, 0, 0, .25);
    --inset-well: inset 0 2px 4px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(220, 255, 225, .06);
    --cat-breathing: oklch(.5 .05 215); --cat-gratitude: oklch(.52 .06 95); --cat-body-scan: oklch(.5 .05 305);
    --cat-present-moment: oklch(.5 .055 165); --cat-compassion: oklch(.5 .05 15); --cat-movement: oklch(.52 .06 55);
    --cat-nature: oklch(.52 .07 135); --cat-journaling: oklch(.5 .04 75); --cat-focus: oklch(.5 .05 190);
    --cat-letting-go: oklch(.5 .045 265);
    --orb-core: #5f9a74; --orb-mid: #3a6a50; --orb-edge: #23463a; --orb-ring: rgba(165, 211, 159, .3); --orb-ink: #eef5ea;
    --scrim-rgb: 4, 16, 9; --scrim-strength: .46;

    --desk-bg: radial-gradient(55% 65% at 18% 30%, #1f3d2e, transparent 70%), radial-gradient(50% 60% at 82% 18%, #2c3a22, transparent 70%), radial-gradient(70% 70% at 70% 95%, #12352b, transparent 70%), #0a1510;
    --menubar-bg: rgba(8, 18, 12, .5); --menubar-ink: #e8eee5; --tray-open: rgba(255, 255, 255, .2);
    --win-bg: #1e2320; --win-shadow: 0 24px 50px -16px rgba(0, 0, 0, .7), 0 0 0 .5px rgba(255, 255, 255, .1); --win-rule: rgba(255, 255, 255, .07); --win-line: rgba(255, 255, 255, .08);
    --dock-bg: rgba(20, 30, 24, .45); --dock-edge: rgba(255, 255, 255, .1);
    --nsmenu-bg: rgba(38, 42, 40, .82); --nsmenu-ink: #ececec; --nsmenu-shadow: 0 0 0 .5px rgba(255, 255, 255, .15), 0 12px 30px -6px rgba(0, 0, 0, .6); --nsmenu-sep: rgba(255, 255, 255, .12);
    color-scheme: dark;
  }
}

/* Category scope: add `cat cat--<id>` to any element; children derive tints */
.cat { --cat: var(--sage);
  --cat-soft: color-mix(in oklch, var(--cat) 55%, var(--surface));
  --cat-ink: color-mix(in oklch, var(--cat) 32%, var(--text));
  --cat-wash: color-mix(in oklch, var(--cat) 42%, transparent); }
.cat--breathing { --cat: var(--cat-breathing); } .cat--gratitude { --cat: var(--cat-gratitude); }
.cat--body-scan { --cat: var(--cat-body-scan); } .cat--present-moment { --cat: var(--cat-present-moment); }
.cat--compassion { --cat: var(--cat-compassion); } .cat--movement { --cat: var(--cat-movement); }
.cat--nature { --cat: var(--cat-nature); } .cat--journaling { --cat: var(--cat-journaling); }
.cat--focus { --cat: var(--cat-focus); } .cat--letting-go { --cat: var(--cat-letting-go); }

/* ---------- 2. Base ------------------------------------------------------ */
.mf, .mf * { box-sizing: border-box; }
.mf { font: 600 13px/1.45 var(--font-body); color: var(--text); -webkit-font-smoothing: antialiased; letter-spacing: .005em; }
:where(.mf) :where(h1, h2, h3, p, ul, figure) { margin: 0; padding: 0; }
:where(.mf) :where(button) { font: inherit; color: inherit; }
.mf :focus-visible, .mf .is-focus { outline: 2.5px solid var(--ring); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; } .icon--lg { width: 24px; height: 24px; }

/* ---------- 3. Glass material ------------------------------------------- */
/* Translucent fill + backdrop blur + specular rim (::before) + inner glow + green shadow */
.glass { position: relative; isolation: isolate; background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--spec), inset 0 0 28px var(--glow), var(--shadow-3); }
.glass::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.25px; pointer-events: none; z-index: 2;
  background: linear-gradient(155deg, var(--spec) 0%, transparent 32%, transparent 64%, var(--spec-2) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* Grain — SVG feTurbulence, tiled, ~6% */
.grain { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .07; mix-blend-mode: multiply; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .2 0 0 0 0 .14 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .05; }
[data-theme="dark"] [data-theme="light"] .grain { mix-blend-mode: multiply; opacity: .07; }

/* Ambient — slow-drifting blurred blobs (transform only; blur is static) */
.ambient { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: -1; }
.ambient__blob { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 47% 53% 41% 59% / 52% 44% 56% 48%; filter: blur(34px); opacity: .55; will-change: transform; }
.ambient__blob--1 { top: -22%; left: -18%; background: var(--cat-present-moment); }
.ambient__blob--2 { top: 28%; right: -30%; background: var(--cat-nature); opacity: .4; }
.ambient__blob--3 { bottom: -30%; left: 8%; background: var(--cat-gratitude); opacity: .35; }

/* ---------- 4. Popover shell ------------------------------------------- */
.app { width: 320px; height: 450px; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-xl); }
.header { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 18px; flex-shrink: 0; position: relative; z-index: 1; }
.header-title { display: flex; align-items: center; gap: 8px; font: 600 17px/1 var(--font-display); letter-spacing: .01em; }
.header-title .icon { width: 22px; height: 22px; color: var(--accent); }
.header-actions { display: flex; gap: 4px; }
.header-btn { width: 34px; height: 34px; border: 0; padding: 0; border-radius: var(--r-pill); display: grid; place-items: center; background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background-color var(--d-fast), color var(--d-fast), transform var(--d-base) var(--ease-spring); }
.header-btn:hover, .header-btn.is-hover { background: var(--surface-2); color: var(--text); }
.header-btn:active { transform: scale(.9); }
.header-btn--active { background: var(--accent); color: var(--accent-contrast); }
.header-btn--active:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.main { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 14px; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; scrollbar-width: none; }
.footer { display: flex; gap: 8px; padding: 0 14px 14px; position: relative; z-index: 1; }
.footer-btn { flex: 1; height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card-fill); color: var(--text); font: 600 13.5px/1 var(--font-display); cursor: pointer;
  box-shadow: var(--inset-pillow); transition: transform var(--d-base) var(--ease-spring), background-color var(--d-fast); }
.footer-btn .icon { color: var(--accent); width: 18px; height: 18px; }
.footer-btn:hover, .footer-btn.is-hover { background: var(--surface); }
.footer-btn:active { transform: scale(.96, .93); }
.view-head { display: flex; align-items: center; gap: 6px; min-height: 34px; }
.view-title { font: 600 18px/1.1 var(--font-display); flex: 1; }
.view-sub { font: 600 12.5px/1.4 var(--font-body); color: var(--text-muted); }

/* ---------- 5. Tip card ------------------------------------------------- */
.tip-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; border-radius: var(--r-lg);
  background: radial-gradient(130% 90% at 100% 0%, var(--cat-wash), transparent 62%), var(--card-fill);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--spec); }
.tip-card__head { display: flex; align-items: center; gap: 12px; }
.tip-card__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tip-text { font: 800 18px/1.3 var(--font-tip); letter-spacing: .004em; color: var(--text); text-wrap: pretty; }
.tip-text > span { display: inline; }
.tip-card__actions { display: flex; gap: 8px; margin-top: 2px; }
.tip-card__actions .btn { flex: 1; }
.tip-card--empty { align-items: center; text-align: center; padding: 26px 20px 22px; background: var(--card-fill); }

/* Badge / pill / chip */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px 0 6px; border-radius: var(--r-pill); background: var(--cat-soft); color: var(--text); font: 600 12.5px/1 var(--font-display); white-space: nowrap; }
.badge .icon { width: 16px; height: 16px; color: var(--cat-ink); }
.badge--small { height: 22px; font-size: 11.5px; padding: 0 9px 0 5px; gap: 4px; }
.badge--small .icon { width: 14px; height: 14px; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-muted); font: 700 12px/1 var(--font-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill .icon { width: 14px; height: 14px; }
.kbd { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 7px; background: var(--surface-2); box-shadow: inset 0 -1.5px 0 var(--line); font: 700 11px/1 var(--font-body); color: var(--text-muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: transparent; color: var(--text-muted); font: 600 13px/1 var(--font-display); cursor: pointer; white-space: nowrap;
  transition: transform var(--d-base) var(--ease-spring), background-color var(--d-fast), color var(--d-fast); }
.chip:hover, .chip.is-hover { background: var(--surface-2); color: var(--text); }
.chip:active { transform: scale(.94); }
.chip[aria-checked="true"], .chip[aria-selected="true"] { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
.chip .icon { width: 16px; height: 16px; }

/* ---------- 6. Buttons -------------------------------------------------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; min-width: 32px; padding: 0 18px; border: 0; border-radius: var(--r-pill);
  font: 600 14.5px/1 var(--font-display); letter-spacing: .01em; cursor: pointer; overflow: hidden; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform var(--d-base) var(--ease-spring), background-color var(--d-fast), box-shadow var(--d-fast), color var(--d-fast); }
.btn .icon { width: 18px; height: 18px; }
.btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity var(--d-base);
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .32), transparent 60%); }
.btn:hover::after, .btn.is-hover::after { opacity: 1; }
.btn:active, .btn.is-active { transform: scale(.95, .91); }   /* squash */
.btn--primary { background: var(--accent); color: var(--accent-contrast);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -2px 0 rgba(0, 0, 0, .14), 0 8px 16px -8px rgba(var(--shade), .55); }
.btn--primary:hover, .btn--primary.is-hover { background: var(--accent-hover); }
.btn--soft { background: var(--surface-2); color: var(--text); box-shadow: var(--inset-pillow); }
.btn--soft:hover, .btn--soft.is-hover { background: color-mix(in oklch, var(--surface-2) 80%, var(--text) 8%); }
.btn--ghost { background: transparent; color: var(--text-muted); }
.btn--ghost:hover, .btn--ghost.is-hover { background: var(--surface-2); color: var(--text); }
.btn--back { height: 34px; padding: 0 12px 0 6px; gap: 4px; background: transparent; color: var(--text); font-size: 14px; }
.btn--back:hover { background: var(--surface-2); }
.btn--icon { width: 40px; padding: 0; }
.btn--lg { height: 46px; font-size: 15.5px; padding: 0 24px; }
.btn--pause { background: var(--surface-2); color: var(--text); box-shadow: var(--inset-pillow); }
.btn--resume { background: var(--accent); color: var(--accent-contrast); }
.btn--block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .42; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:disabled::after, .btn.is-disabled::after { display: none; }
.btn--primary::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -50%; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-18deg); }

/* ---------- 7. Toggle (pillowy) ---------------------------------------- */
/* <button class="toggle" role="switch" aria-checked="true"> */
.toggle { position: relative; flex: none; width: 46px; height: 28px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--toggle-off); cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(var(--shade), .2), inset 0 -1px 0 rgba(255, 255, 255, .45); transition: background-color var(--d-base) var(--ease-soft); }
.toggle::before { content: ""; position: absolute; inset: -4px -2px; }  /* 36px hit area */
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: var(--r-pill); background: var(--knob);
  box-shadow: 0 2px 5px rgba(var(--shade), .28), inset 0 -2px 2px rgba(var(--shade), .08), inset 0 1px 0 rgba(255, 255, 255, .9);
  transition: transform var(--d-slow) var(--ease-spring), width var(--d-base) var(--ease-spring); }
.toggle[aria-checked="true"] { background: var(--accent-mid); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); }
.toggle:active::after { width: 28px; }                                       /* stretch on press */
.toggle[aria-checked="true"]:active::after { transform: translateX(12px); }
.toggle:hover, .toggle.is-hover { filter: brightness(1.04); }
.toggle:disabled, .toggle.is-disabled { opacity: .42; cursor: not-allowed; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; font: 600 14px/1.2 var(--font-display); }
.toggle-row__label { display: flex; align-items: center; gap: 8px; }
.toggle-row__label .icon { color: var(--text-muted); width: 18px; height: 18px; }

/* ---------- 8. Settings bento ------------------------------------------ */
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settings-section, .bento-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--card-fill); box-shadow: var(--shadow-1), inset 0 1px 0 var(--spec); }
.bento-card--wide { grid-column: span 2; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 600 13px/1 var(--font-display); color: var(--text-muted); }
.settings-heading .icon { width: 16px; height: 16px; }
.segmented, .interval-group { display: flex; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--inset-well); }
.segmented__opt, .interval-option { flex: 1; height: 32px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-muted); font: 600 13px/1 var(--font-display); cursor: pointer;
  transition: background-color var(--d-fast), color var(--d-fast), transform var(--d-base) var(--ease-spring); }
.segmented__opt:hover, .interval-option:hover { color: var(--text); }
.segmented__opt:active, .interval-option:active { transform: scale(.92); }
.segmented__opt[aria-checked="true"], .interval-option[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), inset 0 1px 0 var(--spec); }
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.category-option { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 4px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: transparent; color: var(--text-muted); font: 600 12px/1 var(--font-display); cursor: pointer; text-align: left; min-width: 0;
  transition: background-color var(--d-fast), border-color var(--d-fast), color var(--d-fast), transform var(--d-base) var(--ease-spring); }
.category-option > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-option__icon { flex: none; width: 24px; height: 24px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); transition: background-color var(--d-fast); }
.category-option__icon .icon { width: 15px; height: 15px; }
.category-option:hover, .category-option.is-hover { background: var(--surface-2); color: var(--text); }
.category-option:active { transform: scale(.95); }
.category-option[aria-checked="true"] { background: var(--cat-soft); border-color: transparent; color: var(--text); }
.category-option[aria-checked="true"] .category-option__icon { background: var(--cat); color: var(--cat-ink); box-shadow: inset 0 1px 0 var(--spec-2); }
.category-option:disabled, .category-option.is-disabled { opacity: .42; cursor: not-allowed; }
.quiet-hours-times { display: flex; gap: 8px; }
.time-input { flex: 1; display: flex; flex-direction: column; gap: 5px; font: 600 11.5px/1 var(--font-display); color: var(--text-muted); }
.time-input__field, .time-input input { height: 36px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--inset-well); color: var(--text); display: flex; align-items: center; justify-content: center; gap: 6px; font: 800 15px/1 var(--font-tip); font-variant-numeric: tabular-nums; text-align: center; }
.time-input__field .icon { width: 15px; height: 15px; color: var(--text-muted); }
.is-off .time-input__field { opacity: .45; }
.note { font: 600 12px/1.4 var(--font-body); color: var(--text-muted); }

/* ---------- 9. History -------------------------------------------------- */
.history-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; gap: 11px; padding: 12px; border-radius: var(--r-md); background: var(--card-fill); box-shadow: var(--shadow-1), inset 0 1px 0 var(--spec); }
.history-item__icon { flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--cat-soft); color: var(--cat-ink); }
.history-item__icon .icon { width: 18px; height: 18px; }
.history-item__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.history-text { font: 700 13px/1.38 var(--font-body); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-item__meta { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font: 600 11.5px/1 var(--font-body); }
.history-item--latest { flex-direction: column; background: radial-gradient(120% 100% at 100% 0%, var(--cat-wash), transparent 65%), var(--card-fill); }
.history-item--latest .history-text { font: 800 15px/1.32 var(--font-tip); -webkit-line-clamp: 3; }

/* ---------- 10. Paused status & empty states --------------------------- */
.paused-banner { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 4px 4px 12px; border-radius: var(--r-pill); background: var(--paused-bg); color: var(--text); font: 600 13px/1.2 var(--font-display); }
.paused-banner .icon { width: 17px; height: 17px; color: var(--text-muted); }
.paused-banner__text { flex: 1; }
.paused-banner .btn { height: 28px; padding: 0 12px; font-size: 12.5px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin: auto 0; padding: 12px 10px; }
.empty__title { font: 800 18px/1.3 var(--font-tip); text-wrap: balance; }
.empty__text { font: 600 13px/1.45 var(--font-body); color: var(--text-muted); text-wrap: pretty; max-width: 240px; }
.loader { display: inline-flex; gap: 7px; align-items: center; }
.loader span { width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--accent-mid); opacity: .6; }

/* ---------- 11. Spot illustrations ------------------------------------- */
/* <div class="spot cat cat--nature idle--sway"><svg viewBox="0 0 96 96"><use href="#s-nature"/></svg></div> */
.spot { position: relative; flex: none; width: var(--spot, 84px); height: var(--spot, 84px); color: var(--ink, var(--text)); } /* --ink overrides stroke colour */
.spot > svg { width: 100%; height: 100%; overflow: visible; display: block; }

/* ---------- 12. Guided / breathing ------------------------------------- */
.pattern-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pattern-card { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 11px 12px 12px; border-radius: var(--r-md); border: 1.5px solid transparent; background: var(--card-fill); box-shadow: var(--shadow-1), inset 0 1px 0 var(--spec); cursor: pointer; text-align: left;
  transition: transform var(--d-base) var(--ease-spring), border-color var(--d-fast); }
.pattern-card:hover, .pattern-card.is-hover { border-color: var(--line); }
.pattern-card:active { transform: scale(.96); }
.pattern-card[aria-checked="true"] { border-color: var(--accent); background: radial-gradient(120% 100% at 100% 0%, color-mix(in oklch, var(--accent-mid) 22%, transparent), transparent 70%), var(--card-fill); }
.pattern-card__name { font: 600 14px/1.15 var(--font-display); }
.pattern-card__rhythm { font: 800 12px/1 var(--font-tip); color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.pattern-card__wave { width: 100%; height: 22px; color: var(--accent-mid); }
.pattern-card__wave polyline { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.scroller { display: flex; gap: 6px; overflow: hidden; -webkit-mask: linear-gradient(90deg, #000 80%, transparent); mask: linear-gradient(90deg, #000 80%, transparent); }
.steps { display: flex; gap: 5px; }
.steps span { height: 6px; flex: 1; border-radius: var(--r-pill); background: var(--line); }
.steps span.is-done { background: var(--accent-mid); } .steps span.is-current { background: var(--accent); }
.step-text { font: 800 19px/1.32 var(--font-tip); text-wrap: pretty; }

/* Breathing orb ----------------------------------------------------------
   Parameters: --inhale --hold1 --exhale --hold2 (seconds), --cycles, --size.
   One cycle = sum of the four. Keyframe stop % = phase / cycle (pre-computed
   per pattern below — CSS cannot compute keyframe offsets from variables).   */
@property --orb-n { syntax: "<integer>"; inherits: false; initial-value: 1; }
.orb { --inhale: 4s; --hold1: 4s; --exhale: 4s; --hold2: 4s; --cycles: 6; --size: 200px;
  --cycle: calc(var(--inhale) + var(--hold1) + var(--exhale) + var(--hold2));
  --k-body: orb-box; --k-in: say-box-in; --k-hold: say-box-hold; --k-out: say-box-out;
  position: relative; width: var(--size); height: var(--size); flex: none; }
.orb--box { }
.orb--478 { --inhale: 4s; --hold1: 7s; --exhale: 8s; --hold2: 0s; --k-body: orb-478; --k-in: say-478-in; --k-hold: say-478-hold; --k-out: say-478-out; }
.orb--coherent { --inhale: 5.5s; --hold1: 0s; --exhale: 5.5s; --hold2: 0s; --k-body: orb-coh; --k-in: say-coh-in; --k-hold: none; --k-out: say-coh-out; }
.orb--sigh { --inhale: 2s; --hold1: 1s; --exhale: 6s; --hold2: 1s; --k-body: orb-sigh; --k-in: say-sigh-in; --k-hold: say-sigh-hold; --k-out: say-sigh-out; } /* hold1 = second "top-up" inhale */
.orb__progress { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.orb__track, .orb__bar { fill: none; stroke-width: 2.5; }
.orb__track { stroke: var(--line); }
.orb__bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 62; }
.orb__breath { position: absolute; inset: 15%; transform: scale(.82); }
.orb__blob { position: absolute; inset: 0; border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%;
  background: radial-gradient(circle at 36% 30%, var(--orb-core), var(--orb-mid) 52%, var(--orb-edge)); box-shadow: inset 0 2px 10px rgba(255, 255, 255, .35), 0 12px 30px -10px rgba(var(--shade), .45); }
.orb__blob--2 { inset: -5%; border-radius: 58% 42% 47% 53% / 44% 58% 42% 56%; background: var(--orb-mid); opacity: .35; box-shadow: none; z-index: -1; }
.orb__blob--3 { inset: -11%; border-radius: 41% 59% 60% 40% / 57% 39% 61% 43%; background: var(--orb-mid); opacity: .16; box-shadow: none; z-index: -2; }
.orb__ring { position: absolute; inset: -14%; border-radius: 50%; border: 1.5px solid var(--orb-ring); }
.orb__ring--2 { inset: -26%; opacity: .5; }
.orb__label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--orb-ink); font: 600 calc(var(--size) * .08) / 1.15 var(--font-display); pointer-events: none; }
.orb__label > * { grid-area: 1 / 1; opacity: 0; padding: 0 22%; }
.orb__label > .orb__static { opacity: 1; font-size: .78em; }
.orb__count { position: absolute; left: 0; right: 0; top: calc(100% + 10px); text-align: center; font: 700 12.5px/1 var(--font-body); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.orb__n::after { counter-reset: n var(--orb-n); content: counter(n); }
.orb.is-paused, .orb.is-paused * { animation-play-state: paused !important; }

/* Bloom (completion) */
.bloom { position: relative; width: var(--size, 120px); height: var(--size, 120px); flex: none; }
.bloom__petal { position: absolute; left: 37%; top: 12%; width: 26%; height: 38%; transform-origin: 50% 100%; transform: rotate(var(--a));
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: linear-gradient(to top, var(--cat-present-moment), var(--cat-nature)); box-shadow: inset 0 1px 0 var(--spec-2); }
.bloom__petal:nth-child(even) { background: linear-gradient(to top, var(--cat-gratitude), var(--cat-present-moment)); }
.bloom__core { position: absolute; inset: 39%; border-radius: 50%; background: var(--cat-gratitude); box-shadow: inset 0 -2px 0 rgba(var(--shade), .15); }
.bloom__spark { position: absolute; left: calc(50% - 4px); top: calc(50% - 4px); width: 8px; height: 8px; opacity: 0; background: var(--accent-mid);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* Mood check-in */
.mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: var(--r-md); border: 1.5px solid transparent; background: var(--card-fill); box-shadow: var(--shadow-1), inset 0 1px 0 var(--spec); font: 600 13px/1 var(--font-display); color: var(--text); cursor: pointer;
  transition: transform var(--d-base) var(--ease-spring), border-color var(--d-fast); }
.mood-chip .icon { width: 30px; height: 30px; stroke-width: 1.8; color: var(--cat-ink); padding: 2px; border-radius: 50%; background: var(--cat-soft); }
.mood-chip:hover, .mood-chip.is-hover { border-color: var(--line); }
.mood-chip:active { transform: scale(.94); }
.mood-chip[aria-checked="true"] { background: var(--cat-soft); border-color: var(--cat-ink); }
.mood-chip[aria-checked="true"] .icon { background: var(--cat); }
.intensity { display: flex; flex-direction: column; gap: 8px; }
.intensity__track { position: relative; display: flex; justify-content: space-between; align-items: center; height: 40px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--inset-well); }
.intensity__stop { position: relative; z-index: 1; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; }
.intensity__stop::after { content: ""; width: calc(6px + var(--n) * 2.4px); height: calc(6px + var(--n) * 2.4px); border-radius: 50%; background: var(--text-muted); opacity: .35; transition: transform var(--d-base) var(--ease-spring); }
.intensity__stop.is-filled::after { background: var(--accent-mid); opacity: 1; }
.intensity__stop[aria-checked="true"]::after { background: var(--accent); opacity: 1; transform: scale(1.25); box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--accent); }
.intensity__labels { display: flex; justify-content: space-between; font: 600 11.5px/1 var(--font-display); color: var(--text-muted); padding: 0 6px; }

/* ---------- 13. Focus notification ------------------------------------ */
/* Two independent layers: .focus-scrim (native vibrancy window in production)
   and .focus-card (web layer). Card: role="alertdialog" + aria-live region.  */
.focus-layer { position: absolute; inset: 0; z-index: 50; }
.focus-scrim { position: absolute; inset: 0; -webkit-backdrop-filter: blur(22px) saturate(.85); backdrop-filter: blur(22px) saturate(.85);
  background: radial-gradient(130% 75% at 50% 112%, rgba(var(--scrim-rgb), calc(var(--scrim-strength) + .1)), rgba(var(--scrim-rgb), calc(var(--scrim-strength) * .4)) 62%, rgba(var(--scrim-rgb), calc(var(--scrim-strength) * .25)) 100%); }
.focus-card { position: absolute; left: 50%; bottom: var(--card-bottom, 100px); width: 460px; margin-left: -230px; padding: 20px 22px 20px 20px; border-radius: var(--r-xl);
  display: grid; grid-template-columns: 104px 1fr; gap: 18px; align-items: center; color: var(--text); }
.focus-card__media { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, var(--surface), var(--cat-soft) 70%); box-shadow: inset 0 1px 0 var(--spec), inset 0 -3px 8px rgba(var(--shade), .08); }
.focus-card__media .spot { --spot: 80px; }
.focus-card__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.focus-card__top { display: flex; align-items: center; gap: 6px; }
.focus-card__hint { margin-left: auto; display: flex; align-items: center; gap: 5px; font: 600 11.5px/1 var(--font-body); color: var(--text-muted); }
.focus-card__text { font: 800 19px/1.28 var(--font-tip); text-wrap: pretty; }
.focus-card__sub { font: 600 13px/1.4 var(--font-body); color: var(--text-muted); margin-top: -4px; }
.focus-card__actions { display: flex; gap: 6px; align-items: center; }
.focus-card__timer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 3; }
.focus-card__timer rect { fill: none; stroke: var(--accent-mid); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 34; opacity: .85; }

/* ---------- 14. Motion (all gated) ------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes line-in { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: blur(0); } }
@keyframes sheen { from { left: -50%; opacity: 1; } to { left: 120%; opacity: 1; } }
@keyframes dot-breathe { 0%, 100% { transform: scale(.6); opacity: .35; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes drift-a { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(14%, 10%) rotate(40deg) scale(1.08); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes drift-b { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-16%, -8%) rotate(-50deg) scale(.92); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
/* Orb body: scale .6 (empty) → 1 (full) */
@keyframes orb-box { 0% { transform: scale(.6); } 25%, 50% { transform: scale(1); } 75%, 100% { transform: scale(.6); } }
@keyframes orb-478 { 0% { transform: scale(.6); } 21%, 58% { transform: scale(1); } 100% { transform: scale(.6); } }
@keyframes orb-coh { 0%, 100% { transform: scale(.6); } 50% { transform: scale(1); } }
@keyframes orb-sigh { 0% { transform: scale(.6); } 20% { transform: scale(.86); } 30% { transform: scale(1); } 90%, 100% { transform: scale(.6); } }
/* Labels — cross-fade windows match the body stops */
@keyframes say-box-in { 0%, 23% { opacity: 1; } 25%, 98% { opacity: 0; } 100% { opacity: 1; } }
@keyframes say-box-hold { 0%, 23% { opacity: 0; } 25%, 48% { opacity: 1; } 50%, 73% { opacity: 0; } 75%, 98% { opacity: 1; } 100% { opacity: 0; } }
@keyframes say-box-out { 0%, 48% { opacity: 0; } 50%, 73% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes say-478-in { 0%, 19% { opacity: 1; } 21%, 98% { opacity: 0; } 100% { opacity: 1; } }
@keyframes say-478-hold { 0%, 19% { opacity: 0; } 21%, 56% { opacity: 1; } 58%, 100% { opacity: 0; } }
@keyframes say-478-out { 0%, 56% { opacity: 0; } 58%, 98% { opacity: 1; } 100% { opacity: 0; } }
@keyframes say-coh-in { 0%, 47% { opacity: 1; } 50%, 97% { opacity: 0; } 100% { opacity: 1; } }
@keyframes say-coh-out { 0%, 47% { opacity: 0; } 50%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes say-sigh-in { 0%, 18% { opacity: 1; } 20%, 98% { opacity: 0; } 100% { opacity: 1; } }
@keyframes say-sigh-hold { 0%, 18% { opacity: 0; } 20%, 28% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes say-sigh-out { 0%, 28% { opacity: 0; } 30%, 98% { opacity: 1; } 100% { opacity: 0; } }
@keyframes orb-progress { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes orb-count { from { --orb-n: 1; } to { --orb-n: calc(var(--cycles) + 1); } }
@keyframes ring-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
/* Idle illustration loops */
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes drift-x { 0%, 100% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }
@keyframes sprout { 0%, 100% { transform: scale(1, 1); } 40% { transform: scale(.97, 1.05); } 60% { transform: scale(1.02, .98); } }
@keyframes heartbeat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.07); } 30% { transform: scale(.98); } 45% { transform: scale(1.04); } }
@keyframes halo { from { transform: scale(.7); opacity: .7; } to { transform: scale(1.35); opacity: 0; } }
@keyframes breathe-soft { 0%, 100% { transform: scale(.95); } 50% { transform: scale(1.04); } }
/* Completion */
@keyframes petal-open { 0% { transform: rotate(var(--a)) scale(.1); opacity: 0; } 60% { transform: rotate(var(--a)) scale(1.08); opacity: 1; } 100% { transform: rotate(var(--a)) scale(1); opacity: 1; } }
@keyframes core-pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes spark { 0% { transform: rotate(var(--a)) translateY(0) scale(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(1); opacity: 0; } }
/* Focus notification */
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scrim-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes card-rise { 0% { opacity: 0; transform: translateY(150px) scale(.94); filter: blur(10px); } 55% { opacity: 1; transform: translateY(-9px) scale(1.01); filter: blur(0); } 78% { transform: translateY(3px) scale(.998); } 100% { opacity: 1; transform: none; filter: blur(0); } }
@keyframes card-sink { 0% { opacity: 1; transform: none; filter: blur(0); } 100% { opacity: 0; transform: translateY(150px) scale(.95); filter: blur(8px); } }
@keyframes timer { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: no-preference) {
  /* Tip card: soft rise + blur-to-sharp, then text sentence by sentence */
  .tip-card { animation: rise var(--d-slow) var(--ease-soft) both; }
  .tip-text > span { animation: line-in 480ms var(--ease-soft) both; animation-delay: calc(180ms + var(--i, 0) * 160ms); }
  .history-item, .bento-card, .pattern-card, .mood-chip { animation: rise 460ms var(--ease-soft) both; animation-delay: calc(var(--i, 0) * 50ms); }
  .btn--primary:hover::before { animation: sheen 900ms var(--ease-soft); }
  .loader span { animation: dot-breathe 1.4s var(--ease-breath) infinite; }
  .loader span:nth-child(2) { animation-delay: .2s; } .loader span:nth-child(3) { animation-delay: .4s; }
  /* Ambient: 60–90 s loops */
  .ambient__blob--1 { animation: drift-a 64s ease-in-out infinite; }
  .ambient__blob--2 { animation: drift-b 78s ease-in-out infinite; }
  .ambient__blob--3 { animation: drift-a 90s ease-in-out infinite reverse; }
  /* Orb */
  .orb__breath { transform: scale(.6); animation: var(--k-body) var(--cycle) var(--ease-breath) infinite; }
  .orb__blob { animation: spin 26s linear infinite; }
  .orb__blob--2 { animation: spin-rev 34s linear infinite; }
  .orb__blob--3 { animation: spin 44s linear infinite; }
  .orb__ring--2 { animation: ring-pulse var(--cycle) var(--ease-breath) infinite; }
  .orb__label > .orb__static { display: none; }
  .orb__say--in { animation: var(--k-in) var(--cycle) linear infinite; }
  .orb__say--hold { animation: var(--k-hold) var(--cycle) linear infinite; }
  .orb__say--out { animation: var(--k-out) var(--cycle) linear infinite; }
  .orb__bar { animation: orb-progress calc(var(--cycle) * var(--cycles)) linear infinite; } /* use `forwards` in-app */
  .orb__n { animation: orb-count calc(var(--cycle) * var(--cycles)) steps(var(--cycles), end) infinite; }
  /* Idle loops for spot illustrations */
  .idle--sway > svg { transform-origin: 30% 90%; animation: sway 6s var(--ease-breath) infinite; }
  .idle--float > svg { animation: float 4.5s var(--ease-breath) infinite; }
  .idle--drift > svg { animation: drift-x 9s var(--ease-breath) infinite; }
  .idle--sprout > svg { transform-origin: 50% 82%; animation: sprout 5s var(--ease-breath) infinite; }
  .idle--glow > svg { animation: heartbeat 2.6s ease-in-out infinite; }
  .idle--breathe > svg { animation: breathe-soft 8s var(--ease-breath) infinite; }
  .idle--ripple::before, .idle--ripple::after, .idle--glow::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; border: 2px solid var(--cat-ink); opacity: 0; animation: halo 3.2s var(--ease-soft) infinite; pointer-events: none; }
  .idle--ripple::after { animation-delay: 1.6s; }
  .idle--glow::before { border: 0; background: radial-gradient(circle, var(--cat-wash), transparent 70%); animation-duration: 2.6s; }
  /* Bloom */
  .bloom__petal { animation: petal-open 900ms var(--ease-spring) both; animation-delay: calc(var(--i) * 45ms); }
  .bloom__core { animation: core-pop 700ms 380ms var(--ease-spring) both; }
  .bloom__spark { animation: spark 1100ms var(--ease-soft) both; animation-delay: calc(500ms + var(--i) * 70ms); }
  /* Focus notification */
  .focus-scrim { animation: scrim-in var(--d-scrim) var(--ease-soft) both; }
  .focus-card { animation: card-rise var(--d-enter) 80ms cubic-bezier(.2, .7, .3, 1) both; }
  .is-leaving .focus-card { animation: card-sink 420ms var(--ease-sink) forwards; }
  .is-leaving .focus-scrim { animation: scrim-out 380ms 120ms var(--ease-soft) both; }
  .focus-card__timer rect { animation: timer 15s 800ms linear forwards; }
  .focus-card:hover .focus-card__timer rect { animation-play-state: paused; }
}
/* Reduced motion (forced, for previews) — simple fades only */
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation: none !important; transition: none !important; }
[data-motion="reduce"] .orb__breath { transform: scale(.82) !important; }
[data-motion="reduce"] .orb__label > * { opacity: 0 !important; }
[data-motion="reduce"] .orb__label > .orb__static { display: block !important; opacity: 1 !important; }
[data-motion="reduce"] .focus-scrim, [data-motion="reduce"] .focus-card { animation: fade 300ms ease both !important; }
@media (prefers-reduced-motion: reduce) {
  .focus-scrim, .focus-card { animation: fade 300ms ease both; }
}

/* ---------- 15. Mockup-only helpers (not shipped) --------------------- */
.desk { position: relative; overflow: hidden; border-radius: 16px; isolation: isolate; color: var(--text); background: var(--desk-bg); }
.desk__menubar { position: absolute; top: 0; left: 0; right: 0; height: 26px; display: flex; align-items: center; gap: 18px; padding: 0 12px 0 18px; z-index: 5;
  background: var(--menubar-bg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font: 500 13px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; color: var(--menubar-ink); }
.desk__menubar b { font-weight: 700; }
.desk__tray { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tray-item { height: 22px; min-width: 28px; padding: 0 5px; border-radius: 5px; display: grid; place-items: center; color: inherit; }
.tray-item svg { width: 18px; height: 18px; display: block; }
.tray-item.is-open { background: var(--tray-open); }
.win { position: absolute; border-radius: 12px; overflow: hidden; background: var(--win-bg); box-shadow: var(--win-shadow); }
.win__bar { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--win-rule); }
.win__dot { width: 12px; height: 12px; border-radius: 50%; background: #ec6a5e; } .win__dot:nth-child(2) { background: #f4bf4f; } .win__dot:nth-child(3) { background: #61c554; }
.win__body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.win__line { height: 10px; border-radius: 5px; background: var(--win-line); }
.dock { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); height: 66px; padding: 8px 10px; display: flex; gap: 8px; border-radius: 22px; z-index: 4;
  background: var(--dock-bg); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--dock-edge); }
.dock__app { width: 50px; height: 50px; border-radius: 12px; background: var(--c, #c9d4c4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 4px rgba(0, 0, 0, .12); }
.app-icon { position: relative; overflow: hidden; border-radius: 22.4%; display: grid; place-items: center;
  background: radial-gradient(70% 60% at 25% 20%, #cfe6bd, transparent 70%), radial-gradient(80% 80% at 85% 90%, #3f7a57, transparent 70%), linear-gradient(160deg, #9cc795, #5a9169);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 6px rgba(20, 50, 30, .25), 0 6px 14px -6px rgba(20, 50, 30, .5); }
.nsmenu { width: 230px; padding: 5px; border-radius: 10px; background: var(--nsmenu-bg); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  box-shadow: var(--nsmenu-shadow); font: 400 13px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; color: var(--nsmenu-ink); }
.nsmenu__item { height: 24px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 5px; }
.nsmenu__item.is-hover { background: #4f8a62; color: #fff; }
.nsmenu__sep { height: 1px; margin: 5px 10px; background: var(--nsmenu-sep); }

/* ---------- 16. Companion — "Pip" (Pausa) ------------------------------ */
/* <pausa-companion state="calm|waiting|hello|breathe|focused|proud|sleepy|cheering" size="24|56|120" stage="1–5" pattern="box|478|coherent|sigh">
   Decorative: always aria-hidden. Never the only carrier of information.                                   */
pausa-companion { display: inline-block; line-height: 0; vertical-align: middle; flex: none; }
/* Pip tokens follow the theme scope like every other token */
:root, [data-theme="light"] { --pet-body: #cfe1bb; --pet-leaf: #a4bf72; --pet-ink: #1e3326; --pet-eye: #1e3326; --pet-hl: #fffdf6;
  --pet-blush: oklch(.82 .08 15); --pet-petal: oklch(.84 .08 15); --pet-core: oklch(.9 .1 95); --pet-spark: #5a9169; --pet-sw: 3.5; }
[data-theme="dark"] { --pet-body: #7fae7c; --pet-leaf: #9cc07a; --pet-ink: #e3ecdd; --pet-eye: #10241a; --pet-hl: #f2f8ee;
  --pet-blush: oklch(.66 .09 15); --pet-petal: oklch(.72 .09 15); --pet-core: oklch(.86 .1 95); --pet-spark: #a5d39f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pet-body: #7fae7c; --pet-leaf: #9cc07a; --pet-ink: #e3ecdd; --pet-eye: #10241a; --pet-hl: #f2f8ee;
  --pet-blush: oklch(.66 .09 15); --pet-petal: oklch(.72 .09 15); --pet-core: oklch(.86 .1 95); --pet-spark: #a5d39f; } }
.companion { --size: 120px; position: relative; display: inline-block; width: var(--size); height: var(--size); -webkit-tap-highlight-color: transparent; }
.companion[data-size="tiny"], .companion-static--tiny { --pet-sw: 7; }
.companion-static { display: inline-block; width: var(--size, 56px); height: var(--size, 56px); overflow: visible; flex: none; }
.companion__svg { width: 100%; height: 100%; overflow: visible; display: block; }
.companion g, .pp-sym * { transform-box: view-box; }
/* Paint — fills offset +3/+3 from the line, like the spot illustrations */
.pp-fill { fill: var(--pet-body); stroke: none; }
.pp-fill.pp-lf { fill: var(--pet-leaf); }
.pp-line { fill: none; stroke: var(--pet-ink); stroke-width: var(--pet-sw); stroke-linecap: round; stroke-linejoin: round; }
.pp-face { fill: none; stroke: var(--pet-eye); stroke-width: calc(var(--pet-sw) * .8); stroke-linecap: round; stroke-linejoin: round; }
.pp-eye { fill: var(--pet-eye); } .pp-hl { fill: var(--pet-hl); }
.pp-mouth { fill: var(--pet-eye); stroke: var(--pet-eye); stroke-width: 1.5; stroke-linejoin: round; }
.pp-blush { fill: var(--pet-blush); opacity: .75; }
.pp-petal { fill: var(--pet-petal); stroke: var(--pet-ink); stroke-width: 1.6; } .pp-core { fill: var(--pet-core); stroke: var(--pet-ink); stroke-width: 1.6; }
.pp-spk { fill: var(--pet-spark); } .pp-zline { fill: none; stroke: var(--pet-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.companion[data-size="tiny"] :is(.pp-hl, .pp-blush, .pp-puff, .pp-zz, .pp-sparks) { display: none; }
/* Pivots */
.companion__rig, .companion__squash { transform-origin: 60px 104px; }
.companion__leaves { transform-origin: 60px 50px; }
.companion__leaf--l { transform-origin: 60px 44px; } .companion__leaf--r { transform-origin: 60px 38px; }
.companion__eyes { transform-origin: 60px 78px; }
.pp-flower { transform-origin: 60px 34px; }
.companion__squash { transition: transform var(--d-base) var(--ease-spring); }
.companion:active .companion__squash { transform: scale(1.08, .9); }                      /* tap squash */
/* Growth stage */
.pp-bud, .pp-leafC { display: none; }
.companion[data-stage="1"] .companion__leaves { display: none; } .companion[data-stage="1"] .pp-bud { display: inline; }
.companion[data-stage="2"] .companion__leaves { transform: scale(.62); }
.companion[data-stage="4"] .pp-leafC, .companion[data-stage="5"] .pp-leafC { display: inline; }
/* Parts: hidden by default, shown per state (cross-fade on change) */
.pp-o { opacity: 0; transition: opacity var(--d-base) var(--ease-soft); }
.companion:is([data-state="calm"], [data-state="waiting"], :not([data-state])) :is(.pp-eyes-open, .pp-m-smile, .pp-blush),
.companion[data-state="hello"] :is(.pp-eyes-bright, .pp-m-open, .pp-blush),
.companion[data-state="breathe"] :is(.pp-eyes-closed, .pp-m-smile, .pp-blush),
.companion[data-state="focused"] :is(.pp-eyes-closed, .pp-m-smile, .pp-blush),
.companion[data-state="proud"] :is(.pp-eyes-happy, .pp-m-open, .pp-blush, .pp-flower, .pp-sparks),
.companion[data-state="sleepy"] :is(.pp-eyes-sleep, .pp-m-out, .pp-blush, .pp-zz),
.companion[data-state="cheering"] :is(.pp-eyes-happy, .pp-m-open, .pp-blush, .pp-sparks),
.companion[data-stage="5"] .pp-flower { opacity: 1; }
.companion[data-state="waiting"] .pp-eyes-open { opacity: 0; } .companion[data-state="waiting"] .pp-eyes-glance { opacity: 1; }

/* Shared breath timing: put data-pattern on any ancestor (card, view) or on the companion itself;
   .orb, .companion and .breath-text inside all read the same variables and stay in step.            */
[data-pattern] { --inhale: 4s; --hold1: 4s; --exhale: 4s; --hold2: 4s;
  --cycle: calc(var(--inhale) + var(--hold1) + var(--exhale) + var(--hold2));
  --k-pet: pet-box; --k-in: say-box-in; --k-hold: say-box-hold; --k-out: say-box-out; }
[data-pattern="478"] { --inhale: 4s; --hold1: 7s; --exhale: 8s; --hold2: 0s; --k-pet: pet-478; --k-in: say-478-in; --k-hold: say-478-hold; --k-out: say-478-out; }
[data-pattern="coherent"] { --inhale: 5.5s; --hold1: 0s; --exhale: 5.5s; --hold2: 0s; --k-pet: pet-coh; --k-in: say-coh-in; --k-hold: none; --k-out: say-coh-out; }
[data-pattern="sigh"] { --inhale: 2s; --hold1: 1s; --exhale: 6s; --hold2: 1s; --k-pet: pet-sigh; --k-in: say-sigh-in; --k-hold: say-sigh-hold; --k-out: say-sigh-out; }
.breath-text { display: grid; font: 800 20px/1.25 var(--font-tip); }
.breath-text > * { grid-area: 1 / 1; opacity: 0; }
.breath-text > .breath-text__static { opacity: 1; }
/* Companion surfaces */
.companion-ground { position: relative; display: grid; place-items: end center; }
.companion-ground::after { content: ""; position: absolute; bottom: 2%; left: 22%; right: 22%; height: 9%; border-radius: 50%; background: rgba(var(--shade), .14); filter: blur(3px); z-index: -1; }
.companion-hero { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.companion-hero__line { font: 800 16px/1.3 var(--font-tip); text-wrap: pretty; }
.companion-hero__sub { font: 600 12.5px/1.35 var(--font-body); color: var(--text-muted); }
.growth-ring { position: relative; display: grid; place-items: center; }
.growth-ring > svg.growth-ring__arc { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.growth-ring__arc circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.garden { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.garden__stage { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 10.5px/1.15 var(--font-display); color: var(--text-muted); text-align: center; }
.garden__stage.is-future { opacity: .4; filter: grayscale(.7); }
.garden__stage.is-current { color: var(--text); }

@keyframes pet-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03, 1.045); } }
@keyframes pet-blink { 0%, 93%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.1); } }
@keyframes pet-sway-l { 0%, 100% { transform: rotate(3deg); } 50% { transform: rotate(-5deg); } }
@keyframes pet-sway-r { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(5deg); } }
@keyframes pet-wave { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-24deg); } 32% { transform: rotate(8deg); } 50% { transform: rotate(-20deg); } 68% { transform: rotate(5deg); } 84% { transform: rotate(-4deg); } }
@keyframes pet-hop { 0%, 100% { transform: translateY(0) scale(1); } 25% { transform: translateY(0) scale(1.06, .92); } 50% { transform: translateY(-10px) scale(.96, 1.05); } 75% { transform: translateY(0) scale(1.03, .97); } }
@keyframes pet-cheer-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(18deg); } }
@keyframes pet-cheer-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }
@keyframes pet-z { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(8px, -20px) scale(1.1); opacity: 0; } }
@keyframes pet-twinkle { 0%, 100% { transform: scale(.4) rotate(0); opacity: 0; } 40%, 60% { transform: scale(1) rotate(20deg); opacity: 1; } }
@keyframes pet-bloom { 0% { transform: scale(0) rotate(-40deg); } 65% { transform: scale(1.18) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes pet-enter { 0% { opacity: 0; transform: translateY(40px) scale(.9); filter: blur(6px); } 55% { opacity: 1; transform: translateY(-6px) scale(1.02); filter: blur(0); } 78% { transform: translateY(2px); } 100% { opacity: 1; transform: none; filter: blur(0); } }
@keyframes pet-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg) scale(1.03); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
/* Breath-sync body: .94 empty → 1.06 full, same stops as the orb */
@keyframes pet-box { 0% { transform: scale(.94); } 25%, 50% { transform: scale(1.06); } 75%, 100% { transform: scale(.94); } }
@keyframes pet-478 { 0% { transform: scale(.94); } 21%, 58% { transform: scale(1.06); } 100% { transform: scale(.94); } }
@keyframes pet-coh { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.06); } }
@keyframes pet-sigh { 0% { transform: scale(.94); } 20% { transform: scale(1.02); } 30% { transform: scale(1.06); } 90%, 100% { transform: scale(.94); } }

@media (prefers-reduced-motion: no-preference) {
  /* Idle (calm, waiting): breathe 6s, blink every 5s, leaves sway 6s */
  .companion .companion__rig { animation: pet-breathe 6s var(--ease-breath) infinite; }
  .companion .companion__eyes { animation: pet-blink 5s linear infinite; }
  .companion[data-state="waiting"] .companion__leaf--l { animation: pet-sway-l 6s var(--ease-breath) infinite; }
  .companion[data-state="waiting"] .companion__leaf--r { animation: pet-sway-r 6s var(--ease-breath) infinite; }
  .companion[data-state="waiting"] .companion__eyes { animation-duration: 6.5s; }
  /* Hello: rise in step with the focus card, wave twice */
  .companion[data-state="hello"] .companion__rig { animation: pet-enter var(--d-enter) 120ms cubic-bezier(.2, .7, .3, 1) both, pet-breathe 6s 1s var(--ease-breath) infinite; }
  .companion[data-state="hello"] .companion__leaf--r { animation: pet-wave 1.5s 500ms var(--ease-soft) 2; }
  /* Breathe: body follows --inhale/--hold1/--exhale/--hold2; mouth and cheeks swap per phase */
  .companion[data-state="breathe"] .companion__rig { animation: var(--k-pet, pet-box) var(--cycle, 16s) var(--ease-breath) infinite; }
  .companion[data-state="breathe"] .companion__eyes { animation: none; }
  .companion[data-state="breathe"] .pp-m-smile { opacity: 0; }
  .companion[data-state="breathe"] .pp-m-in { animation: var(--k-in, say-box-in) var(--cycle, 16s) linear infinite; }
  .companion[data-state="breathe"] .pp-m-hold, .companion[data-state="breathe"] .pp-puff { animation: var(--k-hold, say-box-hold) var(--cycle, 16s) linear infinite; }
  .companion[data-state="breathe"] .pp-m-out { animation: var(--k-out, say-box-out) var(--cycle, 16s) linear infinite; }
  /* Focused / sleepy: slower breath, no blink */
  .companion[data-state="focused"] .companion__rig { animation-duration: 8s; }
  .companion[data-state="sleepy"] .companion__rig { animation-duration: 9s; }
  .companion:is([data-state="focused"], [data-state="sleepy"]) .companion__eyes { animation: none; }
  .companion[data-state="sleepy"] .pp-z1 { animation: pet-z 3.6s var(--ease-soft) infinite; }
  .companion[data-state="sleepy"] .pp-z2 { animation: pet-z 3.6s 1.2s var(--ease-soft) infinite both; }
  .companion[data-state="sleepy"] .pp-z3 { animation: pet-z 3.6s 2.4s var(--ease-soft) infinite both; }
  /* Proud: flower springs open, one hop, sparkles twinkle */
  .companion[data-state="proud"] .pp-flower { animation: pet-bloom 900ms 200ms var(--ease-spring) both; }
  .companion[data-state="proud"] .companion__rig { animation: pet-hop 800ms var(--ease-soft) 1, pet-breathe 6s 1s var(--ease-breath) infinite; }
  .companion:is([data-state="proud"], [data-state="cheering"]) .pp-sparks g { transform-origin: center; transform-box: fill-box; animation: pet-twinkle 2.4s var(--ease-soft) infinite both; }
  .companion .pp-s2 { animation-delay: .5s !important; } .companion .pp-s3 { animation-delay: 1s !important; }
  /* Cheering: hops and raises both leaves */
  .companion[data-state="cheering"] .companion__rig { animation: pet-hop 1.1s var(--ease-soft) infinite; }
  .companion[data-state="cheering"] .companion__leaf--l { animation: pet-cheer-l 1.1s var(--ease-soft) infinite; }
  .companion[data-state="cheering"] .companion__leaf--r { animation: pet-cheer-r 1.1s var(--ease-soft) infinite; }
  /* One-shot reactions: react="wiggle" (e.g. on Take a moment) */
  .companion[data-react="wiggle"] .companion__squash { animation: pet-wiggle 600ms var(--ease-spring) 2; }
  /* Shared breath text */
  .breath-text > .breath-text__static { display: none; }
  .breath-text__in { animation: var(--k-in) var(--cycle) linear infinite; }
  .breath-text__hold { animation: var(--k-hold) var(--cycle) linear infinite; }
  .breath-text__out { animation: var(--k-out) var(--cycle) linear infinite; }
}
[data-motion="reduce"] .breath-text > * { opacity: 0 !important; }
[data-motion="reduce"] .breath-text > .breath-text__static { display: block !important; opacity: 1 !important; }
[data-motion="reduce"] .companion[data-state="breathe"] .pp-m-smile { opacity: 1 !important; }
[data-motion="reduce"] .companion[data-state="breathe"] :is(.pp-m-in, .pp-m-hold, .pp-m-out, .pp-puff) { opacity: 0 !important; }

/* Tray "wake" preview (mockup only — in-app, Tauri swaps tray images on a timer with the same frames) */
.tray-wake { position: relative; display: inline-grid; width: var(--s, 18px); height: var(--s, 18px); }
.tray-wake > svg { grid-area: 1 / 1; width: 100%; height: 100%; opacity: 0; }
.tray-wake > .tw-plain { opacity: 1; }
@keyframes tw-plain { 0%, 8%, 70%, 100% { opacity: 1; } 10%, 68% { opacity: 0; } }
@keyframes tw-awake { 0%, 8% { opacity: 0; } 10%, 30%, 36%, 50%, 56%, 68% { opacity: 1; } 31%, 35%, 51%, 55%, 70%, 100% { opacity: 0; } }
@keyframes tw-blink { 0%, 30% { opacity: 0; } 31%, 35% { opacity: 1; } 36%, 50% { opacity: 0; } 51%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .tray-wake > .tw-plain { animation: tw-plain 6s steps(1, end) infinite; }
  .tray-wake > .tw-awake { animation: tw-awake 6s steps(1, end) infinite; }
  .tray-wake > .tw-blink { animation: tw-blink 6s steps(1, end) infinite; }
}
