/* Thrive marketing site
   Colors come from the app's "Slate & Clay" palette (lib/core/app_palette.dart).
   Shape rule: buttons and inputs are pills, cards and panels use --r-card (20px),
   small chips use --r-sm (10px). Green is only for "done/completed". */

:root {
  --slate-900: #141A1F;
  --slate-800: #1E2830;
  --slate-600: #2E3A42;
  --slate-400: #465862;
  --slate-200: #8A99A1;
  --slate-50: #DDE3E6;
  --clay-700: #8A4526;
  --clay-600: #A6522E;
  --clay-500: #C6693F;
  --clay-300: #D98A63;
  --clay-200: #EDBFA6;
  --clay-50: #F6E7DD;
  --coral: #E88E5E;
  --cream: #EFEAE2;

  /* light theme tokens */
  --bg: #FFFFFF;
  --bg-tint: #F8F6F2;
  --bg-sand: #F1EFEA;
  --surface: #FFFFFF;
  --border: #DBD8D2;
  --text: #1E2830;
  --text-2: #465862;
  --text-3: #6B6660;
  --accent: #A6522E;          /* clay text/links on light (AA on white) */
  --cta-bg: #A6522E;
  --cta-bg-hover: #8A4526;
  --cta-text: #FFFFFF;
  --accent-wash: #F6E7DD;
  --success: #2F7A46;
  --success-wash: #E3F0E7;
  --priority: #E3A11C;
  --info: #3E6C8A;
  --brand-band: #2E3A42;
  --brand-band-text: #EFEAE2;
  --shadow: 0 1px 2px rgb(46 58 66 / .06), 0 12px 32px -12px rgb(46 58 66 / .18);
  --shadow-lg: 0 2px 4px rgb(46 58 66 / .05), 0 32px 64px -24px rgb(46 58 66 / .28);

  --r-card: 20px;
  --r-sm: 10px;
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191D;
    --bg-tint: #1A2126;
    --bg-sand: #1A2126;
    --surface: #1D252B;
    --border: #2A343B;
    --text: #EFEAE2;
    --text-2: #B9C1C6;
    --text-3: #9AA4AB;
    --accent: #D98A63;
    --cta-bg: #D97A4C;
    --cta-bg-hover: #E88E5E;
    --cta-text: #141A1F;
    --accent-wash: #2C231F;
    --success: #4C9E64;
    --success-wash: #1B2A21;
    --priority: #EDB443;
    --info: #5B96BE;
    --brand-band: #1E2830;
    --brand-band-text: #EFEAE2;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -12px rgb(0 0 0 / .5);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 32px 64px -24px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.025em; line-height: 1.1; font-weight: 700; color: var(--text); }
h1, h2, h3, h4, .eyebrow { text-wrap: balance; }
.lead { text-wrap: pretty; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--clay-300); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--surface); color: var(--text); padding: 10px 16px; border-radius: 999px; z-index: 100; box-shadow: var(--shadow); }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 760px; }
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-tint { background: var(--bg-tint); }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--text-2); max-width: 60ch; }
.triple-copy .sec-head .lead, .ow-copy .sec-head .lead, .persist-copy .sec-head .lead { margin-top: 12px; }
.h-xl { font-size: clamp(38px, 4.6vw, 58px); letter-spacing: -0.035em; line-height: 1.04; }
.h-lg { font-size: clamp(32px, 4.2vw, 50px); letter-spacing: -0.03em; }
.h-md { font-size: clamp(24px, 2.6vw, 32px); }
.h-sm { font-size: 20px; letter-spacing: -0.015em; }
.muted { color: var(--text-2); }
.accent { color: var(--accent); }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.stack > * + * { margin-top: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  font: 600 16px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--cta-bg); color: var(--cta-text); box-shadow: 0 8px 20px -8px rgb(166 82 46 / .55); }
.btn-primary:hover { background: var(--cta-bg-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text-2); }
.btn i { font-size: 18px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 30px; width: auto; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .brand .logo-light { display: none; } .brand .logo-dark { display: block; } }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav .btn { min-height: 42px; padding: 0 20px; font-size: 15px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 999px; width: 44px; height: 44px; color: var(--text); font-size: 20px; cursor: pointer; align-items: center; justify-content: center; }
@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu { position: absolute; left: 0; right: 0; top: 72px; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 24px; display: none; }
  .nav-menu.open { display: block; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links a { display: block; padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--border); }
  .nav-menu .btn { width: 100%; margin-top: 18px; min-height: 52px; }
}
@media (min-width: 881px) { .nav-menu { display: flex; align-items: center; gap: 30px; } }
/* Phones: early access stays in the top bar as a compact pill next to the menu button */
.nav .nav-cta { display: none; }
@media (max-width: 880px) {
  .nav { gap: 10px; }
  .nav .nav-cta { display: inline-flex; margin-left: auto; min-height: 38px; padding: 0 16px; font-size: 14px; }
  .nav-menu .btn { display: none; }
}
@media (max-width: 359px) {
  .brand img { height: 26px; }
  .nav .nav-cta { padding: 0 12px; font-size: 13px; }
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- App kit ----------
   Mirrors the Flutter app so the mockups look like the real thing:
   - item card: lib/features/Item_component/presentation/item_component_main.dart + item_component_ui.dart
   - queue section headers + Progress card: lib/features/Queue/queue_page.dart, Queue_charts_section/
   - bottom nav: Tasks, Habits, Queue, Calendar, Templates, Routines
   Category colours come from lib/services/category_color_util.dart. */
:root {
  --app-canvas: #F1EFEA;
  --app-card-a: #FFFFFF;
  --app-card-b: #F8F6F2;
  --app-border: rgb(0 0 0 / .08);
  --app-text: #1E2830;
  --app-sub: rgb(30 40 48 / .7);
  --app-muted: #87817B;
  --app-header: #2E3A42;
  /* theme.primary: slate in light, the lifted rust (AppPalette.ctaDark) in dark */
  --app-primary: #2E3A42;
  --app-surface: #FFFFFF;
  --app-red: #D94236;
  --app-amber: #E3A11C;
  --app-green: #2F7A46;
  --app-ring: #E6E3DD;
  --app-done: rgb(135 129 123 / .75);
  --app-touch: rgb(46 58 66 / .16);
  /* Comeback ring (interactive_cumulative_score_chart.dart): accent1 ring,
     a gap in the card's own colour (AppPalette.hero, the app's card), the
     line colour for the dot. Charts set --app-comeback-gap to their background. */
  --app-line: var(--app-header);
  --app-comeback: var(--clay-600);
  --app-comeback-gap: var(--app-surface);
  /* day calendar: hour lines (theme.alternate), live-time line (accent1), selection, label ink */
  --dc-line: var(--app-ring);
  --dc-now: var(--clay-500);
  --dc-sel: var(--slate-800);
  --dc-sel-on: var(--bg);
  --dc-ink-base: var(--slate-900);
  --dc-ink-mix: 55%;
  --lt-on: var(--bg);
  /* Redesigned app chrome (AppPalette): the dark "hero" Progress card and its rust
     ring ramp, the Queue · Calendar island, the active tab's rust pill */
  --app-hero: var(--slate-800);
  --app-on-hero: #F2F4F5;
  --app-hero-ring-start: #8E6E62;
  --app-hero-ring-end: var(--clay-300);
  --app-island: var(--slate-800);
  --app-island-pill: #FFFFFF;
  --app-tab-on: var(--clay-500);
  --app-tab-pill: var(--clay-50);
  --app-seg-track: var(--border);
  --app-on-hero-good: #4C9E64;
  --film-tag-task: var(--slate-600);
  --film-tag-habit: var(--clay-600);
  --film-tag-ink: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --app-canvas: #14191D;
    --app-card-a: #1D252B;
    --app-card-b: #1A2126;
    --app-border: rgb(255 255 255 / .1);
    --app-text: #EFEAE2;
    --app-sub: rgb(239 234 226 / .7);
    --app-muted: #9AA4AB;
    --app-header: #1E2830;
    --app-primary: #D9724A;
    --app-surface: #1D252B;
    --app-red: #E85A4E;
    --app-amber: #EDB443;
    --app-green: #4C9E64;
    --app-ring: #2A343B;
    --app-done: rgb(154 164 171 / .75);
    --app-touch: rgb(239 234 226 / .18);
    --app-line: var(--clay-300);
    --app-comeback: var(--clay-300);
    --dc-now: var(--clay-300);
    --dc-sel: var(--slate-50);
    --dc-sel-on: var(--slate-900);
    --dc-ink-base: var(--cream);
    --dc-ink-mix: 40%;
    --lt-on: var(--cream);
    --app-island: var(--slate-600);
    --film-tag-task: var(--slate-400);
    --app-island-pill: var(--cream);
    --app-tab-on: #E58A62;
    --app-tab-pill: color-mix(in srgb, var(--clay-500) 22%, transparent);
    --app-seg-track: var(--border);
  }
}

.mi { font-family: "Material Icons"; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; user-select: none; }
.app { font-family: var(--font); color: var(--app-text); background: var(--app-canvas); position: relative; -webkit-font-smoothing: antialiased; }

/* Phone frame */
.phone {
  position: relative; border-radius: 44px; padding: 11px; background: #11161A;
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgb(255 255 255 / .08); max-width: 372px; margin-left: auto;
}
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 20px; background: #11161A; z-index: 3; }
.screen { border-radius: 34px; overflow: hidden; height: 690px; display: flex; flex-direction: column; }
@media (max-width: 480px) { .screen { height: 640px; } }


