/* Ludoq — the pop-up family (Premium pass §13 + founder order Nov 27): toast, milestone card, drawn checks, Copy-link
   swap, achievement seals. Linked on every app page (js/app.js and js/delight.js also inject it when a page did not).
   One family: white surface, hairline, soft layered shadow, a status glyph in a tinted circle, specific copy, accent text
   actions. Bottom centre. Spring in (transform + opacity only), quick fade down out; fade only under reduced motion.
   The toast rules used to live in css/styles.css (§ toasts); they live here now and win by order and specificity. */

:root{
  /* component motion tokens — a damped spring (ζ .74, ~3% overshoot) sampled into linear() */
  --spring-toast:linear(0, 0.027, 0.094, 0.186, 0.291, 0.4, 0.506, 0.604, 0.692, 0.769, 0.834, 0.888, 0.931, 0.964, 0.989, 1.007, 1.019, 1.027, 1.03, 1.032, 1.031, 1.029, 1.026, 1.022, 1.019, 1.016, 1.013, 1.01, 1.007, 1.005, 1.004, 1.002, 1);
  --dur-toast-in:440ms; --dur-toast-out:200ms; --dur-moment-in:560ms;
  --toast-max-w:440px; --toast-ic:24px; --moment-w:420px; --moment-ic:32px;
}

/* ───────── toast: the surface (also used by the static design-system demos) ───────── */
.toast{position:relative;left:auto;bottom:auto;transform:none;opacity:1;pointer-events:auto} /* resets the legacy fixed toast; the live stack places it */
html:root[data-theme] .toast{
  display:flex;align-items:flex-start;gap:var(--space-10);box-sizing:border-box; /* ds-allow: L13 the toast family lives in delight.css now (moved from styles.css) */
  width:max-content;min-width:0;max-width:min(var(--toast-max-w),100%);min-height:0;
  padding:var(--space-12) var(--space-16) var(--space-12) var(--space-12);border-radius:var(--radius-card);
  background:var(--toast-bg);color:var(--toast-fg);border:1px solid var(--toast-line);box-shadow:var(--shadow-toast); /* white toast standard (Nov 28) */
  font:var(--type-label);letter-spacing:var(--ls-title-sm);-webkit-font-smoothing:antialiased}
html:root[data-theme] .toast:has(.toast-act){padding-right:var(--space-8)} /* ds-allow: L13 toast family */
.toast-msg,.toast > span:not([class]){flex:1 1 auto;min-width:0;padding-top:var(--space-2);overflow-wrap:anywhere;text-wrap:pretty}

/* status glyph: 24px tinted circle, 14px mark (works for the live glyph and a bare .ic in static markup) */
html:root[data-theme] .toast > .ic{flex:none;box-sizing:border-box;width:var(--toast-ic);height:var(--toast-ic);padding:var(--space-4);border-radius:var(--radius-full);
  background:var(--bg-muted);color:var(--icon-default);stroke-width:2.6;opacity:1}
html:root[data-theme] .toast[data-tone="ok"] > .ic,html:root[data-theme] .toast > .ic:not(.err):not(.info):not(.toast-ic){background:var(--success-bg);color:var(--success-fg)}
html:root[data-theme] .toast[data-tone="error"] > .ic,html:root[data-theme] .toast > .ic.err{background:var(--danger-bg);color:var(--danger-fg)}
html:root[data-theme] .toast[data-tone="info"] > .ic,html:root[data-theme] .toast > .ic.info{background:var(--bg-muted);color:var(--icon-muted)}
html:root[data-theme] .toast[data-tone="ok"] > .ic,html:root[data-theme] .toast[data-tone="error"] > .ic,html:root[data-theme] .toast[data-tone="info"] > .ic{stroke-width:2.4}