/* Progress card (donut + cumulative score) */
.app-prog { margin: 12px 12px 0; padding: 8px 10px 10px; background: var(--app-surface); border-radius: 12px; box-shadow: 0 2px 4px rgb(0 0 0 / .2); }
.app-prog-h { display: flex; align-items: center; font-size: 14px; font-weight: 600; padding: 0 2px 2px; }
.app-prog-h small { margin-left: auto; font-size: 12px; color: var(--app-text); display: inline-flex; align-items: center; }
.app-prog-h small .mi { font-size: 16px; }
.app-prog-cols { display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
.app-prog-cols b { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
.app-prog-cols small { display: block; font-size: 11.5px; color: var(--app-muted); }
.app-prog-cols small em { font-style: normal; color: var(--app-green); font-weight: 600; margin-left: 6px; }
.donut { width: 80px; height: 80px; margin: 0 auto; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 12; }
.donut .ring { stroke: var(--app-ring); }
.donut .val { stroke: var(--app-amber); stroke-linecap: butt; transition: stroke-dashoffset .9s var(--ease), stroke .4s; }
.donut span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 16px; }
.spark { height: 80px; display: grid; place-items: center; }
.spark svg { width: 100%; height: 62px; overflow: visible; }
.spark path { fill: none; stroke: var(--app-header); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
@media (prefers-color-scheme: dark) { .spark path { stroke: #D98A63; } }
.spark circle { fill: var(--app-header); transition: transform .6s var(--ease); }
@media (prefers-color-scheme: dark) { .spark circle { fill: #D98A63; } }

/* Section header ("Pending (4)") */
.app-sec { margin: 8px 12px 4px; padding: 7px 10px 7px 12px; display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 600; border: 1px solid var(--app-border); border-radius: 16px 16px 12px 12px; background: linear-gradient(var(--app-card-a), var(--app-card-b)); }
.app-sec.closed { border-radius: 16px; box-shadow: 0 2px 5px rgb(0 0 0 / .06); }
.app-sec .mi { font-size: 26px; }

/* Item card */
.ai {
  display: flex; align-items: center; gap: 5px; margin: 4px 12px; padding: 9px 6px; min-height: 70px;
  border: 1px solid var(--app-border); border-radius: 12px; background: linear-gradient(var(--app-card-a), var(--app-card-b));
  position: relative; overflow: hidden;
}
.ai-stripe { align-self: stretch; flex: none; min-height: 50px; }
.ai-stripe.task { width: 4px; border-radius: 2px; background: var(--cat); }
.ai-stripe.habit { width: 5.5px; background: linear-gradient(to right, var(--cat) 0 2px, transparent 2px 3.5px, var(--cat) 3.5px 5.5px); }
.ai-ctrl { width: 48px; height: 48px; flex: none; display: grid; place-items: center; position: relative; }
.ai-box { width: 24px; height: 24px; border-radius: 4px; border: 2px solid var(--cat); display: grid; place-items: center; color: var(--cat); transition: background-color .22s, border-color .22s, color .22s; }
.ai-box .mi { font-size: 19px; }
.ai[data-type="binary"]:not(.is-done) .ai-box .mi { opacity: 0; }
.ai.is-done .ai-box { background: var(--app-done); border-color: transparent; color: #fff; }
.ai.is-running .ai-box { background: var(--app-red); border-color: transparent; color: #fff; }
.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.ai-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; transition: color .3s; }
.ai.is-done .ai-name { color: var(--app-muted); text-decoration: line-through; }
.grp-over .ai-sub { color: var(--app-red); }
.ai-sub { font-size: 13px; font-weight: 500; color: var(--app-sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: proportional-nums; }
.ai-stars { display: inline-flex; vertical-align: -3px; margin-left: 2px; }
.ai-stars .mi { font-size: 15px; color: rgb(135 129 123 / .4); transition: color .25s, transform .3s var(--ease); }
.ai-stars .mi.on { color: #FFC107; }
.ai-bar { height: 4px; margin-top: 5px; border: 1px solid var(--cat); border-radius: 2px; background: var(--app-surface); overflow: hidden; }
.ai-bar b { display: block; height: 100%; background: var(--cat); transition: width .45s var(--ease); }
.ai-tools { display: flex; gap: 5px; padding: 0 2px 0 5px; flex: none; color: var(--app-text); }
.ai-tools .mi { font-size: 20px; }
.ai.dim { opacity: .5; }

/* Pop when a control is pressed or completes */
@keyframes boxpop { 0% { transform: scale(1); } 35% { transform: scale(.82); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.ai-box.pop, .ai-quick.pop { animation: boxpop .42s var(--ease); }
/* Finger / touch indicator */
.app-touch { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: var(--app-touch); border: 2px solid color-mix(in srgb, var(--app-touch) 100%, var(--app-text) 30%); pointer-events: none; opacity: 0; z-index: 4; }
.app-touch.go { animation: touch .55s var(--ease); }
@keyframes touch { 0% { opacity: 0; transform: scale(1.5); } 30% { opacity: 1; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.1); } }
/* "+1" floater */
.float-up { position: absolute; font-size: 13px; font-weight: 700; color: var(--cat); pointer-events: none; animation: floatup .8s var(--ease) forwards; z-index: 4; font-family: var(--font); }
.float-up.big { font-size: 22px; color: var(--accent); z-index: 8; animation: floatbig 1.6s var(--ease) forwards; }
@keyframes floatbig { 0% { opacity: 0; transform: translateY(8px); } 15%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px); } }
@keyframes floatup { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-22px); } }



/* Mini app panel used inside sections and on the features page */
.mini-app { position: relative; border-radius: 20px; padding: 10px 0; border: 1px solid var(--border); overflow: hidden; }
.mini-app .ai:first-child { margin-top: 0; }
.fitem .mini-app { margin-top: 18px; }

/* ---------- Typical-app kit (#2, kept for #17) ----------
   A "typical app" side (generic, greys only) and Thrive's answer in the app
   kit's colours. The --typ-* tokens are deliberately neutral so the switch to
   colour is the payoff. */
:root {
  --typ-bg: #F3F3F2;
  --typ-surface: #FFFFFF;
  --typ-line: #E1E1DF;
  --typ-text: #55585A;
  --typ-sub: #8E9193;
  --typ-mark: #B3B5B6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --typ-bg: #1B1F22;
    --typ-surface: #23282B;
    --typ-line: #33393D;
    --typ-text: #C3C6C8;
    --typ-sub: #8A9094;
    --typ-mark: #697075;
  }
}

/* Stage: two layers (typical, Thrive); the thought bubble comes from .tc */
.fs { position: relative; height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--typ-line); background: var(--typ-bg); transition: border-color .5s; }
.fs.is-thr { border-color: var(--app-border); }
.fs-tag { position: absolute; top: 10px; left: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--font); padding: 6px 10px 6px 8px; border-radius: 999px; border: 1px solid var(--typ-line); background: var(--typ-surface); color: var(--typ-sub); transition: color .4s, background-color .4s, border-color .4s, opacity .4s; }
.fs-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--typ-mark); transition: background-color .4s; }
.fs.is-thr .fs-tag { color: var(--accent); background: var(--accent-wash); border-color: transparent; }
.fs.is-thr .fs-tag i { background: var(--accent); }
.fs-typ, .fs-thr { position: absolute; inset: 0; padding: 44px 12px 12px; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.fs-typ { font-family: var(--font); color: var(--typ-text); }
.fs-thr { opacity: 0; transform: translateY(10px); }
.fs.is-bubble .fs-typ { opacity: .3; }
.fs.is-thr .fs-typ { opacity: 0; transform: scale(.97); }
.fs.is-thr .fs-thr { opacity: 1; transform: none; }
.fs.blank .fs-typ, .fs.blank .fs-thr, .fs.blank .fs-tag { opacity: 0; transition-duration: .35s; }
.fs-bubble { position: absolute; left: 18px; right: 18px; top: 50%; z-index: 4; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; font: 600 16px/1.35 var(--font); letter-spacing: -0.01em; text-align: center; opacity: 0; transform: translateY(calc(-50% + 10px)) scale(.95); transition: opacity .35s var(--ease), transform .5s var(--ease); }
.fs-bubble::before, .fs-bubble::after { content: ""; position: absolute; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); }
.fs-bubble::before { width: 13px; height: 13px; right: 30px; bottom: -19px; }
.fs-bubble::after { width: 8px; height: 8px; right: 20px; bottom: -31px; }

/* Typical to-do list */
.ty-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; }
.ty-h b { font-size: 15px; }
.ty-h small { font-size: 13px; color: var(--typ-sub); font-variant-numeric: proportional-nums; }
.ty-list { list-style: none; margin: 0; padding: 0; background: var(--typ-surface); border: 1px solid var(--typ-line); border-radius: 10px; overflow: hidden; }
.ty-list li { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; font-size: 13.5px; border-top: 1px solid var(--typ-line); white-space: nowrap; overflow: hidden; }
.ty-list li:first-child { border-top: 0; }
.ty-c { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--typ-mark); flex: none; display: grid; place-items: center; transition: background-color .2s, border-color .2s; }
.ty-c .mi { font-size: 12px; color: var(--typ-surface); opacity: 0; transition: opacity .2s; }
.ty-list li.tick .ty-c { background: var(--typ-mark); }
.ty-list li.tick .ty-c .mi { opacity: 1; }
.ty-list li.tick .n { text-decoration: line-through; color: var(--typ-sub); }

/* Thrive side, compact */
.fs .ai { margin: 3px 0; min-height: 0; padding: 4px 6px 4px 5px; gap: 2px; border-radius: 10px; }
.fs .ai-stripe { min-height: 34px; }
.fs .ai-ctrl { width: 34px; height: 34px; }
.fs .ai-box { width: 20px; height: 20px; }
.fs .ai-box .mi { font-size: 16px; }
.fs .ai-name { font-size: 13px; }
.fs .ai-sub { font-size: 11.5px; margin-top: 0; }
.fs .ai-bar { margin: 3px 8px 0 0; }
.fs .ai-tools { display: none; }
.fs .ai-stars .mi { font-size: 13px; }
.fs-thr .ai, .fs-thr .app-sec, .fs-thr .app-prog { opacity: 0; transform: translateY(6px); transition: opacity .4s var(--ease), transform .4s var(--ease); transition-delay: calc(.15s + var(--k, 0) * 90ms); }
.fs.is-thr .fs-thr .ai, .fs.is-thr .fs-thr .app-sec, .fs.is-thr .fs-thr .app-prog { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) { .fs *, .tc, .tc * { transition: none !important; animation: none !important; } }

/* ---------- Title cards outside the hero (#17) ----------
   The hero's caption type (.film-cap / .fc-in) on a card that covers its stage. */
.tc { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; background: var(--surface); border-radius: inherit; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s var(--ease), visibility 0s linear .3s; }
.tc.on { opacity: 1; visibility: visible; transition: opacity .3s var(--ease), visibility 0s; }
.tc .film-cap { font-size: clamp(24px, 2.6vw, 32px); max-width: 13em; }
.tc.bubble, .chart-card .tc.bubble, .stage-screen .tc.bubble { background: transparent; }
.tc .fs-bubble { opacity: 1; transform: translateY(-50%); font-size: 20px; padding: 18px 18px; }
.tc .fs-bubble .fc-in { font-weight: 600; }

/* To-do vs Thrive (#accomplished): heading beside the video on desktop, above it on phones */
.acc-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: center; text-align: left; }
.film-after .acc-grid .h-lg { margin: 0; max-width: 14ch; }
.acc-wrap { width: 100%; max-width: 480px; justify-self: end; }
.fs.acc { display: grid; height: auto; border-radius: 20px; }
.fs.acc .fs-typ, .fs.acc .fs-thr { position: relative; grid-area: 1 / 1; }
.fs.acc .ty-list li { height: 72px; font-size: 16px; gap: 14px; padding: 0 16px; }
.fs.acc .ty-c { width: 22px; height: 22px; border-width: 2px; }
/* Cards sit over the still, dimmed app */
.fs.acc .tc:not(.bubble) { background: color-mix(in srgb, var(--surface) 84%, transparent); }
.fs.acc .fs-thr .app-prog { padding-top: 8px; padding-bottom: 10px; }
.fs.acc .fs-thr .app-prog .donut { width: 68px; height: 68px; }
.fs.acc .fs-thr .app-prog .donut span { font-size: 19px; }
.fs.acc .fs-thr .spark { height: 68px; }
/* Completed opens only for the points beat; each card shows its points on its right */
.acc-list { clip-path: inset(0 0 100%); opacity: 0; transition: clip-path .45s var(--ease), opacity .35s var(--ease); }
.fs.acc.acc-open .acc-list { clip-path: inset(0); opacity: 1; }
.acc-rows { overflow: hidden; }
.acc-row { position: relative; }
.acc-row .ai { padding-right: 64px; }
.acc-pts { position: absolute; right: 12px; top: 50%; z-index: 2; font-family: var(--font); font-size: 16px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; color: var(--app-text); opacity: 0; transform: translate(-6px, -50%); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.acc-pts.big { font-size: 22px; color: var(--accent); }
.acc-pts.mid { font-size: 18px; }
.acc-pts.on { opacity: 1; transform: translate(0, -50%); }
.fs.acc .fs-thr .app-prog, .fs.acc .fs-thr .app-sec { margin-left: 0; margin-right: 0; }
.fs.acc .fs-thr .app-prog { margin-top: 0; }
.fs.acc .fs-thr .app-sec { margin-block: 4px; padding-block: 4px; }
.fs.acc .fs-thr .ai { margin: 2px 0; padding-block: 2px; }
.fs.acc .acc-row .ai-stripe { min-height: 30px; }
.fs.acc .acc-row .ai-ctrl { width: 32px; height: 32px; }
.fs.acc .acc-row .ai-name { font-size: 12.5px; }
.fs.acc .acc-row .ai-sub { line-height: 1.2; }
@media (max-width: 900px) {
  .acc-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .film-after .acc-grid .h-lg { max-width: 20ch; }
  .acc-wrap { justify-self: stretch; max-width: 520px; }
}
@media (max-width: 380px) { .fs.acc .ty-list li { font-size: 15px; } }

/* Persistence: Person A's typical-tracker streak chip, and the cards on the band */
.chart-card[data-scene="persist"] { position: relative; }
.chart-card .tc { background: color-mix(in srgb, var(--brand-band) 88%, transparent); }
/* Persistence (#22): one fixed stage, three layers shown one at a time */
.pz { position: relative; height: 470px; overflow: hidden; }
.pz-l { position: absolute; inset: 0; padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s linear .4s; }
.pz[data-show="grids"] .pz-grids, .pz[data-show="score"] .pz-score, .pz[data-show="cu"] .pz-cu { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }
.pz:not([data-show]) .pz-grids { opacity: 1; visibility: visible; }
.pz .score-wrap { margin-top: 0; }
.pz-months { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: rgb(239 234 226 / .6); }
.pz-cu .cu-stage { margin: 0; }
.pz-cu .cu-cap { display: none; }
.pz-cu .cu-grid { grid-template-columns: minmax(0, 1fr); }
.pz-cu .cu-stage[data-pane="typ"] .cu-thr, .pz-cu .cu-stage[data-pane="thr"] .cu-typ { display: none; }
.pz-cu .cu-res.failed b { text-decoration: line-through; text-decoration-thickness: 2px; }
.pz-cu .cu-res.failed small { font-weight: 700; color: var(--typ-text); }
.pz-cu .cu-cols { height: 76px; margin-top: 22px; }
.pz-wk { margin: 12px 4px 0; font-family: var(--font); }
.pz-wk-h { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; color: var(--app-sub); }
.pz-wk-bar { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); height: 18px; margin-top: 5px; border-radius: 5px; overflow: hidden; background: color-mix(in srgb, var(--app-muted) 10%, transparent); }
.pz-wk-bar span { border-right: 1px dashed color-mix(in srgb, var(--app-muted) 45%, transparent); }
.pz-wk-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--app-comeback); }
.pz-wk-goal { position: absolute; top: -2px; bottom: -2px; left: calc(700% / 8); width: 2px; background: var(--app-text); }
.pz-wk-d { display: grid; grid-template-columns: repeat(8, 1fr); margin-top: 3px; font-size: 10px; color: var(--app-muted); text-align: center; }
@media (max-width: 400px) { .pz { height: 500px; } }
@media (prefers-reduced-motion: reduce) { .pz-l, .pz-wk-fill { transition: none !important; } }
.chart-card .tc .film-cap { color: var(--brand-band-text); }
.chart-card > * { transition: opacity .35s var(--ease); }
.chart-card.is-bubble > :not(.tc) { opacity: .3; }
.streak-chip { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; padding: 2px 9px 2px 6px; border-radius: 999px; border: 1px solid var(--typ-line); background: var(--typ-surface); color: var(--typ-text); font: 600 13px/1.3 var(--font); vertical-align: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.streak-chip .mi { font-size: 16px; color: var(--typ-mark); transition: opacity .3s; }
.row-label .streak-chip b { color: inherit; font-size: inherit; font-weight: 600; display: inline-block; min-width: 1.2em; }
.streak-chip.reset .mi { opacity: .4; }
.streak-chip.reset b { animation: chipShake .5s var(--ease); }
@keyframes chipShake { 0%, 100% { transform: none; } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

.stage-screen { position: relative; }
.stage-screen .tc .film-cap { color: var(--app-text); }


/* ---------- App kit, part 2: overlays and screens used by the demos ---------- */
.mini-app.tall { min-height: 300px; }
.mini-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 14px 8px; font-size: 15px; font-weight: 600; }
.mini-head small { font-size: 12px; font-weight: 500; color: var(--app-muted); }
.mini-head .icons { display: flex; gap: 6px; align-items: center; }
.mini-head .mi { font-size: 22px; }
.ico-badge { position: relative; display: inline-grid; }
.ico-badge em { position: absolute; right: -6px; top: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 10px; background: var(--app-primary); color: #fff; font: 700 10px/16px var(--font); font-style: normal; text-align: center; border: 1.5px solid var(--app-canvas); transform: scale(0); transition: transform .3s var(--ease); }
.ico-badge em.on { transform: scale(1); }
/* Dotted stripe = unscored (priority 0) item, e.g. templates */
.ai-stripe.dotted { width: 3px; background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--cat) 75%, transparent) 0 3px, transparent 3px 10px); border-radius: 2px; }
.ai-quick { width: 48px; height: 48px; display: grid; place-items: center; color: var(--app-header); }
@media (prefers-color-scheme: dark) { .ai-quick { color: #D98A63; } }
.ai-quick .mi { font-size: 24px; }
.ai-badge { font-size: 11px; font-weight: 700; color: var(--app-header); opacity: 0; transform: scale(.6); transition: opacity .3s, transform .35s var(--ease); margin-right: 4px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .ai-badge { color: #D98A63; } }
.ai-badge.on { opacity: 1; transform: none; }
/* Drag: lifted card */
.ai.lift { box-shadow: 0 14px 28px -10px rgb(0 0 0 / .35); transform: scale(1.03); z-index: 3; transition: transform .2s var(--ease), box-shadow .2s; }
/* Popup menu (Material) */
.app-menu { position: absolute; z-index: 6; background: var(--app-surface); border-radius: 4px; box-shadow: 0 6px 20px rgb(0 0 0 / .22); padding: 6px 0; min-width: 176px; transform-origin: top right; transform: scale(.85); opacity: 0; transition: transform .2s var(--ease), opacity .2s; pointer-events: none; }
.app-menu.open { transform: none; opacity: 1; }
.app-menu div { font-size: 12px; padding: 9px 16px; }
.app-menu div.hl { background: color-mix(in srgb, var(--app-text) 10%, transparent); }
/* Bottom sheet */
.app-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--app-surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgb(0 0 0 / .18); padding: 8px 18px 16px; transform: translateY(105%); transition: transform .38s var(--ease); }
.app-sheet.open { transform: none; }
.app-sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--app-muted) 30%, transparent); margin: 0 auto 10px; }
.app-sheet h5 { margin: 0 0 6px; font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.app-sheet h5 small { font-size: 13px; color: var(--app-header); font-weight: 500; }
@media (prefers-color-scheme: dark) { .app-sheet h5 small { color: #D98A63; } }
.app-scrim { position: absolute; inset: 0; z-index: 6; background: rgb(0 0 0 / .32); opacity: 0; transition: opacity .3s; pointer-events: none; }
.app-scrim.on { opacity: 1; }
.cbrow { display: flex; align-items: center; gap: 12px; font-size: 14px; padding: 7px 0; }
.cbrow.sub { padding-left: 22px; }
.cbrow .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.cbrow .lbl { flex: 1; }
.cbrow.head .lbl { font-weight: 600; }
.cb { width: 18px; height: 18px; border-radius: 2px; border: 2px solid var(--app-muted); display: grid; place-items: center; flex: none; transition: background-color .2s, border-color .2s; color: #fff; }
.cb .mi { font-size: 15px; opacity: 0; }
.cb.on { background: var(--app-header); border-color: var(--app-header); }
.cb.on .mi { opacity: 1; }
.cb.part { background: var(--app-header); border-color: var(--app-header); }
.cb.part::after { content: ""; width: 9px; height: 2px; background: #fff; }
@media (prefers-color-scheme: dark) { .cb.on, .cb.part { background: #D98A63; border-color: #D98A63; } }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.mbtn { font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 999px; color: var(--app-header); }
.mbtn.fill { background: var(--app-header); color: #fff; }
@media (prefers-color-scheme: dark) { .mbtn { color: #D98A63; } .mbtn.fill { background: #D97A4C; color: #141A1F; } }
/* Snack bar */
.app-snack { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 8; background: var(--app-green); color: #fff; border-radius: 6px; padding: 12px 14px; font-size: 13.5px; box-shadow: 0 6px 16px rgb(0 0 0 / .25); transform: translateY(140%); transition: transform .35s var(--ease); }
.app-snack.on { transform: none; }
/* Search FAB + field */
.app-fab { position: absolute; left: 14px; bottom: 14px; z-index: 5; width: 48px; height: 48px; border-radius: 14px; background: var(--app-header); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 10px rgb(0 0 0 / .25); }
.app-fab .mi { font-size: 22px; }
.app-field { display: flex; align-items: center; gap: 8px; border: 1px solid color-mix(in srgb, var(--app-muted) 45%, transparent); border-radius: 12px; padding: 11px 12px; font-size: 14px; }
.app-field .q { flex: 1; }
.app-field .q:empty::before { content: "Search..."; color: var(--app-muted); }
.app-field .caret { width: 1.5px; height: 17px; background: var(--app-header); animation: blink 1s steps(1) infinite; margin-left: -6px; }
@keyframes blink { 50% { opacity: 0; } }
/* Swipe action (Focus mode) */
.swipe { position: relative; margin: 4px 12px; border-radius: 12px; overflow: hidden; }
.swipe .ai { margin: 0; transition: transform .45s var(--ease); position: relative; z-index: 1; }
.swipe-act { position: absolute; top: 0; bottom: 0; right: 0; width: 110px; background: var(--app-header); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; }
/* Focus mode (timer page) */
.tv { padding: 10px 18px 6px; text-align: center; }
.tv-kicker { font-size: 13px; font-weight: 600; color: var(--app-header); margin-bottom: 8px; }
.tv-mode { display: inline-flex; gap: 14px; font-size: 12.5px; color: var(--app-muted); margin-bottom: 10px; }
.tv-mode b { color: var(--app-text); font-weight: 600; }
.tv h6 { margin: 0; font-size: 16px; font-weight: 600; }
.tv-clock { font-size: 46px; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 14px; font-variant-numeric: proportional-nums; }
.tv-btns { display: flex; justify-content: center; gap: 10px; }
/* Score trend chart (Progress page) */
.sc { --app-comeback-gap: color-mix(in srgb, var(--app-ring) 45%, var(--app-surface)); background: var(--app-comeback-gap); border-radius: 8px; padding: 10px 10px 8px; }
.sc-h { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.sc-h span { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 4px; color: var(--app-header); background: color-mix(in srgb, var(--app-header) 10%, transparent); }
@media (prefers-color-scheme: dark) { .sc-h span { color: #D98A63; background: rgb(217 138 99 / .14); } }
.sc-body { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 170px; gap: 4px; }
.sc-plot, .sc-y { height: 170px; min-height: 0; }
.sc-plot svg { position: absolute; inset: 0; }
.sc-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 9px; color: var(--app-muted); }
.sc-plot { position: relative; }
.sc-plot svg { width: 100%; height: 100%; overflow: visible; }
.sc-plot .line { fill: none; stroke: var(--app-header); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
@media (prefers-color-scheme: dark) { .sc-plot .line { stroke: var(--app-line); } }
.sc-plot .area { fill: color-mix(in srgb, var(--app-header) 10%, transparent); }
.sc-plot .gap { fill: color-mix(in srgb, var(--app-red) 10%, transparent); opacity: 0; transition: opacity .4s; }
.sc-plot .gap.on { opacity: 1; }
/* One full label in a lane above the plot, joined to its ring by a leader;
   later rings get a small tag below-right (clear of the rising line) or nothing. */
.sc-body { margin-top: 26px; }
.sc-call { position: absolute; top: -26px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; color: var(--app-comeback); background: color-mix(in srgb, var(--app-comeback) 12%, var(--app-surface)); opacity: 0; transition: opacity .35s; }
.sc-lead { position: absolute; top: -6px; width: 0; border-left: 1px dashed var(--app-comeback); opacity: 0; transition: opacity .35s; }
.sc-tag { position: absolute; margin: 9px 0 0 6px; font-size: 10px; font-weight: 600; line-height: 1; color: var(--app-comeback); opacity: 0; transition: opacity .35s; white-space: nowrap; }
.sc-call.on, .sc-lead.on, .sc-tag.on { opacity: 1; }
.sc-cb { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--app-text); margin-top: 8px; opacity: 0; transition: opacity .4s; }
.sc-cb.on { opacity: 1; }
.sc-cb .cring { position: relative; margin: 0; opacity: 1; transform: none; flex: none; }
.sc-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--app-muted); margin-top: 6px; }
.sc-legend b { color: var(--app-text); }
/* Time breakdown pie */
.tb { padding: 6px 14px 4px; }
.tb-h { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.tb-h .mi { font-size: 20px; display: none; }
.tb-h .mi.on { display: inline-block; }
.tb-sub { font-size: 12.5px; color: var(--app-muted); margin: 2px 0 6px; }
.tb-pie { width: 150px; height: 150px; margin: 6px auto 10px; }
.tb-pie path { stroke: var(--app-surface); stroke-width: 1.5; transition: opacity .3s; }
.tb-legend { display: grid; gap: 7px; }
.tb-row { display: grid; grid-template-columns: 16px 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; }
.tb-row i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--app-surface); box-shadow: 0 0 0 1px var(--app-border); }
.tb-row .d { font-weight: 600; font-variant-numeric: proportional-nums; }
.tb-row .p { font-size: 11px; color: var(--app-muted); padding: 2px 7px; border-radius: 8px; }
.tb-row.hl { font-weight: 600; }
/* Routine progress bar */
.rt-bar { margin: 0 14px 8px; height: 4px; border-radius: 2px; background: var(--app-ring); overflow: hidden; }
.rt-bar b { display: block; height: 100%; width: 0; background: var(--app-green); transition: width .45s var(--ease); }


:root { --tb-task: #1E2830; --tb-unlogged: #E0E0E0; }
@media (prefers-color-scheme: dark) { :root { --tb-task: #8A99A1; --tb-unlogged: #3A444B; } }
/* Search filtering */
.sd-list .ai { max-height: 120px; transition: max-height .35s var(--ease), opacity .25s, padding .35s var(--ease), margin .35s var(--ease), min-height .35s var(--ease), border-width .35s; }
.sd-list .ai.gone { max-height: 0; min-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; border-width: 0; }
.mini-app.tall { min-height: 380px; }
.mini-app[data-scene="searchdrag"] { padding-bottom: 72px; }
.score-wrap { margin-top: 16px; border-radius: 16px; padding: 12px; background: var(--app-surface); }

/* ---------- Triple tracking: auto-playing carousel ---------- */
.triple { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
@media (max-width: 900px) { .triple { grid-template-columns: minmax(0, 1fr); } }
.yardsticks { display: grid; gap: 8px; margin-top: 32px; }
.ys {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start;
  padding: 14px 16px 16px; border-radius: 16px; position: relative; overflow: hidden; transition: background-color .3s;
}
.ys:focus-visible { outline: 3px solid var(--clay-300); outline-offset: 2px; }
.ys:hover { background: var(--bg-tint); }
.ys { opacity: .66; transition: background-color .3s, opacity .3s, box-shadow .3s; }
.ys:hover { opacity: 1; }
.ys[aria-selected="true"] { opacity: 1; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ys[aria-selected="true"] > i { background: var(--accent); color: var(--surface); }
.ys[aria-selected="true"] b { color: var(--accent); }
.ys > i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); font-size: 20px; }
.ys b { display: block; font-size: 17px; }
.ys span { color: var(--text-2); font-size: 15px; }
.ys .ys-prog { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--border); opacity: 0; transition: opacity .3s; }
.ys .ys-prog::after { content: ""; position: absolute; inset: 0; background: var(--accent); border-radius: 2px; transform-origin: left; transform: scaleX(var(--p, 0)); }
.ys[aria-selected="true"] .ys-prog { opacity: 1; }

.stage { position: relative; }
.stage-screen { border-radius: 28px; padding: 18px 0 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
@media (min-width: 640px) { .stage-screen { zoom: 1.18; } }
.stage-top { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 8px; font-size: 13px; color: var(--app-muted); font-weight: 500; }
.stage-top b { color: var(--app-text); font-size: 16px; font-weight: 600; }
.stage-list { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.stage-list.out { opacity: 0; transform: translateY(8px); }
/* One caption block under the phone (phones only; desktop has the list beside it).
   Fixed height, so nothing below moves as the modes change. */
.stage-caption { display: none; transition: opacity .25s; }
.stage-caption b { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--text); }
.stage-caption span { display: block; margin-top: 6px; font-size: 16px; line-height: 1.4; color: var(--text-2); }
.stage-caption.out { opacity: 0; }
.stage-dots { display: none; justify-content: center; gap: 2px; margin-top: 10px; }
.stage-dots button { all: unset; cursor: pointer; padding: 10px 4px; display: inline-flex; }
.stage-dots button::after { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--border); transition: background-color .3s, width .3s; }
.stage-dots button.on::after { background: var(--accent); width: 22px; }
.stage-dots button:focus-visible { outline: 2px solid var(--clay-300); outline-offset: 0; border-radius: 6px; }
@media (max-width: 900px) {
  .stage { display: flex; flex-direction: column; }
  .stage-dots { display: flex; order: 1; margin-top: 8px; }
  .stage-caption { display: block; order: 2; height: 108px; margin-top: 4px; overflow: hidden; }
  .triple-copy > .yardsticks { display: none; }
}
@media (max-width: 360px) { .stage-caption { height: 112px; } .stage-caption b { font-size: 20px; } .stage-caption span { font-size: 15px; } }
/* Fixed app screen: the list area is sized to the tallest mode. */
.stage-list { height: 232px; overflow: hidden; } /* the tallest mode (Time / time on anything) */
.stage-screen .tc { background: color-mix(in srgb, var(--app-canvas) 86%, transparent); }
.stage-screen .tc .film-cap { font-size: 23px; max-width: 12em; }
.tc-sub { display: block; margin-top: 10px; font-size: 15px; font-weight: 500; line-height: 1.35; letter-spacing: 0; color: var(--app-muted); }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.cell { border-radius: var(--r-card); padding: clamp(24px, 3vw, 36px); background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.cell h3 { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 12px; }
.cell p { color: var(--text-2); }
.cell-a { grid-column: span 4; background: var(--brand-band); border-color: transparent; color: var(--brand-band-text); }
.cell-a h3 { color: #fff; }
.cell-a p { color: rgb(239 234 226 / .78); }
.cell-b { grid-column: span 2; background: var(--accent-wash); border-color: transparent; }
.cell-d { grid-column: span 6; }
.cell-d .tpl-head { max-width: 720px; }
@media (max-width: 960px) { .cell-a, .cell-b { grid-column: span 6; } }
.timeline { margin-top: 28px; display: grid; gap: 10px; }
.tl-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; font-size: 13px; color: rgb(239 234 226 / .72); }
.tl-track { height: 30px; border-radius: 8px; background: rgb(255 255 255 / .06); position: relative; }
.tl-block { position: absolute; top: 0; bottom: 0; border-radius: 8px; display: flex; align-items: center; padding: 0 10px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.tl-plan { background: rgb(239 234 226 / .14); color: var(--cream); border: 1px dashed rgb(239 234 226 / .35); }
.tl-real { background: var(--coral); color: var(--slate-900); }
.score-pop { display: flex; align-items: baseline; gap: 10px; margin-top: 20px; }
.score-pop b { font-size: 44px; letter-spacing: -0.03em; color: var(--coral); }
.mult { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.mult div { background: var(--surface); border-radius: 14px; padding: 12px 14px; flex: 1 1 80px; text-align: center; }
.mult .stars { font-size: 16px; display: block; }
.mult b { display: block; font-size: 22px; letter-spacing: -0.02em; margin-top: 4px; color: var(--text); }
.tpl-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.pill i { font-size: 16px; }
.pill.pts { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.pct-big { font-size: clamp(64px, 8vw, 96px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: var(--text); margin: 18px 0 6px; }
.pct-big span { color: var(--success); }

/* ---------- Persistence band ---------- */
.band { background: var(--brand-band); color: var(--brand-band-text); }
.band h2, .band h3 { color: #fff; }
.band .lead { color: rgb(239 234 226 / .78); }
.band .eyebrow { color: var(--coral); }
.persist { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 960px) { .persist { grid-template-columns: 1fr; } }
.chart-card { background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .1); border-radius: var(--r-card); padding: clamp(20px, 3vw, 32px); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; margin-bottom: 18px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.year-grid { display: grid; grid-template-columns: repeat(52, 1fr); gap: 3px; }
.year-grid + .year-grid { margin-top: 14px; }
.wk { height: 64px; border-radius: 3px; background: rgb(255 255 255 / .07); position: relative; overflow: hidden; }
.wk b { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px; transform-origin: bottom; }
.grid-a .wk b { background: var(--slate-200); }
.grid-b .wk b { background: var(--coral); }
.reveal-chart .wk b { transform: scaleY(0); transition: transform .5s var(--ease); transition-delay: calc(var(--i) * 12ms); }
.reveal-chart.in .wk b { transform: scaleY(1); }
.row-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: rgb(239 234 226 / .78); }
.row-label { gap: 12px; }
.row-label b { color: #fff; font-size: 18px; font-weight: 600; white-space: nowrap; }
.persist-points { display: grid; gap: 18px; margin-top: 32px; }
.persist-points div { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.persist-points i { color: var(--coral); font-size: 22px; margin-top: 2px; }

/* ---------- Calendar ---------- */
.cal-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
@media (max-width: 900px) { .cal-split { grid-template-columns: 1fr; } }
.cal { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px; }
.cal-app { background: transparent; }
/* Where did my time go? (#20): the Time Breakdown sheet over the calendar, and the loop's fade */
.tl-sheet { padding: 8px 18px 20px; }
/* The Templates tab as a screen that slides over the calendar (#21) */
.tl-tpl { position: absolute; inset: 0; z-index: 5; padding: 14px 0 0; background: var(--app-canvas); transform: translateX(104%); transition: transform .38s var(--ease); }
.tl-tpl.open { transform: none; }
.tl-tpl-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 16px 8px; }
.tl-tpl-h b { font-size: 18px; font-weight: 700; }
.tl-tpl-t { font-size: 13px; font-weight: 600; color: var(--app-muted); font-variant-numeric: proportional-nums; }
.tl-tpl .tpl-cards { padding: 0; border: 0; border-radius: 0; background: transparent; }
.tl-sheet .tb-pie { width: 140px; height: 140px; }
.cal-app { transition: opacity .35s var(--ease); }
.cal.cal-out .cal-app { opacity: 0; }
@media (min-width: 901px) { .tl-split { grid-template-columns: 1fr 1fr; } }
/* Captions between the shots (#19): a card over the paused, dimmed calendar */
.cal .tc { background: color-mix(in srgb, var(--surface) 84%, transparent); }
.cal .tc .film-cap { font-size: clamp(24px, 2.4vw, 30px); max-width: 11em; }
@media (prefers-reduced-motion: reduce) { .cal .tc, .cal .tc * { transition: none !important; animation: none !important; } }

/* Shared day calendar (scenes.js DayCal), copied from the app's Calendar tab:
   lib/features/Calendar/calendar_page_ui.dart + Event_tiles/calendar_event_tile.dart */
.dc { position: relative; overflow: hidden; background: var(--app-canvas); border: 1px solid var(--app-border); border-radius: 16px; }
.dc-head { padding: 6px 10px 9px; border-bottom: 1px solid var(--app-border); }
.dc-date { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 7px; font-size: 14px; }
.dc-date b { font-weight: 700; }
.dc-date .mi { font-size: 22px; }
.dc-tabs { display: flex; padding: 3px; border-radius: 12px; background: var(--dc-line); }
.dc-tabs span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 4px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--app-sub); }
.dc-tabs span.on { background: var(--app-surface); color: var(--app-text); font-weight: 700; }
.dc-tabs .g { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.dc-tabs .g.plan { border: 1.5px dashed currentColor; }
.dc-tabs .g.done { background: currentColor; }
/* Planned-view conflict banner (calendar_overlap_ui.dart) */
.dc-warn { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.dc-warn.on { grid-template-rows: 1fr; }
.dc-warn > div { overflow: hidden; display: flex; align-items: center; gap: 10px; margin: 0 12px; padding: 0 12px; border-radius: 12px; background: color-mix(in srgb, var(--app-red) 8%, transparent); border: 0 solid color-mix(in srgb, var(--app-red) 35%, transparent); color: var(--app-red); transition: margin .35s var(--ease), padding .35s var(--ease); }
.dc-warn.on > div { margin: 10px 12px 4px; padding: 9px 12px; border-width: 1px; }
.dc-warn .mi { font-size: 22px; flex: none; }
.dc-warn span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dc-warn b { font-size: 13px; font-weight: 700; color: var(--app-text); }
.dc-warn small { font-size: 12px; font-weight: 500; color: var(--app-sub); }
/* Hour gutter + grid */
.dc-vp { position: relative; overflow: hidden; }
.dc.fixed { display: flex; flex-direction: column; }
.dc.fixed .dc-vp { flex: 1; min-height: 0; height: auto !important; }
.dc-day { position: relative; top: 10px; display: grid; grid-template-columns: 54px minmax(0, 1fr); }
.dc-gut { position: relative; }
.dc-gut span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; font-weight: 500; color: var(--app-sub); white-space: nowrap; }
.dc-grid { position: relative; border-left: 1px solid var(--dc-line); margin-right: 8px; }
.dc-grid > i { position: absolute; left: 0; right: 0; border-top: 1px solid var(--dc-line); }
.dc-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--dc-now); z-index: 3; }
.dc-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--dc-now); }
/* Blocks. Fill and outline alphas are the app's (light / dark). */
.dc-b { --c: 0; --n: 1; --fill: 22%; --line: 55%; --edge: var(--cat); position: absolute; top: 0;
  left: calc(var(--c) * 100% / var(--n) + 3px); width: calc(100% / var(--n) - 5px); border-radius: 6px; overflow: hidden;
  background-color: color-mix(in srgb, var(--cat) var(--fill), transparent);
  opacity: 0; transform: scale(.96); transition: top .45s var(--ease), left .35s var(--ease), width .35s var(--ease), opacity .4s, transform .4s var(--ease); }
.dc-b.in { opacity: 1; transform: none; }
.dc-b.out { opacity: 0; transform: translateX(30%); }
.dc-b.done { border: 1px solid color-mix(in srgb, var(--cat) var(--line), transparent); }
.dc-b.done.tpl { --fill: 12%; --line: 35%; }
.dc-b.plan { --fill: 5%; --edge: color-mix(in srgb, var(--cat) 55%, transparent); border: 1.5px dashed color-mix(in srgb, var(--cat) 75%, transparent); }
.dc-b.plan.tpl { border-color: color-mix(in srgb, var(--cat) 45%, transparent); }
.dc-b.clash { border: 2px solid var(--app-red); background-image: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--app-red) 18%, transparent) 0 3px, transparent 3px 10px); }
.dc-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--edge); }
.dc-b.tpl .dc-edge { left: .75px; width: 2.5px; background: repeating-linear-gradient(to bottom, var(--edge) 0 3px, transparent 3px 10px); }
.dc-l { position: absolute; left: 8px; right: 4px; top: 3px; color: color-mix(in srgb, var(--cat) var(--dc-ink-mix), var(--dc-ink-base)); line-height: 1.25; }
.dc-b.tpl .dc-l { opacity: .82; }
.dc-l b { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; min-width: 0; }
.dc-l b > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dc-l b .mi { font-size: 12px; flex: none; }
.dc-l small { display: block; font-size: 10px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-short { display: none; }
/* "Grows into place": a logged block wipes in down to the live-time line. */
.dc-b.grow { opacity: 1; transform: none; clip-path: inset(100% 0 0 0 round 6px); transition: clip-path .6s var(--ease); }
.dc-b.grow.in { clip-path: inset(0 0 0 0 round 6px); }
/* Selection (calendar_event_tile.dart): outline, move grip, resize knobs, live time badge */
.dc-b.sel { z-index: 2; overflow: visible; }
.dc-b.drag { z-index: 4; transition: left .35s var(--ease), width .35s var(--ease), opacity .4s; }
.dc-sel { position: absolute; inset: -1.5px; border: 2px solid var(--dc-sel); border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.dc-b.clash .dc-sel { inset: -2px; }
.dc-b.sel .dc-sel { opacity: 1; }
.dc-sel i { position: absolute; left: 50%; display: grid; place-items: center; background: var(--dc-sel); color: var(--dc-sel-on); border: 1.5px solid var(--dc-sel-on); }
.dc-sel .grip { top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; }
.dc-sel .grip .mi { font-size: 13px; }
.dc-sel .hd { width: 40px; height: 13px; margin-left: -20px; border-radius: 7px; }
.dc-sel .hd .mi { font-size: 11px; }
.dc-sel .hd.top { top: -7px; }
.dc-sel .hd.bot { bottom: -7px; }
.dc-sel .badge { position: absolute; right: 4px; top: 2px; padding: 2px 6px; border-radius: 4px; background: var(--dc-sel); color: var(--dc-sel-on); font: 600 10px/1.3 var(--font); font-style: normal; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.dc-b.drag .badge { opacity: 1; }
/* A finger held down during a drag */
.app-finger { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: var(--app-touch); border: 2px solid color-mix(in srgb, var(--app-touch) 100%, var(--app-text) 30%); pointer-events: none; z-index: 9; opacity: 0; transform: scale(1.4); transition: opacity .2s, transform .25s var(--ease); }
.app-finger.on { opacity: 1; transform: scale(.9); }
/* Queue card peek used for "Schedule for tomorrow" */
.dc-peek { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 8px 0 10px; background: var(--app-canvas); border-top: 1px solid var(--app-border); border-radius: 16px 16px 0 0; transform: translateY(105%); transition: transform .38s var(--ease); }
.dc-peek.open { transform: none; }
.dc-peek-h { display: flex; align-items: center; gap: 6px; padding: 0 16px 4px; font-size: 13px; font-weight: 600; }
.dc-peek-h .mi { font-size: 18px; }
.dc-peek-h small { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--app-muted); }

/* Calendar section tabs (same look as the triple-tracking yardsticks) */

/* Calendar entry sheets: "Log Time" (solid slate header) and "Plan a Task" (outlined) */
.lt-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--app-surface); border-top: 1px solid var(--app-border); border-radius: 16px 16px 0 0; overflow: hidden; transform: translateY(105%); transition: transform .38s var(--ease); }
.lt-sheet.open { transform: none; }
.lt-h { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--app-header); color: var(--lt-on); font-size: 15px; font-weight: 700; }
.lt-h .mi { font-size: 20px; }
.lt-h.plan { background: transparent; color: var(--app-text); }
.lt-h { border-bottom: 1px solid var(--app-border); }
.lt-body { padding: 12px 14px 14px; display: grid; gap: 9px; }
.lt-field { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--app-muted) 45%, transparent); border-radius: 10px; font-size: 13.5px; min-height: 40px; }
.lt-field .mi { font-size: 18px; color: var(--app-muted); }
.lt-field .q:empty::before { content: "Search tasks, habits, templates…"; color: var(--app-muted); }
.lt-field .caret { width: 1.5px; height: 16px; background: var(--app-header); animation: blink 1s steps(1) infinite; margin-left: -6px; }
.lt-create { display: none; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 10px; border: 1px solid var(--app-border); border-radius: 10px; font-size: 12px; color: var(--app-sub); }
.lt-create.on { display: flex; }
.lt-sheet.is-task .lt-create { display: none; }
.lt-create > .mi { font-size: 16px; }
.lt-create .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-create .lbl b { font-weight: 600; color: var(--app-text); }
.lt-create .kinds { display: flex; gap: 5px; }
.lt-sheet { container-type: inline-size; }
/* Below 420px the app puts the buttons under the label */
@container (max-width: 419px) { .lt-create .lbl { flex-basis: calc(100% - 24px); } .lt-create .kinds { padding-left: 22px; } }
.lt-create .kinds i { display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border: 1px solid var(--app-border); border-radius: 8px; font-style: normal; font-weight: 600; }
.lt-create .kinds .mi { font-size: 13px; }
.lt-note { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--app-sub); }
.lt-note .mi { font-size: 14px; }
.lt-sheet.is-task .lt-note { display: flex; }
.lt-times { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.lt-times .tb { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--app-border); border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.lt-times .tb .mi { font-size: 14px; color: var(--app-muted); }
.lt-times .dur { padding: 6px 12px; border-radius: 999px; background: var(--dc-line); font-size: 12.5px; font-weight: 700; }
.lt-cat { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--app-border); border-radius: 10px; font-size: 13.5px; }
.lt-cat i { width: 12px; height: 12px; border-radius: 50%; background: var(--cat); }
.lt-cat .mi { margin-left: auto; color: var(--app-muted); }
.lt-check { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 10px; background: var(--app-canvas); font-size: 13.5px; }
.lt-check .cb { width: 18px; height: 18px; }
.lt-btn { padding: 11px; border-radius: 999px; background: var(--app-header); color: var(--lt-on); text-align: center; font-size: 14px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .lt-btn { background: var(--cta-bg); color: var(--cta-text); } }
/* Tasks list over the calendar ("Recent Completions") */
.lt-tasks { position: absolute; inset: 0; z-index: 7; padding: 10px 0; background: var(--app-canvas); transform: translateX(102%); transition: transform .4s var(--ease); }
.lt-tasks.open { transform: none; }
.lt-tasks-h { padding: 4px 16px 6px; font-size: 17px; font-weight: 700; }
/* /features calendar minis + templates with their card tools */
.cal-mini { position: relative; margin-top: 18px; background: transparent; }
.tpl-cards.tools .ai-tools { display: flex; }
/* Templates demo: template cards beside the Completed day view */
.tpl-demo { margin-top: 22px; background: transparent; container-type: inline-size; }
.tpl-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tpl-cards { position: relative; overflow: hidden; padding: 4px 0 66px; border-radius: 16px; background: var(--app-canvas); border: 1px solid var(--app-border); }
.tpl-cards .ai { min-height: 62px; padding-top: 6px; padding-bottom: 6px; }
.tpl-cards .ai-stripe { min-height: 44px; }
.tpl-cards .ai-tools { display: none; }
.tpl-split.stacked .tpl-cards { padding-bottom: 6px; }
.tpl-split.stacked .ai { min-height: 54px; margin-top: 3px; margin-bottom: 3px; padding-top: 3px; padding-bottom: 3px; }
.tpl-split.stacked .ai-stripe { min-height: 38px; }
.tpl-split.stacked .ai-quick { height: 40px; }
@container (min-width: 640px) {
  .tpl-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
}
@container (max-width: 420px) {
  .dc-day { grid-template-columns: 46px minmax(0, 1fr); }
  .dc-gut span { font-size: 10.5px; right: 6px; }
}
.cal-app { container-type: inline-size; }
@container (max-width: 470px) {
  .has-short .t-full { display: none; }
  .has-short .t-short { display: inline; }
  .dc-day { grid-template-columns: 46px minmax(0, 1fr); }
  .dc-gut span { font-size: 10.5px; right: 6px; }
}
@media (prefers-color-scheme: dark) {
  .dc-b { --fill: 32%; --line: 65%; }
  .dc-b.done.tpl { --fill: 20%; --line: 45%; }
  .dc-b.plan { --fill: 8%; }
}
.check-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.check-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--text-2); }
.check-list li i { color: var(--accent); font-size: 20px; margin-top: 3px; }
.check-list li b { color: var(--text); }



/* ---------- Animated section details ---------- */
/* Time Bonus timeline */
.tl-real { width: 22%; transition: none; }
.tb-pts { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 8px 14px; border-radius: 999px; background: rgb(232 142 94 / .16); color: var(--coral); font-weight: 700; font-size: 14px; opacity: 0; transform: translateY(6px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.tb-pts.on { opacity: 1; transform: none; }
/* Priority multiplier tiles */
.mult div { transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .35s; }
.mult div.on { transform: translateY(-4px); box-shadow: 0 10px 22px -10px rgb(166 82 46 / .55); }
.mult div.on b { color: var(--accent); }
.cell-b .mini-app { margin-top: 20px; background: var(--app-canvas); border: none; padding: 6px 0; }
.cell-b .ai { margin: 0 6px; }
.cell-b .ai-tools { display: none; }
.cell-b .ai-stars .mi { font-size: 18px; }

/* Time Bonus comparison (homepage tile) */
/* Time Bonus tile (home #fair-scoring): one task, planned 30m, runs to 3h.
   The cell sits on the slate brand band in both themes, so text uses cream. */
.tbv { --tbv-ink: var(--brand-band-text); --tbv-soft: color-mix(in srgb, var(--brand-band-text) 72%, transparent); --tbv-faint: color-mix(in srgb, var(--brand-band-text) 14%, transparent); margin-top: 26px; }
.tbv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-size: 15px; }
.tbv-task { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--tbv-ink); min-width: 0; }
.tbv-box { flex: none; width: 22px; height: 22px; border-radius: 4px; border: 2px solid var(--coral); display: grid; place-items: center; color: transparent; transition: background-color .25s, color .25s; }
.tbv-box .mi { font-size: 17px; }
.tbv-box.on { background: var(--coral); border-color: var(--coral); color: var(--slate-800); }
/* Planned vs Actual: same style and size; the actual value has a fixed width so it never shifts, and turns accent once it passes the plan. */
.tbv-pair { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; font-size: 15px; color: var(--tbv-soft); }
.tbv-stat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tbv-stat .mi { font-size: 18px; color: var(--tbv-soft); transition: color .3s; }
.tbv-stat b { display: inline-block; font-size: 17px; font-weight: 700; color: var(--tbv-ink); font-variant-numeric: tabular-nums; transition: color .3s; }
.tbv-actual b { width: 4.3em; }
.tbv-actual.over b, .tbv-actual.over .mi { color: var(--coral); }
@media (max-width: 400px) { .tbv-k { display: inline-block; min-width: 4.1em; } }
.tbv-track { position: relative; height: 12px; border-radius: 6px; background: var(--tbv-faint); margin-top: 20px; }
.tbv-plan { position: absolute; left: 0; top: -3px; bottom: -3px; width: 16.667%; border: 1.5px dashed color-mix(in srgb, var(--brand-band-text) 55%, transparent); border-radius: 7px; }
.tbv-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; background: var(--coral); }
.tbv-mark { position: absolute; left: 16.667%; top: -7px; bottom: -7px; width: 2px; margin-left: -1px; background: var(--brand-band-text); }
.tbv-tick { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; border-radius: 1px; background: color-mix(in srgb, var(--brand-band-text) 30%, transparent); transition: background-color .3s; }
.tbv-tick.passed { background: var(--slate-800); }
.tbv-scale { position: relative; height: 18px; margin-top: 8px; font-size: 12px; color: var(--tbv-soft); font-variant-numeric: proportional-nums; }
.tbv-scale span { position: absolute; top: 0; transform: translateX(-50%); }
.tbv-scale span:first-child { transform: none; }
.tbv-scale span:last-child { transform: translateX(-100%); }
.tbv-total { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin-top: 18px; padding: 12px 18px; border-radius: 14px; background: color-mix(in srgb, var(--brand-band-text) 6%, transparent); transition: background-color .4s; }
.tbv-total b { font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; color: var(--tbv-ink); font-variant-numeric: proportional-nums; transition: color .3s; }
.tbv-total em { font-style: normal; font-size: 15px; color: var(--tbv-soft); }
.tbv-total small { flex-basis: 100%; font-size: 13px; color: var(--tbv-soft); }
.tbv-total.over { background: color-mix(in srgb, var(--coral) 16%, transparent); }
.tbv-total.over b { color: var(--coral); }
.tbv-total.pulse b { animation: tbv-pulse .55s var(--ease); }
@keyframes tbv-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
.tbv-total b { display: inline-block; transform-origin: left 70%; }
.cell-a .tbv-most { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: var(--tbv-faint);
  font-size: clamp(17px, 1.8vw, 20px); font-weight: 700; line-height: 1.35; color: var(--tbv-ink); opacity: 0; transition: opacity .5s; }
.tbv-most.on { opacity: 1; }
.tbv-most strong { color: var(--coral); }
.cell-a .tbv-more { margin-top: 20px; font-size: 15px; }
.tbv-more a { color: var(--brand-band-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--coral) 70%, transparent); text-underline-offset: 3px; }
.tbv-more a:hover { color: var(--coral); }
@media (prefers-reduced-motion: reduce) { .tbv-total.pulse b { animation: none; } }
/* Big donut in the completion cell */
.donut.big { width: 150px; height: 150px; margin: 22px 0 10px; }
.donut.big circle { stroke-width: 16; }
.donut.big span { font-size: 34px; letter-spacing: -0.03em; font-family: var(--font); font-weight: 600; color: var(--text); }
/* Template pills: staggered in, and the self-care one flips to earning points */
.js .cell-d .pill { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease), color .4s, border-color .4s, background-color .4s; transition-delay: calc(var(--i, 0) * 120ms); }
.js .cell-d.in .pill { opacity: 1; transform: none; }
.pill.flip.pts { background: var(--accent-wash); }