/* the one text action, accent; Undo / Open / Customize */
html:root[data-theme] .toast-act{ /* ds-allow: L13 toast family */
  flex:none;margin:calc(-1 * var(--space-2)) 0;display:inline-flex;align-items:center;height:var(--h-28);padding:0 var(--space-8);border-radius:var(--radius-item);
  background:transparent;color:var(--toast-act);font:var(--type-label);font-weight:600;
  transition:background-color var(--dur-fast) var(--ease),transform var(--dur-fast) var(--ease)}
html:root[data-theme] .toast-act:hover{background:var(--toast-act-hover)}
html:root[data-theme] .toast-act:active{background:var(--toast-act-hover);transform:scale(var(--press-scale))}
html:root[data-theme] .toast-act + .toast-act{margin-left:calc(-1 * var(--space-6))}

/* close: a small round button on the top-left corner, shown on hover or keyboard focus */
html:root[data-theme] .toast-x{ /* ds-allow: L13 toast family */
  position:absolute;top:calc(-1 * var(--space-6));left:calc(-1 * var(--space-6));margin:0;width:20px;height:20px;padding:0;display:grid;place-items:center;
  border-radius:var(--radius-full);background:var(--toast-bg);color:var(--icon-muted);box-sizing:border-box;border:1px solid var(--toast-line);box-shadow:var(--shadow-xs);
  opacity:0;transform:scale(.6);pointer-events:none;
  transition:opacity var(--dur-fast) var(--ease),transform var(--dur-spring-fast) var(--spring-snappy),color var(--dur-fast) var(--ease)}
html:root[data-theme] .toast-x:hover{background:var(--toast-bg);color:var(--fg-default)}
html:root[data-theme] .toast:hover > .toast-x,html:root[data-theme] .toast:focus-within > .toast-x,html:root[data-theme] .toast-x:focus-visible{opacity:1;transform:none;pointer-events:auto}
.toast-x .ic{color:inherit}

/* compact (Home fix, founder Nov 28): the post-Apply toast — one line, 40px, 20px mark, Undo (quiet) · Share (accent) */
html:root[data-theme] .toast.is-compact{align-items:center;gap:var(--space-8);min-height:var(--h-40);max-width:min(400px,100%);padding:var(--space-6) var(--space-6) var(--space-6) var(--space-10)} /* ds-allow: L13 toast family */
html:root[data-theme] .toast.is-compact > .ic{width:20px;height:20px;padding:var(--space-2)}
.toast.is-compact .toast-msg{padding-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
html:root[data-theme] .toast.is-compact .toast-act{margin:0;height:var(--h-28);padding:0 var(--space-8)}
html:root[data-theme] .toast.is-compact .toast-act + .toast-act{margin-left:0}
html:root[data-theme] .toast-act[data-quiet]{color:var(--toast-fg);font-weight:500}
html:root[data-theme] .toast-act[data-quiet]:hover{background:var(--bg-hover)}
.toast .kbd{background:var(--bg-muted);color:var(--fg-muted);box-shadow:none}

/* ───────── toast: the live stack (bottom centre; js/app.js positions each toast with --y / --s) ───────── */
.toast-stack:not(.dsx-static){position:fixed;left:var(--space-16);right:var(--space-16);bottom:var(--space-24);width:auto;max-width:none;height:0;
  transform:none;z-index:var(--z-toast);display:block;pointer-events:none}
.toast-stack:not(.dsx-static) .toast{position:absolute;left:0;right:0;bottom:0;margin-inline:auto;
  transform-origin:50% 0;transform:translateY(var(--y,0px)) scale(var(--s,1));will-change:transform,opacity;touch-action:none;
  transition:transform var(--dur-toast-in) var(--spring-toast),opacity var(--dur-slow) var(--ease-out-quint),translate var(--dur-spring-fast) var(--spring-snappy)}
/* hover bridge: keeps the fanned-out list open while the pointer crosses the gaps */
.toast-stack:not(.dsx-static) .toast::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:calc(var(--space-8) + 2px)} /* ds-allow: L13 hover bridge, not a restyle */
/* tucked behind the front toast: same card, content hidden */
.toast-stack .toast[data-back] > *{opacity:0;transition:opacity var(--dur-fast) var(--ease)}
.toast-stack .toast > *{transition:opacity var(--dur) var(--ease) var(--dur-fast)}
.toast-stack .toast[data-back]{pointer-events:auto}
/* enter: rise from below and settle with a spring */
.toast-stack:not(.dsx-static) .toast[data-state="enter"]{opacity:0;transform:translateY(calc(var(--y,0px) + 100%)) scale(.92);transition:none}
/* exit: quick, down and away */
.toast-stack:not(.dsx-static) .toast[data-state="out"]{opacity:0;pointer-events:none;transform:translateY(calc(var(--y,0px) + var(--space-12))) scale(calc(var(--s,1) * .96));
  transition:transform var(--dur-toast-out) var(--ease-exit),opacity var(--dur-toast-out) var(--ease-exit),translate var(--dur-toast-out) var(--ease-exit)}