/* ---------- Feature list ("Also in Thrive", under the compare table) ---------- */
.feat { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 16px 0; }
.feat + .feat { border-top: 1px solid var(--border); }
.feat > i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-sand); color: var(--text); font-size: 22px; }
.feat b { display: block; font-size: 17px; margin-bottom: 2px; }
.feat span { color: var(--text-2); font-size: 15px; }

/* ---------- Compare ---------- */
.compare-wrap { margin-top: 48px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 15px; }
.compare th, .compare td { padding: 16px 18px; text-align: center; }
.compare thead th { font-size: 14px; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); vertical-align: bottom; }
.compare thead th.us { color: var(--accent); font-size: 16px; font-weight: 700; }
.compare tbody th { text-align: left; font-weight: 600; }
.compare tbody tr:nth-child(even) { background: var(--bg-tint); }
.compare td { color: var(--text-2); }
.compare td.us { color: var(--text); font-weight: 700; background: color-mix(in srgb, var(--accent-wash) 70%, transparent); }
.compare-note { font-size: 13px; color: var(--text-3); margin-top: 14px; }
.also { margin-top: clamp(48px, 7vw, 72px); }
.also h3 { font-size: 22px; }
.also-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; margin-top: 12px; }
.also-grid .feat + .feat { border-top: 0; }
@media (max-width: 900px) { .also-grid { grid-template-columns: minmax(0, 1fr); } .also-grid .feat + .feat { border-top: 1px solid var(--border); } }
.also-more { margin-top: 20px; font-weight: 700; }