.toast-stack .toast.is-dragging{transition:transform var(--dur-toast-in) var(--spring-toast),opacity var(--dur-slow) var(--ease-out-quint);cursor:grabbing}
/* the same id again: a small acknowledging bump (scale is separate from the stacking transform) */
.toast.is-bumped{animation:tBump var(--dur-spring-fast) var(--spring-toast)}
@keyframes tBump{0%{scale:.97}100%{scale:1}}
/* the success check draws itself in */
.toast[data-tone="ok"] > .toast-ic path{stroke-dasharray:1;stroke-dashoffset:1;animation:dlDraw calc(var(--dur-slow) + var(--dur-fast)) var(--ease-out-quint) calc(var(--dur-slow) + var(--dur-instant)) forwards}

/* ───────── milestone card (§13.2): first-time moments; bottom centre, above the toast stack ───────── */
.moment{position:fixed;left:0;right:0;margin-inline:auto;bottom:var(--space-24);z-index:var(--z-toast);box-sizing:border-box;width:min(var(--moment-w),calc(100vw - var(--space-32)));
  display:grid;grid-template-columns:var(--moment-ic) minmax(0,1fr);column-gap:var(--space-12);align-items:start;
  padding:var(--space-16);border-radius:var(--radius-dialog);background:var(--bg-surface);color:var(--fg-default);box-shadow:var(--shadow-xs),var(--shadow-lg);
  translate:0 calc(-1 * var(--mo-lift,0px));transform-origin:50% 100%;
  opacity:0;transform:translateY(var(--space-24)) scale(.96);pointer-events:none;
  transition:opacity var(--dur-slow) var(--ease-out-quint),transform var(--dur-moment-in) var(--spring-toast),translate var(--dur-spring-fast) var(--spring-snappy)}
.moment.show{opacity:1;transform:none;pointer-events:auto}
.moment.out{opacity:0;transform:translateY(var(--space-12)) scale(.98);transition:opacity var(--dur-toast-out) var(--ease-exit),transform var(--dur-toast-out) var(--ease-exit)}
@media (max-width:760px){html.has-tabbar .moment{bottom:calc(var(--space-64) + var(--space-8) + env(safe-area-inset-bottom))}}   /* the tab bar shows only ≤760px; .has-tabbar is set at every width */

/* seal: a tinted circle pops in, the check draws, one soft ring breathes out, six specks drift (real milestones only) */
.mo-seal{position:relative;width:var(--moment-ic);height:var(--moment-ic);display:grid;place-items:center}
.mo-disc{position:absolute;inset:0;border-radius:var(--radius-full);background:var(--accent-weak);transform:scale(.4);opacity:0}
.mo-mark{position:relative;width:18px;height:18px;overflow:visible}
.mo-check{fill:none;stroke:var(--icon-accent);stroke-width:2.25;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1}
.mo-halo{position:absolute;inset:0;border-radius:var(--radius-full);border:1px solid var(--accent-line);opacity:0}
.mo-speck{position:absolute;left:50%;top:50%;width:4px;height:4px;margin:calc(-1 * var(--space-2));border-radius:var(--radius-full);background:var(--accent);opacity:0;
  rotate:var(--a);transform:translateY(0)}
.mo-speck:nth-child(odd){background:var(--accent-line)}
.moment.show .mo-disc{animation:moDisc var(--dur-moment-in) var(--spring-toast) var(--dur-instant) forwards}
.moment.show .mo-check{animation:dlDraw calc(var(--dur-slow) * 2) var(--ease-out-quint) calc(var(--dur-slow) + var(--dur-fast)) forwards}
.moment.show .mo-halo{animation:moHalo calc(var(--dur-spring) + var(--dur-slow)) var(--ease-out-quint) calc(var(--dur-slow) * 2) forwards}
.moment.show .mo-speck{animation:moSpeck var(--dur-spring) var(--ease-out-quint) calc(var(--dur-slow) * 2) forwards}
@keyframes moDisc{0%{transform:scale(.4);opacity:0}30%{opacity:1}100%{transform:scale(1);opacity:1}}
@keyframes moHalo{0%{transform:scale(1);opacity:.9}100%{transform:scale(1.85);opacity:0}}
@keyframes moSpeck{0%{transform:translateY(-14px) scale(.4);opacity:0}25%{opacity:1}100%{transform:translateY(-25px) scale(1);opacity:0}}

.mo-txt{min-width:0;padding-top:var(--space-6)}
.mo-t{margin:0;font:var(--type-section);letter-spacing:var(--ls-section);color:var(--fg-default);text-wrap:balance}
.mo-b{margin:var(--space-2) 0 0;font:var(--type-body-sm);color:var(--fg-muted);text-wrap:pretty}
.mo-acts{display:flex;align-items:center;gap:var(--space-8);margin-top:var(--space-14)}
/* text staggers in a beat after the card */
.moment .mo-t,.moment .mo-b,.moment .mo-acts{opacity:0;transform:translateY(var(--space-4))}
.moment.show .mo-t,.moment.show .mo-b,.moment.show .mo-acts{animation:moUp var(--dur-spring-fast) var(--ease-out-quint) forwards}
.moment.show .mo-t{animation-delay:var(--dur-instant)}
.moment.show .mo-b{animation-delay:calc(var(--dur-instant) * 2)}
.moment.show .mo-acts{animation-delay:calc(var(--dur-instant) * 3)}
@keyframes moUp{to{opacity:1;transform:none}}

/* ───────── drawn checks: Copy link (§13.1) ───────── */
.toast.t-draw .ic path,.toast.t-draw .ic polyline{stroke-dasharray:1;stroke-dashoffset:1;animation:dlDraw calc(var(--dur-fast) * 2) var(--ease-out-quint) var(--dur-fast) forwards}
.dl-swap{display:inline-flex;align-items:center;gap:var(--space-6);animation:dlFade var(--dur) var(--ease) both}
.dl-ck{color:var(--success-dot)}
.dl-ck path{stroke-dasharray:1;stroke-dashoffset:1;animation:dlDraw calc(var(--dur-fast) * 2) var(--ease-out-quint) var(--dur-instant) forwards}
@keyframes dlDraw{to{stroke-dashoffset:0}}
@keyframes dlFade{from{opacity:0}to{opacity:1}}

/* ───────── achievement seals row (§13.3; the .seal mark itself lives in styles.css) ───────── */
.seals{display:flex;flex-wrap:wrap;gap:var(--space-16) var(--space-8)}
.seals-demo{display:flex;flex-direction:column;gap:var(--space-16)}
.seals-lead{margin:0;font:var(--type-body-sm);color:var(--fg-muted)}