/* Mid-page early-access prompt (end of the persistence band) */
.mid-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: clamp(40px, 6vw, 64px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid color-mix(in srgb, var(--brand-band-text) 14%, transparent); }
.mid-cta p { font-size: 19px; font-weight: 600; color: var(--brand-band-text); }
.mid-cta p span { display: inline-block; }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 80px); }
@media (max-width: 900px) { .faq-grid { grid-template-columns: 1fr; } }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-child { border-top: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; font-weight: 700; font-size: 18px; position: relative; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: translateY(-75%) rotate(45deg); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq .ans { padding: 0 0 24px; color: var(--text-2); max-width: 65ch; }
.faq .ans p + p { margin-top: 12px; }

/* ---------- Signup ---------- */
.signup { background: var(--brand-band); color: var(--brand-band-text); border-radius: 28px; padding: clamp(36px, 6vw, 72px); display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; position: relative; overflow: hidden; }
.signup::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 380px; height: 380px; background: url("/assets/img/thrive-symbol-on-dark.svg") no-repeat center / contain; opacity: .08; pointer-events: none; }
.signup h2 { color: #fff; }
.signup .lead { color: rgb(239 234 226 / .8); margin-top: 16px; }
@media (max-width: 900px) { .signup { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 400px) { .signup { padding: 32px 22px; } }
/* Very small phones: long buttons (e.g. the support email) wrap instead of pushing the page sideways */
@media (max-width: 380px) { .btn:not(.nav-cta) { max-width: 100%; white-space: normal; text-align: center; line-height: 1.25; padding-top: 10px; padding-bottom: 10px; } }
.form { position: relative; z-index: 1; }
.form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; color: #fff; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form input[type="email"] {
  flex: 1 1 220px; min-height: 54px; border-radius: 999px; border: 1.5px solid rgb(239 234 226 / .35); background: rgb(255 255 255 / .08);
  color: #fff; padding: 0 22px; font: 500 16px var(--font);
}
.form input[type="email"]::placeholder { color: rgb(239 234 226 / .7); }
.form input[type="email"]:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px rgb(232 142 94 / .25); }
.form .btn-primary { background: var(--coral); color: var(--slate-900); min-height: 54px; box-shadow: none; }
.form .btn-primary:hover { background: #F0A57D; }
.form .help { font-size: 14px; color: rgb(239 234 226 / .75); margin-top: 12px; }
.form .msg { font-size: 15px; margin-top: 12px; min-height: 24px; }
.form .msg.err { color: #FFB4A8; }
.form .msg.ok { color: #A8E0B8; font-weight: 600; }
.hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 64px 0 40px; margin-top: clamp(72px, 10vw, 128px); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: span 2; } }
.foot-brand p { color: var(--text-2); margin-top: 16px; max-width: 34ch; }
.site-footer h4 { font-size: 14px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 14px; }

/* ---------- Inner pages ---------- */
.page-hero { padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 5vw, 56px); }
.page-hero .lead { margin-top: 20px; }
.crumbs { font-size: 14px; color: var(--text-3); margin-bottom: 18px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.toc a { text-decoration: none; color: var(--text); }
.fsec { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--border); }
.fsec-grid { display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 5vw, 72px); }
@media (max-width: 900px) { .fsec-grid { grid-template-columns: 1fr; } }
.fsec-grid aside { position: sticky; top: 100px; align-self: start; }
@media (max-width: 900px) { .fsec-grid aside { position: static; } }
.fsec-grid aside h2 { font-size: clamp(26px, 3vw, 34px); }
.fsec-grid aside p { color: var(--text-2); margin-top: 14px; }
.fitems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .fitems { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 901px) and (max-width: 1180px) { .fitems { grid-template-columns: minmax(0, 1fr); } }
.fitem { border: 1px solid var(--border); border-radius: var(--r-card); padding: 26px; background: var(--surface); }
@media (max-width: 420px) { .fitem { padding: 22px 18px; } }
.fitem.wide { grid-column: 1 / -1; background: var(--bg-tint); }
.fitem > i { font-size: 26px; color: var(--accent); }
.fitem h3 { font-size: 20px; margin: 14px 0 8px; }
.fitem p { color: var(--text-2); font-size: 16px; }
.fitem p + p { margin-top: 10px; }
/* "Fair by design" (/features #fair-by-design): two rules, each with a small static diagram. */
.fitem.fair { container-type: inline-size; }
.fair-rules { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; }
@container (min-width: 640px) { .fair-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fr { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 18px; display: flex; flex-direction: column; }
.fr h4 { font-size: 16px; line-height: 1.35; margin: 0 0 14px; }
.fitem .fr p { font-size: 15px; margin-top: 12px; }
.fr-viz { min-height: 128px; display: flex; flex-direction: column; justify-content: flex-end; }
.fr-bars { display: flex; align-items: flex-end; gap: 6px; height: 96px; }
.fr-bar { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.fr-bar i { display: block; height: calc(var(--h) * .72); border-radius: 5px 5px 2px 2px; border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); background: linear-gradient(to top, var(--accent) calc(var(--f) * 100%), transparent 0); }
.fr-bar:first-child i { background: var(--text-2); border-color: var(--text-2); }
.fr-bar b { font-size: 12px; font-weight: 600; text-align: center; color: var(--text); font-variant-numeric: proportional-nums; margin-bottom: 4px; white-space: nowrap; }
.fr-bar small { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.fr-sum { margin-top: 26px !important; font-size: 14px !important; color: var(--text-2); }
.fr-sum b { color: var(--accent); font-size: 16px; }
.fr-cap { margin-top: 16px !important; font-size: 15px !important; }
.fitem .eg { margin-top: 14px; font-size: 15px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--bg-sand); color: var(--text); }
.fitem.wide .eg { background: var(--surface); }

.goals-cards { align-items: start; }
.goal-reminder-cards { display: grid; gap: 16px; }
.goal-sample { margin: 18px 0 0; padding: 0; background: var(--bg-tint); }
.goal-sample-header { padding: 16px; background: var(--slate-800); color: #F2F4F5; }
.goal-sample-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.goal-sample-label i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgb(242 244 245 / .12); font-size: 17px; }
.goal-sample-header h4 { margin: 12px 0; color: inherit; font-size: 24px; text-wrap: wrap; }
.goal-sample-deadline { display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.45; }
.goal-sample-countdown { display: grid; align-content: center; flex: 0 0 62px; height: 62px; border: 3px solid rgb(242 244 245 / .2); border-top-color: var(--clay-300); border-radius: 50%; text-align: center; font-size: 11px; line-height: 1.2; }
.goal-sample-countdown strong { font-size: 20px; }
.goal-sample-plan { display: grid; gap: 14px; margin: 0; padding: 16px; }
.goal-sample-plan > div { position: relative; padding-left: 30px; }
.goal-sample-plan dt { font-size: 15px; font-weight: 700; line-height: 1.4; }
.goal-sample-plan dt span { position: absolute; left: 0; color: var(--accent); font-size: 16px; font-variant-numeric: tabular-nums; }
.goal-sample-plan dd { margin: 4px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.45; }

.prose { font-size: 18px; line-height: 1.75; color: var(--text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(26px, 3vw, 32px); margin-top: 2em; }
.prose h3 { font-size: 22px; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--clay-500); font-size: 21px; line-height: 1.5; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.prose .callout { background: var(--bg-tint); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px 26px; font-size: 17px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text-2); font-size: 14px; }
.post-meta { color: var(--text-3); font-size: 15px; margin-top: 18px; }
.post-cta { margin-top: 56px; padding: 32px; border-radius: var(--r-card); background: var(--accent-wash); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.post-cta p { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; max-width: 30ch; }

.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 760px) { .posts { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-card); padding: 30px; text-decoration: none; color: var(--text); background: var(--surface); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card:first-child { grid-column: 1 / -1; background: var(--bg-sand); border-color: transparent; padding: clamp(30px, 4vw, 48px); }
.post-card:first-child h2 { font-size: clamp(26px, 3vw, 36px); }
.post-card h2 { font-size: 22px; margin-bottom: 12px; }
.post-card p { color: var(--text-2); }
.post-card .more { margin-top: auto; padding-top: 20px; color: var(--accent); font-weight: 700; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }

.manifesto-quote { font-size: clamp(28px, 3.6vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.18; max-width: 22ch; }

/* ---------- Reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .film-visual { animation: rise 1.1s var(--ease) both; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-chart .wk b { transform: none; transition: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Comeback ring (shared by the score charts) ----------
   Copied from the app's cumulative chart: accent ring r7, gap r5, dot r3.5.
   It pulses three times as it appears, then settles into a slow, faint pulse. */
.cring { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--app-comeback); opacity: 0; transform: scale(.3); transition: opacity .3s, transform .45s var(--ease); z-index: 2; pointer-events: none; }
.cring::before { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--app-comeback-gap); }
.cring i { position: absolute; inset: 3.5px; border-radius: 50%; background: var(--app-line); }
.cring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--app-comeback); opacity: 0; }
.cring.on { opacity: 1; transform: none; }
.cring.on::after { animation: cbPop .9s ease-out 3, cbIdle 3.6s ease-out 2.7s infinite; }
@keyframes cbPop { from { transform: scale(1); opacity: .75; } to { transform: scale(2.7); opacity: 0; } }
@keyframes cbIdle { 0% { transform: scale(1); opacity: .32; } 55%, 100% { transform: scale(2); opacity: 0; } }