/* ───────── reduced motion: fade only, nothing travels or scales ───────── */
@media (prefers-reduced-motion:reduce){
  .toast-stack:not(.dsx-static) .toast,.toast-stack:not(.dsx-static) .toast[data-state="out"],.toast-stack .toast.is-dragging{transition:opacity var(--dur) var(--ease)}
  .toast-stack:not(.dsx-static) .toast[data-state="enter"],.toast-stack:not(.dsx-static) .toast[data-state="out"]{transform:translateY(var(--y,0px)) scale(var(--s,1))}
  .toast.is-bumped{animation:none}
  .moment,.moment.out{transform:none;transition:opacity var(--dur) var(--ease)}
  .moment .mo-t,.moment .mo-b,.moment .mo-acts{opacity:1;transform:none;animation:none}
  .moment.show .mo-disc{animation:none;transform:none;opacity:1}
  .moment.show .mo-halo,.moment.show .mo-speck{animation:none;opacity:0}
  .moment.show .mo-check,.toast[data-tone="ok"] > .toast-ic path,.toast.t-draw .ic path,.toast.t-draw .ic polyline,.dl-ck path,.dl-swap{animation:none;stroke-dashoffset:0}
  html:root[data-theme] .toast-x{transition:opacity var(--dur-fast) var(--ease);transform:none}
}
html.reduce-motion .toast-stack:not(.dsx-static) .toast,html.reduce-motion .toast-stack:not(.dsx-static) .toast[data-state="out"]{transition:opacity var(--dur) var(--ease)}
html.reduce-motion .toast-stack:not(.dsx-static) .toast[data-state="enter"],html.reduce-motion .toast-stack:not(.dsx-static) .toast[data-state="out"]{transform:translateY(var(--y,0px)) scale(var(--s,1))}
html.reduce-motion .toast.is-bumped{animation:none}
html.reduce-motion .moment,html.reduce-motion .moment.out{transform:none;transition:opacity var(--dur) var(--ease)}
html.reduce-motion .moment .mo-t,html.reduce-motion .moment .mo-b,html.reduce-motion .moment .mo-acts{opacity:1;transform:none;animation:none}
html.reduce-motion .moment.show .mo-disc{animation:none;transform:none;opacity:1}
html.reduce-motion .moment.show .mo-halo,html.reduce-motion .moment.show .mo-speck{animation:none;opacity:0}
html.reduce-motion .moment.show .mo-check,html.reduce-motion .toast[data-tone="ok"] > .toast-ic path,html.reduce-motion .toast.t-draw .ic path,html.reduce-motion .dl-ck path,html.reduce-motion .dl-swap{animation:none;stroke-dashoffset:0}

/* ═══════════ MOTION SYSTEM (Loved pass, Nov 28 — reports/Ludoq loved like Notion and Apple.md) ═══════════
   Five durations, one ease-out, press 0.97, popovers grow from their trigger, nothing moves on keyboard actions,
   reduced motion = a 120 ms fade. These tokens override the older ones in styles.css (same names, higher specificity),
   so every page that already uses var(--dur*) / var(--ease*) / var(--spring*) follows without its own edit.
     --dur-instant 0     record hotkey, ⌘K, arrow keys, shortcut tab switches
     --dur-micro   120   hover, press, toggle, checkbox
     --dur-small   180   menus, popovers, tooltips
     --dur-medium  240   modals and sheets in (180 out)
     --dur-large   300   in-app screen changes (max; only marketing pages may go longer)
   Ease: cubic-bezier(.22,1,.36,1) everywhere. No ease-in, no bounce above ~3%. Toasts use plain `ease` (Sonner). */
html:root[data-theme],html:root{
  --dur-instant:0ms; --dur-micro:120ms; --dur-small:180ms; --dur-medium:240ms; --dur-medium-out:180ms; --dur-large:300ms;
  --ease-ui:cubic-bezier(.22,1,.36,1);
  /* legacy names mapped onto the five steps */
  --dur-fast:var(--dur-micro); --dur:var(--dur-small); --dur-slow:var(--dur-medium);
  --dur-spring-fast:.3s; --dur-spring:300ms; --dur-spring-bounce:300ms;
  --ease:var(--ease-ui); --ease-out-quint:var(--ease-ui); --ease-exit:var(--ease-ui);
  /* springs keep their names but lose the overshoot (bounce 0) */
  --spring-snappy:var(--ease-ui); --spring-soft:var(--ease-ui); --spring-bounce:var(--ease-ui);
  --spring-toast:ease; --dur-toast-in:240ms; --dur-toast-out:180ms; --dur-moment-in:240ms;
  --press-scale:.97; --press-scale-card:.99;
}
/* popovers + menus: scale .96 + fade, from the trigger (openPopover sets transform-origin), 180 ms */
html:root[data-theme] .pop{transition:opacity var(--dur-small) var(--ease-ui),transform var(--dur-small) var(--ease-ui)}
html:root[data-theme] .pop.out{transition:opacity var(--dur-micro) var(--ease-ui),transform var(--dur-micro) var(--ease-ui)}
/* modals + sheets: 240 in */
html:root[data-theme] .modal{transition:opacity var(--dur-medium) var(--ease-ui),transform var(--dur-medium) var(--ease-ui)}
html:root[data-theme] .cmdk{transition:opacity var(--dur-small) var(--ease-ui),transform var(--dur-small) var(--ease-ui)}
/* skeletons: the real layout, no shimmer (loading formula) */
html:root[data-theme] :is(.skel,.skeleton,[class*="-skel"]){animation:ldAppear 1s steps(1,end) both!important;background-image:none!important}
@keyframes ldAppear{from{visibility:hidden}to{visibility:visible}}   /* nothing shows for the first second, so a fast load never flashes a skeleton */

/* keyboard actions never animate: js/app.js sets html.kb-instant on a shortcut / arrow / Enter / Esc and clears it on
   the next pointer move. ⌘K, menus, tabs, tooltips and modals then appear and change at once. */
html.kb-instant :is(.cmdk-wrap,.cmdk,.cmdk-bg,.pop,.menu,.modal-wrap,.modal,.modal-bg,.tip,[role="tooltip"],[role="tab"],.seg>*,.tabs>*,.utabs>*,.toast){transition:none!important;animation:none!important}

/* reduced motion (OS setting or Settings › Preferences › Reduce motion): every transform becomes a 120 ms fade */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-property:opacity,color,background-color,border-color,box-shadow,fill,stroke!important;transition-duration:120ms!important;scroll-behavior:auto!important}
}
html.reduce-motion *,html.reduce-motion *::before,html.reduce-motion *::after{transition-property:opacity,color,background-color,border-color,box-shadow,fill,stroke!important;transition-duration:120ms!important;scroll-behavior:auto!important}

/* ink roles: hierarchy from ink opacities (100 / 64 / 40 / 12), not new greys */
:root{--ink-100:rgba(43,42,39,1);--ink-64:rgba(43,42,39,.64);--ink-40:rgba(43,42,39,.40);--ink-12:rgba(43,42,39,.12)}

/* AI-written text: the lighter ink shade, each point linked to its moment (first session, prepared notes) */
.ai-text{color:var(--ink-64)}
.ai-text .ai-ts{color:var(--ink-40);font-variant-numeric:tabular-nums;text-decoration:none;margin-left:6px;font-size:12px}
.ai-text .ai-ts:hover{color:var(--accent)}

/* sound twin: every sound has a visual cue (a 120 ms ring on the thing that made it) */
.cue-pulse{animation:cuePulse var(--dur-large) var(--ease-ui) 1}
@keyframes cuePulse{from{box-shadow:0 0 0 0 rgba(29,107,243,.35)}to{box-shadow:0 0 0 6px rgba(29,107,243,0)}}

/* empty-state formula (Loved pass): a greyed outline of the real layout + one line on what lives here + one action.
   No mascots, no icon art. [data-ghost="rows"] draws three hairline rows the way the filled list looks. */