/* ---------- Persistence chart: A, then B, then the verdict ---------- */
.chart-card.seq .wk b, .chart-card.seq.in .wk b { transform: scaleY(0); transition: transform .35s var(--ease); transition-delay: 0s; }
.chart-card.seq .wk.on b { transform: scaleY(1); }
.chart-card.seq .wk { transition: background-color .3s; }
.chart-card.seq .wk.past { background: rgb(255 255 255 / .11); }
.year-grid, .chart-card .row-label { transition: opacity .6s var(--ease); }
.chart-card .mute { opacity: .3; }
.persist-cap { margin: 18px 0 0; min-height: 1.4em; font-size: 16px; font-weight: 700; color: var(--brand-band-text); transition: opacity .35s; }
.persist-cap.hide { opacity: 0; }
.persist-cap em { font-style: normal; color: var(--coral); }

/* ---------- Weekly catch-up (#13) ---------- */
.cu { margin-top: clamp(48px, 7vw, 88px); }
.cu-head { max-width: 640px; }
.cu-head p { color: rgb(239 234 226 / .78); margin: 12px 0 0; font-size: 17px; }
.cu-stage { margin-top: 28px; }
.cu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .cu-grid { grid-template-columns: 1fr; } }
.cu-pan { border-radius: 16px; padding: 16px; min-width: 0; }
.cu-tag { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--font); padding: 6px 10px 6px 8px; border-radius: 999px; }
.cu-tag i { width: 7px; height: 7px; border-radius: 50%; }
.cu-typ { background: var(--typ-bg); color: var(--typ-text); font-family: var(--font); border: 1px solid var(--typ-line); }
.cu-typ .cu-tag { background: var(--typ-surface); color: var(--typ-sub); border: 1px solid var(--typ-line); }
.cu-typ .cu-tag i { background: var(--typ-mark); }
.cu-tname { margin-top: 18px; font-size: 15px; font-weight: 600; }
.cu-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 16px; }
.cu-dots span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--typ-sub); }
.cu-dots i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--typ-mark); transition: background-color .3s, border-color .3s, transform .3s var(--ease); }
.cu-dots i .mi { font-size: 16px; opacity: 0; transition: opacity .2s; }
.cu-dots i.miss { border-style: solid; }
.cu-dots i.miss .mi { opacity: 1; color: var(--typ-sub); }
.cu-dots i.hit { border-style: solid; border-color: var(--typ-mark); background: var(--typ-mark); }
.cu-dots i.hit .mi { opacity: 1; color: var(--typ-surface); }
.cu-res { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--typ-line); }
.cu-res b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: proportional-nums; }
.cu-res small { font-size: 13px; color: var(--typ-sub); font-variant-numeric: proportional-nums; }
.cu-thr { background: var(--app-canvas); border: 1px solid var(--app-border); }
.cu-thr .cu-tag { background: var(--app-surface); color: var(--app-text); border: 1px solid var(--app-border); font-family: var(--font); }
.cu-thr .cu-tag i { background: var(--app-comeback); }
/* Day columns against a dashed daily line, like the app's week signature:
   ink up to the line, accent above it, tall days capped. */
.cu-cols { position: relative; height: 92px; margin: 30px 4px 0; display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid color-mix(in srgb, var(--app-muted) 50%, transparent); }
.cu-share { position: absolute; left: 0; right: 0; bottom: 55%; border-top: 1px dashed color-mix(in srgb, var(--app-muted) 60%, transparent); }
.cu-share span { position: absolute; left: 0; bottom: 3px; font-size: 10px; color: var(--app-muted); }
.cu-col { position: relative; }
.cu-col b { position: absolute; left: 50%; width: 18px; margin-left: -9px; display: block; }
.cu-col .base { bottom: 0; height: 0; background: var(--app-text); border-radius: 0; }
.cu-col .over { bottom: 55%; height: 0; background: var(--app-comeback); border-radius: 4.5px 4.5px 0 0; }
.cu-col em { position: absolute; left: -6px; right: -6px; top: -16px; text-align: center; font-style: normal; font-size: 10px; font-weight: 600; color: var(--app-muted); opacity: 0; transition: opacity .3s; }
.cu-col.lit em { opacity: 1; }
.cu-dn { display: grid; grid-template-columns: repeat(7, 1fr); margin: 6px 4px 0; font-size: 11px; font-weight: 500; color: var(--app-muted); text-align: center; }
.cu-dn span.now { color: var(--app-text); font-weight: 700; }
.cu-thr .ai { margin: 14px 0 0; }
.cu-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 0 4px; font-family: var(--font); }
.cu-sum span { font-size: 13px; color: var(--app-sub); font-variant-numeric: proportional-nums; }
.cu-sum b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: proportional-nums; color: var(--app-text); transition: color .3s; }
.cu-sum.met b { color: var(--app-green); }
.cu-cap { margin: 20px 0 0; font-size: 17px; font-weight: 700; color: var(--brand-band-text); opacity: 0; transition: opacity .5s; }
.cu-cap.on { opacity: 1; }
.cu-cap em { font-style: normal; color: var(--coral); }

@media (prefers-reduced-motion: reduce) {
  .cring, .cring::after, .sc-call, .sc-lead, .sc-tag, .sc-cb { transition: none !important; animation: none !important; }
  .cu-pan *, .cu-cap { transition: none !important; }
}

/* ---------- No more overwhelm (home #overwhelm, #18): one caption-first film ---------- */
#overwhelm { border-top: 1px solid var(--border); }
.ow { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
@media (max-width: 900px) { .ow { grid-template-columns: minmax(0, 1fr); } }
.ow-side { max-width: 460px; width: 100%; margin: 0 auto; }
.ow-stage { --ow-note-font: "Caveat", "Segoe Print", "Bradley Hand", cursive; position: relative; container-type: inline-size; height: 560px; border-radius: 28px; overflow: hidden; border: 1px solid var(--border); background: var(--app-canvas); box-shadow: var(--shadow-lg); }
.ow-stage .tc { background: color-mix(in srgb, var(--surface) 84%, transparent); }
.ow-stage .tc .film-cap { font-size: clamp(24px, 2.4vw, 30px); max-width: 11em; }
.ow-stage .tc.ow-note-title .film-cap { max-width: 100%; overflow-wrap: anywhere; font: 700 clamp(32px, 3.6vw, 42px)/1.05 var(--ow-note-font); }
.ow-stage .tc.end { background: transparent; align-items: flex-end; padding-bottom: 96px; }

/* The handwritten list: everything, dated, mostly for later */
.owt { position: absolute; inset: 0; padding: 18px 14px 14px; background: var(--typ-bg); color: var(--typ-text); font: 600 19px/1.1 var(--ow-note-font); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.owt-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 6px 10px; }
.owt-h b { font-size: 24px; }
.owt-h small { font-size: 16px; color: var(--typ-sub); }
.owt-list { position: relative; list-style: none; margin: 0; padding: 0; background: var(--typ-surface); border: 1px solid var(--typ-line); border-radius: 12px; overflow: hidden; }
.owt-list li { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; height: 24.5px; padding: 0 8px; font-size: clamp(15px, 5.5cqi, 19px); border-top: 1px solid var(--typ-line); white-space: nowrap; transition: color .2s, opacity .3s; }
.owt-list li:first-child { border-top: 0; }
.owt-list .n { position: relative; min-width: 0; padding-inline-end: 3px; overflow: hidden; text-overflow: ellipsis; }
.owt-list .d { flex: none; margin-left: auto; padding-inline-end: 2px; font-size: clamp(13px, 4.6cqi, 16px); color: var(--typ-sub); font-variant-numeric: proportional-nums; }
/* the glance: a scan line runs down; "not today" gets crossed out, today's get a nod */
.owt-scan { position: absolute; left: 14px; right: 14px; top: 52px; height: 24px; z-index: 0; border-radius: 6px; background: color-mix(in srgb, var(--typ-mark) 28%, transparent); opacity: 0; transition: transform .12s linear, opacity .2s; pointer-events: none; }
.owt.scanning .owt-scan { opacity: 1; }
.owt-list .xm { flex: none; width: 14px; margin-left: -4px; display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .14s ease-out, transform .18s var(--ease); }
.owt-list .xm .mi { font-size: 14px; color: var(--typ-mark); }
.owt-list li.x { color: var(--typ-sub); }
.owt-list li.x .xm { opacity: 1; transform: none; }
.owt-list li.seen .n { font-weight: 700; }
/* ...and the one that mattered slips through */
.owt.missed li:not(.bill) { opacity: .35; }
.owt.missed li.bill { color: var(--app-red); font-weight: 700; background: color-mix(in srgb, var(--app-red) 9%, transparent); }
.owt.missed li.bill .d { color: var(--app-red); font-weight: 700; }

/* Thrive's Queue */
.ow-app { position: absolute; inset: 0; padding-top: 16px; opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.ow-stage.show-app .ow-app { opacity: 1; transform: none; }
.ow-stage.show-app .owt { opacity: 0; transform: scale(.97); }
.ow-app .app-sec[hidden] { display: none; }
.ow-date { display: inline-block; transition: opacity .25s, transform .25s var(--ease); }
.ow-date.flip { opacity: 0; transform: translateY(-6px); }
.ow-app .cbrow .cb.on, .ow-app .cbrow .cb.part { background: var(--app-header); border-color: var(--app-header); }
.ow-app .cbrow .cb.part::after { content: ""; position: static; width: 9px; height: 2px; border: 0; border-radius: 0; opacity: 1; background: var(--app-surface); }
@media (prefers-color-scheme: dark) { .ow-app .cbrow .cb.on, .ow-app .cbrow .cb.part { background: var(--clay-300); border-color: var(--clay-300); } }

/* The reminder, as a notification on the phone */
.ow-notes { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 5; pointer-events: none; }
.rr-note { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-14px) scale(.96); transition: opacity .35s var(--ease), transform .45s var(--ease); }
.rr-note.in { opacity: 1; transform: none; }
.rr-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--cta-bg); color: var(--cta-text); }
.rr-ic .mi { font-size: 19px; }
.rr-note div { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.rr-note small { font-size: 11.5px; color: var(--text-3); }
.rr-note b { font-size: 14px; }
.rr-note div > span { font-size: 13px; color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .ow-stage * { transition: none !important; animation: none !important; } }

/* ---------- Routines as habit stacking (home #routines) + /features routine run ---------- */
/* Routine page pieces shared by both scenes (routine_detail_page.dart, routine_progress_bar.dart) */
.rh { margin: 0 12px 6px; padding: 7px 8px 7px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--app-border); border-radius: 16px; background: linear-gradient(var(--app-card-a), var(--app-card-b)); color: var(--app-header); }
.rh > .mi { font-size: 22px; }
.rh b { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-edit { display: grid; place-items: center; width: 30px; height: 30px; color: var(--app-muted); }
.rh-edit .mi { font-size: 19px; }
.rh-n { min-width: 22px; padding: 3px 8px; border-radius: 12px; background: var(--app-header); color: #fff; font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: proportional-nums; }
@media (prefers-color-scheme: dark) { .rh { color: #D98A63; } .rh-n { background: #D98A63; color: #14191D; } }
.rp { padding: 2px 20px 8px; }
.rp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 6px; }
.rp-h b { font-weight: 600; color: var(--app-text); transition: color .3s; }
.rp-h b.ok { color: var(--app-green); }
.rp-h small { font-size: 12.5px; color: var(--app-muted); font-variant-numeric: proportional-nums; }
.rp .rt-bar { margin: 0; }
.ai.hs-new { animation: hs-new 1.6s var(--ease); }
@keyframes hs-new { 0%, 35% { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); } 100% { border-color: var(--app-border); box-shadow: none; } }

/* Home section: the Morning routine's own page, with title cards between the actions (#23) */
#routines { border-top: 1px solid var(--border); }
.hs { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.hs-side { order: -1; max-width: 420px; width: 100%; margin: 0 auto; }
@media (max-width: 900px) { .hs { grid-template-columns: minmax(0, 1fr); } .hs-side { order: 0; } }
.hs-stage { position: relative; height: 520px; border-radius: 28px; overflow: hidden; border: 1px solid var(--border); background: var(--app-canvas); box-shadow: var(--shadow-lg); }
.hs-detail { position: absolute; inset: 0; padding-top: 16px; }
.hs-list .ai { min-height: 64px; }
.hs-list .ai-sub:empty { display: none; }
/* Chips: the film's .ftag pill on each step's top edge. Already a habit = slate, New = clay. */
.hs-list { position: relative; }
.hs-chip { right: 22px; z-index: 3; font-size: 12.5px; }
.hs-chip.old { background: var(--film-tag-task); }
.hs-chip.new { background: var(--film-tag-habit); }
.hs-stage.is-tc:not(.hs-end) .hs-chip { opacity: 0; transition: opacity .2s; }
.hs-stage .tc { background: color-mix(in srgb, var(--surface) 84%, transparent); }
.hs-stage .tc .film-cap { font-size: clamp(24px, 2.4vw, 30px); max-width: 11em; }
.hs-stage .tc .tc-sub { font-size: 16px; }
.hs-stage .tc.end { background: transparent; align-items: flex-end; padding-bottom: 30px; }
.hs-stage .tc.end .film-cap { font-size: clamp(21px, 2vw, 25px); }

/* /features routine: Routines list card (routines_page_main.dart) and the routine page */
.mini-app[data-scene="routine"] { min-height: 430px; }
.rl, .rd { position: absolute; left: 0; right: 0; top: 10px; transition: transform .45s var(--ease), opacity .35s; }
.rd { transform: translateX(104%); opacity: 0; }
.mini-app.in-detail .rl { transform: translateX(-30%); opacity: 0; }
.mini-app.in-detail .rd { transform: none; opacity: 1; }
.rd .ai { min-height: 64px; }
.rd .ai-sub:empty { display: none; }
.rl-card { margin: 0 12px 10px; padding: 12px 2px 12px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--app-border); border-radius: 16px; background: var(--app-surface); }
.rl-card.dim { opacity: .55; }
.rl-card > .mi { font-size: 20px; color: var(--app-muted); }
.rl-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--app-text) 6%, transparent); }
.rl-ic .mi { font-size: 22px; }
.rl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rl-main b { font-size: 16px; font-weight: 600; }
.rl-main small { font-size: 12.5px; color: var(--app-muted); margin-top: 2px; }
.rl-strip { display: flex; gap: 3px; margin-top: 9px; }
.rl-strip i { flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--cat) 22%, transparent); overflow: hidden; }
.rl-strip i b { display: block; height: 100%; width: 0; background: var(--cat); transition: width .5s var(--ease); }
.rl-state { flex: none; }
.rl-start { display: inline-flex; align-items: center; gap: 2px; padding: 6px 11px 6px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--clay-600); background: color-mix(in srgb, var(--clay-600) 10%, transparent); }
.rl-start .mi { font-size: 16px; }
@media (prefers-color-scheme: dark) { .rl-start { color: var(--clay-300); background: color-mix(in srgb, var(--clay-300) 16%, transparent); } }
.rl-done { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--app-green); }
.rl-done .mi { font-size: 18px; }
.rl-pct { font-size: 17px; font-weight: 600; font-variant-numeric: proportional-nums; }

@media (max-width: 480px) {
  .hs-list .ai .ai-tools { display: none; }
  .hs-chip { right: 18px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hs *, .hs .tc, .hs .tc * { transition: none !important; animation: none !important; }
}

/* ---------- Home hero: the opening film (#16, website/scripts/hero-film.md) ----------
   One phone, one timeline (scenes.js SCENES.hero), Revision 6. The screen is
   laid out at a phone's width (412) and scaled to fit. Captions are title
   cards between the scenes (R6.8): the app holds still and dims, the caption
   stands alone over the dimmed phone, then clears before the action plays.
   The headline sits beside the phone on desktop and opens the film on mobile. */
.film { padding: clamp(24px, 3vw, 40px) 0 clamp(40px, 6vw, 72px); position: relative; overflow: hidden; }
.film-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); grid-template-areas: "side visual"; column-gap: clamp(32px, 5vw, 72px); align-items: start; }
.film-side { grid-area: side; padding-top: clamp(40px, 7vh, 96px); }
.film-visual { grid-area: visual; }
.film-head { margin: 0; font-size: clamp(42px, 4.8vw, 62px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; color: var(--text); text-wrap: balance; }
.film-head span { display: block; color: var(--accent); }
.film-cap { margin: 0; color: var(--text); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }
.film-capbar { display: none; }
.film.is-still .film-capbar { display: flex; flex-direction: column; gap: 8px; max-width: 372px; margin: 0 0 10px auto; padding: 0 6px; font-size: 21px; }
.film-capbar .film-cap { font-size: 1em; line-height: 1.12; letter-spacing: -0.02em; }
.film-capbar .film-head { display: none; }
.fc-in { display: block; animation: fcIn .2s var(--ease) backwards; transition: opacity .15s; }
.fc-in.out { opacity: 0; }
.fc-big { animation: none; }
.fc-w, .fc-l2 { display: inline-block; animation: fcIn .2s var(--ease) backwards; }
.fc-l2 { display: block; color: var(--accent); }
.fc-in { text-wrap: balance; }
@keyframes fcIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }


.film-phone { transition: transform .9s cubic-bezier(.45,0,.2,1); transform-origin: 50% 40%; }
/* A title card stands alone: the phone holds still and dims behind it */
.film-screen { transition: opacity .3s; }
.film.is-card .film-screen { opacity: .85; }
.film-screen { position: relative; height: clamp(560px, calc(100vh - 150px), 690px); display: block; }
.film-screen, .film-screen * { -webkit-tap-highlight-color: transparent; }
.fstage { position: absolute; left: 0; top: 0; width: 412px; height: 690px; transform-origin: 0 0; display: flex; flex-direction: column; background: var(--app-canvas); }
.film-band { display: none; flex-direction: column; justify-content: center; position: absolute; left: 11px; right: 11px; top: 11px; z-index: 2;
  opacity: 0; transition: opacity .2s, min-height .45s var(--ease); pointer-events: none; }
.film-band.on { opacity: 1; }
.film-band .film-cap { text-align: center; }
.film-band.card { display: flex; bottom: 11px; padding: 40px 24px; border-radius: 34px; background: color-mix(in srgb, var(--bg) 84%, transparent); }
.film-band.card .film-cap { font-size: 30px; }