[data-ghost="rows"] .empty-mark,[data-ghost="rows"] .mt-empty-ic{display:none}
[data-ghost="rows"]::before{content:"";display:block;width:min(360px,100%);height:96px;margin:0 auto var(--space-16,16px);
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='96' viewBox='0 0 360 96'%3E%3Cg fill='none' stroke='%23111110' stroke-opacity='.12'%3E%3Crect x='.5' y='.5' width='27' height='27' rx='6'/%3E%3Crect x='.5' y='34.5' width='27' height='27' rx='6'/%3E%3Crect x='.5' y='68.5' width='27' height='27' rx='6'/%3E%3C/g%3E%3Cg fill='%23111110' fill-opacity='.07'%3E%3Crect x='40' y='7' width='170' height='6' rx='3'/%3E%3Crect x='40' y='17' width='100' height='5' rx='2.5'/%3E%3Crect x='300' y='11' width='60' height='6' rx='3'/%3E%3Crect x='40' y='41' width='140' height='6' rx='3'/%3E%3Crect x='40' y='51' width='120' height='5' rx='2.5'/%3E%3Crect x='300' y='45' width='60' height='6' rx='3'/%3E%3Crect x='40' y='75' width='190' height='6' rx='3'/%3E%3Crect x='40' y='85' width='80' height='5' rx='2.5'/%3E%3Crect x='300' y='79' width='60' height='6' rx='3'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
.empty.sm[data-ghost="rows"]::before{width:min(260px,100%);height:70px}
.es-alt{margin-top:var(--space-8,8px);font-size:12px;color:var(--ink-40)}

/* loading thresholds (Loved pass): <1 s keep the old content · 1–2 s skeleton of the real layout (no shimmer) ·
   2–10 s spinner + specific text · >10 s blue progress bar + time left. js/app.js loadingFor() picks the state. */
.ld-line{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ink-64)}
.ld-spin{width:14px;height:14px;border-radius:50%;border:2px solid var(--ink-12);border-top-color:var(--ink-64);animation:ldSpin .8s linear infinite}
@keyframes ldSpin{to{transform:rotate(360deg)}}
.ld-bar{height:4px;border-radius:2px;background:var(--ink-12);overflow:hidden;min-width:160px}
.ld-bar>i{display:block;height:100%;background:var(--accent);transition:width var(--dur-small) var(--ease-ui)}
.ld-eta{font-size:12px;color:var(--ink-40);font-variant-numeric:tabular-nums}

/* Recording indicator (Loved D1 · trust): a calm chip wherever a recording runs (quick record, a live meeting).
   The recorder page has its own live controls, so it hides this. */
html.rec-live body::after{content:"Recording";position:fixed;top:10px;left:50%;transform:translateX(-50%);z-index:var(--z-toast,600);
  display:inline-flex;align-items:center;height:24px;padding:0 10px 0 22px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow-sm);
  font:500 12px/1 var(--sans);color:var(--text-1);pointer-events:none;
  background-image:radial-gradient(circle at 11px 50%,var(--rec) 0 4px,transparent 4.5px)}
html.rec-live body.rec-page::after,html.rec-live #page[data-phase]::after{display:none}

/* sync chip (Loved D3): bottom-left, quiet; "Applying…" then "Saved" */
.sync-chip{position:fixed;left:16px;bottom:16px;z-index:var(--z-toast,600);display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 10px;border-radius:12px;
  background:var(--surface);box-shadow:var(--shadow-sm);font-size:12px;color:var(--ink-64);transition:opacity var(--dur-small) var(--ease-ui);pointer-events:none}
.sync-chip[data-state="gone"]{opacity:0}
.sync-chip .sync-dot{width:6px;height:6px;border-radius:50%;background:var(--accent);animation:syncBlink .9s ease-in-out infinite alternate}
.sync-chip[data-state="ok"] .ic{color:var(--pos)}
@keyframes syncBlink{from{opacity:.35}to{opacity:1}}
/* audit Nov 29: past the sidebar, so "Saved" never covers the account row (and never the Lidd button at the bottom right) */
@media (min-width:761px){html.has-shell .sync-chip{left:calc(var(--sb-w) + var(--space-16))}}
@media (max-width:760px){.sync-chip{bottom:76px}}

/* ───────── Fixes Nov 29 · sheet 01: ONE toast — bottom-right, 356px, 16px glyph or 24px avatar, title + body ───────── */
.toast-stack:not(.dsx-static){left:auto;right:var(--space-24);bottom:var(--space-24);width:min(356px,calc(100vw - var(--space-32)))}
.toast-stack:not(.dsx-static) .toast{left:auto;right:0;margin-inline:0;transform-origin:100% 0}
.toast-stack:not(.dsx-static) .toast:not(.is-compact){width:100%;max-width:100%}
html:root[data-theme] .toast > .ic,html:root[data-theme] .toast[data-tone] > .ic{width:16px;height:16px;padding:0;margin-top:var(--space-2);background:none;stroke-width:2}
html:root[data-theme] .toast[data-tone="ok"] > .ic{color:var(--success-fg)}
html:root[data-theme] .toast[data-tone="error"] > .ic{color:var(--danger-fg)}
html:root[data-theme] .toast[data-tone="info"] > .ic,html:root[data-theme] .toast[data-tone="neutral"] > .ic{color:var(--icon-muted)}
.toast-title{display:block;font-weight:500;color:var(--toast-fg)}
.toast-body{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:var(--space-2);color:var(--fg-muted);font-weight:400}
.toast.is-link .toast-msg{cursor:pointer}
.toast-av{flex:none;width:24px;height:24px;border-radius:var(--radius-full);display:grid;place-items:center;overflow:hidden;background:var(--bg-muted);color:var(--fg-muted);font:var(--type-caption);font-weight:600}
.toast-av img{width:100%;height:100%;object-fit:cover}
.toast-spin{flex:none;width:14px;height:14px;margin:var(--space-2) 0 0;border-radius:var(--radius-full);border:2px solid var(--border-subtle);border-top-color:var(--apply-fg);animation:tSpin var(--dur-spin) linear infinite}
@keyframes tSpin{to{transform:rotate(1turn)}}
.toast-bar{display:block;height:3px;margin-top:var(--space-8);border-radius:var(--radius-full);background:var(--bg-muted);overflow:hidden}
.toast-bar i{display:block;height:100%;background:var(--apply-fg);border-radius:inherit}
@media (prefers-reduced-motion:reduce){
  .toast-stack:not(.dsx-static) .toast,.toast-stack:not(.dsx-static) .toast[data-state]{transition:opacity var(--dur-fast) linear!important;transform:translateY(var(--y,0px))!important}
  .toast-spin{animation-duration:2.4s}}
@media (max-width:560px){.toast-stack:not(.dsx-static){right:var(--space-16);left:var(--space-16);width:auto}}
/* .moment joins the one toast look: same surface, hairline, bottom-right (Lidd stays — Ludoq's own voice) */
html:root[data-theme] .moment{left:auto;right:var(--space-24);margin-inline:0;background:var(--toast-bg);border:1px solid var(--toast-line);box-shadow:var(--shadow-toast);border-radius:var(--radius-card);transform-origin:100% 100%}
@media (max-width:560px){html:root[data-theme] .moment{right:var(--space-16);left:var(--space-16);width:auto}}
/* Turn into menu foot: "Auto for new recordings" switch (fixes Nov 29 sheet 03) */
.menu-foot{display:flex;align-items:center;justify-content:space-between;gap:var(--space-12);margin:var(--space-4) calc(-1 * var(--space-4)) calc(-1 * var(--space-4));padding:var(--space-10) var(--space-12);border-top:1px solid var(--border-subtle);font:var(--type-body-sm);color:var(--fg-muted);cursor:pointer}