/* Light header (home_app_bar.dart): menu · title (date above on the Queue) · Goal · timer */
.fh { flex: none; display: flex; align-items: center; height: 96px; padding: 40px 4px 0; background: var(--app-canvas); }
.fh > .mi { font-size: 24px; width: 48px; text-align: center; }
.fh-t { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.fh-t small { font-size: 12px; color: var(--app-muted); line-height: 1.1; }
.fh-t b { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15; }
.fh-goal { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 12px; margin-right: 2px; border: 1px solid var(--app-border); border-radius: 999px; font-size: 14px; font-weight: 600; }
.fh-goal .mi { font-size: 15px; color: var(--app-tab-on); }

.fbody { flex: 1; position: relative; overflow: hidden; }
.fcam { position: absolute; inset: 0; }
.fview { position: absolute; inset: 0; overflow: hidden; background: var(--app-canvas); transition: transform .42s var(--ease), opacity .3s; }
.fview.fade-in { animation: fFade .3s ease-out; }
.fview.fade-out { opacity: 0; }
@keyframes fFade { from { opacity: 0; } }
.fscroll { transition: transform .5s var(--ease); padding-bottom: 12px; }

/* Bottom bar (home_bottom_navigation_bar.dart): flat creation tabs, the Queue · Calendar island */
.fnav { flex: none; display: flex; align-items: center; height: 86px; padding-bottom: 14px; background: var(--app-surface); border-top: 1px solid var(--app-border); }
.ft { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--app-muted); }
.ft b { width: 50px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background-color .2s, color .2s; }
.ft b .mi { font-size: 22px; }
.ft em { font-style: normal; font-weight: 500; white-space: nowrap; max-width: 100%; overflow: hidden; }
.ft.on b { background: var(--app-tab-pill); color: var(--app-tab-on); }
.ft.on em { color: var(--app-text); font-weight: 700; }
.fisland { flex: none; position: relative; display: flex; gap: 4px; width: 168px; height: 56px; margin: 0 4px; padding: 4px; border-radius: 20px; background: var(--app-island); }
.fpill { position: absolute; left: 4px; top: 4px; width: 78px; height: 48px; border-radius: 16px; background: var(--app-island-pill); transition: transform .2s var(--ease), opacity .2s; }
.fisland.cal .fpill { transform: translateX(82px); }
.fisland.none .fpill { opacity: 0; }
.fi { flex: 1; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 16px;
  font-size: 11px; font-weight: 500; color: color-mix(in srgb, var(--app-on-hero) 72%, transparent); }
.fi .mi { font-size: 20px; }
.fi em { font-style: normal; }
.fi.on { color: var(--app-hero); font-weight: 700; }

/* Queue: the Today / This Week toggle (queue_page.dart _buildTabToggle) */
.fq-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 2px 16px; }
.fq-top .icons { display: flex; gap: 14px; color: var(--app-muted); }
.fq-top .icons .mi { font-size: 24px; }
.fseg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--app-seg-track); }
.fseg span { height: 34px; padding: 0 16px; display: grid; place-items: center; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--app-sub); }
.fseg span.on { background: var(--app-surface); color: var(--app-text); font-weight: 700; box-shadow: 0 1px 2px rgb(0 0 0 / .1); }

/* The Queue's one dark card: today's progress (queue_charts_section.dart) */
.app-prog.is-hero { margin: 12px 16px 4px; padding: 10px 12px 12px; border-radius: 22px; background: var(--app-hero); color: var(--app-on-hero); box-shadow: 0 6px 16px rgb(0 0 0 / .1); }
.is-hero .app-prog-h { font-weight: 700; }
.is-hero .app-prog-h small { color: var(--app-on-hero); font-weight: 600; }
.is-hero .app-prog-cols small { color: color-mix(in srgb, var(--app-on-hero) 72%, transparent); }
.is-hero .app-prog-cols small em { color: var(--app-on-hero-good); }
.is-hero .donut .ring { stroke: color-mix(in srgb, var(--app-on-hero) 14%, transparent); }
.is-hero .donut span { color: var(--app-on-hero); }
.is-hero .spark path { stroke: var(--app-on-hero); }
.is-hero .spark circle { fill: var(--app-on-hero); }

/* Calendar inside the film phone */
.fcal { position: absolute; inset: 0; }
.fcal .dc { height: 100%; border: 0; border-radius: 0; }

/* Gym's habit detail page, cropped to the weekly stats. */
.fstats { position: absolute; inset: 0; z-index: 7; background: var(--app-canvas); animation: fFade .25s ease-out; }
.fstats-head { display: flex; align-items: center; gap: 20px; height: 96px; padding: 36px 16px 0; font-size: 22px; }
.fstats-head .mi { font-size: 24px; }
.fstats-body { padding: 16px; }
.fstats-period { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 24px; border-radius: 8px; background: var(--app-surface); font-size: 16px; }
.fstats-period .mi { margin-left: auto; color: var(--app-muted); }
.fstats-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; font-size: 22px; }
.fstats-title strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.fstats-week { padding: 16px; border: 1px solid var(--app-border); border-radius: 16px; background: var(--app-surface); }
.fstats .cu-cols { margin: 0; }
.fstats .cu-dn { margin-inline: 0; font-size: 13px; }
.fstats .cu-col.done .base, .fstats .cu-col.planned .base, .fstats.updated .cu-col.today .base { height: 55%; }
.fstats .cu-col.done .over, .fstats.updated .cu-col.today .over { height: 45%; }
.fstats .cu-col.planned .base { border: 1px dashed var(--app-muted); border-radius: 4px; background: transparent; }
.fstats .cu-col.today b { transition: height .45s var(--ease); }
.fstats-meter { position: relative; height: 8px; margin-top: 20px; border-radius: 999px; background: var(--app-border); }
.fstats-meter i { display: block; width: 33.33%; height: 100%; border-radius: inherit; background: var(--app-text); transition: width .45s var(--ease); }
.fstats.updated .fstats-meter i { width: 66.67%; }
.fstats-meter span { position: absolute; left: 28.57%; top: -3px; width: 2px; height: 14px; background: var(--app-comeback); }
.fstats-pace { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 14px; }
.fstats-pace small { font-size: 13px; color: var(--app-muted); }
.fstats-count { margin-top: 12px; font-size: 19px; font-weight: 700; }
.fstats.updated .fstats-count { color: var(--accent); }

/* Card tags (R5.3, R6): a pill on each card's corner, drawn outside the scaled
   screen so it stays 13 px on the visitor's phone. Task = slate, Habit = clay. */
.ftag { position: absolute; z-index: 5; padding: 4px 8px; border-radius: 999px; font: 600 13px/1 var(--font); color: var(--film-tag-ink);
  pointer-events: none; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s var(--ease); }
.ftag.task { background: var(--film-tag-task); }
.ftag.habit { background: var(--film-tag-habit); }
.ftag.on { opacity: 1; transform: none; }
.ftag.on.dim { opacity: .55; }
.ftag.out { opacity: 0; transform: none; transition: opacity .3s; }
/* The one highlight style (R6): a 2 px clay outline, everything else at 55%. No glow, no shadow, no scale. */
.fview .ai, .fview .app-prog, .fview .app-sec, .fview .fq-top { transition: opacity .3s, filter .3s; }
.fview.dim .ai:not(.hl), .fview.dim .app-prog, .fview.dim .app-sec, .fview.dim .fq-top { opacity: .55; }
.fview .ai.hl { outline: 2px solid var(--accent); outline-offset: -1px; }
.fcal.dim .dc-b.in:not(.hl) { opacity: .55; }
.fcal .dc-b.hl { outline: 2px solid var(--accent); outline-offset: 0; z-index: 2; }
.fcal .dc-b.fade { transform: none; transition: opacity .45s; }
/* List details: an overdue subtitle in red; a skipped card greys before it folds away */
.ai-over { color: var(--app-red); }
.ai.skipped { filter: grayscale(1); opacity: .5; }
.fview .app-sec[hidden] { display: none; }
/* The task editor, cropped to the due-time field and Save */
.fedit { position: absolute; left: 40px; right: 40px; top: 50%; z-index: 7; transform: translateY(-50%); padding: 20px;
  border: 1px solid var(--app-border); border-radius: 20px; background: var(--app-surface); color: var(--app-text);
  animation: fFade .25s ease-out; }
.fedit h5 { margin: 0; font-size: 21px; }
.fedit p { margin: 5px 0 16px; font-size: 16px; }
.fedit small { display: block; margin: 0 0 4px; color: var(--app-sub); font-size: 14px; }
.fedit .lt-field { font-size: 17px; }
.fedit-save { width: max-content; margin: 14px 0 0 auto; padding: 8px 22px; border-radius: 999px;
  background: var(--app-hero); color: var(--app-on-hero); font-size: 16px; font-weight: 700; }
.fmenu { z-index: 7; min-width: 200px; }
.fmenu div { font-size: 15px; padding: 11px 18px; }
.fmenu div.sep { padding: 0; margin: 4px 0; border-top: 1px solid var(--app-border); }
/* The finale's annotation beside Gym's logged block: a film tag, not app chrome */
.ftag.note { padding: 5px 10px 5px 8px; }
.ftag.note::before { content: "\2713"; margin-right: 5px; }
.film.is-card .ftag { opacity: 0 !important; }

/* The section after the film: the old hero line (moved for now) */
.film-after { padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 7vw, 88px); text-align: center; }
.film-after .h-lg { max-width: 20ch; margin: 0 auto; }
.film-after .lead { margin: 20px auto 0; }

/* Desktop starts with the headline, then brings in the phone for the tag reveal. */
@media (width > 900px) {
  .film-phone { transition: opacity .35s var(--ease), transform .35s var(--ease); }
  .film.is-open .film-phone { opacity: 0; transform: translateY(12px); transition: none; }
  .film.is-open .film-head { animation: fcIn .28s var(--ease) both; }
  .film.is-open .film-head span { animation: fcIn .28s var(--ease) .65s both; }
}

/* Phones open with the headline over the top half of the screen. */
@media (max-width: 900px) {
  .film { padding: 8px 0 24px; }
  .film-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "visual"; }
  .film-side { display: none; }
  .film-phone { max-width: 400px; margin: 0 auto; }
  .film-screen { height: clamp(540px, calc(100svh - 160px), 690px); transition: opacity .6s; }
  .film.is-open .film-phone { transform: scale(.92); }
  .film.is-open .film-screen { opacity: .6; }
  /* The reduced-motion still: the headline and caption 5 above the phone */
  .film.is-still .film-capbar { max-width: 400px; margin: 0 auto 10px; }
  .film.is-still .film-capbar .film-head { display: block; font-size: 28px; }
  .film-band.tall { display: flex; min-height: 50%; padding: 40px 20px 10px; border-radius: 34px 34px 0 0; background: color-mix(in srgb, var(--bg) 92%, transparent); }
  .film-band .film-cap.big { font-size: 34px; }
  .film-after { text-align: left; }
  .film-after .h-lg { margin: 0; }
  .film-after .lead { margin-left: 0; }
}
@media (max-width: 359px) {
  .film-band.tall { padding-inline: 14px; }
  .film-band .film-cap.big { font-size: 30px; }
  .film-band.card .film-cap { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .film *, .film *::before, .film *::after { animation: none !important; transition: none !important; }
}

/* ---------- Phones: the visual comes before the paragraph (#15) ----------
   Once a section stacks into one column, its copy block is flattened so the
   heading comes first, then the animation, then its tabs/steps, then the body
   text. Desktop's side-by-side layouts are untouched. */
@media (max-width: 900px) {
  .triple, .ow, .cal-split, .hs { gap: 0; }
  .triple-copy, .ow-copy, .cal-copy, .hs-copy { display: contents; }
  .triple-copy > *, .ow-copy > *, .cal-copy > *, .hs-copy > * { order: 3; }
  .triple-copy > .sec-head, .ow-copy > .sec-head,
  .cal-copy > h2, .hs-copy > .eyebrow, .hs-copy > h2 { order: 0; justify-self: start; }
  .triple-copy > .sec-head, .ow-copy > .sec-head, .cal-copy > h2, .hs-copy > h2 { margin-bottom: 28px; }
  .triple > .stage, .ow-side, .cal-split > .cal, .hs-side { order: 1; }
  .triple-copy > .yardsticks, .ow-copy > .yardsticks { order: 2; margin-top: 20px; }
  /* Fair scoring: each card shows its demo before its text; the section intro closes it */
  #fair-scoring .wrap { display: flex; flex-direction: column; }
  #fair-scoring .sec-head { display: contents; }
  #fair-scoring .sec-head > h2 { order: 0; }
  #fair-scoring .bento { order: 1; margin-top: 28px; }
  #fair-scoring .sec-head > .lead { order: 2; }
  .cell { display: flex; flex-direction: column; }
  .cell-d .tpl-head { display: contents; }
  .cell > *, .cell-d .tpl-head > * { order: 2; }
  .cell h3, .cell-d .tpl-head > h3 { order: 0; }
  .cell .tbv, .cell .mini-app, .cell .mult, .cell .tpl-demo { order: 1; margin-top: 4px; margin-bottom: 18px; }
  .cell .mult { margin-top: -6px; }
  /* Persistence: the weekly catch-up shows its demo before its line */
  .cu-head { display: contents; }
  .cu { display: flex; flex-direction: column; }
  .cu-head h3 { order: 0; }
  .cu-stage { order: 1; }
  .cu-head p { order: 2; margin-top: 20px; }
}
@media (max-width: 960px) {
  .persist { gap: 0; }
  .persist-copy { display: contents; }
  .persist-copy > * { order: 3; }
  .persist-copy > .sec-head { order: 0; justify-self: start; margin-bottom: 28px; }
  .persist > .chart-card { order: 1; }
}
/* /features cards on phones: icon and title, then the demo, then the text */
@media (max-width: 900px) {
  .fitem { display: flex; flex-direction: column; }
  .fitem > * { order: 2; }
  .fitem > i, .fitem > h3 { order: 0; }
  .fitem > [data-scene] { order: 1; margin: 6px 0 18px; }
}
