/* ==========================================================================
   365Pages — Design System
   Capture your year, one day at a time.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&family=Caveat:wght@500;700&family=JetBrains+Mono:wght@400;600&family=Playfair+Display:wght@500;600;700&family=Work+Sans:wght@400;500;600;700&family=Libre+Baskerville:wght@400;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Nunito:wght@400;600;700;800&family=Poppins:wght@600;700;800&display=swap');

:root {
  /* Brand — warm, editorial "keepsake" palette */
  --color-primary: #BF6435;
  --color-primary-600: #A8552B;
  --color-primary-700: #8A4423;
  --color-primary-100: #F5E3D3;
  --color-primary-50: #FBF1E7;

  --color-forest: #2B453B;
  --color-forest-700: #1E332B;
  --color-forest-100: #E1E9E3;

  /* Soft card tints (fixed pastels — used by the native app's tiles,
     date chips and quote panel, matching the mobile design refs). */
  --tint-green: #E8F3EC;
  --tint-purple: #EFEBFA;
  --tint-blue: #E7F1FA;
  --tint-peach: #FBEEE0;
  --tint-pink: #F8E7EF;
  --tint-yellow: #F7F0DA;
  --tint-sage: #E4EDE0;

  /* Warm neutrals (light) */
  --bg: #F8F2E7;
  --bg-elevated: #FFFDF8;
  --surface: #FFFDF8;
  --surface-muted: #F1E9D8;
  --border: #E5DAC4;
  --border-soft: #EEE5D2;

  --text-primary: #2B2A22;
  --text-secondary: #625C4D;
  --text-tertiary: #726C55; /* darkened from #8C866F — was 3.28:1 on --bg, fails WCAG AA (4.5:1) */
  --text-on-primary: #FFFFFF;

  /* Semantic */
  --success: #3F9E6C;
  --success-bg: #E7F6EE;
  --warning: #C9862C;
  --warning-bg: #FBF1E1;
  --error: #D6555A;
  --error-bg: #FBE9EA;
  --info: #4C8FD6;
  --info-bg: #EAF3FC;

  /* AI reflection — a fixed accent (independent of the active page theme)
     so AI-generated content always reads as visually distinct. */
  --ai-accent: #7C5CBF;
  --ai-bg: #F2EDFB;
  --ai-border: #DCD0F2;

  /* Mood palette */
  --mood-joyful: #E8B23D;
  --mood-calm: #6FA8DC;
  --mood-grateful: #6FB582;
  --mood-neutral: #B9B4C2;
  --mood-tired: #9C8FC4;
  --mood-anxious: #E0895A;
  --mood-sad: #7C86B8;
  --mood-angry: #D06868;
  --mood-energetic: #E36B9E;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(43, 42, 51, 0.06);
  --shadow-md: 0 4px 16px rgba(43, 42, 51, 0.08);
  --shadow-lg: 0 12px 32px rgba(43, 42, 51, 0.12);
  --shadow-focus: 0 0 0 3px rgba(191, 100, 53, 0.25);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-hand: 'Caveat', cursive;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 140ms;
  --dur-med: 240ms;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #191712;
  --bg-elevated: #211E17;
  --surface: #24211A;
  --surface-muted: #2C2820;
  --border: #3A3529;
  --border-soft: #2C2820;

  --text-primary: #F3EEE3;
  --text-secondary: #C2B9A5;
  --text-tertiary: #8F8770;
  --text-on-primary: #FFFFFF;

  --success-bg: #16281F;
  --warning-bg: #2E2312;
  --error-bg: #2E1618;
  --info-bg: #131F2B;
  --ai-accent: #B79FEA;
  --ai-bg: #241F33;
  --ai-border: #392F52;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191712;
    --bg-elevated: #211E17;
    --surface: #24211A;
    --surface-muted: #2C2820;
    --border: #3A3529;
    --border-soft: #2C2820;

    --text-primary: #F3EEE3;
    --text-secondary: #C2B9A5;
    --text-tertiary: #8F8770;
    --text-on-primary: #FFFFFF;

    --success-bg: #16281F;
    --warning-bg: #2E2312;
    --error-bg: #2E1618;
    --info-bg: #131F2B;
    --ai-accent: #B79FEA;
    --ai-bg: #241F33;
    --ai-border: #392F52;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

/* ---------- Page themes (Settings → Appearance) ----------
   Each theme re-tints the accent palette AND the background/surface/text
   tokens, so switching themes changes the whole app's environment, not
   just a few buttons. Every theme also carries an explicit dark variant
   ([data-theme="dark"][data-page-theme="X"]) plus a system-preference
   dark variant further below, so the environment stays coherent — never
   a light-tinted background with dark-mode's default near-black text,
   or vice versa. */
[data-page-theme="ocean"] {
  --color-primary: #2E7A8C; --color-primary-600: #266473; --color-primary-700: #1F515D;
  --color-primary-100: #DCEBEE; --color-primary-50: #EFF6F7;
  --color-forest: #1E3A4A; --color-forest-700: #152933; --color-forest-100: #DDE6EA;
  --bg: #EAF3F4; --bg-elevated: #F7FBFB; --surface: #F7FBFB; --surface-muted: #DCEBEC;
  --border: #C7DEE1; --border-soft: #D8E9EB;
  --text-primary: #152933; --text-secondary: #3F5960; --text-tertiary: #547278; /* darkened from #6E8A90 — was ~3.27:1, fails WCAG AA */
}
[data-theme="dark"][data-page-theme="ocean"] {
  --bg: #0E1B1F; --bg-elevated: #132227; --surface: #152A30; --surface-muted: #1B333A;
  --border: #274048; --border-soft: #1B333A;
  --text-primary: #E6F2F4; --text-secondary: #AFC8CD; --text-tertiary: #7C9AA0;
}
[data-page-theme="rose"] {
  --color-primary: #B6485F; --color-primary-600: #9C3B4F; --color-primary-700: #7D2F3F;
  --color-primary-100: #F4DEE2; --color-primary-50: #FAF0F1;
  --color-forest: #4A2033; --color-forest-700: #331525; --color-forest-100: #EBDDE3;
  --bg: #FBF0F1; --bg-elevated: #FFF8F9; --surface: #FFF8F9; --surface-muted: #F5E3E5;
  --border: #E9CDD1; --border-soft: #F0DBDE;
  --text-primary: #3A1A24; --text-secondary: #6B3745; --text-tertiary: #95707B;
}
[data-theme="dark"][data-page-theme="rose"] {
  --bg: #1F1116; --bg-elevated: #2A161C; --surface: #2E181F; --surface-muted: #3A1F27;
  --border: #4A2A33; --border-soft: #3A1F27;
  --text-primary: #F5E6E9; --text-secondary: #D0AEB6; --text-tertiary: #9C7E86;
}
[data-page-theme="slate"] {
  --color-primary: #55637A; --color-primary-600: #465065; --color-primary-700: #384052;
  --color-primary-100: #E1E4EA; --color-primary-50: #F1F2F5;
  --color-forest: #2B323F; --color-forest-700: #1D222B; --color-forest-100: #DFE2E7;
  --bg: #F1F2F5; --bg-elevated: #FAFBFC; --surface: #FAFBFC; --surface-muted: #E6E8EC;
  --border: #D3D7DE; --border-soft: #DFE2E7;
  --text-primary: #1D222B; --text-secondary: #454C58; --text-tertiary: #767E8C;
}
[data-theme="dark"][data-page-theme="slate"] {
  --bg: #181B21; --bg-elevated: #1F232B; --surface: #22262F; --surface-muted: #2A2F39;
  --border: #383F4B; --border-soft: #2A2F39;
  --text-primary: #EAEDF2; --text-secondary: #B7BFCB; --text-tertiary: #828A97;
}
[data-page-theme="sunset"] {
  --color-primary: #D9793F; --color-primary-600: #BE6530; --color-primary-700: #9C5127;
  --color-primary-100: #FBE4D1; --color-primary-50: #FDF2E8;
  --color-forest: #5C3324; --color-forest-700: #402319; --color-forest-100: #F0DFD3;
  --bg: #FBEEE3; --bg-elevated: #FFF8F1; --surface: #FFF8F1; --surface-muted: #F5E1CE;
  --border: #E8CBAE; --border-soft: #F0DAC0;
  --text-primary: #3D2416; --text-secondary: #6B4A32; --text-tertiary: #957253;
}
[data-theme="dark"][data-page-theme="sunset"] {
  --bg: #201409; --bg-elevated: #2A1B0E; --surface: #2E1E10; --surface-muted: #3A2716;
  --border: #4A331E; --border-soft: #3A2716;
  --text-primary: #F7EAE0; --text-secondary: #D3B79E; --text-tertiary: #A2896F;
}
/* Paper-like: warmer, higher-contrast "ink on paper" feel — flatter shadows, crisp borders. */
[data-page-theme="paper"] {
  --color-primary: #8A4423; --color-primary-600: #723A1D; --color-primary-700: #5C2F18;
  --color-primary-100: #EFE0CC; --color-primary-50: #F8F1E4;
  --color-forest: #33291B; --color-forest-700: #221B11; --color-forest-100: #E9E1D2;
  --bg: #F3EBDA; --bg-elevated: #FBF6EA; --surface: #FBF6EA; --surface-muted: #EDE2CB;
  --border: #D9C9A6; --border-soft: #E5D8B9;
  --text-primary: #33291B; --text-secondary: #6B573D; --text-tertiary: #998763;
  --shadow-sm: 0 1px 0 rgba(51, 41, 27, 0.15); --shadow-md: 0 2px 0 rgba(51, 41, 27, 0.12); --shadow-lg: 0 4px 0 rgba(51, 41, 27, 0.1);
  --radius-sm: 3px; --radius-md: 5px; --radius-lg: 7px;
}
[data-theme="dark"][data-page-theme="paper"] {
  --bg: #1C160D; --bg-elevated: #241C10; --surface: #281F12; --surface-muted: #322717;
  --border: #453623; --border-soft: #322717;
  --text-primary: #F4ECDB; --text-secondary: #CBB999; --text-tertiary: #9A8B6C;
}
/* Minimalist: near-white, muted grey accent, no warm cast, soft shadows. */
[data-page-theme="minimalist"] {
  --color-primary: #2B2A22; --color-primary-600: #1E1D18; --color-primary-700: #131310;
  --color-primary-100: #E7E6E2; --color-primary-50: #F4F3F1;
  --color-forest: #44453F; --color-forest-700: #2E2F2A; --color-forest-100: #E7E7E4;
  --bg: #FAFAF8; --bg-elevated: #FFFFFF; --surface: #FFFFFF; --surface-muted: #F2F2EF;
  --border: #E4E4E0; --border-soft: #EDEDEA;
  --text-primary: #1E1E1B; --text-secondary: #4E4E48; --text-tertiary: #82827A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04); --shadow-md: 0 2px 10px rgba(0,0,0,0.05); --shadow-lg: 0 8px 24px rgba(0,0,0,0.06);
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
}
[data-theme="dark"][data-page-theme="minimalist"] {
  --bg: #171715; --bg-elevated: #1E1E1D; --surface: #212120; --surface-muted: #292928;
  --border: #3A3A38; --border-soft: #292928;
  --text-primary: #F2F2F0; --text-secondary: #C4C4C0; --text-tertiary: #8E8E89;
}
/* Grey: the muted cream/grey neutrals + rust/forest accents from the 101 reference site's Calendar page. */
[data-page-theme="grey"] {
  --color-primary: #C2662F; --color-primary-600: #A55728; --color-primary-700: #864620;
  --color-primary-100: #F6E8E0; --color-primary-50: #FAF3EE;
  --color-forest: #1E3A2C; --color-forest-700: #162A20; --color-forest-100: #E9EBEA;
  --bg: #FBF8F1; --bg-elevated: #FFFDF8; --surface: #FFFDF8; --surface-muted: #F4EFE4;
  --border: #ECE6D8; --border-soft: #F3EEE2;
  --text-primary: #2A2620; --text-secondary: #5C564A; --text-tertiary: #8A8272;
}
[data-theme="dark"][data-page-theme="grey"] {
  --bg: #1A1712; --bg-elevated: #211E17; --surface: #24211A; --surface-muted: #2D2921;
  --border: #3D372A; --border-soft: #2D2921;
  --text-primary: #F2EEE3; --text-secondary: #C7BEA9; --text-tertiary: #948A70;
}
[data-page-theme="spring"] {
  --color-primary: #5B9B5E; --color-primary-600: #4C8550; --color-primary-700: #3D6B40;
  --color-primary-100: #DFEFDD; --color-primary-50: #F0F8EF;
  --color-forest: #2F4A31; --color-forest-700: #203421; --color-forest-100: #DEE9DE;
  --bg: #EFF6EC; --bg-elevated: #F9FCF7; --surface: #F9FCF7; --surface-muted: #E2EEDD;
  --border: #CBDFC4; --border-soft: #DCEAD6;
  --text-primary: #1E3220; --text-secondary: #4C6B4A; --text-tertiary: #7E9779;
}
[data-theme="dark"][data-page-theme="spring"] {
  --bg: #12190F; --bg-elevated: #182114; --surface: #1B2416; --surface-muted: #212D1B;
  --border: #2E3D26; --border-soft: #212D1B;
  --text-primary: #E9F3E5; --text-secondary: #BCD3B6; --text-tertiary: #86A17E;
}
[data-page-theme="summer"] {
  --color-primary: #E0A62E; --color-primary-600: #C48E20; --color-primary-700: #9E7119;
  --color-primary-100: #FBEECB; --color-primary-50: #FDF7E7;
  --color-forest: #1F5A6B; --color-forest-700: #163F4B; --color-forest-100: #DCEAEE;
  --bg: #FBF3E1; --bg-elevated: #FFFBF0; --surface: #FFFBF0; --surface-muted: #F5E8C7;
  --border: #E8D4A0; --border-soft: #F0E2B8;
  --text-primary: #3D2E0C; --text-secondary: #6E5A28; --text-tertiary: #9C8A5C;
}
[data-theme="dark"][data-page-theme="summer"] {
  --bg: #1E1608; --bg-elevated: #271C0B; --surface: #2B1F0C; --surface-muted: #372711;
  --border: #4A361A; --border-soft: #372711;
  --text-primary: #F7EEDA; --text-secondary: #D2C097; --text-tertiary: #A1926B;
}
[data-page-theme="autumn"] {
  --color-primary: #B5502A; --color-primary-600: #99401F; --color-primary-700: #7A331A;
  --color-primary-100: #F2DDCB; --color-primary-50: #FAF0E6;
  --color-forest: #5A3A1E; --color-forest-700: #402A15; --color-forest-100: #EBE0D2;
  --bg: #F7EAE0; --bg-elevated: #FDF6F0; --surface: #FDF6F0; --surface-muted: #EFDBC9;
  --border: #DFC2A6; --border-soft: #E9D2BB;
  --text-primary: #3A2210; --text-secondary: #6B4A2E; --text-tertiary: #9B7C5C;
}
[data-theme="dark"][data-page-theme="autumn"] {
  --bg: #1E1209; --bg-elevated: #26170D; --surface: #2A190E; --surface-muted: #352113;
  --border: #492E1B; --border-soft: #352113;
  --text-primary: #F5E6D8; --text-secondary: #CFB49B; --text-tertiary: #9C8368;
}
[data-page-theme="winter"] {
  --color-primary: #3E6FA6; --color-primary-600: #335C8B; --color-primary-700: #294A70;
  --color-primary-100: #DCE7F2; --color-primary-50: #EFF4FA;
  --color-forest: #22344A; --color-forest-700: #172333; --color-forest-100: #DCE2EA;
  --bg: #EDF2F8; --bg-elevated: #F8FBFD; --surface: #F8FBFD; --surface-muted: #DFE8F1;
  --border: #C7D6E5; --border-soft: #D6E1EC;
  --text-primary: #17263A; --text-secondary: #435872; --text-tertiary: #7288A0;
}
[data-theme="dark"][data-page-theme="winter"] {
  --bg: #0E141C; --bg-elevated: #131B25; --surface: #162029; --surface-muted: #1C2733;
  --border: #283848; --border-soft: #1C2733;
  --text-primary: #E7EEF6; --text-secondary: #AFC0D2; --text-tertiary: #7C8FA3;
}

/* Dark variants applied via OS-level "system" preference (no explicit [data-theme]) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-page-theme="ocean"] {
    --bg: #0E1B1F; --bg-elevated: #132227; --surface: #152A30; --surface-muted: #1B333A;
    --border: #274048; --border-soft: #1B333A;
    --text-primary: #E6F2F4; --text-secondary: #AFC8CD; --text-tertiary: #7C9AA0;
  }
  :root:not([data-theme="light"])[data-page-theme="rose"] {
    --bg: #1F1116; --bg-elevated: #2A161C; --surface: #2E181F; --surface-muted: #3A1F27;
    --border: #4A2A33; --border-soft: #3A1F27;
    --text-primary: #F5E6E9; --text-secondary: #D0AEB6; --text-tertiary: #9C7E86;
  }
  :root:not([data-theme="light"])[data-page-theme="slate"] {
    --bg: #181B21; --bg-elevated: #1F232B; --surface: #22262F; --surface-muted: #2A2F39;
    --border: #383F4B; --border-soft: #2A2F39;
    --text-primary: #EAEDF2; --text-secondary: #B7BFCB; --text-tertiary: #828A97;
  }
  :root:not([data-theme="light"])[data-page-theme="sunset"] {
    --bg: #201409; --bg-elevated: #2A1B0E; --surface: #2E1E10; --surface-muted: #3A2716;
    --border: #4A331E; --border-soft: #3A2716;
    --text-primary: #F7EAE0; --text-secondary: #D3B79E; --text-tertiary: #A2896F;
  }
  :root:not([data-theme="light"])[data-page-theme="paper"] {
    --bg: #1C160D; --bg-elevated: #241C10; --surface: #281F12; --surface-muted: #322717;
    --border: #453623; --border-soft: #322717;
    --text-primary: #F4ECDB; --text-secondary: #CBB999; --text-tertiary: #9A8B6C;
  }
  :root:not([data-theme="light"])[data-page-theme="minimalist"] {
    --bg: #171715; --bg-elevated: #1E1E1D; --surface: #212120; --surface-muted: #292928;
    --border: #3A3A38; --border-soft: #292928;
    --text-primary: #F2F2F0; --text-secondary: #C4C4C0; --text-tertiary: #8E8E89;
  }
  :root:not([data-theme="light"])[data-page-theme="grey"] {
    --bg: #1A1712; --bg-elevated: #211E17; --surface: #24211A; --surface-muted: #2D2921;
    --border: #3D372A; --border-soft: #2D2921;
    --text-primary: #F2EEE3; --text-secondary: #C7BEA9; --text-tertiary: #948A70;
  }
  :root:not([data-theme="light"])[data-page-theme="spring"] {
    --bg: #12190F; --bg-elevated: #182114; --surface: #1B2416; --surface-muted: #212D1B;
    --border: #2E3D26; --border-soft: #212D1B;
    --text-primary: #E9F3E5; --text-secondary: #BCD3B6; --text-tertiary: #86A17E;
  }
  :root:not([data-theme="light"])[data-page-theme="summer"] {
    --bg: #1E1608; --bg-elevated: #271C0B; --surface: #2B1F0C; --surface-muted: #372711;
    --border: #4A361A; --border-soft: #372711;
    --text-primary: #F7EEDA; --text-secondary: #D2C097; --text-tertiary: #A1926B;
  }
  :root:not([data-theme="light"])[data-page-theme="autumn"] {
    --bg: #1E1209; --bg-elevated: #26170D; --surface: #2A190E; --surface-muted: #352113;
    --border: #492E1B; --border-soft: #352113;
    --text-primary: #F5E6D8; --text-secondary: #CFB49B; --text-tertiary: #9C8368;
  }
  :root:not([data-theme="light"])[data-page-theme="winter"] {
    --bg: #0E141C; --bg-elevated: #131B25; --surface: #162029; --surface-muted: #1C2733;
    --border: #283848; --border-soft: #1C2733;
    --text-primary: #E7EEF6; --text-secondary: #AFC0D2; --text-tertiary: #7C8FA3;
  }
}

/* ---------- Typography (Settings → Appearance) ---------- */
[data-typography="modern"] { --font-serif: 'Work Sans', 'Inter', sans-serif; --font-sans: 'Work Sans', 'Inter', sans-serif; }
[data-typography="editorial"] { --font-serif: 'Playfair Display', Georgia, serif; --font-sans: 'Inter', sans-serif; }
[data-typography="classic-book"] { --font-serif: 'Libre Baskerville', Georgia, serif; --font-sans: 'Inter', sans-serif; }

/* ---------- Font size (Settings → Appearance) ---------- */
[data-font-size="sm"] { font-size: 14px; }
[data-font-size="md"] { font-size: 16px; }
[data-font-size="lg"] { font-size: 18px; }

/* ---------- Spacing density (Settings → Appearance) ---------- */
[data-spacing="compact"] .card { padding: 14px !important; }
[data-spacing="compact"] .page-head { margin-bottom: 16px; }
[data-spacing="compact"] .stat-grid, [data-spacing="compact"] .grid-2, [data-spacing="compact"] .grid-3 { gap: 10px; }
[data-spacing="compact"] .app-content { padding: 16px 20px; }
[data-spacing="spacious"] .card { padding: 30px !important; }
[data-spacing="spacious"] .page-head { margin-bottom: 34px; }
[data-spacing="spacious"] .stat-grid, [data-spacing="spacious"] .grid-2, [data-spacing="spacious"] .grid-3 { gap: 22px; }
[data-spacing="spacious"] .app-content { padding: 36px 44px; }

/* ---------- Background style (Settings → Appearance) ---------- */
[data-background="soft-glow"] body { background-image: radial-gradient(circle at 15% 0%, var(--color-primary-50) 0%, transparent 45%), radial-gradient(circle at 100% 30%, var(--color-forest-100) 0%, transparent 40%); background-attachment: fixed; }
[data-background="dot-grid"] body { background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; }
[data-background="linen"] body { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,0.015) 0px, rgba(0,0,0,0.015) 1px, transparent 1px, transparent 5px); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
h1, h2 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.5rem); }
h3 { font-size: 1.3rem; }

.divider-mark { display: block; width: 22px; height: 22px; margin: 14px 0; position: relative; }
.divider-mark::before { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; background: var(--color-primary); transform: rotate(45deg); border-radius: 2px; }
.divider-mark.center { margin-left: auto; margin-right: auto; }
p { margin: 0 0 1em; color: var(--text-secondary); }
.lede { font-size: 1.15rem; color: var(--text-secondary); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 300;
  background: var(--color-primary); color: #fff; padding: 10px 18px;
  border-radius: var(--radius-sm); text-decoration: none; font-weight: 600;
  transition: top 150ms ease;
}
.skip-link:focus { top: 8px; outline: none; box-shadow: var(--shadow-focus); }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-full); border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-600); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-muted); color: var(--text-primary); }
.btn-danger { background: var(--error); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border); }
.btn-icon:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card-hover { transition: box-shadow var(--dur-med) var(--ease), transform var(--dur-med) var(--ease); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600;
  background: var(--surface-muted); color: var(--text-secondary);
}
.badge-primary { background: var(--color-primary-100); color: var(--color-primary-700); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-ai { background: var(--ai-bg); color: var(--ai-accent); }

/* ---------- AI reflection panels ---------- */
.ai-panel {
  background: var(--ai-bg); border: 1px solid var(--ai-border); border-radius: var(--radius-md);
  padding: 16px 18px; margin-top: 12px;
}
.ai-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ai-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-panel-actions button { background: none; border: none; padding: 2px 6px; font-size: 0.78rem; font-weight: 600; color: var(--ai-accent); cursor: pointer; border-radius: var(--radius-sm); }
.ai-panel-actions button:hover { background: var(--ai-border); }
.ai-panel-text { font-size: 0.9rem; line-height: 1.6; color: var(--text-primary); }
.ai-disclaimer { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 10px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.field { margin-bottom: 18px; }
.field-hint { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], input[type="search"], input[type="number"], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-primary); font-family: inherit; font-size: 0.95rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--shadow-focus); }
textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--color-primary); }

/* ---------- Nav (marketing) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
/* backdrop-filter lives on a pseudo-element, not .site-header itself, because
   filter/backdrop-filter on an ancestor becomes the containing block for
   position:fixed descendants — that broke the fixed mobile .nav-links panel. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text-primary); }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--color-forest); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem; font-weight: 800; font-family: var(--font-serif); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 0.92rem; font-weight: 500; color: var(--text-secondary); transition: color var(--dur-fast); }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 72px 0 0 0; background: var(--bg); flex-direction: column; padding: 24px; gap: 20px; transform: translateX(100%); transition: transform var(--dur-med) var(--ease); }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: inline-flex; }
}

.theme-toggle { width: 40px; height: 40px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-soft); padding: 56px 0 32px; margin-top: 100px; background: var(--surface-muted); }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(5, 1fr); gap: 28px; }
.footer-grid h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 14px; }
.footer-grid a { display: block; padding: 6px 0; color: var(--text-secondary); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--color-primary); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-tertiary); flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Hero ---------- */
.hero { padding: 88px 0 60px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--color-primary-100); color: var(--color-primary-700); padding: 6px 14px; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 700; margin-bottom: 20px; }
.hero h1 { margin-bottom: 20px; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-trust { margin-top: 28px; display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-tertiary); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* mini year swatch used in hero + landing */
.mini-year { display: grid; grid-template-columns: repeat(18, 1fr); gap: 3px; }
.mini-year .cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-muted); }

/* ---------- Section scaffolding ---------- */
.section { padding: 80px 0; }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head .eyebrow { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-primary); margin-bottom: 10px; }
.alt-bg { background: var(--surface-muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.feature-card { padding: 28px; }
.feature-icon { width: 46px; height: 46px; border-radius: var(--radius-md); background: var(--color-primary-100); color: var(--color-primary-700); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 1.3rem; }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: step; }
.step { text-align: center; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 14px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }

.testimonial { padding: 26px; }
.testimonial-quote { font-family: var(--font-serif); font-size: 1.05rem; color: var(--text-primary); }
.testimonial-person { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--color-primary-100); color: var(--color-primary-700); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; }

.pricing-card { padding: 32px; position: relative; display: flex; flex-direction: column; }
.pricing-card.featured { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.pricing-badge { position: absolute; top: -13px; right: 24px; }
.price { font-size: 2.4rem; font-weight: 800; margin: 14px 0 4px; }
.price span { font-size: 0.95rem; font-weight: 500; color: var(--text-tertiary); }
.plan-features { list-style: none; padding: 0; margin: 22px 0; flex: 1; }
.plan-features li { display: flex; gap: 10px; padding: 7px 0; font-size: 0.9rem; color: var(--text-secondary); }

.faq-item { border-bottom: 1px solid var(--border-soft); padding: 18px 0; }
.faq-q { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height var(--dur-med) var(--ease); }
.faq-item.open .faq-a { max-height: 300px; margin-top: 12px; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.chev { transition: transform var(--dur-med) var(--ease); color: var(--text-tertiary); }

.cta-band { background: var(--color-forest); border-radius: var(--radius-lg); padding: 56px; text-align: center; color: #fff; position: relative; overflow: hidden; }
.cta-band h2, .cta-band p { color: #fff; }
.cta-band .btn-secondary { background: #fff; color: var(--color-primary-700); border: none; }
.cta-band .wave-decoration { position: absolute; left: 0; right: 0; bottom: -2px; opacity: 0.35; pointer-events: none; }

/* ---------- Trust band ---------- */
.trust-band { background: var(--color-forest); color: #fff; padding: 44px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; text-align: center; }
.trust-item .trust-icon { font-size: 1.5rem; margin-bottom: 10px; }
.trust-item h4 { color: #fff; font-size: 1rem; margin-bottom: 6px; }
.trust-item p { color: rgba(255,255,255,0.78); font-size: 0.85rem; margin: 0; }
@media (max-width: 760px) { .trust-grid { grid-template-columns: 1fr; } }

/* ---------- Press / rating strip ---------- */
.press-strip { padding: 22px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.press-strip .container { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.press-stars { color: var(--color-primary); letter-spacing: 2px; font-size: 0.95rem; }

/* ---------- Milestone stat ---------- */
.milestone-stat { text-align: center; padding: 10px 0 30px; }
.milestone-stat .num { font-family: var(--font-serif); font-style: italic; color: var(--color-forest); }

/* ---------- Home landing page ---------- */
.press-badges-bar { background: var(--color-forest); color: rgba(255,255,255,0.92); padding: 14px 0; }
.press-badges-bar .container { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: 0.85rem; letter-spacing: 0.01em; }
.press-badges-bar .press-badge { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.press-badges-bar .press-badge .press-badge-mark { font-family: var(--font-serif); font-style: italic; font-weight: 700; }
.press-badges-bar .press-sep { opacity: 0.45; font-size: 1.1rem; }

/* Background matches the reference wall tone so the two stacked photo crops
   (plant + books, below) blend into it edge to edge with no visible seam. */
.home-hero { background: #ebe5df; padding: 0; text-align: center; position: relative; overflow: hidden; }

/* Reserves the same height the plant crop occupies in the reference
   (250/1565 of full width), so the foliage below is never clipped. */
.home-hero-copy { min-height: clamp(130px, 15.97vw, 250px); display: flex; flex-direction: column; justify-content: center; padding: 38px 24px 26px; }
.home-hero h1 { font-size: clamp(1.75rem, 3.45vw, 3.375rem); line-height: 1.18; margin: 0 auto 14px; max-width: 900px; }
.home-hero h1 em { font-style: italic; color: var(--color-forest); font-family: var(--font-serif); }
.home-hero .lede { max-width: 420px; margin: 0 auto; color: var(--text-secondary); font-size: clamp(0.875rem, 1.09vw, 1.0625rem); }

/* Two crops of the same original photo, stacked so the plant (a separate,
   proportionally-scaled image) sits flush above the books strip and
   reconstructs the full scene without ever overlapping the headline text. */
.home-hero-scene { position: relative; }
.home-hero-books { display: block; width: 100%; height: auto; }
.home-hero-plant { position: absolute; left: 0; bottom: 100%; width: 14.696%; height: auto; display: block; }

.icon-feature-row {
  display: flex; justify-content: center; align-items: flex-start; gap: 0; flex-wrap: wrap;
  padding: 26px 40px 44px;
  /* top edge continues the books photo's own horizontal tone, then fades to
     the wall color, so there is no hard step where the photo ends. */
  background:
    linear-gradient(180deg, rgba(235,229,223,0) 0%, #ebe5df 72%),
    linear-gradient(90deg, #ded6cd 0%, #e1d9d0 19%, #e6e0d7 38%, #e8e2db 58%, #e7e1da 77%, #e9e3db 100%);
}

/* Dark mode: the source photos carry a fixed light "wall" background, so
   swapping the section to var(--bg) alone would leave a light rectangle
   floating in a dark page. Darken the photos to match the surrounding
   background and mask their outer edges to transparent so the section
   background shows through and the seam disappears, the same way it does
   in light mode. The plant image is masked from its own bottom-left corner
   (flush against the books strip below) since that's its only anchored
   edge — top and right float free in the dark background. */
[data-theme="dark"] .home-hero,
[data-theme="dark"] .icon-feature-row { background: var(--bg); }
[data-theme="dark"] .home-hero-scene::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, var(--bg) 0%, transparent 14%, transparent 80%, var(--bg) 100%),
    radial-gradient(150% 140% at 50% 35%, transparent 38%, var(--bg) 100%);
  mix-blend-mode: multiply;
}
[data-theme="dark"] .home-hero-books {
  filter: brightness(0.8) saturate(0.95);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 4%, black 96%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, black 4%, black 96%, transparent 100%);
}
[data-theme="dark"] .home-hero-plant {
  filter: brightness(0.42) saturate(0.8);
  -webkit-mask-image: radial-gradient(130% 130% at 0% 100%, black 45%, transparent 100%);
  mask-image: radial-gradient(130% 130% at 0% 100%, black 45%, transparent 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home-hero,
  :root:not([data-theme="light"]) .icon-feature-row { background: var(--bg); }
  :root:not([data-theme="light"]) .home-hero-scene::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      linear-gradient(180deg, var(--bg) 0%, transparent 14%, transparent 80%, var(--bg) 100%),
      radial-gradient(150% 140% at 50% 35%, transparent 38%, var(--bg) 100%);
    mix-blend-mode: multiply;
  }
  :root:not([data-theme="light"]) .home-hero-books {
    filter: brightness(0.8) saturate(0.95);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 4%, black 96%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 4%, black 96%, transparent 100%);
  }
  :root:not([data-theme="light"]) .home-hero-plant {
    filter: brightness(0.42) saturate(0.8);
    -webkit-mask-image: radial-gradient(130% 130% at 0% 100%, black 45%, transparent 100%);
    mask-image: radial-gradient(130% 130% at 0% 100%, black 45%, transparent 100%);
  }
}
.icon-feature { flex: 1 1 0; min-width: 0; padding: 4px 18px; border-left: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; text-align: left; }
.icon-feature:first-child { border-left: none; }
.icon-feature .circle { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; background: var(--color-primary-100); color: var(--color-primary-700); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.icon-feature h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.icon-feature p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }

.toolkit-band { background: var(--color-forest); color: #fff; padding: 54px 0; }
.toolkit-band h2 { color: #fff; text-align: center; margin-bottom: 40px; font-size: 1.9rem; }
.toolkit-grid { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 30px; align-items: center; }
.toolkit-item { display: flex; align-items: flex-start; gap: 12px; }
.toolkit-item .circle { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.toolkit-item h4 { color: #fff; font-size: 0.82rem; margin-bottom: 4px; }
.toolkit-item p { color: rgba(255,255,255,0.72); font-size: 0.82rem; margin: 0; }
.toolkit-cta { text-align: center; }
.toolkit-cta .btn-primary { background: var(--color-primary-100); color: var(--color-forest-700); box-shadow: none; }
.toolkit-cta .btn-primary:hover { background: #fff; }
.toolkit-caption { text-align: center; margin-top: 8px; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.55); white-space: nowrap; }

@media (max-width: 900px) {
  .icon-feature { flex-basis: 46%; border-left: none; }
  .toolkit-grid { grid-template-columns: 1fr; text-align: center; }
  .toolkit-item { flex-direction: column; align-items: center; }
}
@media (max-width: 600px) {
  .home-hero-copy { min-height: 0; }
  .home-hero-plant { display: none; }
  .icon-feature { flex-basis: 100%; }
}

/* ---------- Home landing: Premium upsell section ---------- */
.press-logo-bar { background: var(--bg); padding: 26px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.press-logo-bar .container { display: flex; align-items: center; justify-content: center; gap: 44px; flex-wrap: wrap; }
.press-logo-bar .press-logo { font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; color: var(--text-secondary); opacity: 0.75; white-space: nowrap; }
.press-logo-bar .press-logo.sans { font-family: var(--font-sans); }

/* Section bg reproduces the vertical gradient sampled from the photo's own
   left edge, so the photo (feathered on its left edge below) blends into the
   text side with no visible seam — same technique as the reference build. */
.premium-section {
  padding: 0; overflow: hidden;
  background: linear-gradient(180deg,
    #f1ebe6 0%, #e8e2da 11%, #e7e1d9 23%, #e7e0d8 35%, #e4ded6 47%,
    #e0d9d0 59%, #dbd3c9 69%, #dcd3c9 76%, #d6caba 82%, #c6b199 87%,
    #cfb49a 91%, #dcc9b4 94%, #dcc9b2 97%, #d8c3a7 100%);
}
.premium-grid { display: grid; grid-template-columns: 34% 66%; align-items: stretch; gap: 0; }
.premium-copy { min-width: 0; padding: 64px 4vw 64px clamp(24px, 6vw, 140px); display: flex; flex-direction: column; justify-content: center; }
.premium-copy h2 { font-size: clamp(1.4rem, 3.4vw, 2.6rem); line-height: 1.18; margin: 18px 0 16px; }
.premium-copy .lede { margin-bottom: 26px; font-size: clamp(0.85rem, 1.1vw, 1rem); }
.check-feature-list li { flex-wrap: wrap; }
.premium-photo { position: relative; overflow: hidden; aspect-ratio: 1016 / 833; align-self: end; }
.premium-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center bottom;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 34px);
  mask-image: linear-gradient(to right, transparent 0, #000 34px);
}

/* Dark mode: same problem and fix as .home-hero above — the photo carries a
   fixed light wall/table tone, so darken it and vignette its outer edges
   (table below, vase and plant at the right) into var(--bg) while leaving
   the book covers themselves vivid. */
[data-theme="dark"] .premium-section { background: var(--bg); }
[data-theme="dark"] .premium-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, var(--bg) 0%, transparent 22%, transparent 55%, var(--bg) 100%),
    linear-gradient(90deg, transparent 70%, var(--bg) 100%),
    radial-gradient(90% 90% at 100% 0%, var(--bg) 0%, transparent 35%);
  mix-blend-mode: multiply;
}
[data-theme="dark"] .premium-photo img { filter: brightness(0.8) saturate(0.95); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .premium-section { background: var(--bg); }
  :root:not([data-theme="light"]) .premium-photo::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      linear-gradient(180deg, var(--bg) 0%, transparent 22%, transparent 55%, var(--bg) 100%),
      linear-gradient(90deg, transparent 70%, var(--bg) 100%),
      radial-gradient(90% 90% at 100% 0%, var(--bg) 0%, transparent 35%);
    mix-blend-mode: multiply;
  }
  :root:not([data-theme="light"]) .premium-photo img { filter: brightness(0.8) saturate(0.95); }
}

.badge-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: var(--radius-full); padding: 7px 16px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; margin-bottom: 22px; color: var(--text-primary); width: fit-content; }

.check-feature-list { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 14px; }
.check-feature-list li { display: flex; align-items: center; gap: 12px; font-size: 0.95rem; color: var(--text-primary); }
.check-feature-list .circle { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; background: var(--color-forest); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; }

.btn-forest { background: var(--color-forest); color: #fff; border-radius: var(--radius-full); }
.btn-forest:hover { background: var(--color-forest-700); }

.premium-rating { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 0.9rem; color: var(--text-secondary); }
.premium-rating strong { color: var(--text-primary); }

.brand-strip { background: var(--color-forest); color: rgba(255,255,255,0.85); padding: 26px 0; }
.brand-strip .container { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; text-align: center; }
.brand-strip .brand-strip-name { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.04em; color: #fff; }
.brand-strip .brand-strip-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.25); }
.brand-strip .brand-strip-tag { font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.7); }

@media (max-width: 900px) {
  .premium-grid { grid-template-columns: 1fr; }
  .premium-photo { order: -1; align-self: stretch; }
  .premium-photo img { mask-image: none; -webkit-mask-image: none; }
  .premium-copy { padding: 40px 24px; }
}
@media (max-width: 600px) {
  .premium-copy h2 { font-size: 2rem; }
  .press-logo-bar .container { gap: 24px; }
}

/* ---------- Home landing: Toolkit detail (light, mockup previews) ---------- */
.toolkit-detail { background: var(--bg-elevated); padding: 90px 40px 0; text-align: center; position: relative; overflow: hidden; }
.toolkit-detail h2 { font-size: 2.2rem; margin-bottom: 12px; }
.td-eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text-tertiary); margin-bottom: 50px; }

.tk-plant { position: absolute; bottom: 0; z-index: 0; pointer-events: none; height: auto; }
.tk-plant.l { left: 0; width: 8vw; min-width: 70px; max-width: 124px; }
.tk-plant.r { right: 0; width: 9vw; min-width: 78px; max-width: 140px; }

.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; height: 420px; overflow: hidden; }
.detail-card { text-align: left; }
.detail-card .ic { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: var(--color-forest); }
.detail-card h4 { font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 10px; text-align: center; }
.detail-card p { font-size: 0.85rem; color: var(--text-secondary); text-align: center; line-height: 1.55; margin-bottom: 22px; padding: 0 8px; }
.dc-icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.mock-card { background: #fff; border: 1px solid var(--border); border-radius: 10px 10px 0 0; padding: 20px; min-height: 220px; box-shadow: var(--shadow-lg); text-align: left; }
.mock-tag { font-size: 0.7rem; color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.mock-q { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.3; margin-bottom: 14px; color: var(--text-primary); }
.mock-line { height: 1px; background: var(--border); margin-bottom: 10px; }
.mock-placeholder { font-size: 0.8rem; color: var(--text-tertiary); }
.waveform { display: flex; align-items: center; gap: 2px; height: 36px; margin-bottom: 16px; }
.waveform span { width: 3px; background: var(--color-primary); border-radius: 2px; opacity: 0.75; display: block; }
.play-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-size: 0.7rem; color: var(--text-tertiary); }
.play-btn { width: 26px; height: 26px; border-radius: 50%; background: var(--color-forest); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.6rem; }
.progress-track { flex: 1; height: 3px; background: var(--border); border-radius: 2px; position: relative; }
.progress-track::before { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 32%; background: var(--color-primary); border-radius: 2px; }
.toolbar-row { display: flex; gap: 14px; color: var(--text-tertiary); font-size: 0.8rem; border-top: 1px solid var(--border); padding-top: 12px; margin-bottom: 12px; }
.editor-text { font-size: 0.8rem; color: var(--text-primary); line-height: 1.6; }
.editor-text .squiggle { text-decoration: underline; text-decoration-color: var(--error); text-decoration-style: wavy; }
.tooltip-card { background: #fff; border-radius: 8px; box-shadow: var(--shadow-lg); padding: 14px 16px; margin-top: 10px; font-size: 0.75rem; max-width: 170px; }
.tooltip-card .q { color: var(--text-tertiary); margin-bottom: 4px; }
.tooltip-card .ans { color: #5a2fb0; font-weight: 600; margin-bottom: 10px; }
.tooltip-actions { display: flex; gap: 8px; }
.tt-btn { font-size: 0.7rem; padding: 6px 12px; border-radius: 6px; border: none; cursor: default; }
.tt-ignore { background: var(--surface-muted); color: var(--text-secondary); }
.tt-accept { background: #5a2fb0; color: #fff; }

/* ---------- Home landing: Questions library (dark) ---------- */
.questions-dark { background: var(--color-forest); color: #f2ead9; padding: 70px 40px; }
.qd-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; }
.qd-head h2 { color: #fff; font-size: 1.9rem; margin-bottom: 8px; }
.qd-head p { font-size: 0.9rem; color: #c9c2ae; margin: 0; }
.qd-head-cta { text-align: right; }
.qd-head .btn-cream { background: var(--color-primary-100); color: var(--color-forest-700); }
.qd-head .btn-cream:hover { background: #fff; }
.qd-price { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: #c9c2ae; margin-top: 10px; }

.q-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.q-card { background: var(--bg-elevated); color: var(--text-primary); border-radius: 8px; padding: 22px 16px 54px; min-height: 180px; position: relative; }
.q-card .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: var(--color-forest); }
.q-card p { font-family: var(--font-serif); font-size: 0.95rem; line-height: 1.3; color: var(--text-primary); margin: 0; }
.q-card .tag { position: absolute; bottom: 16px; left: 16px; font-size: 0.65rem; letter-spacing: 0.08em; color: var(--text-tertiary); text-transform: uppercase; }

.write-own { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 34px; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: #f2ead9; }
.write-own .ic { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.4); display: flex; align-items: center; justify-content: center; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; height: auto; gap: 44px; }
  .tk-plant { display: none; }
  .q-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .toolkit-detail { padding: 60px 20px 0; }
  .questions-dark { padding: 50px 20px; }
  .qd-head { flex-direction: column; align-items: flex-start; }
  .qd-head-cta { text-align: left; }
  .q-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Home landing: photo collage + newsletter signup ---------- */
.collage { background: var(--bg); padding: 0; font-size: 0; line-height: 0; }
.collage-strip { width: 100%; height: auto; display: block; }

.newsletter-band { background: var(--color-forest); color: #f2ead9; padding: 44px 40px; }
.newsletter-top { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto; }
.newsletter-left { display: flex; align-items: center; gap: 20px; max-width: 480px; }
.newsletter-left .mail-ic { width: 56px; height: 56px; min-width: 56px; border-radius: 50%; border: 1.5px solid rgba(242,234,217,0.35); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.newsletter-left h3 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 500; margin-bottom: 4px; color: #fff; }
.newsletter-left p { font-size: 0.85rem; color: #c9c2ae; margin: 0; }
.newsletter-form { display: flex; gap: 14px; flex: 1; max-width: 520px; min-width: 260px; }
.newsletter-form input { flex: 1; min-width: 0; padding: 14px 22px; border-radius: var(--radius-full); border: none; font-size: 0.9rem; background: #fff; color: var(--text-primary); }
.newsletter-form input::placeholder { color: var(--text-tertiary); }
.newsletter-form .btn { white-space: nowrap; }

@media (max-width: 700px) {
  .newsletter-top { flex-direction: column; align-items: flex-start; }
  .newsletter-form { max-width: 100%; width: 100%; }
}

/* ---------- How It Works: photographic hero + glass steps ---------- */
.hiw-hero {
  position: relative; padding: 64px 24px 88px; text-align: center; overflow: hidden;
  background-color: #f3eadf;
  background-image: url('../img/hiw-hero-bg.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
/* Dark mode: the flat-lay photo is a near-white desk, so tint it with the
   active theme's own background color (via color-mix, so it tracks every
   page theme automatically) instead of leaving a light photo behind
   dark-mode text. */
[data-theme="dark"] .hiw-hero {
  background-color: var(--bg);
  background-image: linear-gradient(color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 80%, transparent)), url('../img/hiw-hero-bg.jpg');
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hiw-hero {
    background-color: var(--bg);
    background-image: linear-gradient(color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 80%, transparent)), url('../img/hiw-hero-bg.jpg');
  }
}
.hiw-hero-inner { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; }
.hiw-hero h1 { font-size: clamp(1.9rem, 3.5vw, 3.75rem); line-height: 1.16; margin: 0 auto 24px; }
.hiw-hero .lede { font-size: clamp(0.95rem, 1.15vw, 1.19rem); max-width: 640px; margin: 0 auto; color: var(--text-secondary); }

.hiw-divider { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 40px 0 44px; }
.hiw-divider .ln { width: 74px; height: 1px; background: var(--color-primary-100); }

.hiw-steps { max-width: 730px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.hiw-step {
  display: flex; align-items: flex-start; gap: 22px; text-align: left;
  /* Theme-aware "glass" tint (was a hardcoded near-white rgba) so the card
     reads as frosted glass over the photo in both light and dark mode. */
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border-radius: var(--radius-lg); padding: 26px 30px; box-shadow: var(--shadow-sm);
}
.hiw-step .num {
  width: 42px; height: 42px; min-width: 42px; border-radius: 50%; background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; font-weight: 700; margin-top: 4px;
}
.hiw-step .tile {
  width: 114px; height: 114px; min-width: 114px; border-radius: var(--radius-md); background: var(--color-primary-50);
  display: flex; align-items: center; justify-content: center; color: var(--color-primary-600);
}
.hiw-step .tile svg { width: 56px; height: 56px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hiw-step .body { padding-top: 6px; }
.hiw-step h3 { font-size: 1.3rem; margin-bottom: 10px; }
.hiw-step p { font-size: 0.95rem; line-height: 1.65; color: var(--text-secondary); }

/* --color-primary-50/600 are fixed light-tint shades (no dark variant), so
   the icon tile stays a pale peach square even in dark mode — swap it to
   the theme's own dark surface with the accent color for the glyph. */
[data-theme="dark"] .hiw-step .tile,
[data-theme="dark"] .hiw-feat .ic { background: var(--surface-muted); color: var(--color-primary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hiw-step .tile,
  :root:not([data-theme="light"]) .hiw-feat .ic { background: var(--surface-muted); color: var(--color-primary); }
}

/* ---------- How It Works: photographic "what's inside" ---------- */
.hiw-inside {
  position: relative; padding: 74px 30px 84px; text-align: center;
  background-color: #f2ece1;
  background-image: linear-gradient(rgba(247,243,235,0.55), rgba(247,243,235,0.55)), url('../img/hiw-inside-bg.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
[data-theme="dark"] .hiw-inside {
  background-color: var(--bg);
  background-image: linear-gradient(color-mix(in srgb, var(--bg) 82%, transparent), color-mix(in srgb, var(--bg) 82%, transparent)), url('../img/hiw-inside-bg.jpg');
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hiw-inside {
    background-color: var(--bg);
    background-image: linear-gradient(color-mix(in srgb, var(--bg) 82%, transparent), color-mix(in srgb, var(--bg) 82%, transparent)), url('../img/hiw-inside-bg.jpg');
  }
}
.hiw-inside .eyebrow { font-size: 0.8rem; letter-spacing: 0.1em; font-weight: 700; color: var(--color-primary); margin-bottom: 16px; }
.hiw-inside h2 { font-size: clamp(1.75rem, 2.9vw, 2.75rem); line-height: 1.22; max-width: 20ch; margin: 0 auto 16px; }
.hiw-inside h2 em { font-style: italic; font-family: var(--font-serif); }
.hiw-inside-sub { font-size: clamp(0.875rem, 1.05vw, 1.0625rem); color: var(--text-secondary); max-width: 520px; margin: 0 auto 46px; }

.hiw-feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; max-width: 1150px; margin: 0 auto; }
.hiw-feat { position: relative; background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 26px 26px 46px; text-align: left; box-shadow: var(--shadow-sm); }
.hiw-feat .ic { width: 46px; height: 46px; border-radius: 11px; background: var(--color-primary-50); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 20px; }
.hiw-feat h3 { font-size: 1.05rem; margin-bottom: 8px; }
.hiw-feat p { font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary); }
.hiw-feat .go { position: absolute; right: 22px; bottom: 20px; color: var(--color-primary); display: flex; align-items: center; }
.hiw-feat .go svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- How It Works: photo-bookend closing CTA ---------- */
.hiw-cta-wrap { background: #f0e6d6; padding: 74px 24px 84px; }
.hiw-cta {
  position: relative; max-width: 1400px; margin: 0 auto; min-height: 480px;
  border-radius: var(--radius-lg); overflow: hidden; background: #fbf3ea;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center;
}
.hiw-cta-end { position: absolute; top: 0; bottom: 0; width: 28%; object-fit: cover; height: 100%; }
.hiw-cta-end.l { left: 0; }
.hiw-cta-end.r { right: 0; }
.hiw-cta-inner { position: relative; z-index: 1; text-align: center; padding: 40px 24px; max-width: 560px; }
/* h2 is pinned to a fixed dark forest green in light mode for contrast
   against the pale card — that same fixed color goes near-invisible once
   the card itself turns dark, so dark mode swaps it back to the normal
   theme-aware text token. */
.hiw-cta h2 { font-size: clamp(2rem, 3.4vw, 3.6rem); line-height: 1.12; color: var(--color-forest-700); margin-bottom: 22px; }
.hiw-cta p.lede { font-size: clamp(0.95rem, 1.1vw, 1.125rem); color: var(--text-secondary); margin-bottom: 34px; }
.hiw-cta .fine { display: block; margin-top: 22px; font-size: 0.9rem; color: var(--text-tertiary); }

[data-theme="dark"] .hiw-cta-wrap { background: var(--bg); }
[data-theme="dark"] .hiw-cta { background: var(--surface); }
[data-theme="dark"] .hiw-cta-end { filter: brightness(0.32) saturate(0.85); }
[data-theme="dark"] .hiw-cta h2 { color: var(--text-primary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hiw-cta-wrap { background: var(--bg); }
  :root:not([data-theme="light"]) .hiw-cta { background: var(--surface); }
  :root:not([data-theme="light"]) .hiw-cta-end { filter: brightness(0.32) saturate(0.85); }
  :root:not([data-theme="light"]) .hiw-cta h2 { color: var(--text-primary); }
}

@media (max-width: 900px) {
  .hiw-feat-grid { grid-template-columns: repeat(2, 1fr); }
  .hiw-step { flex-wrap: wrap; }
  .hiw-step .tile { width: 84px; height: 84px; min-width: 84px; }
  .hiw-step .tile svg { width: 42px; height: 42px; }
  .hiw-cta { min-height: 0; }
  .hiw-cta-end { width: 22%; opacity: 0.5; }
  .hiw-cta-inner { padding: 56px 18px; }
}
@media (max-width: 660px) { .hiw-feat-grid { grid-template-columns: 1fr; } }

/* ---------- Pricing: photo-framed hero + plan cards ---------- */
.framed { position: relative; overflow: hidden; }
.framed .edge { position: absolute; top: 0; bottom: 0; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
.framed .edge.l { left: 0; }
.framed .edge.r { right: 0; }
.framed .framed-inner { position: relative; z-index: 1; }

.price-hero { background: #f8f2eb; padding: 52px 24px 70px; text-align: center; }
[data-theme="dark"] .price-hero { background: var(--bg); }
[data-theme="dark"] .price-hero .edge { filter: brightness(0.32) saturate(0.85); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .price-hero { background: var(--bg); }
  :root:not([data-theme="light"]) .price-hero .edge { filter: brightness(0.32) saturate(0.85); }
}
.price-hero .edge { width: 14.6%; min-width: 100px; max-width: 132px; }
.price-hero .framed-inner { max-width: 1042px; margin: 0 auto; }
.price-hero h1 { font-size: clamp(2rem, 4.1vw, 3.875rem); line-height: 1.1; margin-bottom: 22px; }
.price-hero .lede { max-width: 640px; margin: 0 auto 34px; }

.toggle-row { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 40px; }
.toggle-row .lab { font-size: 1.03rem; color: var(--text-tertiary); cursor: pointer; }
.toggle-row .lab.on { color: var(--text-primary); font-weight: 700; }
.sw { width: 58px; height: 31px; border-radius: var(--radius-full); background: var(--color-forest); position: relative; flex-shrink: 0; transition: background 0.18s; border: none; cursor: pointer; padding: 0; }
.sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 23px; height: 23px; border-radius: 50%; background: #fff; transition: transform 0.18s; }
.sw.annual::after { transform: translateX(27px); }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; align-items: start; }
.plan { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 30px 30px; text-align: left; position: relative; display: flex; flex-direction: column; min-height: 582px; }
.plan.pop { border: 1.6px solid var(--color-primary); background: var(--color-primary-50); }
.plan .badge-pop { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: var(--color-primary-100); color: var(--color-primary-700); font-size: 0.8rem; font-weight: 500; padding: 6px 17px; border-radius: var(--radius-full); white-space: nowrap; }
.plan .plan-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; color: var(--color-forest); }
.plan.pop .plan-ic { background: var(--color-primary-100); color: var(--color-primary-700); }

/* --color-primary-50/100/700 and --color-forest are fixed shades with no
   dark variant, so the "most popular" card, its badge, and every plan's
   icon circle would stay light/mismatched in dark mode. Re-derive them
   from the active theme via color-mix instead. */
[data-theme="dark"] .plan.pop { background: color-mix(in srgb, var(--color-primary) 10%, var(--bg-elevated)); }
[data-theme="dark"] .plan .badge-pop { background: var(--bg-elevated); color: var(--color-primary); border: 1px solid var(--color-primary); }
[data-theme="dark"] .plan .plan-ic { color: var(--color-primary); }
[data-theme="dark"] .plan.pop .plan-ic { background: color-mix(in srgb, var(--color-primary) 22%, var(--bg-elevated)); color: var(--color-primary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .plan.pop { background: color-mix(in srgb, var(--color-primary) 10%, var(--bg-elevated)); }
  :root:not([data-theme="light"]) .plan .badge-pop { background: var(--bg-elevated); color: var(--color-primary); border: 1px solid var(--color-primary); }
  :root:not([data-theme="light"]) .plan .plan-ic { color: var(--color-primary); }
  :root:not([data-theme="light"]) .plan.pop .plan-ic { background: color-mix(in srgb, var(--color-primary) 22%, var(--bg-elevated)); color: var(--color-primary); }
}
.plan h3 { font-size: 1.35rem; margin-bottom: 16px; }
.plan .price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.plan .price-row .amt { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.plan .price-row .per { font-size: 0.9rem; color: var(--text-tertiary); }
.plan .annual-note { font-size: 0.85rem; color: var(--success); margin-bottom: 14px; min-height: 20px; visibility: hidden; }
.plan .blurb { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55; padding-bottom: 20px; border-bottom: 1px solid var(--border-soft); margin-bottom: 20px; }
.plan ul.plan-tick-list { list-style: none; display: flex; flex-direction: column; gap: 13px; margin-bottom: 26px; padding: 0; }
.plan ul.plan-tick-list li { display: flex; align-items: flex-start; gap: 11px; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.45; }
.tick { width: 19px; height: 19px; min-width: 19px; border-radius: 50%; background: var(--success); flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px; color: #fff; }
.tick svg, .tk svg { width: 12px; height: 12px; }
.tick.off { background: var(--border); }
.plan .plan-cta { margin-top: auto; display: block; text-align: center; }
.foot-note { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 34px; font-size: 0.92rem; color: var(--text-tertiary); }
.foot-note .lk { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; color: var(--color-primary-600); }

/* ---------- Pricing: Family & Couples band ---------- */
.family-band {
  display: flex; gap: 40px; align-items: center; text-align: left;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px 36px;
}
.family-band-copy { flex: 0 0 280px; }
.family-band-copy h3 { font-size: 1.3rem; margin: 14px 0 6px; }
.family-band-copy .blurb { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 14px; border: none; padding: 0; }
.family-band-copy .price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.family-band-copy .price-row .amt { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.family-band-copy .price-row .per { font-size: 0.88rem; color: var(--text-tertiary); }
.family-band-copy .annual-note { font-size: 0.83rem; color: var(--success); margin-bottom: 16px; min-height: 18px; visibility: hidden; }
.family-band-list { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 24px; }
.family-band-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.4; }

/* ---------- Pricing: Lifetime band ---------- */
.lifetime-band {
  display: flex; align-items: center; gap: 22px; text-align: left; margin-top: 22px;
  background: var(--surface-muted); border-radius: var(--radius-lg); padding: 22px 30px;
}
.lifetime-ic { font-size: 1.8rem; flex-shrink: 0; }
.lifetime-copy { flex: 1; min-width: 0; }
.lifetime-copy h3 { font-size: 1.05rem; margin-bottom: 4px; }
.lifetime-copy p { font-size: 0.87rem; color: var(--text-secondary); margin: 0; }
.lifetime-cta { flex-shrink: 0; white-space: nowrap; }

/* ---------- Pricing: Yearbooks ---------- */
.yearbook-section { background: #f8f2e7; padding: 56px 24px 68px; text-align: center; }
.yearbook-section .framed-inner { max-width: 900px; margin: 0 auto; }
.yearbook-section .eyebrow { font-size: 0.8rem; letter-spacing: 0.1em; font-weight: 700; color: var(--color-primary); margin-bottom: 14px; }
.yearbook-section h2 { font-size: clamp(1.6rem, 2.6vw, 2.4rem); margin-bottom: 10px; }
.yearbook-sub { font-size: 0.94rem; color: var(--text-secondary); max-width: 480px; margin: 0 auto 40px; }
.yb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 36px; }
.yb-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 28px 28px; text-align: left; }
.yb-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.yb-card .price-row { margin-bottom: 12px; }
.yb-card .price-row .amt { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.yb-card .blurb { font-size: 0.86rem; color: var(--text-secondary); margin-bottom: 16px; }
.yb-list { list-style: none; margin: 0 0 22px; padding: 0; font-size: 0.86rem; color: var(--text-secondary); }
.yb-list li { padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.yb-list li:last-child { border-bottom: none; }
.yb-list-price li { display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--text-primary); }
.yb-cta { display: block; text-align: center; }
.yb-discount { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 28px; text-align: left; }
.yb-discount h4 { font-size: 0.95rem; margin-bottom: 14px; }
.yb-discount-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.yb-discount-table th { text-align: left; color: var(--text-tertiary); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.yb-discount-table td { padding: 9px 0; border-bottom: 1px solid var(--border-soft); color: var(--text-secondary); }
.yb-discount-table tr:last-child td { border-bottom: none; }
.yb-discount-table td:last-child, .yb-discount-table th:last-child { text-align: right; }

[data-theme="dark"] .yearbook-section { background: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .yearbook-section { background: var(--bg); }
}

@media (max-width: 780px) {
  .family-band { flex-direction: column; align-items: stretch; }
  .family-band-copy { flex: none; }
  .family-band-list { grid-template-columns: 1fr; }
  .lifetime-band { flex-direction: column; text-align: center; }
  .yb-grid { grid-template-columns: 1fr; }
}

/* ---------- Pricing: photo-framed compare table ---------- */
.compare-section { background: #f8eee3; padding: 56px 24px 74px; text-align: center; }
.compare-section .edge { width: 15.6%; min-width: 110px; max-width: 140px; }
.compare-section .framed-inner { max-width: 1114px; margin: 0 auto; }
.compare-section .eyebrow { font-size: 0.8rem; letter-spacing: 0.1em; font-weight: 700; color: var(--color-primary); margin-bottom: 16px; }
.compare-section h2 { font-size: clamp(1.75rem, 3.1vw, 3rem); color: var(--color-forest-700); margin-bottom: 40px; }
.table-card { background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 12px 34px 20px; box-shadow: var(--shadow-lg); overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; text-align: left; }
.compare-table thead th { font-size: 0.78rem; letter-spacing: 0.1em; font-weight: 700; color: var(--color-primary-700); padding: 22px 10px 16px; border-bottom: 1px solid var(--border-soft); }

/* h2 and the table header row are pinned to fixed dark shades (forest-700,
   primary-700) for contrast against the light photo/card — both go
   near-invisible once those backgrounds turn dark. */
[data-theme="dark"] .compare-section { background: var(--bg); }
[data-theme="dark"] .compare-section .edge { filter: brightness(0.32) saturate(0.85); }
[data-theme="dark"] .compare-section h2 { color: var(--text-primary); }
[data-theme="dark"] .compare-table thead th { color: var(--color-primary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .compare-section { background: var(--bg); }
  :root:not([data-theme="light"]) .compare-section .edge { filter: brightness(0.32) saturate(0.85); }
  :root:not([data-theme="light"]) .compare-section h2 { color: var(--text-primary); }
  :root:not([data-theme="light"]) .compare-table thead th { color: var(--color-primary); }
}
/* "minimalist" is the one page theme whose --color-primary is itself a
   near-black neutral by design (not a saturated accent), so text colored
   with it goes near-invisible on a dark card. Every other page theme keeps
   the accented look above; this only patches the minimalist edge case. */
[data-theme="dark"][data-page-theme="minimalist"] .compare-table thead th,
[data-theme="dark"][data-page-theme="minimalist"] .plan .badge-pop { color: var(--text-primary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-page-theme="minimalist"] .compare-table thead th,
  :root:not([data-theme="light"])[data-page-theme="minimalist"] .plan .badge-pop { color: var(--text-primary); }
}
.compare-table thead th:not(:first-child) { text-align: center; }
.compare-table tbody td { padding: 17px 10px; border-bottom: 1px solid var(--border-soft); font-size: 0.92rem; color: var(--text-secondary); vertical-align: middle; }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody td:not(:first-child) { text-align: center; }
.feat-cell { display: flex; align-items: center; gap: 14px; }
.feat-cell .fi { width: 36px; height: 36px; min-width: 36px; border-radius: 9px; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.compare-table .dash { color: var(--text-tertiary); }
.tk { width: 22px; height: 22px; border-radius: 50%; background: var(--success); display: inline-flex; align-items: center; justify-content: center; color: #fff; }

@media (max-width: 1080px) {
  .plans { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
  .plan { min-height: 0; }
  .framed .edge { display: none; }
}

/* ---------- Resource Hub ---------- */
.hub-head { position: relative; padding: 6px 0 26px; text-align: left; }
.hub-head h1 { font-size: 1.9rem; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hub-head p { font-size: 0.9rem; color: var(--text-tertiary); margin-bottom: 22px; }
.hub-search { position: relative; max-width: 420px; }
.hub-search input { width: 100%; padding: 13px 16px 13px 42px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-elevated); font-size: 0.9rem; outline: none; color: var(--text-primary); }
.hub-search input::placeholder { color: var(--text-tertiary); }
.hub-search .mg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); display: flex; }
.hub-art { position: absolute; right: 0; top: -10px; width: 220px; pointer-events: none; opacity: 0.9; }

.hub-panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 22px; }
.hub-panel-head { display: flex; align-items: center; gap: 9px; font-size: 1rem; font-weight: 700; }
.hub-panel-sub { font-size: 0.8rem; color: var(--text-tertiary); margin: 4px 0 18px 27px; }

.feat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; overflow: hidden; }
.feat-card { border-radius: var(--radius-md); overflow: hidden; position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 220px; padding: 20px 22px; cursor: pointer; }
.feat-card.tone-a { background: linear-gradient(115deg, #fbeadb 0%, #f8e2cf 52%, #f3d8c2 100%); }
.feat-card.tone-b { background: linear-gradient(115deg, #e7dcf3 0%, #dccdec 55%, #cfc0e4 100%); }
.feat-card-art { position: absolute; right: 18px; bottom: 18px; width: 116px; height: 116px; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 24px rgba(40,28,14,0.22); pointer-events: none; }
.feat-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feat-card-art svg { width: 100%; height: 100%; }
.feat-card .tag { display: inline-block; background: rgba(255,255,255,0.66); color: var(--color-primary-700); font-size: 0.68rem; letter-spacing: 0.06em; font-weight: 700; padding: 5px 11px; border-radius: var(--radius-full); margin-bottom: 14px; }
.feat-card.tone-b .tag { color: #5f4b86; }
.feat-card h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.28; margin-bottom: 9px; max-width: 80%; }
.feat-card p { font-size: 0.82rem; line-height: 1.55; color: #5a5047; max-width: 78%; margin-bottom: 12px; }
.feat-card.tone-b p { color: #4e4560; }
.feat-card .meta { font-size: 0.75rem; color: #6f6355; display: flex; align-items: center; gap: 6px; max-width: 66%; position: relative; z-index: 1; }
.feat-card.tone-b .meta { color: #5b5270; }

/* tone-a/tone-b are self-contained light gradient cards with fixed dark
   text baked in — legible on their own, but a pair of light islands once
   the rest of the page turns dark. Re-tint them dark using the theme's own
   accent colors (primary for tone-a, the fixed AI-purple accent for
   tone-b, both already dark-mode aware) so they read as part of the page. */
[data-theme="dark"] .feat-card.tone-a {
  background: linear-gradient(115deg, color-mix(in srgb, var(--color-primary) 26%, var(--bg-elevated)) 0%, color-mix(in srgb, var(--color-primary) 14%, var(--bg-elevated)) 100%);
}
[data-theme="dark"] .feat-card.tone-b {
  background: linear-gradient(115deg, color-mix(in srgb, var(--ai-accent) 30%, var(--bg-elevated)) 0%, color-mix(in srgb, var(--ai-accent) 16%, var(--bg-elevated)) 100%);
}
[data-theme="dark"] .feat-card .tag { background: rgba(255,255,255,0.14); color: var(--text-primary); }
[data-theme="dark"] .feat-card.tone-b .tag { color: var(--text-primary); }
[data-theme="dark"] .feat-card p,
[data-theme="dark"] .feat-card.tone-b p { color: var(--text-secondary); }
[data-theme="dark"] .feat-card .meta,
[data-theme="dark"] .feat-card.tone-b .meta { color: var(--text-tertiary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .feat-card.tone-a {
    background: linear-gradient(115deg, color-mix(in srgb, var(--color-primary) 26%, var(--bg-elevated)) 0%, color-mix(in srgb, var(--color-primary) 14%, var(--bg-elevated)) 100%);
  }
  :root:not([data-theme="light"]) .feat-card.tone-b {
    background: linear-gradient(115deg, color-mix(in srgb, var(--ai-accent) 30%, var(--bg-elevated)) 0%, color-mix(in srgb, var(--ai-accent) 16%, var(--bg-elevated)) 100%);
  }
  :root:not([data-theme="light"]) .feat-card .tag { background: rgba(255,255,255,0.14); color: var(--text-primary); }
  :root:not([data-theme="light"]) .feat-card.tone-b .tag { color: var(--text-primary); }
  :root:not([data-theme="light"]) .feat-card p,
  :root:not([data-theme="light"]) .feat-card.tone-b p { color: var(--text-secondary); }
  :root:not([data-theme="light"]) .feat-card .meta,
  :root:not([data-theme="light"]) .feat-card.tone-b .meta { color: var(--text-tertiary); }
}

.topics { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.topic-btn { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 8px 14px; text-align: center; font-size: 0.75rem; line-height: 1.35; color: var(--text-secondary); cursor: pointer; }
.topic-btn:hover { background: var(--surface-muted); }
.topic-btn.on { background: var(--color-primary-50); border-color: var(--color-primary-100); color: var(--color-primary-700); }
.topic-btn .em { font-size: 1.25rem; display: block; margin-bottom: 9px; }

/* Both pinned to fixed light-only shades (primary-50/100/700, and a flat
   #fff) with no dark variant. Text uses --text-primary rather than
   --color-primary: the "minimalist" page theme's --color-primary is itself
   a near-black neutral by design, which would put near-invisible text on
   top of a background tinted from that same near-black color. */
[data-theme="dark"] .topic-btn.on { background: color-mix(in srgb, var(--color-primary) 20%, var(--bg-elevated)); border-color: var(--color-primary); color: var(--text-primary); }
[data-theme="dark"] .hub-sel { background: var(--bg-elevated); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topic-btn.on { background: color-mix(in srgb, var(--color-primary) 20%, var(--bg-elevated)); border-color: var(--color-primary); color: var(--text-primary); }
  :root:not([data-theme="light"]) .hub-sel { background: var(--bg-elevated); }
}

.hub-filters { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.hub-sel { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 13px; font-size: 0.82rem; color: var(--text-secondary); white-space: nowrap; flex-shrink: 0; }
.hub-sel select { border: none; outline: none; background: none; font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; }
.hub-filters .right { display: flex; align-items: center; gap: 9px; }
.hub-views { display: flex; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.hub-views button { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #fff; border: none; color: var(--text-tertiary); }
.hub-views button.on { background: var(--color-primary-100); color: var(--color-primary-700); }

.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.hub-grid.list-view { grid-template-columns: 1fr; }
.hub-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow var(--dur-med) var(--ease), transform var(--dur-med) var(--ease); }
.hub-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hub-thumb { height: 148px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.hub-chip { align-self: flex-start; font-size: 0.65rem; letter-spacing: 0.05em; font-weight: 700; padding: 4px 9px; border-radius: var(--radius-full); margin-bottom: 10px; text-transform: uppercase; }
.hub-card h4 { font-size: 0.92rem; margin-bottom: 8px; }
.hub-card p { font-size: 0.8rem; line-height: 1.55; color: var(--text-tertiary); margin-bottom: 12px; }
.hub-card .meta { margin-top: auto; font-size: 0.73rem; color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; }

.hub-news { position: relative; overflow: hidden; background: linear-gradient(100deg, var(--color-primary-50), #fbe4d0); border-radius: var(--radius-lg); padding: 24px 26px; margin-bottom: 8px; }
.hub-news h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin-bottom: 6px; }
.hub-news p { font-size: 0.8rem; color: #7a6555; margin: 0 0 16px 30px; }
.hub-news-form { display: flex; gap: 10px; margin-left: 30px; max-width: 420px; }
.hub-news-form input { flex: 1; min-width: 0; padding: 11px 15px; border-radius: var(--radius-sm); border: 1px solid #f0d5bd; background: var(--bg-elevated); font-size: 0.82rem; outline: none; }
.hub-news .fine { font-size: 0.7rem; color: #a08b78; margin: 10px 0 0 30px; }
.hub-news .plane { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: 150px; pointer-events: none; opacity: 0.85; }

/* Same fixed-light-gradient-with-baked-in-dark-text pattern as the
   feat-cards above: re-tint dark using the theme's own primary accent, and
   swap the fixed dark copy colors for the normal text tokens. */
[data-theme="dark"] .hub-news {
  background: linear-gradient(100deg, color-mix(in srgb, var(--color-primary) 16%, var(--bg-elevated)), color-mix(in srgb, var(--color-primary) 8%, var(--bg-elevated)));
  border: 1px solid var(--border);
}
[data-theme="dark"] .hub-news p { color: var(--text-secondary); }
[data-theme="dark"] .hub-news-form input { border-color: var(--border); color: var(--text-primary); }
[data-theme="dark"] .hub-news .fine { color: var(--text-tertiary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hub-news {
    background: linear-gradient(100deg, color-mix(in srgb, var(--color-primary) 16%, var(--bg-elevated)), color-mix(in srgb, var(--color-primary) 8%, var(--bg-elevated)));
    border: 1px solid var(--border);
  }
  :root:not([data-theme="light"]) .hub-news p { color: var(--text-secondary); }
  :root:not([data-theme="light"]) .hub-news-form input { border-color: var(--border); color: var(--text-primary); }
  :root:not([data-theme="light"]) .hub-news .fine { color: var(--text-tertiary); }
}

@media (max-width: 1100px) { .topics { grid-template-columns: repeat(4, 1fr); } .hub-art { display: none; } }
@media (max-width: 900px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } .feat-row { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .hub-grid { grid-template-columns: 1fr; }
  .topics { grid-template-columns: repeat(3, 1fr); }
  .hub-news-form { margin-left: 0; flex-direction: column; }
  .hub-news p { margin-left: 0; }
  .hub-news .fine { margin-left: 0; }
  .hub-news .plane { display: none; }
}

/* ---------- About page: photo-framed sections ---------- */
/* edges dissolve into the page instead of ending on a hard line */
.about-edge.l { -webkit-mask-image: linear-gradient(to right, #000 42%, rgba(0,0,0,0.55) 72%, transparent 100%); mask-image: linear-gradient(to right, #000 42%, rgba(0,0,0,0.55) 72%, transparent 100%); }
.about-edge.r { -webkit-mask-image: linear-gradient(to left, #000 42%, rgba(0,0,0,0.55) 72%, transparent 100%); mask-image: linear-gradient(to left, #000 42%, rgba(0,0,0,0.55) 72%, transparent 100%); }

.about-hero { background: #f9f1e6; padding: 44px 24px 66px; text-align: center; }
.about-hero .edge { width: 22.9%; min-width: 140px; max-width: 220px; }
.about-hero .framed-inner { max-width: 830px; margin: 0 auto; }
.about-hero h1 { font-size: clamp(2rem, 3.95vw, 3.5625rem); line-height: 1.17; color: var(--color-forest-700); margin-bottom: 24px; }
.about-hero h1 em { font-style: italic; color: var(--color-forest); font-family: var(--font-serif); }
.about-hero .hiw-divider { margin-bottom: 26px; }
.about-hero .lede { font-size: clamp(0.9rem, 1.16vw, 1.0625rem); max-width: 700px; margin: 0 auto 46px; }

.mv { display: flex; flex-direction: column; gap: 22px; max-width: 780px; margin: 0 auto; }
.mv-card { display: flex; align-items: flex-start; gap: 30px; text-align: left; background: rgba(253,251,246,0.92); border-radius: var(--radius-lg); padding: 30px 34px; box-shadow: var(--shadow-sm); }
.mv-ic { width: 120px; height: 120px; min-width: 120px; border-radius: var(--radius-lg); background: var(--color-primary-50); display: flex; align-items: center; justify-content: center; color: var(--color-primary); }
.mv-ic svg { width: 66px; height: 66px; }
.mv-body h3 { font-size: 1.7rem; margin-bottom: 10px; }
.mv-body .rule { width: 44px; height: 2px; background: var(--color-primary); margin-bottom: 16px; }
.mv-body p { font-size: 0.9rem; line-height: 1.72; color: var(--text-secondary); }

.about-values { background: #faefe4; padding: 52px 24px 68px; text-align: center; }
.about-values .edge { width: 17.8%; min-width: 120px; max-width: 180px; }
.about-values .framed-inner { max-width: 1120px; margin: 0 auto; }
.about-values .eyebrow { font-size: 0.8rem; letter-spacing: 0.1em; font-weight: 700; color: var(--color-primary); margin-bottom: 14px; }
.about-values h2 { font-size: clamp(1.875rem, 3.3vw, 3.125rem); color: var(--color-forest-700); margin-bottom: 16px; }
.about-values .hiw-divider { margin-bottom: 40px; }
.vgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.vcard { background: rgba(253,251,246,0.94); border-radius: var(--radius-lg); padding: 26px 28px 30px; text-align: left; box-shadow: var(--shadow-sm); }
.vcard .em { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.55rem; margin-bottom: 22px; }
.vcard h3 { font-size: 1.35rem; margin-bottom: 10px; }
.vcard .rule { width: 36px; height: 2px; background: var(--color-primary); margin-bottom: 14px; }
.vcard p { font-size: 0.88rem; line-height: 1.68; color: var(--text-secondary); }

.about-phil { background: #f9f0e4; padding: 64px 24px 74px; }
.about-phil .edge { width: 22%; min-width: 130px; max-width: 200px; }
.about-phil .framed-inner { max-width: 940px; margin: 0 auto; }
.phil-block { display: flex; align-items: flex-start; gap: 38px; }
.phil-ic { width: 118px; height: 118px; min-width: 118px; border-radius: var(--radius-lg); background: var(--color-primary-50); display: flex; align-items: center; justify-content: center; color: var(--color-primary); }
.phil-ic svg { width: 64px; height: 64px; }
.phil-body { max-width: 620px; }
.phil-body h2 { font-size: clamp(1.75rem, 2.7vw, 2.5rem); color: var(--color-forest-700); margin-bottom: 12px; }
.phil-body .rule { width: 44px; height: 2px; background: var(--color-primary); margin-bottom: 20px; }
.phil-body p { font-size: 0.94rem; line-height: 1.82; color: var(--text-secondary); margin-bottom: 18px; }
.phil-body p:last-child { margin-bottom: 0; }
.phil-sep { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 48px 0; }
.phil-sep .ln { flex: 1; height: 1px; background: #e2cdb6; }

/* Dark mode: same fixed-light-background pattern as the other
   photo-framed pages (About uses three: hero, values, philosophy),
   plus card/icon backgrounds pinned to fixed near-white or light-tint
   shades, and headings pinned to a fixed dark forest green that goes
   invisible once its section turns dark. */
[data-theme="dark"] .about-hero,
[data-theme="dark"] .about-values,
[data-theme="dark"] .about-phil { background: var(--bg); }
[data-theme="dark"] .about-edge { filter: brightness(0.32) saturate(0.85); }
[data-theme="dark"] .about-hero h1,
[data-theme="dark"] .about-values h2,
[data-theme="dark"] .phil-body h2 { color: var(--text-primary); }
[data-theme="dark"] .mv-card,
[data-theme="dark"] .vcard { background: color-mix(in srgb, var(--bg-elevated) 92%, transparent); }
[data-theme="dark"] .mv-ic,
[data-theme="dark"] .phil-ic { background: var(--surface-muted); }
[data-theme="dark"] .vcard .em { background: var(--surface-muted) !important; }
[data-theme="dark"] .phil-sep .ln { background: var(--border); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .about-hero,
  :root:not([data-theme="light"]) .about-values,
  :root:not([data-theme="light"]) .about-phil { background: var(--bg); }
  :root:not([data-theme="light"]) .about-edge { filter: brightness(0.32) saturate(0.85); }
  :root:not([data-theme="light"]) .about-hero h1,
  :root:not([data-theme="light"]) .about-values h2,
  :root:not([data-theme="light"]) .phil-body h2 { color: var(--text-primary); }
  :root:not([data-theme="light"]) .mv-card,
  :root:not([data-theme="light"]) .vcard { background: color-mix(in srgb, var(--bg-elevated) 92%, transparent); }
  :root:not([data-theme="light"]) .mv-ic,
  :root:not([data-theme="light"]) .phil-ic { background: var(--surface-muted); }
  :root:not([data-theme="light"]) .vcard .em { background: var(--surface-muted) !important; }
  :root:not([data-theme="light"]) .phil-sep .ln { background: var(--border); }
}

@media (max-width: 1080px) {
  .vgrid { grid-template-columns: repeat(2, 1fr); }
  .about-hero .edge, .about-values .edge, .about-phil .edge { display: none; }
}
@media (max-width: 820px) {
  .vgrid { grid-template-columns: 1fr; }
  .mv-card, .phil-block { flex-direction: column; gap: 20px; }
  .mv-ic, .phil-ic { width: 88px; height: 88px; min-width: 88px; }
}

/* ---------- Time Capsules ---------- */
.cap-head-wrap { position: relative; }
.cap-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; position: relative; z-index: 1; }
.cap-page-head h1 { font-size: 2.1rem; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.cap-page-head h1 .sp { font-size: 1.1rem; margin-top: 2px; }
.cap-page-head p { font-size: 0.9rem; color: var(--text-tertiary); }
/* sits in the whitespace beside the banner, well clear of the header row and its button */
.cap-plane { position: absolute; top: 72px; right: 20px; width: 190px; pointer-events: none; opacity: 0.85; z-index: 0; }

.cap-banner { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; background: linear-gradient(96deg, var(--color-primary-50), #fbe7d3); border-radius: var(--radius-md); padding: 15px 20px; max-width: 480px; margin-bottom: 34px; font-size: 0.9rem; color: #5c4530; }
.cap-banner .lk { color: var(--color-primary-600); display: flex; }

.cap-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.cap-sec-head h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 11px; margin: 0; }
.cap-count { background: var(--surface-muted); border: 1px solid var(--border); color: var(--text-tertiary); font-size: 0.78rem; font-weight: 500; padding: 2px 10px; border-radius: var(--radius-full); }
.cap-sec-tools { display: flex; align-items: center; gap: 10px; }

.cap-cards { display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; gap: 26px; margin-bottom: 34px; }
.cap-cards.list-view { grid-template-columns: 1fr; gap: 14px; }
.cap-card { --seal-top: 174px; --seal-left: 50%; position: relative; border-radius: 16px; overflow: hidden; background: var(--bg-elevated); border: 1px solid rgba(20,15,5,0.07); display: flex; flex-direction: column; box-shadow: 0 2px 4px rgba(40,30,10,0.05), 0 8px 20px rgba(40,30,10,0.06); }

/* list view: a compact row (small envelope thumb + body + date) instead of the full card stacked full-width */
.cap-cards.list-view .cap-card { --seal-top: 83px; --seal-left: 55px; flex-direction: row; align-items: stretch; }
.cap-cards.list-view .cap-top { width: 110px; height: auto; min-height: 96px; }
.cap-cards.list-view .cap-seal { width: 36px; height: 36px; }
.cap-cards.list-view .cap-status { font-size: 0.6rem; padding: 3px 7px; top: 6px; left: 6px; white-space: nowrap; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.cap-cards.list-view .cap-badges-extra { display: none; }
.cap-cards.list-view .cap-body { padding: 14px 18px; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.cap-cards.list-view .cap-body h3 { font-size: 0.92rem; margin-bottom: 3px; }
.cap-cards.list-view .cap-body p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.cap-cards.list-view .cap-media-view { display: none; }
.cap-cards.list-view .cap-foot { flex-direction: column; align-items: flex-end; justify-content: center; width: 150px; flex-shrink: 0; text-align: right; gap: 2px; }
.cap-cards.list-view .cap-foot-icon { display: none; }
.cap-top { position: relative; height: 200px; flex-shrink: 0; overflow: hidden; }
.cap-top .env { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cap-sparkle { opacity: 0.85; pointer-events: none; }
.cap-status { position: absolute; top: 16px; left: 18px; z-index: 2; display: flex; align-items: center; gap: 5px; padding: 5px 13px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; background: rgba(255,255,255,0.92); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.cap-status.st-green { color: #3d7a45; }
.cap-status.st-amber { color: #8a5a1e; }
.cap-status.st-purple { color: #6a4f9c; }
.cap-status.st-blue { color: #2f5c85; }
.cap-status.st-pink { color: #9c4a63; }
.cap-badges-extra { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cap-badges-extra .badge { font-size: 0.65rem; padding: 3px 8px; }

/* Seal sits at the point the four envelope panels converge on — the "wax stamp" holding the
   letter shut. It's a real photo of a wax seal (assets/img/capsule-seal.png), masked into a
   circle to crop the source crop's square corners; other tones reuse it via a hue-rotate filter
   set inline. Its bottom edge spills a few px past .cap-top, onto the cream body underneath. */
.cap-seal { position: absolute; left: var(--seal-left); top: var(--seal-top); transform: translate(-50%, -50%); z-index: 3; width: 68px; height: 68px; border-radius: 50%; overflow: hidden; box-shadow: 0 6px 14px rgba(40,35,15,0.24); }
.cap-seal img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cap-body { padding: 34px 20px 16px; flex: 1; }
.cap-body h3 { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.cap-body p { font-size: 0.8rem; line-height: 1.65; color: var(--text-secondary); }
.cap-media-view { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.cap-media-view img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }

.cap-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid rgba(0,0,0,0.045); }
.cap-foot .lbl { font-size: 0.7rem; color: var(--text-tertiary); margin-bottom: 2px; }
.cap-foot .dt { font-size: 0.92rem; font-weight: 700; }
.cap-foot-icon { flex-shrink: 0; margin: -6px -2px -8px 0; opacity: 0.92; }
.cap-foot.ft-green { background: #e9f1e4; }
.cap-foot.ft-amber { background: #fbeed6; }
.cap-foot.ft-purple { background: #ece5f8; }
.cap-foot.ft-blue { background: #e4eef8; }
.cap-foot.ft-pink { background: #fbe9ee; }
.cap-foot.ft-green .dt { color: #2f5c39; }
.cap-foot.ft-amber .dt { color: #8a5518; }
.cap-foot.ft-blue .dt { color: #2a5580; }
.cap-foot.ft-pink .dt { color: #8a3f5c; }
.cap-foot.ft-purple .dt { color: #5b4084; }

.cap-card.cap-archived { opacity: 0.6; }
.cap-open-row { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px 16px; font-size: 0.82rem; font-weight: 600; color: var(--color-forest); cursor: pointer; }
.cap-archived-flag { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-muted); color: var(--text-tertiary); font-size: 0.72rem; padding: 5px 12px; border-radius: var(--radius-full); margin: 0 20px 16px; cursor: pointer; width: fit-content; }
.cap-archived-flag:hover { background: var(--border-soft); color: var(--text-secondary); }

/* ---- full-screen capsule reading sheet ---- */
.cap-sheet { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; flex-direction: column; }
.cap-sheet-bar { display: flex; align-items: center; gap: 14px; flex-shrink: 0; padding: 16px 30px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.cap-sheet-bar .back { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-secondary); background: none; border: none; cursor: pointer; }
.cap-sheet-bar .spacer { margin-left: auto; }
.cap-sheet-body { flex: 1; overflow-y: auto; padding: 0 30px; }
.cap-read-wrap { max-width: 760px; margin: 0 auto; padding: 52px 0 70px; }
.cap-read-seal-wrap { display: flex; justify-content: center; margin-bottom: 26px; }
.cap-read-seal { width: 74px; height: 74px; border-radius: 50%; overflow: hidden; display: block; box-shadow: 0 8px 18px rgba(60,45,20,0.28); }
.cap-read-seal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cap-read-meta { text-align: center; font-size: 0.78rem; letter-spacing: 0.13em; font-weight: 700; margin-bottom: 14px; }
.cap-read-wrap h1 { font-family: var(--font-serif); font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 600; text-align: center; letter-spacing: -0.015em; margin-bottom: 16px; overflow-wrap: anywhere; word-break: break-word; }
.cap-read-dates { text-align: center; font-size: 0.85rem; color: var(--text-tertiary); margin-bottom: 34px; }
.cap-read-rule { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 38px; }
.cap-read-rule .ln { width: 80px; height: 1px; background: var(--border); }
.cap-read-body { font-family: var(--font-serif); font-size: 1.18rem; line-height: 1.95; color: var(--text-secondary); overflow-wrap: anywhere; word-break: break-word; }
.cap-read-body p { margin-bottom: 24px; overflow-wrap: anywhere; word-break: break-word; }
.cap-read-body p:last-child { margin-bottom: 0; }
.cap-read-sign { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border-soft); font-size: 0.87rem; color: var(--text-tertiary); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cap-read-acts { display: flex; gap: 10px; }
@media (max-width: 700px) { .cap-sheet-bar, .cap-sheet-body { padding-left: 18px; padding-right: 18px; } }

.cap-letter { display: grid; grid-template-columns: minmax(0,1fr) 420px; gap: 30px; align-items: center; background: linear-gradient(102deg, #fdefe0, #fbe6d4); border-radius: var(--radius-lg); padding: 32px 34px; }
.cap-letter h2 { font-size: 1.55rem; display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.cap-letter > div > p { font-size: 0.9rem; line-height: 1.72; color: #5c4530; max-width: 400px; margin-bottom: 24px; }
.cap-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cap-perk { display: flex; gap: 11px; }
.cap-perk .em { font-size: 1.2rem; line-height: 1.2; }
.cap-perk h4 { font-size: 0.85rem; margin-bottom: 4px; }
.cap-perk p { font-size: 0.78rem; line-height: 1.55; color: #6b5540; }
.cap-letter-art { width: 100%; height: auto; display: block; }

@media (max-width: 1240px) {
  .cap-cards { grid-template-columns: 1fr; }
  .cap-letter { grid-template-columns: 1fr; }
  .cap-plane { display: none; }
}
@media (max-width: 860px) {
  .cap-page-head { flex-direction: column; }
  .cap-perks { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  /* the fixed thumb/date column widths in list view don't leave room for the
     title on narrow screens, so fall back to the stacked card layout */
  .cap-cards.list-view .cap-card { --seal-top: 174px; --seal-left: 50%; flex-direction: column; }
  .cap-cards.list-view .cap-top { width: 100%; height: 200px; }
  .cap-cards.list-view .cap-seal { width: 68px; height: 68px; }
  .cap-cards.list-view .cap-body { padding: 34px 18px 12px; }
  .cap-cards.list-view .cap-body h3, .cap-cards.list-view .cap-body p { white-space: normal; overflow: visible; text-overflow: clip; }
  .cap-cards.list-view .cap-foot { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 13px 18px; }
  .cap-cards.list-view .cap-foot-icon { display: block; }
}

/* ---------- Recaps ---------- */
.recap-head { position: relative; padding: 4px 0 20px; }
.recap-head .eyebrow { font-size: 0.72rem; letter-spacing: 0.12em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 8px; }
.recap-head h1 { font-size: 2rem; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.recap-head p { font-size: 0.85rem; line-height: 1.6; color: var(--text-tertiary); }
.recap-head-art { position: absolute; right: 0; top: -6px; width: 260px; pointer-events: none; }

.recap-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 14px; }
.recap-toolbar-left, .recap-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recap-divider { width: 1px; height: 26px; background: var(--border); flex-shrink: 0; }
.recap-divider[hidden] { display: none; }
.recap-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.recap-tabs button { display: flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius-md); font-size: 0.82rem; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border); font-weight: 500; white-space: nowrap; }
.recap-tabs button svg { flex-shrink: 0; opacity: 0.7; }
.recap-tabs button.on { background: var(--color-forest); color: #fff; border-color: var(--color-forest); }
.recap-tabs button.on svg { opacity: 1; }
.recap-yr { display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 14px; font-size: 0.82rem; font-weight: 500; color: var(--text-primary); flex-shrink: 0; }
.recap-yr svg:first-child { color: var(--color-forest); flex-shrink: 0; }
.recap-yr svg:last-child { color: var(--text-tertiary); flex-shrink: 0; }
.recap-yr select { border: none; outline: none; background: none; font-size: 0.82rem; font-weight: 500; cursor: pointer; color: var(--text-primary); -webkit-appearance: none; appearance: none; }
.recap-yr[hidden] { display: none; }
.recap-export-btn { display: flex; align-items: center; gap: 8px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 16px; font-size: 0.82rem; font-weight: 600; color: var(--color-forest); white-space: nowrap; }
.recap-export-btn:hover { background: var(--border-soft); }

#aiRecapZone .ai-panel { margin-bottom: 18px; }

.recap-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.recap-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.recap-stat .ic { width: 40px; height: 40px; min-width: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.recap-stat .k { font-size: 0.7rem; letter-spacing: 0.08em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 6px; }
.recap-stat .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; margin-bottom: 4px; }
.recap-stat .v.word { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 700; }
.recap-stat .u { font-size: 0.78rem; color: var(--text-tertiary); margin-bottom: 3px; }
.recap-stat .up { font-size: 0.75rem; color: var(--success); display: flex; align-items: center; gap: 3px; }
.recap-stat .lnk { font-size: 0.75rem; color: var(--color-primary); display: flex; align-items: center; gap: 4px; }

.recap-panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; }
.recap-panel h3 { font-size: 0.95rem; margin-bottom: 3px; }
.recap-psub { font-size: 0.78rem; color: var(--text-tertiary); margin-bottom: 16px; }
.recap-plink { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 0.8rem; color: var(--text-secondary); }

.recap-two { display: grid; grid-template-columns: 0.86fr 1.6fr; gap: 16px; margin-bottom: 18px; }
.recap-two > *, .recap-two2 > *, .recap-two3 > *, .recap-stats > * { min-width: 0; }
.recap-donut-wrap { display: flex; align-items: center; gap: 20px; }
.recap-donut { width: 118px; height: 118px; min-width: 118px; border-radius: 50%; position: relative; }
.recap-donut::after { content: ""; position: absolute; inset: 26%; background: var(--bg-elevated); border-radius: 50%; }
.recap-legend { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.recap-legend .li { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--text-secondary); }
.recap-legend .swatch { width: 9px; height: 9px; border-radius: 2.5px; flex-shrink: 0; }
.recap-legend .pc { margin-left: auto; color: var(--text-tertiary); font-size: 0.74rem; }

.recap-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.recap-mcol { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.recap-mlab { font-size: 0.62rem; letter-spacing: 0.05em; color: var(--text-tertiary); font-weight: 700; }
.recap-dots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.recap-dot { width: 6px; height: 6px; border-radius: 2px; background: var(--border-soft); }
.recap-grid-legend { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 14px; font-size: 0.68rem; color: var(--text-tertiary); }
.recap-grid-legend span { display: flex; align-items: center; gap: 5px; }
.recap-grid-legend i { width: 8px; height: 8px; border-radius: 2px; display: block; }

.recap-stood { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 18px; }
.recap-stood-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.recap-insights { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.recap-ins { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 16px 18px; }
.recap-ins .ic { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; margin-bottom: 14px; }
.recap-ins h4 { font-family: var(--font-serif); font-size: 0.98rem; font-weight: 700; margin-bottom: 8px; }
.recap-ins p { font-size: 0.78rem; line-height: 1.55; color: var(--text-tertiary); margin-bottom: 10px; }
.recap-ins .foot { font-size: 0.72rem; color: var(--success); display: flex; align-items: center; gap: 3px; }
.recap-ins .foot.grey { color: var(--text-tertiary); }

.recap-two2 { display: grid; grid-template-columns: 0.92fr 1.35fr; gap: 16px; margin-bottom: 18px; }
.recap-trow { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.82rem; }
.recap-trow .em { font-size: 1rem; width: 18px; text-align: center; }
.recap-trow .tg { width: 100px; color: var(--text-secondary); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-trow .bar { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; }
.recap-trow .bar span { display: block; height: 100%; border-radius: 4px; background: var(--color-primary); }
.recap-trow .n { width: 64px; text-align: right; color: var(--text-tertiary); font-size: 0.72rem; flex-shrink: 0; }

.recap-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.recap-chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; padding-left: 28px; position: relative; overflow-x: auto; }
.recap-col { min-width: 18px; }
.recap-yaxis { position: absolute; left: 0; top: 0; bottom: 18px; width: 24px; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.62rem; color: var(--text-tertiary); text-align: right; }
.recap-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.recap-col .b { width: 100%; max-width: 22px; border-radius: 3px 3px 0 0; background: var(--mood-grateful); min-height: 2px; }
.recap-col .cl { font-size: 0.65rem; color: var(--text-tertiary); }
.recap-note { display: flex; align-items: flex-start; gap: 11px; background: var(--surface-muted); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 14px; font-size: 0.8rem; line-height: 1.55; color: var(--text-secondary); }

.recap-two3 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; margin-bottom: 18px; }
.recap-mem { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.recap-mem:last-of-type { border-bottom: none; }
.recap-mem .th { width: 46px; height: 36px; min-width: 46px; border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.recap-mem .d { font-size: 0.68rem; color: var(--text-tertiary); margin-bottom: 2px; }
.recap-mem .ti { font-size: 0.85rem; font-weight: 700; margin-bottom: 2px; }
.recap-mem .ex { font-size: 0.75rem; color: var(--text-tertiary); line-height: 1.45; }
.recap-mem .tag { background: var(--surface-muted); color: var(--text-secondary); font-size: 0.68rem; padding: 3px 8px; border-radius: var(--radius-full); flex-shrink: 0; }
.recap-mem .star { color: #e8a33d; font-size: 0.9rem; flex-shrink: 0; }

.recap-cta { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px; background: linear-gradient(140deg, #4a3527 0%, #3b2a1f 60%, #33241a 100%); color: #f3e9da; display: flex; flex-direction: column; justify-content: center; min-height: 100%; }
.recap-cta h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; color: #fdf6ea; max-width: 70%; }
.recap-cta p { font-size: 0.82rem; line-height: 1.7; color: #d6c7b4; max-width: 62%; margin-bottom: 14px; }
.recap-cta .rule { width: 100%; max-width: 62%; height: 1px; background: rgba(243,233,218,0.18); margin-bottom: 14px; }
.recap-cta .btns { display: flex; flex-direction: column; gap: 9px; max-width: 62%; }
.recap-btn-rust { background: var(--color-primary-600); color: #fff; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; text-align: center; }
.recap-btn-ghost { background: rgba(253,246,234,0.94); color: #3b2a1f; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }

.recap-tip { position: relative; overflow: hidden; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 28px; display: flex; align-items: center; gap: 26px; min-height: 100px; }
.recap-tip .body { flex: 1; }
.recap-tip h4 { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin-bottom: 7px; }
.recap-tip p { font-size: 0.8rem; line-height: 1.65; color: var(--text-secondary); }
.recap-tip-art { flex-shrink: 0; opacity: 0.9; }

@media (max-width: 1240px) {
  .recap-stats { grid-template-columns: repeat(2, 1fr); }
  .recap-two, .recap-two2, .recap-two3 { grid-template-columns: 1fr; }
  .recap-insights { grid-template-columns: repeat(2, 1fr); }
  .recap-head-art { display: none; }
}
@media (max-width: 700px) {
  .recap-months { grid-template-columns: repeat(6, 1fr); }
  .recap-tip { flex-direction: column; text-align: center; }
}
@media (max-width: 560px) {
  .recap-tabs { flex-wrap: wrap; }
  .recap-tabs-row { gap: 10px; }
  .recap-stats { grid-template-columns: 1fr; }
  .recap-trow .tg { width: 78px; }
}

/* ---------- Tags ---------- */
.tg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 26px; margin-bottom: 20px; flex-wrap: wrap; }
.tg-head .eyebrow { font-size: 0.72rem; letter-spacing: 0.12em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 8px; }
.tg-head h1 { font-size: 2rem; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tg-head p { font-size: 0.85rem; line-height: 1.6; color: var(--text-tertiary); }
.tg-top-topic { background: linear-gradient(120deg, #fdf1e6, #fbe6d4); border-radius: var(--radius-lg); padding: 16px 20px; display: flex; align-items: center; gap: 20px; flex-shrink: 0; min-width: 240px; }
.tg-top-topic .k { font-size: 0.72rem; color: #8a6a4e; margin-bottom: 5px; }
.tg-top-topic .t { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 700; margin-bottom: 4px; }
.tg-top-topic .n { font-size: 0.78rem; color: var(--text-tertiary); }
.tg-ring { width: 58px; height: 58px; min-width: 58px; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center; }
.tg-ring::after { content: ""; position: absolute; inset: 5px; background: #fdf2e8; border-radius: 50%; }
.tg-ring span { position: relative; z-index: 1; font-size: 1.3rem; }

.tg-toolbar { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; flex-wrap: wrap; }
.tg-search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.tg-search input { width: 100%; padding: 11px 15px 11px 38px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; font-size: 0.82rem; outline: none; color: var(--text-primary); }
.tg-search input::placeholder { color: var(--text-tertiary); }
.tg-search .mg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); display: flex; }
.tg-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; font-size: 0.78rem; color: var(--text-tertiary); flex-wrap: wrap; }

.tg-sec-t { font-size: 0.92rem; font-weight: 700; margin-bottom: 3px; }
.tg-sec-s { font-size: 0.76rem; color: var(--text-tertiary); margin-bottom: 14px; }

.tg-feat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 13px; margin-bottom: 22px; }
.tg-fcard { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 16px 12px; cursor: pointer; transition: box-shadow var(--dur-med) var(--ease); }
.tg-fcard:hover { box-shadow: var(--shadow-sm); }
.tg-fcard .ic { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 13px; }
.tg-fcard h4 { font-size: 0.92rem; margin-bottom: 4px; }
.tg-fcard .pg { font-size: 0.72rem; color: var(--text-tertiary); margin-bottom: 10px; }
.tg-fcard p { font-size: 0.72rem; line-height: 1.55; color: var(--text-tertiary); min-height: 44px; }
.tg-spark { width: 100%; height: 30px; display: block; }

.tg-split { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; align-items: start; }
.tg-split.no-detail { grid-template-columns: 1fr; }

.tg-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.tg-chip { display: inline-flex; align-items: center; gap: 9px; border-radius: var(--radius-full); background: #fff; border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; font-size: 0.72rem; padding: 7px 12px; }
.tg-chip .ct { color: var(--text-tertiary); }
.tg-chip.xl { font-size: 0.94rem; font-weight: 700; padding: 11px 20px; }
.tg-chip.lg { font-size: 0.84rem; font-weight: 600; padding: 10px 17px; }
.tg-chip.md { font-size: 0.76rem; padding: 8px 14px; }

.tg-think { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 26px; }
.tg-tk { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 15px 16px; }
.tg-tk .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.tg-tk .ic { width: 32px; height: 32px; min-width: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; }
.tg-tk .lb { font-size: 0.68rem; color: var(--text-tertiary); margin-bottom: 1px; }
.tg-tk .tagname { font-size: 0.92rem; font-weight: 700; }
.tg-tk p { font-size: 0.75rem; line-height: 1.55; color: var(--text-tertiary); }

.tg-tbl-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.tg-tbl-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px 12px; }
.tg-table { width: 100%; border-collapse: collapse; }
.tg-table thead th { font-size: 0.66rem; letter-spacing: 0.09em; font-weight: 700; color: var(--text-tertiary); text-align: left; padding: 0 12px 9px; border-bottom: 1px solid var(--border-soft); }
.tg-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; font-size: 0.8rem; }
.tg-table tbody tr { cursor: pointer; }
.tg-table tbody tr:hover { background: var(--surface-muted); }
.tg-table tbody tr:last-child td { border-bottom: none; }
.tg-tcell { display: flex; align-items: center; gap: 11px; }
.tg-tcell .ic { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.tg-tcell .nm { font-size: 0.8rem; font-weight: 700; margin-bottom: 1px; }
.tg-tcell .ds { font-size: 0.68rem; color: var(--text-tertiary); }
.tg-act { height: 5px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; min-width: 90px; }
.tg-act span { display: block; height: 100%; border-radius: 4px; background: var(--color-primary); }
.tg-vp { color: var(--text-secondary); font-size: 0.72rem; white-space: nowrap; }
.tg-more { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto; padding: 11px 0 14px; font-size: 0.78rem; color: var(--text-secondary); width: 100%; cursor: pointer; }
.tg-color-dot { width: 14px; height: 14px; border-radius: 50%; border: none; cursor: pointer; padding: 0; flex-shrink: 0; }

.tg-detail { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 20px; position: relative; }
.tg-detail .x { position: absolute; right: 13px; top: 13px; color: var(--text-tertiary); font-size: 0.95rem; cursor: pointer; }
.tg-detail .ic { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 14px; }
.tg-detail h3 { font-size: 1.35rem; margin-bottom: 7px; }
.tg-detail .sub { font-size: 0.72rem; color: var(--text-tertiary); line-height: 1.65; margin-bottom: 5px; }
.tg-detail .desc { font-size: 0.76rem; line-height: 1.65; color: var(--text-secondary); margin: 14px 0 18px; }
.tg-d-t { font-size: 0.78rem; font-weight: 700; margin-bottom: 11px; }
.tg-mini { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-bottom: 6px; }
.tg-mini .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.tg-mini .b { width: 100%; max-width: 13px; border-radius: 2px 2px 0 0; background: var(--color-primary-100); min-height: 2px; }
.tg-mini .b.hi { background: var(--color-primary); }
.tg-mini .l { font-size: 0.58rem; color: var(--text-tertiary); }
.tg-rel { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.tg-rel span { background: var(--surface-muted); border-radius: var(--radius-full); padding: 6px 12px; font-size: 0.72rem; color: var(--text-secondary); cursor: pointer; }
.tg-ent { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 9px; cursor: pointer; }
.tg-ent:hover { background: var(--surface-muted); }
.tg-ent .fi { width: 24px; height: 24px; min-width: 24px; border-radius: 6px; background: var(--surface-muted); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 0.7rem; }
.tg-ent .d { font-size: 0.66rem; color: var(--text-tertiary); margin-bottom: 2px; }
.tg-ent .ti { font-size: 0.8rem; font-weight: 700; margin-bottom: 2px; }
.tg-ent .ex { font-size: 0.7rem; line-height: 1.5; color: var(--text-tertiary); }
.tg-ent .ar { margin-left: auto; color: var(--text-tertiary); align-self: center; }
.tg-btn-all { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--color-primary); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 600; margin-top: 4px; }

.tg-pattern { position: relative; overflow: hidden; border-radius: var(--radius-lg); margin-top: 20px; padding: 24px 28px; background: linear-gradient(140deg, #4a3527 0%, #3b2a1f 62%, #33241a 100%); color: #f3e9da; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.tg-pattern .art { width: 130px; flex-shrink: 0; }
.tg-pattern .body { flex: 1; min-width: 200px; }
.tg-pattern .hd { display: flex; align-items: center; gap: 9px; font-size: 0.85rem; font-weight: 700; color: #fdf6ea; margin-bottom: 11px; }
.tg-pattern p { font-size: 0.94rem; line-height: 1.6; color: #e4d8c6; margin-bottom: 9px; }
.tg-pattern p.small { font-size: 0.75rem; line-height: 1.65; color: #c2b4a1; margin-bottom: 0; }
.tg-pattern .hl { color: #f0a868; font-weight: 700; }
.tg-pattern .btns { display: flex; flex-direction: column; gap: 9px; flex-shrink: 0; }
.tg-pb1 { background: var(--color-primary-600); color: #fff; padding: 11px 20px; border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 600; text-align: center; white-space: nowrap; }
.tg-pb2 { background: rgba(253,246,234,0.94); color: #3b2a1f; padding: 11px 20px; border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 600; text-align: center; white-space: nowrap; }

.tg-split > *, .tg-think > *, .tg-feat-row > * { min-width: 0; }
.tg-tbl-wrap { overflow-x: auto; }
.tg-table { min-width: 480px; }

@media (max-width: 1240px) {
  .tg-split { grid-template-columns: 1fr; }
  .tg-feat-row { grid-template-columns: repeat(3, 1fr); }
  .tg-think { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .tg-head { flex-direction: column; }
  .tg-feat-row { grid-template-columns: 1fr; }
  .tg-pattern { flex-direction: column; text-align: center; }
  .tg-pattern .body { min-width: 0; }
  .tg-toolbar { flex-wrap: wrap; }
  .tg-search { flex: 1 1 100%; }
  .tg-top-topic { flex-wrap: wrap; }
}

/* ---------- Archive page ---------- */
.arc-head { position: relative; padding: 2px 0 6px; min-height: 100px; }
.arc-head-art { position: absolute; right: 0; top: -22px; width: 240px; pointer-events: none; z-index: 0; }
.arc-head > * { position: relative; z-index: 1; }
.arc-head h1 { font-family: var(--font-serif); display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.arc-head .sub { color: var(--text-tertiary); font-size: 0.92rem; }

.arc-filters { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; position: relative; z-index: 2; }
.arc-search { position: relative; flex: 1; min-width: 220px; }
.arc-search input { width: 100%; padding: 12px 42px 12px 17px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg-elevated); font-size: 0.85rem; outline: none; color: var(--text-primary); }
.arc-search input::placeholder { color: var(--text-tertiary); }
.arc-search .mg { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.arc-pick { display: flex; align-items: center; gap: 9px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 15px; font-size: 0.85rem; color: var(--text-secondary); min-width: 168px; }
.arc-pick select { border: none; outline: none; background: none; padding: 0; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; flex: 1; }
.arc-pick .ic { color: var(--text-tertiary); display: flex; flex-shrink: 0; }
.arc-pick > svg { color: var(--text-tertiary); flex-shrink: 0; }

.arc-filters2 { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; position: relative; z-index: 2; }
input.arc-date { width: 180px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 15px; font-size: 0.83rem; color: var(--text-secondary); outline: none; flex: 0 0 auto; }
.arc-dash { color: var(--text-tertiary); }
.arc-clear { color: var(--color-primary); font-size: 0.83rem; font-weight: 600; background: none; border: none; padding: 4px; cursor: pointer; }
.arc-fav-pill { display: flex; align-items: center; gap: 7px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 15px; font-size: 0.83rem; color: var(--text-secondary); cursor: pointer; }
.arc-fav-pill.on { background: var(--color-primary-100); border-color: var(--color-primary-100); color: var(--color-primary-700); }
.arc-filters2 .right { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.arc-saved-wrap { position: relative; }
.arc-saved { display: flex; align-items: center; gap: 8px; font-size: 0.83rem; color: var(--text-secondary); cursor: pointer; background: none; border: none; padding: 4px; }
.arc-saved-panel { position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 220px; padding: 8px; z-index: 30; }
.arc-saved-panel .empty { padding: 10px 8px; font-size: 0.8rem; color: var(--text-tertiary); }
.arc-saved-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.83rem; }
.arc-saved-row:hover { background: var(--surface-muted); }
.arc-saved-row span.nm { flex: 1; }
.arc-saved-row .rm { color: var(--text-tertiary); font-size: 0.9rem; padding: 2px 4px; }
.arc-saved-row .rm:hover { color: var(--error); }
.arc-btn-save { display: flex; align-items: center; gap: 8px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 18px; font-size: 0.83rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.arc-btn-save:hover { background: var(--border-soft); }

.arc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.arc-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px; display: flex; align-items: center; gap: 16px; min-width: 0; }
.arc-stat .ic { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.3rem; }
.arc-stat .a1 { background: #e4ede2; color: #4f7a52; } .arc-stat .a2 { background: #fbe9d5; color: #b57c33; }
.arc-stat .a3 { background: #fbe0e2; color: #c05563; } .arc-stat .a4 { background: #fdf0d6; color: #c99a33; }
.arc-stat .body { min-width: 0; }
.arc-stat .k { font-size: 0.68rem; letter-spacing: 0.09em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 6px; }
.arc-stat .v { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 4px; }
.arc-stat .v.word { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; }
.arc-stat .u { font-size: 0.72rem; color: var(--text-tertiary); }

.arc-results { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.arc-count { font-size: 0.85rem; color: var(--text-tertiary); }

.arc-list { display: flex; flex-direction: column; gap: 12px; }
.arc-entry { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 20px; display: flex; align-items: flex-start; gap: 16px; cursor: pointer; transition: box-shadow var(--dur-med) var(--ease); }
.arc-entry:hover { box-shadow: var(--shadow-sm); }
.arc-entry .fi { width: 46px; height: 46px; border-radius: var(--radius-sm); background: var(--surface-muted); border: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.2rem; }
.arc-entry .body { flex: 1; min-width: 0; }
.arc-entry .d { font-size: 0.72rem; color: var(--text-tertiary); margin-bottom: 4px; }
.arc-entry .ti { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; overflow-wrap: break-word; }
.arc-entry .ex { font-size: 0.83rem; line-height: 1.5; color: var(--text-secondary); font-family: var(--font-serif); overflow-wrap: break-word; }
.arc-entry .tags { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.arc-entry .side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-top: 2px; }
.arc-mood { display: flex; align-items: center; gap: 6px; border-radius: var(--radius-full); padding: 6px 13px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.arc-star { color: var(--border); font-size: 1.15rem; line-height: 1; background: none; border: none; padding: 2px; cursor: pointer; }
.arc-star.on { color: #e8a33d; }
.arc-dots { color: var(--text-tertiary); font-size: 1.1rem; line-height: 1; padding: 2px 4px; background: none; border: none; cursor: pointer; }

.arc-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.arc-cardi { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; cursor: pointer; transition: box-shadow var(--dur-med) var(--ease); min-width: 0; }
.arc-cardi:hover { box-shadow: var(--shadow-sm); }
.arc-cardi .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.arc-cardi .d { font-size: 0.72rem; color: var(--text-tertiary); }
.arc-cardi .ti { font-family: var(--font-serif); font-size: 1.02rem; font-weight: 600; margin-bottom: 6px; overflow-wrap: break-word; }
.arc-cardi .ex { font-size: 0.8rem; color: var(--text-secondary); font-family: var(--font-serif); margin-bottom: 10px; overflow-wrap: break-word; }
.arc-cardi .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.arc-cardi .bottom { display: flex; align-items: center; justify-content: space-between; }

.arc-load { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px auto 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 24px; font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.arc-load:hover { background: var(--surface-muted); }

@media (max-width: 1240px) { .arc-stats { grid-template-columns: repeat(2, 1fr); } .arc-head-art { display: none; } .arc-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) {
  .arc-stats { grid-template-columns: 1fr; }
  .arc-entry { flex-wrap: wrap; }
  .arc-entry .side { width: 100%; justify-content: flex-start; }
  .arc-filters2 .right { margin-left: 0; width: 100%; justify-content: space-between; }
  .arc-cards { grid-template-columns: 1fr; }
  .arc-saved-panel { right: auto; left: 0; }
}

/* ---------- Year View page ---------- */
.yr-head { position: relative; padding: 2px 0 6px; min-height: 100px; }
.yr-head-art { position: absolute; right: 0; top: -18px; width: 220px; pointer-events: none; z-index: 0; }
.yr-head > * { position: relative; z-index: 1; }
.yr-head h1 { font-family: var(--font-serif); display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.yr-head .sub { color: var(--text-tertiary); font-size: 0.92rem; }

.yr-controls { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.yr-seg { margin-left: auto; display: flex; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; }
.yr-seg button { padding: 9px 20px; border-radius: var(--radius-sm); font-size: 0.83rem; color: var(--text-secondary); background: none; border: none; cursor: pointer; font-weight: 500; }
.yr-seg button.on { background: var(--color-forest); color: #fff; }

.cap-seg { display: flex; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; flex-shrink: 0; }
.cap-seg button { padding: 8px 16px; border-radius: var(--radius-sm); font-size: 0.8rem; color: var(--text-tertiary); background: none; border: none; cursor: pointer; font-weight: 500; white-space: nowrap; }
.cap-seg button.on { background: var(--color-primary); color: #fff; font-weight: 600; }
.cap-seg button .n { opacity: 0.8; }

.yr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.yr-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px; display: flex; align-items: flex-start; gap: 15px; position: relative; overflow: hidden; min-width: 0; }
.yr-stat .ic { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.yr-stat .y1 { background: #eae5da; } .yr-stat .y2 { background: #fbe6d8; } .yr-stat .y3 { background: #fbdfe2; } .yr-stat .y4 { background: #fde0cf; }
.yr-stat .body { flex: 1; min-width: 0; }
.yr-stat .k { font-size: 0.66rem; letter-spacing: 0.09em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 7px; }
.yr-stat .v { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 5px; }
.yr-stat .u { font-size: 0.72rem; color: var(--text-tertiary); }
.yr-pbar { height: 6px; border-radius: var(--radius-full); background: var(--surface-muted); margin-top: 10px; overflow: hidden; }
.yr-pbar span { display: block; height: 100%; border-radius: var(--radius-full); background: var(--color-forest); }
.yr-sprig { position: absolute; right: 10px; bottom: 8px; opacity: 0.85; pointer-events: none; }

.yr-heat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px 16px; margin-bottom: 20px; overflow-x: auto; }
.yr-months { display: flex; gap: 7px; margin-left: 36px; margin-bottom: 8px; }
.yr-months span { font-size: 0.62rem; letter-spacing: 0.08em; font-weight: 700; color: var(--text-tertiary); text-align: left; flex-shrink: 0; }
.yr-grid-wrap { display: flex; gap: 7px; }
.yr-daylabels { display: flex; flex-direction: column; gap: 3px; width: 29px; flex-shrink: 0; padding-top: 1px; }
.yr-daylabels span { font-size: 0.62rem; color: var(--text-tertiary); height: 12px; line-height: 12px; }
.yr-mgroup { display: flex; gap: 3px; flex-shrink: 0; }
.yr-week { display: flex; flex-direction: column; gap: 3px; }
.yr-cell { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-muted); }
.yr-cell[data-clickable] { cursor: pointer; }
.yr-cell[data-clickable]:hover { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.yr-cell.future { background: transparent; border: 1px dashed var(--border); }
.yr-cell.empty { visibility: hidden; }
.yr-legend { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-top: 16px; font-size: 0.76rem; color: var(--text-secondary); }
.yr-legend span { display: flex; align-items: center; gap: 7px; }
.yr-legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }

.yr-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.yr-panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px 20px 16px; position: relative; overflow: hidden; min-width: 0; }
.yr-panel h3 { font-size: 0.98rem; font-weight: 700; margin-bottom: 4px; }
.yr-panel .psub { font-size: 0.76rem; color: var(--text-tertiary); margin-bottom: 18px; }
.yr-plink { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; }

.yr-donut-row { display: flex; align-items: center; gap: 18px; }
.yr-donut-row > * { min-width: 0; }
.yr-donut { width: 116px; height: 116px; border-radius: 50%; flex-shrink: 0; position: relative; }
.yr-donut::after { content: ''; position: absolute; inset: 30%; background: var(--bg-elevated); border-radius: 50%; }
.yr-dlegend { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; min-width: 0; }
.yr-dlegend .li { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--text-secondary); }
.yr-dlegend .swatch { width: 8px; height: 8px; border-radius: 2.5px; flex-shrink: 0; }
.yr-dlegend .pc { margin-left: auto; color: var(--text-tertiary); font-size: 0.68rem; }

.yr-hi { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.yr-hi .th { width: 48px; height: 42px; border-radius: var(--radius-sm); flex-shrink: 0; }
.yr-hi .body { flex: 1; min-width: 0; }
.yr-hi .d { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 3px; font-weight: 600; }
.yr-hi .ti { font-size: 0.82rem; font-weight: 700; margin-bottom: 3px; overflow-wrap: break-word; }
.yr-hi .ex { font-size: 0.72rem; line-height: 1.5; color: var(--text-tertiary); overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yr-hi .star { color: #e8a33d; font-size: 1.05rem; flex-shrink: 0; }

.yr-chart { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-left: 26px; position: relative; }
.yr-yaxis { position: absolute; left: 0; top: 0; bottom: 18px; width: 22px; display: flex; flex-direction: column; justify-content: space-between; font-size: 0.62rem; color: var(--text-tertiary); text-align: right; }
.yr-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.yr-col .b { width: 100%; max-width: 18px; border-radius: 3px 3px 0 0; background: var(--color-forest); }
.yr-col .cl { font-size: 0.62rem; color: var(--text-tertiary); }
.yr-corner { position: absolute; right: 10px; bottom: 8px; opacity: 0.8; pointer-events: none; }

@media (max-width: 1240px) { .yr-head-art { display: none; } }
@media (max-width: 1080px) { .yr-stats { grid-template-columns: repeat(2, 1fr); } .yr-trio { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .yr-stats { grid-template-columns: 1fr; }
  .yr-seg { margin-left: 0; width: 100%; }
  .yr-controls { flex-direction: column; align-items: stretch; }
  .yr-donut-row { flex-direction: column; align-items: flex-start; }
  .yr-dlegend { grid-template-columns: 1fr; width: 100%; }
}

/* ---------- Calendar page ---------- */
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.cal-body > * { min-width: 0; }
.cal-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.cal-head-art { width: 130px; flex-shrink: 0; margin-top: -10px; }
.cal-head .titles { flex: 1; min-width: 180px; }
.cal-head h1 { font-family: var(--font-serif); font-size: 1.9rem; letter-spacing: -0.015em; color: var(--color-forest); margin-bottom: 6px; }
.cal-head .sub { font-size: 0.85rem; color: var(--text-tertiary); }
.cal-navbtns { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.cal-rnd { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); cursor: pointer; }
.cal-rnd:hover { background: var(--surface-muted); }
.cal-today-btn { display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 17px; font-size: 0.83rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.cal-today-btn:hover { background: var(--surface-muted); }

.cal-panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px 18px; margin-bottom: 18px; overflow-x: auto; }
.cal-dow, .cal-grid { min-width: 380px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 10px; }
.cal-dow span { font-size: 0.72rem; letter-spacing: 0.09em; font-weight: 700; color: var(--text-tertiary); text-align: center; display: block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal-day { border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: 86px; padding: 10px 12px; position: relative; background: var(--bg-elevated); cursor: pointer; }
.cal-day.empty { border: none; background: none; cursor: default; }
.cal-day.blank { background: var(--surface-muted); cursor: default; }
.cal-day.blank.future { cursor: default; }
.cal-day:not(.empty):not(.blank):hover { box-shadow: var(--shadow-sm); }
.cal-day.future:not(.blank) { opacity: 0.55; }
.cal-day .n { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.cal-day.blank .n { color: var(--text-tertiary); font-weight: 500; }
.cal-day .cnt { font-size: 0.7rem; color: var(--text-tertiary); margin-top: 5px; }
.cal-day .mood-emoji { position: absolute; right: 9px; top: 8px; font-size: 1rem; line-height: 1; }
.cal-day .mood-emojis { position: absolute; right: 8px; top: 9px; font-size: 0.8rem; line-height: 1; display: flex; gap: 2px; align-items: center; max-width: 46px; overflow: hidden; white-space: nowrap; }
.cal-day .mood-emojis .extra { font-size: 0.58rem; font-weight: 700; color: var(--text-tertiary); margin-left: 1px; }
.cal-day.today { border: 1.6px solid var(--color-primary); }
.cal-day .pen { font-size: 0.78rem; margin-left: 4px; }

.cal-legend { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 15px 20px 17px; }
.cal-legend .lt { font-size: 0.86rem; font-weight: 700; margin-bottom: 13px; }
.cal-legend .row { display: flex; flex-wrap: wrap; gap: 20px 24px; align-items: center; font-size: 0.8rem; color: var(--text-secondary); }
.cal-legend .row span { display: flex; align-items: center; gap: 8px; }

.cal-rail { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cal-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 22px; position: relative; overflow: hidden; }
.cal-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; }
.cal-big { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; margin-bottom: 5px; }
.cal-lbl { font-size: 0.78rem; color: var(--text-tertiary); margin-bottom: 12px; }
.cal-pbar { height: 6px; border-radius: var(--radius-full); background: var(--surface-muted); overflow: hidden; margin-bottom: 18px; }
.cal-pbar span { display: block; height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, #e0a24a, #d8703c); }
.cal-seal { position: absolute; right: 18px; bottom: 18px; width: 52px; height: 52px; border-radius: 50%; background: #f6ead9; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }

.cal-mrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 0.82rem; color: var(--text-secondary); }
.cal-mrow .em { font-size: 0.92rem; width: 18px; text-align: center; flex-shrink: 0; }
.cal-mrow .nm { width: 68px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-mrow .bar { flex: 1; height: 6px; border-radius: 4px; background: var(--surface-muted); overflow: hidden; min-width: 0; }
.cal-mrow .bar span { display: block; height: 100%; border-radius: 4px; }
.cal-mrow .n { width: 18px; text-align: right; font-size: 0.78rem; color: var(--text-secondary); flex-shrink: 0; }
.cal-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 0.8rem; color: var(--color-primary); font-weight: 600; }

.cal-hi { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.cal-hi .th { width: 52px; height: 42px; border-radius: var(--radius-sm); flex-shrink: 0; }
.cal-hi .body { flex: 1; min-width: 0; }
.cal-hi .d { font-size: 0.7rem; color: var(--text-tertiary); margin-bottom: 3px; }
.cal-hi .ti { font-size: 0.82rem; font-weight: 700; margin-bottom: 3px; overflow-wrap: break-word; }
.cal-hi .pg { font-size: 0.7rem; color: var(--text-tertiary); }

.cal-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal-wcol { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; min-height: 220px; background: var(--bg-elevated); min-width: 0; }
.cal-wcol.today { border: 1.6px solid var(--color-primary); }
.cal-wcol.future { opacity: 0.55; }
.cal-wcol .whead { font-size: 0.7rem; font-weight: 700; color: var(--text-tertiary); letter-spacing: 0.06em; margin-bottom: 2px; }
.cal-wcol .wnum { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.cal-wentry { display: flex; align-items: flex-start; gap: 6px; padding: 6px 0; border-top: 1px solid var(--border-soft); cursor: pointer; font-size: 0.72rem; }
.cal-wentry:first-of-type { border-top: none; }
.cal-wentry .ti { font-weight: 600; overflow-wrap: break-word; }
.cal-wempty { font-size: 0.7rem; color: var(--text-tertiary); }

@media (max-width: 1240px) { .cal-body { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .cal-head-art { display: none; } .cal-day { min-height: 62px; padding: 8px 9px; } .cal-day .cnt { display: none; } }
@media (max-width: 700px) { .cal-week-grid { grid-template-columns: 1fr; } .cal-wcol { min-height: auto; } }

/* ---------- Today's Page (write) ---------- */
.tp-day { position: relative; border-radius: var(--radius-lg); overflow: hidden; padding: 30px 34px 34px; margin-bottom: 20px; background: var(--bg-elevated); border: 1px solid var(--border); }
.tp-day-photo { position: absolute; inset: 0; background-image: radial-gradient(58% 130% at 88% 24%, #cdbba2 0%, #d9cab2 32%, #e6dcc6 58%, transparent 78%), radial-gradient(40% 90% at 66% 84%, #d8c8ae 0%, transparent 72%), linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-elevated) 34%, #f3ecdc 56%, #e9dfca 100%); }
.tp-day > * { position: relative; z-index: 1; }
.tp-day-actions { position: absolute; top: 22px; right: 26px; display: flex; gap: 10px; z-index: 2; }
.tp-round-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,253,247,0.94); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 6px rgba(90,70,40,0.08); font-size: 0.95rem; }
.tp-round-btn.on { color: var(--color-primary); background: var(--color-primary-100); }
.tp-eyebrow { font-size: 0.72rem; letter-spacing: 0.15em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 10px; text-transform: uppercase; }
.tp-day h1 { font-family: var(--font-serif); font-weight: 500; font-size: 2.1rem; letter-spacing: -0.01em; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.tp-day p { font-size: 0.92rem; color: var(--text-secondary); line-height: 1.7; }

.tp-cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.tp-cols > * { min-width: 0; }

.tp-prompt { display: flex; align-items: center; gap: 16px; background: linear-gradient(100deg, #fdeede, #fbe3cd); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 18px; flex-wrap: wrap; }
.tp-prompt .q { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.72); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-serif); font-size: 1.1rem; color: #9a5b33; }
.tp-prompt .txt { flex: 1; min-width: 180px; font-size: 0.92rem; line-height: 1.5; color: #4a3524; }
.tp-prompt-btns { display: flex; gap: 8px; flex-shrink: 0; }
.tp-btn-rust { background: var(--color-primary); color: #fff; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 0.83rem; font-weight: 600; white-space: nowrap; border: none; cursor: pointer; }
.tp-btn-shuffle { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,0.6); border: 1px solid rgba(181,82,42,0.32); color: #8a4a26; padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.83rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tp-btn-x { background: rgba(255,255,255,0.6); border: 1px solid rgba(181,82,42,0.25); color: #8a4a26; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.tp-editor { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.tp-ed-head { display: flex; align-items: center; gap: 13px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); position: relative; }
.tp-ed-badge { width: 30px; height: 30px; border-radius: 8px; background: var(--color-primary-100); color: var(--color-primary-700); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.tp-ed-day { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.tp-ed-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.tp-ed-head .entry-title-input { font-size: 1rem; font-weight: 500; padding: 0; }
.tp-ed-focus-actions { display: none; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.tp-fa-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.tp-fa-btn:hover { background: var(--surface-muted); color: var(--text-primary); }
.tp-fa-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 0.82rem; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
.tp-fa-pill:hover { border-color: var(--color-primary); color: var(--text-primary); }
.tp-fa-exit { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-muted); color: var(--text-primary); font-size: 0.82rem; font-weight: 600; cursor: pointer; flex-shrink: 0; white-space: nowrap; }
.tp-fa-exit:hover { background: var(--border-soft); }
body.tp-focus .tp-ed-focus-actions { display: flex; }
.focus-menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: none; background: transparent; border-radius: 6px; font-size: 0.85rem; color: var(--text-primary); cursor: pointer; }
.focus-menu-item:hover { background: var(--surface-muted); }
.tp-editor .editor-toolbar-row { padding: 10px 16px; margin-bottom: 0; }
.tp-editor .entry-body { padding: 20px; min-height: 340px; }
.tp-editor .attachment-grid { padding: 0 20px; margin-top: 0; margin-bottom: 16px; }

.tp-ed-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.tp-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 0.8rem; color: var(--text-secondary); background: var(--bg-elevated); cursor: pointer; }
.tp-pill select { border: none; outline: none; background: none; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; }
.tp-pill.on { background: var(--color-primary-100); color: var(--color-primary-700); border-color: var(--color-primary-100); }
.tp-ed-stats { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 0.72rem; color: var(--text-tertiary); flex-wrap: wrap; }

.tp-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tp-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.tp-card h3 { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; font-weight: 700; margin-bottom: 15px; }

.tp-moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tp-mood { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.64rem; color: var(--text-secondary); background: var(--bg-elevated); cursor: pointer; min-width: 0; overflow-wrap: break-word; text-align: center; }
.tp-mood:hover { background: var(--surface-muted); }
.tp-mood .em { font-size: 1.15rem; line-height: 1; }
.tp-mood.selected { border-color: var(--color-primary); background: var(--color-primary-50); color: var(--color-primary-700); font-weight: 700; }

.tp-slider-wrap { padding: 4px 0 0; }
.tp-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 4px; outline: none; cursor: pointer; }
.tp-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--color-primary); cursor: pointer; border: 2px solid var(--bg-elevated); box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.tp-slider::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--color-primary); cursor: pointer; border: 2px solid var(--bg-elevated); }
.tp-slider-labels { display: flex; justify-content: space-between; margin-top: 9px; font-size: 0.75rem; color: var(--text-tertiary); }

.tp-adds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tp-add { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 0.68rem; color: var(--text-secondary); background: none; border: none; cursor: pointer; min-width: 0; text-align: center; }
.tp-add .ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.tp-add:hover .ic { filter: brightness(0.96); }
.tp-ic-photo { background: #e6efe6; color: #4f7a52; } .tp-ic-draw { background: #f0e7f7; color: #7c5fb0; }
.tp-ic-voice { background: #fbe0e0; color: #b04a4a; } .tp-ic-upload { background: #fdf0d6; color: #c99a33; }
.tp-ic-video { background: #e0eef8; color: #3f6fa8; } .tp-ic-file { background: #f2ece0; color: #8a7455; }
.tp-ic-link { background: #e5e9fa; color: #4f5da8; }
.tp-add.active .ic { background: var(--error-bg); color: var(--error); }

.tp-loc-badge { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }
.tp-loc-weather { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 4px; }
.tp-loc-remove { background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 0.9rem; flex-shrink: 0; padding: 2px; }
.tp-loc-remove:hover { color: var(--error); }

.tp-bottombar { display: flex; align-items: center; gap: 14px; padding: 16px 0 0; flex-wrap: wrap; }
.tp-bb-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-btn-white { display: flex; align-items: center; gap: 8px; background: var(--bg-elevated); border: 1px solid var(--border); padding: 11px 18px; border-radius: var(--radius-sm); font-size: 0.83rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.tp-btn-white:hover { background: var(--surface-muted); }
.tp-status { margin: 0 auto; display: flex; align-items: center; gap: 8px; font-size: 0.83rem; color: var(--text-secondary); }
.tp-btn-dark { display: flex; align-items: center; gap: 8px; background: var(--color-forest); color: #fff; padding: 11px 22px; border-radius: var(--radius-sm); font-size: 0.83rem; font-weight: 600; cursor: pointer; border: none; }
.tp-btn-dark:hover { background: var(--color-forest-700); }

body.tp-focus .app-sidebar, body.tp-focus .app-topbar, body.tp-focus .tp-rail { display: none !important; }
body.tp-focus .tp-cols { grid-template-columns: 1fr; }
body.tp-focus .app-content { max-width: none; margin: 0; padding: 28px 40px 0; position: relative; z-index: 1; }
body.tp-focus .tp-day, body.tp-focus .filter-bar, body.tp-focus #promptZone, body.tp-focus .tp-bottombar { display: none !important; }
body.tp-focus .tp-editor { border: none; background: var(--bg-elevated); border-radius: var(--radius-lg); box-shadow: 0 1px 3px rgba(60, 48, 25, 0.04); }
body.tp-focus .tp-ed-head { padding: 0 0 14px; border-bottom: none; }
body.tp-focus .tp-ed-head .entry-title-input { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 600; }
body.tp-focus .editor-toolbar-row { background: var(--bg-elevated); border-radius: var(--radius-md) var(--radius-md) 0 0; border-bottom: none; padding: 16px 20px; }
body.tp-focus .tp-editor .entry-body { min-height: calc(100vh - 300px); padding: 28px 4px; font-size: 1.25rem; }
body.tp-focus .tp-ed-foot { border-top: none; padding: 14px 4px; }

/* Trim the toolbar to its essentials in focus mode — numbered lists, the
   list-style picker, and "remove highlight" are rarely used and just add
   visual noise to a view meant to feel calm and distraction-free. */
body.tp-focus .toolbar-btn[data-cmd="insertOrderedList"],
body.tp-focus #listStyleSelect,
body.tp-focus #clearHighlightBtn { display: none; }

/* Format painter reads as a warm red accent in focus mode's reference
   design, distinct from the amber it uses in the regular editor. */
body.tp-focus .toolbar-btn-accent { color: #C6493C; }
body.tp-focus .toolbar-btn-accent:hover { background: rgba(198, 73, 60, 0.12); color: #C6493C; }

/* A calm, fixed sage accent for focus mode's active toolbar states —
   independent of the user's chosen page theme, which can be a much
   louder accent (terracotta, sunset orange, rose) that reads as busy
   against a deliberately quiet writing view. */
body.tp-focus { --focus-accent-bg: #E4ECDF; --focus-accent-fg: #4B6B4E; }
body.tp-focus .toolbar-btn.active { background: var(--focus-accent-bg); color: var(--focus-accent-fg); }
[data-theme="dark"] body.tp-focus { --focus-accent-bg: #29392C; --focus-accent-fg: #A9C8AB; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.tp-focus { --focus-accent-bg: #29392C; --focus-accent-fg: #A9C8AB; }
}

/* The day badge inverts to the page's own ink/paper colors instead of
   the sage accent — a small anchor of contrast against the plain
   focus-mode canvas that still adapts correctly in dark mode. */
body.tp-focus .tp-ed-badge { background: var(--text-primary); color: var(--bg-elevated); }

/* Plain, near-white focus-mode canvas — no gradient, no decorative
   plant art. Focus mode is meant to be a blank page, not a scene. */
body.tp-focus { background: #FDFCFA; }
[data-theme="dark"] body.tp-focus { background: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.tp-focus { background: var(--bg); }
}

@media (max-width: 1180px) { .tp-cols { grid-template-columns: 1fr; } .tp-rail { order: -1; } }
@media (max-width: 700px) {
  .tp-day { padding: 22px 20px 26px; }
  .tp-day h1 { font-size: 1.5rem; }
  .tp-day-actions { position: static; justify-content: flex-end; margin-bottom: 14px; }
  .tp-prompt { flex-direction: column; align-items: flex-start; }
  .tp-bottombar { flex-direction: column; align-items: stretch; }
  .tp-status { order: -1; margin: 0 0 6px; }
}

/* ---------- Dashboard ---------- */
.db-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.db-head h1 { font-family: var(--font-serif); font-size: 1.85rem; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.db-head .sub { font-size: 0.85rem; color: var(--text-tertiary); }
.db-btn-new { display: flex; align-items: center; gap: 8px; background: var(--color-primary); color: #fff; padding: 13px 22px; border-radius: var(--radius-md); font-size: 0.86rem; font-weight: 600; white-space: nowrap; box-shadow: 0 2px 8px rgba(191,100,53,0.26); }
.db-btn-new:hover { background: var(--color-primary-700); }

.db-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.db-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 17px 19px 19px; position: relative; overflow: hidden; min-width: 0; }
.db-stat .k { font-size: 0.68rem; letter-spacing: 0.09em; font-weight: 700; color: var(--text-tertiary); margin-bottom: 10px; }
.db-stat .v { font-size: 1.6rem; font-weight: 700; display: flex; align-items: center; gap: 8px; line-height: 1.1; letter-spacing: -0.01em; }
.db-stat .v .fire { font-size: 1.25rem; }
.db-stat .sub { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 9px; }
.db-bar { height: 6px; border-radius: var(--radius-full); background: var(--surface-muted); margin-top: 13px; overflow: hidden; }
.db-bar span { display: block; height: 100%; border-radius: var(--radius-full); background: var(--color-forest); }
.db-stat .vase { position: absolute; right: 10px; bottom: 6px; width: 54px; opacity: 0.95; pointer-events: none; }

.db-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.db-grid > * { min-width: 0; }
.db-col { display: flex; flex-direction: column; gap: 18px; }

.db-insp { position: relative; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-forest); background: var(--color-forest); min-height: 160px; padding: 20px 22px; }
.db-insp-photo { position: absolute; inset: 0; background-image: radial-gradient(60% 140% at 85% 20%, rgba(255,255,255,0.07) 0%, transparent 60%), radial-gradient(40% 90% at 10% 100%, rgba(255,255,255,0.04) 0%, transparent 70%); }
.db-insp > * { position: relative; z-index: 1; }
.db-insp h3 { display: flex; align-items: center; gap: 9px; font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; color: #fff; }
.db-insp .quote { font-family: var(--font-serif); font-size: 1.15rem; font-style: italic; line-height: 1.45; max-width: 420px; margin-bottom: 10px; color: #fff; }
.db-insp .by { font-size: 0.8rem; color: rgba(255,255,255,0.7); }

.db-waiting { display: flex; align-items: center; gap: 15px; padding: 19px 22px; flex-wrap: wrap; }
.db-waiting .pen { width: 44px; height: 44px; border-radius: 50%; background: var(--color-forest); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; }
.db-waiting .t { font-size: 0.92rem; font-weight: 700; margin-bottom: 3px; }
.db-waiting .s { font-size: 0.78rem; color: var(--text-tertiary); }
.db-btn-green { margin-left: auto; background: var(--color-forest); color: #fff; padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.db-btn-green:hover { background: var(--color-forest-700); }
.db-written-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--success-bg); color: var(--success); font-size: 0.76rem; font-weight: 700; padding: 6px 13px; border-radius: var(--radius-full); }

.db-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); }
.db-card-pad { padding: 18px 20px; }
.db-rec-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px 12px; }
.db-rec-head .t { font-size: 1rem; font-weight: 700; font-family: var(--font-serif); }
.db-rec-head a { font-size: 0.78rem; color: var(--text-tertiary); }
.db-entry { display: flex; gap: 13px; padding: 14px 20px; border-top: 1px solid var(--border-soft); cursor: pointer; }
.db-entry:hover { background: var(--surface-muted); }
.db-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--surface-muted); border: 1px solid var(--border-soft); }
.db-entry .body { flex: 1; min-width: 0; }
.db-entry .d { font-size: 0.7rem; color: var(--text-tertiary); margin-bottom: 3px; }
.db-entry .ti { font-size: 0.9rem; font-weight: 700; margin-bottom: 3px; overflow-wrap: break-word; }
.db-entry .sn { font-size: 0.78rem; color: var(--text-tertiary); line-height: 1.5; overflow-wrap: break-word; }
.db-dots { margin-left: auto; color: var(--text-tertiary); font-size: 1rem; align-self: flex-start; padding: 2px 4px; background: none; border: none; cursor: pointer; flex-shrink: 0; line-height: 1; }
.db-dots:hover { color: var(--text-primary); }

.db-footnote { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 0.85rem; color: var(--text-secondary); padding: 6px 0 0; text-align: center; }

.db-card h3.db-h3 { display: flex; align-items: center; gap: 9px; font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
.db-chal { margin-top: 14px; }
.db-chal:first-of-type { margin-top: 0; }
.db-chal-row { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 7px; }
.db-chal-row .n { font-size: 0.76rem; color: var(--text-tertiary); }
.db-link { display: inline-block; margin-top: 14px; font-size: 0.8rem; color: var(--color-primary); font-weight: 600; }

.db-mem { display: flex; align-items: center; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.db-mem:last-of-type { border-bottom: none; }
.db-mem:hover .ph { filter: brightness(1.05); }
.db-mem .ph { width: 44px; height: 38px; border-radius: var(--radius-sm); flex-shrink: 0; }
.db-mem .body { min-width: 0; }
.db-mem .d { font-size: 0.7rem; color: var(--text-tertiary); margin-bottom: 3px; }
.db-mem .ti { font-size: 0.85rem; font-weight: 700; overflow-wrap: break-word; }

.db-otd { background: var(--color-forest-700); color: #eee7d6; border-radius: var(--radius-md); padding: 18px 20px; position: relative; overflow: hidden; cursor: pointer; }
.db-otd h3 { display: flex; align-items: center; gap: 9px; color: #eee7d6; font-size: 0.95rem; margin-bottom: 14px; font-weight: 700; }
.db-otd .d { font-size: 0.72rem; color: #b9c4b3; margin-bottom: 7px; }
.db-otd .ti { font-size: 0.92rem; font-weight: 700; margin-bottom: 9px; color: #fff; }
.db-otd p { font-size: 0.78rem; line-height: 1.6; color: #cfd6c8; max-width: 260px; }
.db-otd .ph { position: absolute; right: 16px; bottom: 18px; width: 90px; height: 82px; border-radius: var(--radius-sm); background: linear-gradient(160deg, #e8d3ae, #b58f5f 55%, #7d5c34); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }

.db-note { font-size: 0.78rem; line-height: 1.6; color: var(--text-secondary); padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.db-note:first-of-type { padding-top: 2px; }
.db-note:last-of-type { border-bottom: none; }
.db-note.unread { color: var(--text-primary); font-weight: 500; }

.db-prof { display: flex; align-items: center; gap: 15px; margin-top: 4px; }
.db-ring { position: relative; width: 66px; height: 66px; flex-shrink: 0; }
.db-ring svg { transform: rotate(-90deg); }
.db-ring .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.88rem; font-weight: 700; }
.db-prof .t { font-size: 0.85rem; font-weight: 700; margin-bottom: 2px; }
.db-prof .s { font-size: 0.76rem; color: var(--text-tertiary); margin-bottom: 8px; }

.db-plan-head { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.db-plan-head .t { font-size: 0.92rem; font-weight: 700; }
.db-plan-badge { background: var(--color-primary-100); color: var(--color-primary-700); font-size: 0.68rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-full); }

@media (max-width: 1180px) { .db-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .db-stats { grid-template-columns: repeat(2, 1fr); }
  .db-head { flex-direction: column; align-items: stretch; }
  .db-btn-new { justify-content: center; }
  .db-waiting { flex-direction: column; align-items: flex-start; }
  .db-btn-green { margin-left: 0; }
}

/* ---------- Feature showcase (textured dark band) ---------- */
.showcase-band { background: var(--color-forest-700); background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.04), transparent 60%); padding: 84px 0; }
.showcase-band .section-head .eyebrow { color: #E8B98F; }
.showcase-band .section-head h2, .showcase-band .section-head p { color: #fff; }
.showcase-band .section-head p { color: rgba(255,255,255,0.75); }
.showcase-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.showcase-card { background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-lg); }
.showcase-caption { text-align: center; margin-top: 16px; }
.showcase-caption .label { color: #fff; font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.showcase-caption .desc { color: rgba(255,255,255,0.72); font-size: 0.82rem; }
@media (max-width: 900px) { .showcase-row { grid-template-columns: 1fr; } }

/* ---------- Prompt carousel ---------- */
.prompt-carousel-band { background: var(--color-forest); padding: 70px 0; }
.prompt-carousel-band .section-head h2, .prompt-carousel-band .section-head p { color: #fff; }
.prompt-carousel-band .section-head p { color: rgba(255,255,255,0.75); }
.prompt-carousel-band .section-head .eyebrow { color: #E8B98F; }
.prompt-carousel { display: flex; gap: 16px; overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory; }
.prompt-carousel::-webkit-scrollbar { height: 8px; }
.prompt-carousel-card { flex: 0 0 240px; scroll-snap-align: start; background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 26px 22px; font-family: var(--font-serif); font-size: 1.1rem; color: var(--text-primary); min-height: 130px; display: flex; align-items: center; }
.carousel-nav { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.carousel-nav button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); background: transparent; color: #fff; cursor: pointer; font-size: 1rem; }
.carousel-nav button:hover { background: rgba(255,255,255,0.1); }

/* ---------- Testimonial strip ---------- */
.testimonial-strip-wrap { display: flex; gap: 18px; overflow-x: auto; padding: 8px 4px 18px; }
.testimonial-strip-wrap .testimonial { flex: 0 0 300px; }

/* ---------- Rating badge ---------- */
.rating-line { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; color: var(--text-secondary); }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: 248px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.app-sidebar .brand { padding: 20px 22px; border-bottom: 1px solid var(--border-soft); }
.side-nav { padding: 14px; flex: 1; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 2px; }
.side-nav a:hover { background: var(--surface-muted); color: var(--text-primary); }
.side-nav a.active { background: var(--color-primary-100); color: var(--color-primary-700); font-weight: 600; }
.side-nav .nav-icon { width: 20px; text-align: center; }
.side-section-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); padding: 16px 14px 6px; }
.side-foot { padding: 14px; border-top: 1px solid var(--border-soft); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.user-chip:hover { background: var(--surface-muted); }
.user-chip .name { font-size: 0.86rem; font-weight: 600; }
.user-chip .sub { font-size: 0.74rem; color: var(--text-tertiary); }

.app-main { flex: 1; min-width: 0; }
.app-topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); z-index: 20; }
.app-content { padding: 28px; }
.mobile-nav-toggle { display: none; }

@media (max-width: 960px) {
  .app-sidebar { position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-100%); transition: transform var(--dur-med) var(--ease); box-shadow: var(--shadow-lg); }
  .app-sidebar.open { transform: translateX(0); }
  .mobile-nav-toggle { display: inline-flex; }
  .app-content { padding: 18px; }
  .sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; }
  .sidebar-scrim.open { display: block; }
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; font-size: 1.7rem; }
.page-sub { color: var(--text-tertiary); font-size: 0.92rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 18px 20px; }
.stat-card .label { font-size: 0.78rem; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; margin-top: 6px; }
.stat-card .delta { font-size: 0.78rem; margin-top: 4px; }
@media (max-width: 960px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- Journal editor ---------- */
.editor-wrap { max-width: 780px; margin: 0 auto; }
.editor-date { font-size: 0.85rem; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.prompt-card { background: var(--color-primary-50); border: 1px solid var(--color-primary-100); border-radius: var(--radius-lg); padding: 20px 22px; margin: 16px 0 22px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.prompt-card p { color: var(--color-primary-700); font-family: var(--font-serif); font-size: 1.08rem; margin: 0; }
input.entry-title-input { border: none; background: transparent; font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; padding: 6px 0; width: 100%; }
.entry-title-input:focus { box-shadow: none; }
.entry-title-input::placeholder { color: var(--text-tertiary); font-weight: 500; }
.entry-body { border: none; background: transparent; font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.8; width: 100%; min-height: 320px; padding: 10px 0; outline: none; cursor: text; }
.entry-body:focus { box-shadow: none; }
.entry-body:empty:before { content: attr(data-placeholder); color: var(--text-tertiary); pointer-events: none; }

/* Rich text: shared by the live editor (.entry-body) and read-only views
   (Archive modal, entry-print.html has its own copy of these rules). */
.rich-content h1, .rich-content h2, .rich-content h3, .entry-body h1, .entry-body h2, .entry-body h3 { font-family: inherit; margin: 0.7em 0 0.3em; }
.rich-content blockquote, .entry-body blockquote { margin: 0.8em 0; padding: 4px 18px; border-left: 3px solid var(--color-primary); color: var(--text-secondary); font-style: italic; }
.rich-content hr, .entry-body hr { border: none; border-top: 1px solid var(--border-soft); margin: 1.4em 0; }
.rich-content ul, .rich-content ol, .entry-body ul, .entry-body ol { margin: 0.4em 0 0.8em; padding-left: 1.6em; }
.rich-content ul.checklist, .entry-body ul.checklist { list-style: none; padding-left: 0.2em; }
.rich-content .checklist-item, .entry-body .checklist-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; list-style: none; }
.rich-content .checklist-item input, .entry-body .checklist-item input { margin-top: 6px; }
.rich-content a, .entry-body a { color: var(--color-primary); }
/* Tables, inserted via the editor's "Insert table" toolbar button. Wrapped
   in .entry-table-wrap so a table wider than the column scrolls instead of
   overflowing or squeezing every cell unreadably thin. */
.rich-content .entry-table-wrap, .entry-body .entry-table-wrap { overflow-x: auto; margin: 1em 0; }
.rich-content table, .entry-body table { border-collapse: collapse; width: 100%; min-width: 340px; }
.rich-content table td, .rich-content table th, .entry-body table td, .entry-body table th { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; min-width: 80px; }
.rich-content table th, .entry-body table th { background: var(--surface-muted); font-weight: 600; }
/* A #hashtag typed directly into the writing area and recognized as a tag
   (see maybeFinalizeHashtag in today.html) — styled like the tag chips in
   the sidebar so it reads as "this became a tag" rather than plain text. */
.rich-content .tag-mention, .entry-body .tag-mention { font-weight: 600; color: var(--color-primary); }
.diff-del { color: var(--error); text-decoration: line-through; opacity: 0.75; }
.diff-add { color: var(--success); font-weight: 600; }
.save-state { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-tertiary); }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.mood-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-opt { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 8px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); cursor: pointer; background: var(--surface); min-width: 62px; transition: all var(--dur-fast); }
.mood-opt .emoji { font-size: 1.3rem; }
.mood-opt span.label { font-size: 0.68rem; color: var(--text-tertiary); font-weight: 600; }
.mood-opt.selected { border-color: var(--color-primary); background: var(--color-primary-50); }
.mood-opt.selected span.label { color: var(--color-primary-700); }

.tag-input-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-muted); padding: 4px 10px 4px 12px; border-radius: var(--radius-full); font-size: 0.8rem; font-weight: 600; }
.tag-chip button { background: none; border: none; cursor: pointer; color: var(--text-tertiary); font-size: 0.9rem; line-height: 1; }
.tag-input-row input { border: none; flex: 1; min-width: 100px; padding: 4px; }
.tag-input-row input:focus { box-shadow: none; }

/* ---------- Year view ---------- */
.year-heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(13px, 1fr)); gap: 4px; }
.year-heatmap .day-cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-muted); cursor: pointer; position: relative; transition: transform var(--dur-fast); }
.year-heatmap .day-cell:hover { transform: scale(1.35); z-index: 5; box-shadow: var(--shadow-md); }
.year-heatmap .day-cell.empty { background: transparent; cursor: default; }
.year-heatmap .day-cell.future { background: var(--border-soft); cursor: default; }
.year-legend { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--text-tertiary); }
.year-legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.year-legend .sw::after { content: none; }

.month-block { margin-bottom: 26px; }
.month-block h4 { font-size: 0.88rem; margin-bottom: 10px; color: var(--text-secondary); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-grid .day-cell { aspect-ratio: 1; border-radius: 5px; background: var(--surface-muted); }

/* ---------- Archive ---------- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input[type="search"] { width: auto; }

.entry-list { display: flex; flex-direction: column; gap: 12px; }
.entry-row { display: flex; gap: 16px; padding: 16px; align-items: flex-start; cursor: pointer; }
.entry-row .emoji { font-size: 1.4rem; }
.entry-row .meta-line { font-size: 0.78rem; color: var(--text-tertiary); margin-bottom: 4px; }
.entry-row h4 { margin: 0 0 4px; font-size: 1.02rem; }
.entry-row p { margin: 0; font-size: 0.88rem; color: var(--text-secondary); font-family: var(--font-serif); }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-tertiary); }
.empty-state .icon { font-size: 2.6rem; margin-bottom: 14px; }
.divider { height: 1px; background: var(--border-soft); margin: 24px 0; }
.progress-bar { height: 8px; background: var(--surface-muted); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--color-primary); border-radius: var(--radius-full); transition: width var(--dur-med) var(--ease); }

.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--text-primary); color: var(--bg); padding: 13px 18px; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn var(--dur-med) var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.modal-scrim { position: fixed; inset: 0; background: rgba(20,18,28,0.5); display: flex; align-items: center; justify-content: center; z-index: 150; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 480px; width: 100%; padding: 28px; box-shadow: var(--shadow-lg); max-height: 86vh; overflow-y: auto; }
.modal.entry-modal { max-width: 720px; padding: 30px 34px; }

/* Entry preview — circular icon actions */
.entry-acts { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin: 6px 0 4px; }
.entry-act { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 84px; padding: 4px 2px; background: none; border: 0; cursor: pointer; text-decoration: none; font: inherit; color: var(--text-secondary); }
.entry-act-ic { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; background: var(--tint-sage); color: #28483b; transition: background var(--dur-fast) ease, transform var(--dur-fast) ease; }
.entry-act-ic svg { width: 22px; height: 22px; }
.entry-act-ic.is-on { background: #cfe0cd; color: #1f4535; }
.entry-act-lbl { font-size: 0.82rem; font-weight: 600; line-height: 1.15; text-align: center; }
.entry-act:hover .entry-act-ic { background: #d6e4d3; transform: translateY(-1px); }
.entry-act:active .entry-act-ic { transform: translateY(0); }
.entry-act-danger { color: var(--error); }
.entry-act-danger .entry-act-ic { background: var(--error-bg); color: var(--error); }
.entry-act-danger:hover .entry-act-ic { background: var(--error-bg); filter: brightness(0.96); }
/* On the phone the six actions read as a tidy 3 × 2 grid rather than a
   3-row wrap. */
html.is-native .entry-acts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 4px; justify-items: center;
}
html.is-native .entry-act { width: auto; }
html.is-native .modal.entry-modal { padding: 26px 16px; }

.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
.table tr:hover td { background: var(--surface-muted); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 22px; }
.tab { padding: 11px 16px; font-size: 0.88rem; font-weight: 600; color: var(--text-tertiary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--color-primary); border-color: var(--color-primary); }

.skeleton { background: linear-gradient(90deg, var(--surface-muted) 25%, var(--border-soft) 37%, var(--surface-muted) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.onboarding-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.onboarding-card { max-width: 560px; width: 100%; }
.onboarding-progress { display: flex; gap: 6px; margin-bottom: 30px; width: 100%; max-width: 560px; }
.onboarding-progress .seg { flex: 1; height: 4px; border-radius: var(--radius-full); background: var(--border-soft); }
.onboarding-progress .seg.done { background: var(--color-primary); }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice-card { border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 16px; cursor: pointer; transition: all var(--dur-fast); }
.choice-card:hover { border-color: var(--color-primary); }
.choice-card.selected { border-color: var(--color-primary); background: var(--color-primary-50); color: var(--color-primary-700); }
.choice-card .emoji { font-size: 1.4rem; margin-bottom: 8px; }
.choice-card .title { font-weight: 600; font-size: 0.92rem; }
.choice-card .desc { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 2px; }
.choice-card.selected .desc { color: var(--color-primary-700); opacity: 0.75; }

/* Typography picker (Settings → Appearance): each option is rendered in its
   own actual font — a big "Aa" plus the option name set in that same
   typeface — so the four choices read as visibly different from a glance,
   not as four lookalike words in a <select>. */
.typo-choice .typo-sample { font-size: 2rem; line-height: 1; margin-bottom: 6px; }
.typo-choice .title { font-size: 1rem; }

.auth-shell { min-height: 100vh; display: flex; }
.auth-visual { flex: 1; background: linear-gradient(160deg, var(--color-forest), var(--color-forest-700)); display: flex; align-items: center; justify-content: center; padding: 60px; color: #fff; }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-box { max-width: 380px; width: 100%; }
@media (max-width: 860px) { .auth-visual { display: none; } }

/* ---------- Rich editor toolbar ---------- */
.editor-toolbar-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); margin-bottom: 10px; position: relative; }
.toolbar-line { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.toolbar-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-secondary); font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.12s ease, color 0.12s ease; }
.toolbar-btn:hover { background: var(--surface-muted); color: var(--text-primary); }
.toolbar-btn.active { background: var(--color-primary-100); color: var(--color-primary-700); }
.toolbar-btn-text { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.01em; }
.toolbar-btn-accent { color: #e8942f; }
.toolbar-btn-accent:hover { background: rgba(232, 148, 47, 0.14); color: #e8942f; }
.toolbar-btn-check { position: relative; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em; }
.tb-abc-dot { position: absolute; bottom: 3px; right: 3px; pointer-events: none; }
.toolbar-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.toolbar-select { width: auto; height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; font-size: 0.8rem; background: var(--surface); color: var(--text-secondary); }
.tb-color-chip { position: absolute; left: 8px; right: 8px; bottom: 5px; height: 3px; border-radius: 2px; }

/* Google-Docs-style color picker: a swatch grid that opens into a detailed
   hue/saturation picker, shared by the text-color and highlight-color
   toolbar buttons. */
.color-popover { width: 258px; padding: 14px; }
.color-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; justify-items: center; }
.color-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.1); padding: 0; cursor: pointer; }
.color-swatch:hover { transform: scale(1.18); }
.color-custom-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 8px; }
.color-custom-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.color-add-btn, .color-eyedrop-btn { width: 22px; height: 22px; border-radius: 50%; border: 1px dashed var(--border); background: transparent; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.9rem; padding: 0; }
.color-eyedrop-btn { border-style: solid; }
.color-add-btn:hover, .color-eyedrop-btn:hover { background: var(--surface-muted); }
.color-sv-box { position: relative; width: 100%; height: 130px; border-radius: 6px; margin-bottom: 12px; cursor: crosshair; background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); }
.color-sv-handle { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); transform: translate(-50%, -50%); pointer-events: none; }
.color-hue-row { margin-bottom: 12px; }
.color-hue-slider { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); cursor: pointer; }
.color-hue-handle { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); transform: translate(-50%, -50%); pointer-events: none; }
.color-preview-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.color-preview-swatch { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); flex-shrink: 0; }
.color-fields { display: flex; gap: 5px; flex: 1; min-width: 0; }
.color-fields label { display: flex; flex-direction: column; font-size: 0.64rem; color: var(--text-tertiary); gap: 2px; flex: 1; min-width: 0; }
.color-fields input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 4px 3px; font-size: 0.74rem; text-align: center; background: var(--surface); color: var(--text-primary); box-sizing: border-box; -moz-appearance: textfield; }
.color-fields input::-webkit-outer-spin-button, .color-fields input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.color-actions { display: flex; justify-content: flex-end; gap: 8px; }
.color-actions .btn { padding: 6px 14px; font-size: 0.8rem; }

.popover { position: absolute; top: 44px; left: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 12px; }
/* Contextual row shown only while the caret sits inside a table cell — see
   currentTableCell() in today.html. */
.table-tools-row { display: none; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px 16px; border-bottom: 1px solid var(--border-soft); background: var(--bg-elevated); font-size: 0.78rem; }
.table-tools-row .toolbar-btn { width: auto; height: 30px; padding: 0 10px; font-size: 0.78rem; gap: 4px; }
/* Fixed-size cells, not `repeat(8, 1fr)` — an unconstrained 1fr track won't
   shrink below its content's natural width, so a handful of wider emoji
   glyphs were pushing themselves (and the grid) past the popover's edge. */
.emoji-grid { display: grid; grid-template-columns: repeat(8, 28px); gap: 4px; justify-content: center; }
.emoji-grid button { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: none; background: transparent; font-size: 1.05rem; line-height: 1; cursor: pointer; border-radius: 6px; padding: 0; }
.emoji-grid button:hover { background: var(--surface-muted); }

/* Circular "✨ AI reflection" trigger, sized to match .tp-btn-x, styled in
   the AI accent color so it reads as a distinct, AI-branded action next to
   the prompt card's other round buttons. */
.tp-btn-ai { background: var(--ai-bg); border: 1px solid var(--ai-border); color: var(--ai-accent); width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; font-size: 0.95rem; }
.tp-btn-ai:hover { filter: brightness(0.96); }
.ai-reflect-popover { left: auto; right: 0; width: min(300px, 84vw); }
.ai-reflect-popover .ai-panel-actions { flex-direction: column; align-items: stretch; gap: 2px; }
.ai-reflect-popover .ai-panel-actions button { text-align: left; padding: 8px 10px; border-radius: var(--radius-sm); }
.ai-reflect-popover .ai-panel-actions button:hover { background: var(--ai-bg); }

.entry-body.font-sans { font-family: var(--font-sans); }
.entry-body.font-serif { font-family: var(--font-serif); }
.entry-body.font-hand { font-family: var(--font-hand); font-size: 1.5rem; }
.entry-body.font-mono { font-family: var(--font-mono); font-size: 1rem; }

/* ---------- Attachments ---------- */
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-top: 12px; }
.attachment-thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--surface-muted); }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-thumb .att-media-btn { display: block; width: 100%; height: 100%; padding: 0; border: none; background: none; cursor: zoom-in; }
.attachment-thumb .audio-icon, .attachment-thumb .draw-icon, .attachment-thumb .file-icon, .attachment-thumb .video-icon, .attachment-thumb .link-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; font-size: 1.6rem; gap: 2px; padding: 4px; text-align: center; }
.attachment-thumb .file-icon span, .attachment-thumb .link-icon span { font-size: 0.6rem; color: var(--text-tertiary); word-break: break-all; line-height: 1.2; }
.attachment-thumb .remove-att { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; border: none; cursor: pointer; font-size: 0.7rem; line-height: 1; z-index: 2; }
.attachment-thumb audio { width: 100%; }
.attachment-thumb .reorder-row { position: absolute; bottom: 3px; left: 3px; right: 3px; display: flex; justify-content: space-between; z-index: 2; }
.attachment-thumb .reorder-btn { width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; border: none; cursor: pointer; font-size: 0.65rem; line-height: 1; }
.attachment-thumb .reorder-btn:disabled { opacity: 0.3; cursor: default; }

/* Wide tiles: audio/video/file/link need room for real controls or text,
   not a cropped 90px square. */
.attachment-thumb.wide { grid-column: 1 / -1; aspect-ratio: auto; height: auto; display: flex; align-items: center; gap: 10px; padding: 10px 34px 10px 12px; }
.attachment-thumb.wide .video-icon, .attachment-thumb.wide .audio-icon, .attachment-thumb.wide .file-icon, .attachment-thumb.wide .link-icon { height: auto; flex-direction: row; font-size: 1.3rem; padding: 0; }
.attachment-thumb.wide audio { flex: 1; min-width: 0; }
.attachment-thumb.wide video { flex: 1; min-width: 0; max-height: 220px; border-radius: var(--radius-sm); background: #000; }
.attachment-thumb.wide .att-name { flex: 1; min-width: 0; font-size: 0.82rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-thumb.wide .reorder-row { position: static; display: flex; gap: 4px; margin-left: auto; }
.attachment-link { display: inline-flex; align-items: center; gap: 6px; color: var(--color-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-broken-link { color: var(--text-tertiary); font-style: italic; }
.attachment-error { display: flex; align-items: center; justify-content: center; gap: 8px; height: 100%; width: 100%; font-size: 0.72rem; color: var(--error); text-align: center; padding: 6px; }
.attachment-error button { font-size: 0.7rem; padding: 3px 10px; border-radius: var(--radius-full); border: 1px solid var(--error); background: none; color: var(--error); cursor: pointer; white-space: nowrap; }

/* Inline attachments: a photo/audio/video/file/link embedded directly in
   the writing area, at whatever point the user placed it. Reuses the
   .attachment-thumb.wide look (see above) so it reads as the same kind of
   object whether it's sitting in the below-text gallery or inside the
   prose; these two rules only cancel the grid-parent assumptions that
   don't apply once it's floating free inside .entry-body/.rich-content. */
.entry-body .inline-att, .rich-content .inline-att { grid-column: unset; width: 100%; margin: 14px 0; user-select: none; }
.entry-body img[data-attachment-id], .rich-content img[data-attachment-id] { display: block; max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 14px 0; cursor: zoom-in; }

/* Lightbox: full-size, closeable view for image/drawing attachments */
.lightbox-scrim { z-index: 200; background: rgba(10,9,14,0.86); }
.lightbox-body { position: relative; max-width: 92vw; max-height: 90vh; }
.lightbox-body img { display: block; max-width: 92vw; max-height: 90vh; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.lightbox-close { position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); cursor: pointer; font-size: 0.9rem; box-shadow: var(--shadow-sm); }

.draw-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.draw-tool-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 0.95rem; }
.draw-tool-btn.active { background: var(--color-primary-100); border-color: var(--color-primary); }
.draw-tool-btn:disabled { opacity: 0.35; cursor: default; }

.draw-pad-wrap canvas { width: 100%; touch-action: none; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; cursor: crosshair; }
.color-swatch-row { display: flex; gap: 6px; margin: 10px 0; }
.color-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; }
.color-swatch.selected { border-color: var(--color-primary); }

.record-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--error); animation: recordPulse 1s ease infinite; }
@keyframes recordPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.entry-nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft); }

/* ---------- Achievements / Challenges ---------- */
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.achievement-badge { text-align: center; padding: 18px 10px; border-radius: var(--radius-md); border: 1px solid var(--border-soft); background: var(--surface); }
.achievement-badge.locked { opacity: 0.4; filter: grayscale(1); }
.achievement-badge .icon { font-size: 1.8rem; margin-bottom: 8px; }
.achievement-badge .name { font-weight: 700; font-size: 0.85rem; }
.achievement-badge .desc { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 3px; }

.challenge-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.challenge-card .icon { font-size: 1.4rem; }
.challenge-card .progress-bar { margin-top: 6px; }
.challenge-card.complete { border-color: var(--success); }

.quote-card { background: var(--color-forest); color: #fff; border-radius: var(--radius-lg); padding: 26px 28px; }
.quote-card p { color: #fff; font-family: var(--font-serif); font-style: italic; font-size: 1.05rem; margin: 0; }

/* ---------- Diary Lock screen ---------- */
.lock-screen { position: fixed; inset: 0; background: var(--color-forest); z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.pin-dots { display: flex; gap: 14px; margin: 24px 0; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5); }
.pin-dot.filled { background: #fff; border-color: #fff; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 14px; }
.pin-pad button { width: 64px; height: 64px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); color: #fff; font-size: 1.3rem; cursor: pointer; }
.pin-pad button:hover { background: rgba(255,255,255,0.14); }
.lock-error { color: #F2A5A5; font-size: 0.85rem; min-height: 20px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

/* ---------- Legal / help pages (privacy, terms, accessibility, contact) ---------- */
.legal-hero { background: var(--surface-muted); padding: 56px 24px 44px; text-align: center; border-bottom: 1px solid var(--border-soft); }
.legal-hero h1 { margin-bottom: 10px; }
.legal-hero .lede { max-width: 620px; margin: 0 auto; }
.legal-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; font-size: 0.82rem; color: var(--text-tertiary); }

.legal-body { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }
.legal-body h2 { font-size: 1.35rem; margin-top: 2.2em; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { font-size: 1.05rem; margin-top: 1.6em; }
.legal-body p, .legal-body li { font-size: 0.94rem; line-height: 1.75; color: var(--text-secondary); }
.legal-body ul, .legal-body ol { margin: 0 0 1.2em; padding-left: 22px; }
.legal-body li { margin-bottom: 6px; }
.legal-body strong { color: var(--text-primary); }
.legal-toc { background: var(--surface-muted); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 8px; }
.legal-toc h2 { margin-top: 0 !important; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.legal-toc ol { columns: 2; column-gap: 24px; padding-left: 18px; margin: 0; }
.legal-toc li { font-size: 0.85rem; margin-bottom: 4px; break-inside: avoid; }
.legal-toc a { color: var(--text-secondary); }
.legal-toc a:hover { color: var(--color-primary); }
.legal-note { background: var(--color-primary-50); border: 1px solid var(--color-primary-100); border-radius: var(--radius-md); padding: 16px 20px; font-size: 0.88rem; color: var(--text-secondary); margin: 1.4em 0; }

/* ---------- Contact page ---------- */
.contact-wrap { max-width: 640px; margin: 0 auto; padding: 56px 24px 90px; }
.contact-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 34px 36px; box-shadow: var(--shadow-sm); }
.contact-direct { text-align: center; margin-top: 26px; font-size: 0.88rem; color: var(--text-tertiary); }
.contact-direct a { color: var(--color-primary); font-weight: 600; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Native app shell (Capacitor / Android) — never rendered on the web.
   Two screens: the welcome/landing view and the mobile home, plus a
   persistent bottom tab bar on the primary app pages.
   ============================================================ */

/* The native app matches the mobile design refs' type system: Fraunces
   (serif display), Poppins (the "365 Pages" wordmark) and Nunito (body). */
html.is-native {
  --font-serif: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --font-sans: 'Nunito', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-wordmark: 'Poppins', 'Nunito', 'Inter', sans-serif;
  --forest-pill: #2e6451;   /* the design refs' CTA green (brighter than the ink) */
}
/* On the default (forest) theme, use the design refs' exact green ramp:
   a deep near-black green for headings, --forest-pill for CTAs/accents.
   A chosen page theme (data-page-theme) opts back out to its own palette. */
html.is-native:not([data-page-theme]) {
  --color-forest: #1c3a2d;
  --color-forest-700: #14352a;
  --color-forest-100: #dde9e2;
}

/* ---------- Welcome / landing screen (design ref 01-onboarding) ---------- */
/* Onboarding always renders light, per the design system. */
.welcome-body { background: #fbfaf7; color: #1b1b2e; }
.welcome-screen {
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100vh; min-height: 100dvh;
  max-width: 460px; margin: 0 auto; text-align: center;
  padding: max(32px, env(safe-area-inset-top)) 30px calc(24px + env(safe-area-inset-bottom));
}
.welcome-screen[hidden] { display: none; }
.welcome-top { display: flex; flex-direction: column; align-items: center; padding-top: 11vh; }
.welcome-logo { margin-bottom: 16px; line-height: 0; }
.welcome-logo svg { display: block; }
.welcome-title {
  font-family: var(--font-wordmark, 'Poppins', var(--font-sans));
  font-size: 2.45rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  margin: 0 0 15px; color: #1b1b2e;
}
.welcome-tagline {
  margin: 0; max-width: 22ch;
  color: #8a86b0; font-size: 1.12rem; font-weight: 600; line-height: 1.42;
}
.welcome-scene { width: min(82%, 310px); height: auto; margin: 40px auto 0; display: block; }
.welcome-actions { display: flex; flex-direction: column; align-items: stretch; gap: 15px; padding-top: 20px; }
.welcome-cta {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 24px; border-radius: var(--radius-full);
  background: #7d73e6; color: #fff; text-decoration: none;
  font-family: var(--font-sans); font-size: 1.14rem; font-weight: 700; letter-spacing: 0.005em;
  box-shadow: 0 16px 30px -12px rgba(125, 115, 230, 0.55);
}
.welcome-cta:hover { background: #6d63dc; }
.welcome-cta svg { position: absolute; right: 24px; width: 21px; height: 21px; }
.welcome-link {
  align-self: center; padding: 4px 12px;
  color: #7d73e6; font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem; text-decoration: none;
}
:root[data-theme="dark"] .welcome-title { color: #1b1b2e; }
:root[data-theme="dark"] .welcome-link { color: #7d73e6; }

/* ---------- Bottom tab bar ---------- */
.native-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-soft);
  padding-bottom: env(safe-area-inset-bottom);
}
.native-tab {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 4px 8px; text-decoration: none;
  font-size: 0.68rem; font-weight: 600; color: var(--text-tertiary);
}
.native-tab svg { width: 23px; height: 23px; }
.native-tab.active { color: var(--color-forest); }
:root[data-theme="dark"] .native-tab.active { color: #7FB98F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .native-tab.active { color: #7FB98F; } }
.native-tab.active::after {
  content: ""; position: absolute; top: 0; width: 26px; height: 3px;
  background: currentColor; border-radius: 0 0 3px 3px;
}
body.has-native-tabbar .app-content { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }

/* ---------- Mobile home (design-ref 02-dashboard) ----------
   Uses the shared native AppHeader (.app-topbar); only the scroll body below
   it is bespoke. */
body.mhome .app-content { padding: 0 0 calc(66px + env(safe-area-inset-bottom)); }
body.mhome .app-main { background: var(--bg); }

.mhome-scroll { padding: 6px 16px 24px; display: flex; flex-direction: column; gap: 20px; }

/* Hero card — "Today's Page" with the mountain illustration bleeding right. */
.mhome-hero {
  position: relative; overflow: hidden;
  border-radius: 22px; border: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
  background: var(--card, var(--surface));
  box-shadow: 0 1px 2px rgba(32,70,58,0.04), 0 12px 30px -16px rgba(32,70,58,0.14);
}
.mhome-hero-art {
  position: absolute; right: 0; top: 0; height: 100%; width: 54%;
  object-fit: cover; object-position: left center; pointer-events: none;
}
.mhome-hero-in {
  position: relative; z-index: 1; min-height: 208px; padding: 22px 20px 22px;
  background: linear-gradient(96deg, var(--card, var(--surface)) 58%, color-mix(in srgb, var(--card, var(--surface)) 84%, transparent) 72%, transparent 96%);
}
.mhome-hero-date { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: color-mix(in srgb, var(--color-forest) 78%, transparent); }
.mhome-hero h1 { font-family: var(--font-serif); font-size: 2.2rem; font-weight: 600; line-height: 1.04; margin: 8px 0 0; color: var(--color-forest); letter-spacing: -0.015em; }
.mhome-hero p { margin: 11px 0 0; max-width: 215px; color: color-mix(in srgb, var(--color-forest) 62%, var(--text-secondary)); font-size: 0.92rem; font-weight: 600; line-height: 1.34; }
.mhome-hero-btn {
  display: flex; align-items: center; gap: 9px;
  width: fit-content; min-width: 84%; max-width: 100%; margin-top: 20px;
  padding: 14px 19px; border-radius: var(--radius-full);
  background: var(--forest-pill, var(--color-forest)); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 0.95rem; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}
.mhome-hero-btn svg { flex-shrink: 0; width: 17px; height: 17px; }
.mhome-hero-btn span:not(.mhome-hero-arrow) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mhome-hero-arrow { margin-left: auto; font-size: 1.2rem; line-height: 1; font-weight: 400; }

/* Four feature tiles, one row (matches the mockup). */
.mhome-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mhome-tile {
  position: relative; display: flex; flex-direction: column; gap: 5px;
  min-height: 214px; padding: 13px 10px 28px; border-radius: 18px;
  text-decoration: none; background: var(--tile-bg, var(--surface-muted));
}
.mhome-tile.t-violet { --tile-bg: var(--tint-purple, #f2effb); --tile-fg: #7d73e6; }
.mhome-tile.t-green  { --tile-bg: var(--tint-green, #eaf7f1);  --tile-fg: #4a8f6b; }
.mhome-tile.t-blue   { --tile-bg: var(--tint-blue, #e6f4fd);   --tile-fg: #5b9bd4; }
.mhome-tile.t-peach  { --tile-bg: var(--tint-peach, #fdf2e9);  --tile-fg: #ef8f68; }
.mhome-tile-ic { display: inline-flex; color: var(--tile-fg); margin-bottom: 3px; }
.mhome-tile-ic svg { width: 27px; height: 27px; }
.mhome-tile b { font-size: 0.82rem; font-weight: 800; line-height: 1.15; color: var(--color-forest); }
.mhome-tile i { font-style: normal; font-size: 0.66rem; font-weight: 600; line-height: 1.3; color: color-mix(in srgb, var(--text-secondary) 82%, transparent); }
.mhome-tile-chev { position: absolute; left: 11px; bottom: 11px; color: var(--tile-fg); font-size: 1.05rem; line-height: 1; }

.mhome-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.mhome-section-head h2 { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 600; margin: 0; color: var(--color-forest); letter-spacing: -0.01em; }
.mhome-section-head a { font-size: 0.9rem; font-weight: 700; color: var(--forest-pill, var(--color-forest)); }

.mhome-recent { display: flex; flex-direction: column; gap: 10px; }
.mhome-recent-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
  background: var(--card, var(--surface)); text-decoration: none;
}
.mhome-recent-date {
  flex-shrink: 0; width: 46px; text-align: center; line-height: 1;
  border-radius: 13px; padding: 7px 0; background: var(--surface-muted);
}
.mhome-recent-date.dt-green  { background: var(--tint-green, #eaf7f1); }
.mhome-recent-date.dt-blue   { background: var(--tint-blue, #e6f4fd); }
.mhome-recent-date.dt-purple { background: var(--tint-purple, #f2effb); }
.mhome-recent-date.dt-peach  { background: var(--tint-peach, #fdf2e9); }
.mhome-recent-date b { display: block; font-size: 0.52rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: color-mix(in srgb, var(--text-secondary) 72%, transparent); }
.mhome-recent-date i { display: block; font-style: normal; font-family: var(--font-serif); font-size: 1.18rem; font-weight: 600; line-height: 1.15; color: var(--color-forest); }
.mhome-recent-date u { display: block; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: color-mix(in srgb, var(--text-secondary) 60%, transparent); }
.mhome-recent-ic { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.mhome-recent-ic svg { width: 20px; height: 20px; }
.mhome-recent-body { flex: 1; min-width: 0; padding-left: 2px; }
.mhome-recent-body b { display: block; font-size: 1rem; font-weight: 700; color: var(--color-forest); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mhome-recent-body i { display: block; font-style: normal; font-size: 0.85rem; font-weight: 500; color: color-mix(in srgb, var(--color-forest) 52%, var(--text-tertiary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mhome-recent-chev { flex-shrink: 0; color: var(--muted, var(--text-tertiary)); font-size: 1.2rem; }

.mhome-empty { text-align: center; padding: 26px 20px; border: 1px dashed var(--border); border-radius: 16px; color: var(--text-tertiary); }
.mhome-empty span { font-size: 1.6rem; }
.mhome-empty p { margin: 6px 0 0; font-size: 0.86rem; }

/* Quote banner — soft sage panel with the botanical sprigs in both corners. */
.mhome-quote {
  position: relative; overflow: hidden; text-align: center;
  padding: 18px 52px 18px; border-radius: 22px;
  background: var(--tint-sage, #e4ede0);
}
.mhome-quote::before, .mhome-quote::after {
  content: ""; position: absolute; bottom: -2px; width: 76px; height: 86px;
  background: url("../art/sprig-quote.png") no-repeat bottom / contain;
  opacity: 0.95; pointer-events: none;
}
.mhome-quote::before { left: -12px; }
.mhome-quote::after { right: -12px; transform: scaleX(-1); }
.mhome-quote-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: color-mix(in srgb, var(--color-forest) 72%, transparent); }
.mhome-quote-label span { font-family: var(--font-serif); font-size: 1rem; vertical-align: -3px; margin-right: 1px; }
.mhome-quote p { margin: 7px auto 0; max-width: 240px; font-family: var(--font-serif); font-style: italic; font-size: 0.95rem; font-weight: 500; line-height: 1.4; color: var(--color-forest); }

html.is-native[data-theme="dark"] .mhome-menu { background: rgba(255,255,255,0.07); color: var(--text-primary); }
html.is-native[data-theme="dark"] .mhome-tile b,
html.is-native[data-theme="dark"] .mhome-recent-body b,
html.is-native[data-theme="dark"] .mhome-recent-date i,
html.is-native[data-theme="dark"] .mhome-quote p { color: var(--text-primary); }
html.is-native[data-theme="dark"] .mhome-brand b,
html.is-native[data-theme="dark"] .mhome-section-head a,
html.is-native[data-theme="dark"] .mhome-section-head h2,
html.is-native[data-theme="dark"] .mhome-hero h1 { color: #7FB98F; }
html.is-native[data-theme="dark"] .mhome-tile { background: rgba(255,255,255,0.05); }
html.is-native[data-theme="dark"] .mhome-quote { background: rgba(255,255,255,0.05); }
html.is-native[data-theme="dark"] .mhome-hero-in {
  background: linear-gradient(100deg, var(--surface) 34%, color-mix(in srgb, var(--surface) 92%, transparent) 52%, transparent 78%);
}
html.is-native[data-theme="dark"] .mhome-hero-art { opacity: 0.5; }
html.is-native[data-theme="dark"] .mhome-hero-date { color: #8FBF9A; }
html.is-native[data-theme="dark"] .mhome-recent-date,
html.is-native[data-theme="dark"] .mhome-recent-date.dt-green,
html.is-native[data-theme="dark"] .mhome-recent-date.dt-blue,
html.is-native[data-theme="dark"] .mhome-recent-date.dt-purple,
html.is-native[data-theme="dark"] .mhome-recent-date.dt-peach { background: rgba(255,255,255,0.07); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .mhome-menu { background: rgba(255,255,255,0.07); color: var(--text-primary); }
  html.is-native:not([data-theme="light"]) .mhome-tile b,
  html.is-native:not([data-theme="light"]) .mhome-recent-body b,
  html.is-native:not([data-theme="light"]) .mhome-recent-date i,
  html.is-native:not([data-theme="light"]) .mhome-quote p { color: var(--text-primary); }
  html.is-native:not([data-theme="light"]) .mhome-brand b,
  html.is-native:not([data-theme="light"]) .mhome-section-head a,
  html.is-native:not([data-theme="light"]) .mhome-section-head h2,
  html.is-native:not([data-theme="light"]) .mhome-hero h1 { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .mhome-tile { background: rgba(255,255,255,0.05); }
  html.is-native:not([data-theme="light"]) .mhome-quote { background: rgba(255,255,255,0.05); }
  html.is-native:not([data-theme="light"]) .mhome-hero-in {
    background: linear-gradient(100deg, var(--surface) 34%, color-mix(in srgb, var(--surface) 92%, transparent) 52%, transparent 78%);
  }
  html.is-native:not([data-theme="light"]) .mhome-hero-art { opacity: 0.5; }
  html.is-native:not([data-theme="light"]) .mhome-hero-date { color: #8FBF9A; }
  html.is-native:not([data-theme="light"]) .mhome-recent-date,
  html.is-native:not([data-theme="light"]) .mhome-recent-date.dt-green,
  html.is-native:not([data-theme="light"]) .mhome-recent-date.dt-blue,
  html.is-native:not([data-theme="light"]) .mhome-recent-date.dt-purple,
  html.is-native:not([data-theme="light"]) .mhome-recent-date.dt-peach { background: rgba(255,255,255,0.07); }
}

/* ---------- Mobile Templates (design-ref 13-templates) ----------
   Native-only list layout: sage-washed hero header with a botanical
   accent, a full-width "New template" pill, then tinted template cards
   with an icon chip, badge, meta line and an action row. */
body.mtemplates .app-content { padding: 0 0 calc(78px + env(safe-area-inset-bottom)); }
body.mtemplates .app-main { background: var(--bg); }

.mtpl-scroll { display: flex; flex-direction: column; }

.mtpl-hero {
  position: relative; overflow: hidden;
  padding: 14px 16px 18px;
  background:
    radial-gradient(120% 90% at 88% 8%, color-mix(in srgb, var(--color-forest) 22%, transparent), transparent 60%),
    radial-gradient(90% 70% at 12% 0%, color-mix(in srgb, var(--color-forest) 10%, transparent), transparent 55%);
}
.mtpl-hero-art {
  position: absolute; right: -16px; top: -12px; width: 156px; height: auto;
  pointer-events: none; user-select: none; opacity: 0.95;
}
.mtpl-back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 7px;
  font-size: 0.8rem; font-weight: 800; color: var(--forest-pill, var(--color-forest)); text-decoration: none;
}
.mtpl-back svg { width: 15px; height: 15px; }
.mtpl-hero h1 { font-family: var(--font-serif); font-size: 2.05rem; font-weight: 600; line-height: 1.02; margin: 0; color: var(--color-forest); letter-spacing: -0.015em; }
.mtpl-hero p { margin: 8px 0 0; max-width: 250px; font-size: 0.82rem; font-weight: 600; line-height: 1.36; color: color-mix(in srgb, var(--color-forest) 58%, var(--text-secondary)); }

.mtpl-new {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 32px); margin: 13px 16px 0;
  padding: 15px 19px; border: none; border-radius: var(--radius-full);
  background: var(--forest-pill, var(--color-forest)); color: #fff; cursor: pointer;
  font-family: var(--font-sans); font-size: 1.02rem; font-weight: 800;
  box-shadow: 0 10px 20px -8px rgba(46,100,81,0.5);
}
.mtpl-new span:first-child { display: inline-flex; align-items: center; gap: 9px; }
.mtpl-new svg { width: 16px; height: 16px; }
.mtpl-new-chev { font-size: 1.25rem; line-height: 1; font-weight: 400; }

.mtpl-h2 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; margin: 22px 16px 0; color: var(--color-forest); letter-spacing: -0.01em; }
.mtpl-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 16px 0; }
.mtpl-sec-head h2 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; margin: 0; color: var(--color-forest); }
.mtpl-sec-head a { font-size: 0.85rem; font-weight: 800; color: var(--forest-pill, var(--color-forest)); text-decoration: none; }

.mtpl-list { display: flex; flex-direction: column; gap: 11px; padding: 11px 16px 0; }

.mtpl-card {
  border-radius: 18px; padding: 14px;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--card, var(--surface));
}
.mtpl-card.tint-green  { background: color-mix(in srgb, var(--tint-green) 55%, var(--card, var(--surface))); }
.mtpl-card.tint-yellow { background: color-mix(in srgb, var(--tint-yellow) 50%, var(--card, var(--surface))); }
.mtpl-card.tint-pink   { background: color-mix(in srgb, var(--tint-pink) 45%, var(--card, var(--surface))); }
.mtpl-card.tint-blue   { background: color-mix(in srgb, var(--tint-blue) 45%, var(--card, var(--surface))); }
.mtpl-card.tint-purple { background: color-mix(in srgb, var(--tint-purple) 50%, var(--card, var(--surface))); }

.mtpl-card-main { display: flex; align-items: flex-start; gap: 13px; }
.mtpl-thumb {
  flex-shrink: 0; display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 16px; font-size: 1.5rem; line-height: 1;
  background: var(--surface-muted);
}
.mtpl-thumb.tint-green  { background: var(--tint-green); }
.mtpl-thumb.tint-yellow { background: var(--tint-yellow); }
.mtpl-thumb.tint-pink   { background: var(--tint-pink); }
.mtpl-thumb.tint-blue   { background: var(--tint-blue); }
.mtpl-thumb.tint-purple { background: var(--tint-purple); }
.mtpl-thumb svg { width: 21px; height: 21px; color: color-mix(in srgb, var(--color-forest) 80%, transparent); }

.mtpl-card-txt { flex: 1; min-width: 0; }
.mtpl-card-top { display: flex; align-items: center; gap: 8px; }
.mtpl-card-top b { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; color: var(--color-forest); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtpl-badge {
  flex-shrink: 0; margin-left: auto; padding: 2px 9px; border-radius: var(--radius-full);
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.01em;
  background: var(--surface-muted); color: color-mix(in srgb, var(--text-secondary) 85%, transparent);
}
.mtpl-badge.b-custom { background: var(--tint-green); color: var(--color-forest); }
.mtpl-sub  { display: block; font-style: normal; margin-top: 4px; font-size: 0.8rem; font-weight: 600; line-height: 1.3; color: color-mix(in srgb, var(--color-forest) 50%, var(--text-secondary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtpl-meta { display: block; font-style: normal; margin-top: 3px; font-size: 0.75rem; font-weight: 700; color: color-mix(in srgb, var(--text-tertiary) 92%, transparent); }
.mtpl-chev { flex-shrink: 0; align-self: center; color: var(--muted, var(--text-tertiary)); font-size: 1.25rem; line-height: 1; }

.mtpl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 13px; margin-top: 13px; }
.mtpl-act {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-full);
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 800; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--color-forest);
}
.mtpl-act svg { width: 14px; height: 14px; }
.mtpl-act.a-edit { border-color: color-mix(in srgb, var(--color-forest) 22%, transparent); background: var(--surface); }
.mtpl-act.a-use  { border-color: color-mix(in srgb, var(--color-forest) 22%, transparent); background: var(--surface); color: var(--forest-pill, var(--color-forest)); padding: 8px 16px; }
.mtpl-act.a-del  { background: var(--error, #d6555a); color: #fff; }
.mtpl-act.a-ghost { padding: 8px 4px; }

.mtpl-empty { margin: 10px 16px 0; padding: 22px 18px; text-align: center; border: 1px dashed var(--border); border-radius: 16px; }
.mtpl-empty p { margin: 0; font-size: 0.84rem; color: var(--text-tertiary); }

html.is-native[data-theme="dark"] .mtpl-hero h1,
html.is-native[data-theme="dark"] .mtpl-h2,
html.is-native[data-theme="dark"] .mtpl-sec-head h2,
html.is-native[data-theme="dark"] .mtpl-card-top b { color: #7FB98F; }
html.is-native[data-theme="dark"] .mtpl-card { background: rgba(255,255,255,0.05); }
html.is-native[data-theme="dark"] .mtpl-card.tint-green,
html.is-native[data-theme="dark"] .mtpl-card.tint-yellow,
html.is-native[data-theme="dark"] .mtpl-card.tint-pink,
html.is-native[data-theme="dark"] .mtpl-card.tint-blue,
html.is-native[data-theme="dark"] .mtpl-card.tint-purple { background: rgba(255,255,255,0.06); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .mtpl-hero h1,
  html.is-native:not([data-theme="light"]) .mtpl-h2,
  html.is-native:not([data-theme="light"]) .mtpl-sec-head h2,
  html.is-native:not([data-theme="light"]) .mtpl-card-top b { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .mtpl-card { background: rgba(255,255,255,0.05); }
  html.is-native:not([data-theme="light"]) .mtpl-card.tint-green,
  html.is-native:not([data-theme="light"]) .mtpl-card.tint-yellow,
  html.is-native:not([data-theme="light"]) .mtpl-card.tint-pink,
  html.is-native:not([data-theme="light"]) .mtpl-card.tint-blue,
  html.is-native:not([data-theme="light"]) .mtpl-card.tint-purple { background: rgba(255,255,255,0.06); }
}

/* ---------- Mobile Shared Journals (design-ref 14-sharedjournals) ----------
   Native-only: plain hero (botanical accent, no wash), full-width CTA pill,
   tinted journal rows with a leaf-sprig thumb, then two info/CTA panels. */
body.mjournals .app-content { padding: 0 0 calc(78px + env(safe-area-inset-bottom)); }
body.mjournals .app-main { background: var(--bg); }

.mjour-scroll { display: flex; flex-direction: column; }

.mjour-hero { position: relative; overflow: hidden; padding: 18px 16px 4px; }
.mjour-hero-art {
  position: absolute; right: -22px; top: -14px; width: 158px; height: auto;
  pointer-events: none; user-select: none; opacity: 0.9;
}
.mjour-hero h1 { position: relative; max-width: 300px; font-family: var(--font-serif); font-size: 2.05rem; font-weight: 600; line-height: 1.04; margin: 0; color: var(--color-forest); letter-spacing: -0.015em; }
.mjour-hero p { position: relative; margin: 10px 0 0; font-size: 0.86rem; font-weight: 600; color: color-mix(in srgb, var(--color-forest) 58%, var(--text-secondary)); }

.mjour-new {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 32px); margin: 18px 16px 0;
  padding: 15px 19px; border: none; border-radius: var(--radius-full);
  background: var(--forest-pill, var(--color-forest)); color: #fff; cursor: pointer;
  font-family: var(--font-sans); font-size: 1.02rem; font-weight: 800;
  box-shadow: 0 10px 20px -8px rgba(46,100,81,0.5);
}
.mjour-new span:first-child { display: inline-flex; align-items: center; gap: 9px; }
.mjour-new svg { width: 16px; height: 16px; }
.mjour-new-chev { font-size: 1.25rem; line-height: 1; font-weight: 400; }

.mjour-h2 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; margin: 22px 16px 0; color: var(--color-forest); letter-spacing: -0.01em; }

.mjour-list { display: flex; flex-direction: column; gap: 13px; padding: 14px 16px 0; }

.mjour-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: 18px; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--card, var(--surface));
}
.mjour-row.tint-green  { background: color-mix(in srgb, var(--tint-green) 60%, var(--card, var(--surface))); }
.mjour-row.tint-purple { background: color-mix(in srgb, var(--tint-purple) 60%, var(--card, var(--surface))); }
.mjour-row.tint-blue   { background: color-mix(in srgb, var(--tint-blue) 55%, var(--card, var(--surface))); }
.mjour-row.tint-peach  { background: color-mix(in srgb, var(--tint-peach) 55%, var(--card, var(--surface))); }
.mjour-thumb {
  flex-shrink: 0; display: grid; place-items: center;
  width: 60px; height: 60px; border-radius: 16px;
  background: color-mix(in srgb, var(--color-forest) 13%, var(--surface));
}
.mjour-row.tint-purple .mjour-thumb { background: color-mix(in srgb, #7d73e6 18%, var(--surface)); }
.mjour-row.tint-blue   .mjour-thumb { background: color-mix(in srgb, #5b9bd4 18%, var(--surface)); }
.mjour-row.tint-peach  .mjour-thumb { background: color-mix(in srgb, #ef8f68 18%, var(--surface)); }
.mjour-thumb svg { width: 40px; height: 40px; }
.mjour-row-txt { flex: 1; min-width: 0; }
.mjour-row-txt b { display: block; font-family: var(--font-serif); font-size: 1.12rem; font-weight: 600; color: var(--color-forest); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mjour-row-txt i { display: block; font-style: normal; margin-top: 2px; font-size: 0.78rem; font-weight: 600; color: color-mix(in srgb, var(--color-forest) 50%, var(--text-secondary)); }
.mjour-row-mem { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.74rem; font-weight: 700; color: color-mix(in srgb, var(--text-tertiary) 92%, transparent); }
.mjour-row-mem svg { width: 13px; height: 13px; }
.mjour-row-chev { flex-shrink: 0; color: color-mix(in srgb, var(--color-forest) 45%, transparent); font-size: 1.3rem; line-height: 1; }

.mjour-panel {
  display: flex; align-items: center; gap: 14px;
  margin: 16px 16px 0; padding: 15px; border-radius: 18px;
  position: relative; overflow: hidden;
}
.mjour-panel.p-note { background: color-mix(in srgb, var(--tint-green) 70%, var(--card, var(--surface))); }
.mjour-panel.p-cta  { background: color-mix(in srgb, var(--tint-blue) 78%, var(--card, var(--surface))); cursor: pointer; }
.mjour-panel-img { flex-shrink: 0; width: 90px; height: auto; border-radius: 12px; }
.mjour-panel-plus {
  flex-shrink: 0; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--tint-green); color: var(--forest-pill, var(--color-forest));
}
.mjour-panel-plus svg { width: 21px; height: 21px; }
.mjour-panel-txt { flex: 1; min-width: 0; }
.mjour-panel-txt b { display: block; font-family: var(--font-serif); font-size: 0.98rem; font-weight: 600; color: var(--color-forest); }
.mjour-panel-txt p { margin: 3px 0 0; font-size: 0.78rem; font-weight: 600; line-height: 1.36; color: color-mix(in srgb, var(--color-forest) 60%, var(--text-secondary)); }
.mjour-panel-chev { flex-shrink: 0; color: color-mix(in srgb, var(--color-forest) 45%, transparent); font-size: 1.2rem; line-height: 1; }
.mjour-panel-sprig { position: absolute; right: -6px; bottom: -8px; width: 66px; height: auto; opacity: 0.5; pointer-events: none; }

.mjour-invites { margin: 16px 16px 0; padding: 14px; border-radius: 18px; background: var(--warning-bg, var(--surface-muted)); border: 1px solid color-mix(in srgb, var(--warning, #c9862c) 30%, transparent); }
.mjour-invites h3 { margin: 0 0 8px; font-size: 0.9rem; font-weight: 800; color: var(--color-forest); }
.mjour-invite-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.mjour-invite-row b { font-size: 0.85rem; overflow-wrap: anywhere; }
.mjour-invite-row i { display: block; font-style: normal; font-size: 0.72rem; color: var(--text-tertiary); }
.mjour-invite-acts { display: flex; gap: 6px; flex-shrink: 0; }

.mjour-empty { margin: 13px 16px 0; padding: 22px 18px; text-align: center; border: 1px dashed var(--border); border-radius: 16px; }
.mjour-empty p { margin: 0; font-size: 0.84rem; color: var(--text-tertiary); }

html.is-native[data-theme="dark"] .mjour-hero h1,
html.is-native[data-theme="dark"] .mjour-h2,
html.is-native[data-theme="dark"] .mjour-row-txt b,
html.is-native[data-theme="dark"] .mjour-panel-txt b { color: #7FB98F; }
html.is-native[data-theme="dark"] .mjour-row,
html.is-native[data-theme="dark"] .mjour-row.tint-green,
html.is-native[data-theme="dark"] .mjour-row.tint-purple,
html.is-native[data-theme="dark"] .mjour-row.tint-blue,
html.is-native[data-theme="dark"] .mjour-row.tint-peach,
html.is-native[data-theme="dark"] .mjour-panel.p-note,
html.is-native[data-theme="dark"] .mjour-panel.p-cta { background: rgba(255,255,255,0.05); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .mjour-hero h1,
  html.is-native:not([data-theme="light"]) .mjour-h2,
  html.is-native:not([data-theme="light"]) .mjour-row-txt b,
  html.is-native:not([data-theme="light"]) .mjour-panel-txt b { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .mjour-row,
  html.is-native:not([data-theme="light"]) .mjour-row.tint-green,
  html.is-native:not([data-theme="light"]) .mjour-row.tint-purple,
  html.is-native:not([data-theme="light"]) .mjour-row.tint-blue,
  html.is-native:not([data-theme="light"]) .mjour-row.tint-peach,
  html.is-native:not([data-theme="light"]) .mjour-panel.p-note,
  html.is-native:not([data-theme="light"]) .mjour-panel.p-cta { background: rgba(255,255,255,0.05); }
}

/* ============================================================
   Native app chrome — header, slide-in drawer, page shell.
   Everything here is gated on html.is-native, which app.js only
   ever adds inside the Capacitor (Android/iOS) build. The website
   keeps its sidebar layout untouched.

   Dark styling follows the house pattern: an explicit
   html.is-native[data-theme="dark"] rule plus a
   @media (prefers-color-scheme: dark) { html.is-native:not([data-theme="light"]) }
   block near the end of this section — never a bare :not([data-theme="light"]).
   ============================================================ */

/* Brand wordmark + avatar live in the top bar markup for every build,
   but only the native shell shows them. */
.app-topbar-brand, .app-topbar-avatar, .app-topbar-tile, .brand-tagline { display: none; }
.side-logout { display: none; }

html.is-native .app-sidebar .brand .brand-name { display: block; line-height: 1.2; }
html.is-native .app-sidebar .brand .brand-tagline {
  display: block; font-style: normal; font-family: var(--font-sans);
  font-size: 0.72rem; font-weight: 500; color: var(--text-tertiary); margin-top: 1px;
}

html.is-native .app-main { background: var(--bg); }

/* ---------- Top bar ---------- */
html.is-native .app-topbar {
  height: auto;
  min-height: 56px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  gap: 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
html.is-native #topbarTitle { display: none; }
html.is-native #logoutBtn { display: none; }
html.is-native .mobile-nav-toggle {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-full);
  background: var(--color-forest-100); border-color: transparent; color: var(--color-forest);
  font-size: 1rem;
}
/* The rounded "365" wordmark tile, left of the brand text. */
html.is-native .app-topbar-tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 11px;
  background: var(--color-forest); color: #fff;
  font-family: var(--font-serif); font-weight: 800; font-size: 0.72rem;
  letter-spacing: -0.01em;
}
html.is-native[data-theme="dark"] .app-topbar-tile { background: #2f6e4e; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .app-topbar-tile { background: #2f6e4e; }
}
html.is-native .app-topbar-brand-text b .brand-leaf { display: inline-block; vertical-align: -2px; margin-left: 3px; }
/* avatarHtml() returns bare initials (no wrapper) unless the user has a
   photo, so the circle styling lives on the link itself. */
html.is-native .app-topbar-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--radius-full); overflow: hidden;
  background: var(--color-forest-100); color: var(--color-forest);
  font-weight: 700; font-size: 0.8rem; text-decoration: none;
}
html.is-native .app-topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Initials avatars elsewhere read as calm sage circles too (photo avatars
   are <img> and unaffected). */
html.is-native .avatar { background: var(--color-forest-100); color: var(--color-forest); }
html.is-native .app-topbar-brand { display: flex; align-items: center; min-width: 0; }
html.is-native .app-topbar-brand .brand-mark { display: none; }
html.is-native .app-topbar-brand-text { min-width: 0; }
html.is-native .app-topbar-brand-text b {
  display: block; font-family: var(--font-serif); font-size: 1rem; font-weight: 800;
  line-height: 1.15; color: var(--color-forest);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.is-native .app-topbar-brand-text i {
  display: block; font-style: normal; font-size: 0.66rem; color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.is-native .theme-toggle {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft); background: var(--surface); font-size: 0.92rem;
}
html.is-native #logoutBtn { flex-shrink: 0; border-radius: var(--radius-full); padding: 7px 13px; }

/* On the narrowest phones the tagline is the first thing to go. */
@media (max-width: 340px) {
  html.is-native .app-topbar-brand-text i { display: none; }
}

/* ---------- Slide-in drawer ---------- */
html.is-native .app-sidebar {
  width: min(84vw, 320px);
  background: var(--surface);
  padding-top: env(safe-area-inset-top);
  z-index: 90;               /* above the bottom tab bar (80) while open */
}
html.is-native .sidebar-scrim { z-index: 85; }
html.is-native .app-sidebar { overflow: hidden; }
html.is-native .app-sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 12px; border-bottom: 0;
}
html.is-native .app-sidebar .brand .brand-mark {
  position: relative; overflow: visible;
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-forest); color: #fff;
  font-family: var(--font-serif); font-weight: 800; font-size: 0.82rem;
}
html.is-native .app-sidebar .brand .brand-mark-leaf { position: absolute; right: -5px; top: -5px; }
html.is-native .app-sidebar .brand .brand-name {
  font-family: var(--font-wordmark, 'Poppins', var(--font-sans));
  font-size: 1.28rem; font-weight: 800; color: var(--color-forest); letter-spacing: -0.01em;
}
html.is-native .app-sidebar .brand .brand-tagline {
  font-family: var(--font-sans); font-size: 0.74rem; font-weight: 500; color: var(--text-tertiary);
}

html.is-native .side-nav { padding: 4px 12px; }
html.is-native .side-nav a {
  gap: 14px; padding: 6px 12px; margin-bottom: 2px;
  border-radius: var(--radius-md);
  font-size: 1rem; font-weight: 600; color: var(--color-forest);
}
html.is-native .side-nav a .nav-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--surface-muted); color: var(--color-forest);
}
html.is-native .side-nav a .nav-icon svg { width: 20px; height: 20px; }
html.is-native .side-nav a.active {
  background: var(--tint-green, #E8F3EC);
  color: var(--color-forest); font-weight: 800;
}
html.is-native .side-nav a:hover { background: color-mix(in srgb, var(--tint-green) 55%, transparent); }
html.is-native .side-nav a.active:hover { background: var(--tint-green, #E8F3EC); }

/* Per-destination icon tint + colour, matching the drawer in design-ref 15. */
html.is-native .side-nav a[data-nav="dashboard.html"] .nav-icon,
html.is-native .side-nav a[data-nav="home.html"] .nav-icon,
html.is-native .side-nav a[data-nav="capsules.html"] .nav-icon,
html.is-native .side-nav a[data-nav="settings.html"] .nav-icon { background: var(--tint-green, #E3EDE2); color: var(--color-forest); }
html.is-native .side-nav a[data-nav="today.html"] .nav-icon,
html.is-native .side-nav a[data-nav="profile.html"] .nav-icon { background: var(--tint-purple, #EDEAFB); color: #7d73e6; }
html.is-native .side-nav a[data-nav="calendar.html"] .nav-icon,
html.is-native .side-nav a[data-nav="resources.html"] .nav-icon { background: var(--tint-blue, #E4EFF7); color: #5b9bd4; }
html.is-native .side-nav a[data-nav="archive.html"] .nav-icon { background: var(--tint-peach, #FAEECD); color: #e0912f; }
html.is-native .side-nav a[data-nav="recaps.html"] .nav-icon { background: var(--tint-pink, #FBE6EE); color: #e07fa8; }
html.is-native .side-nav a[data-nav="life-story.html"] .nav-icon { background: var(--tint-pink, #FBE6EE); color: #d96b76; }
html.is-native .side-nav a[data-nav="admin.html"] .nav-icon { background: var(--tint-peach, #FAEECD); color: #e0912f; }

html.is-native .side-nav .side-section-label {
  margin: 10px 4px 4px; padding: 14px 12px 4px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; color: var(--text-tertiary);
}

html.is-native .side-foot {
  border-top: 0; text-align: center; position: relative;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 12px 26px calc(16px + env(safe-area-inset-bottom));
}
html.is-native .side-foot .user-chip { display: none; }
html.is-native .side-logout {
  order: 0; display: block; width: 100%; margin: 0 0 14px;
  padding: 11px 16px; border-radius: var(--radius-full);
  border: 1px solid var(--border-soft); background: var(--surface);
  color: var(--text-secondary); font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
html.is-native[data-theme="dark"] .side-logout { background: rgba(255,255,255,0.04); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .side-logout { background: rgba(255,255,255,0.04); }
}
html.is-native .side-foot::before {
  order: 1;
  content: "Small steps every day lead to big results.";
  display: block; position: relative; z-index: 1; max-width: 190px; margin: 4px auto 0;
  font-family: var(--font-hand, 'Caveat', cursive); font-size: 1.3rem; font-weight: 700; line-height: 1.28;
  color: var(--forest-pill, var(--color-forest));
}
html.is-native .side-foot::after {
  order: 2;
  content: ""; display: block; width: 20px; height: 20px; margin: 7px auto 0; position: relative; z-index: 1;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 20C10 16 16 11 20 5' stroke='%239aab86' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M20 5c-6 1-10 5-11 11 6 0 10-4 11-11z' fill='%23a8bd94'/%3E%3Cpath d='M20 5c1 6 5 10 11 11 0-6-4-10-11-11z' fill='%23bccfa8'/%3E%3C/svg%3E");
}
html.is-native .side-foot::before,
html.is-native .side-foot::after { pointer-events: none; }
/* soft botanical art in the drawer's bottom-left corner (design-ref 15) */
html.is-native .app-sidebar {
  background:
    no-repeat left bottom / 210px auto
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 150' fill='none'%3E%3Cg opacity='0.62'%3E%3Cpath d='M20 150C6 110 24 60 70 34 44 74 34 112 44 150Z' fill='%238fb894'/%3E%3Cpath d='M54 150C44 108 66 66 104 46 74 84 66 116 74 150Z' fill='%23a9cbab'/%3E%3Cpath d='M0 150C-4 120 10 92 40 78 20 104 14 128 20 150Z' fill='%23b8d4b3'/%3E%3Cpath d='M18 146C34 108 58 76 96 50' stroke='%235f8f6b' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M96 150C92 128 100 104 120 92 104 112 100 132 106 150Z' fill='%23a9cbab'/%3E%3C/g%3E%3C/svg%3E"),
    var(--surface);
}
html.is-native[data-theme="dark"] .app-sidebar { background: var(--surface); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .app-sidebar { background: var(--surface); }
}

/* ---------- Page chrome ---------- */
html.is-native .app-content { padding: 16px 16px calc(78px + env(safe-area-inset-bottom)); }

/* Page headers: stack the title over its actions on a phone, and let any
   inline button row inside wrap instead of overflowing the viewport. */
html.is-native .page-head {
  flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px;
}
html.is-native .page-head h1 { font-family: var(--font-serif); font-size: 1.7rem; line-height: 1.2; }
html.is-native .page-head > div { flex-wrap: wrap; min-width: 0; }
html.is-native .page-head .btn { align-self: flex-start; }
html.is-native .app-content { overflow-x: hidden; }

/* Cards + stat grids sit a little tighter and rounder on a phone,
   matching the design's calm, card-first screens. */
html.is-native .card { padding: 18px; border-radius: 18px; border-color: var(--border-soft); overflow-wrap: break-word; }
html.is-native .stat-grid { gap: 12px; }
html.is-native .stat-card { padding: 15px 16px; border-radius: 16px; }
html.is-native .stat-card .value { font-size: 1.5rem; }
html.is-native .stat-card .label { font-size: 0.7rem; }

/* The "Quote of the day" card reads as a soft green panel in the design,
   not the solid forest block the desktop app uses. */
html.is-native .quote-card {
  background: var(--success-bg);
  color: var(--text-primary); border: 1px solid color-mix(in srgb, var(--color-forest) 16%, transparent);
  padding: 20px 22px;
}
html.is-native .quote-card p { color: var(--text-secondary); font-size: 0.98rem; }
html.is-native .quote-card .badge {
  background: color-mix(in srgb, var(--color-forest) 12%, transparent) !important;
  color: var(--color-forest) !important;
}
html.is-native[data-theme="dark"] .quote-card .badge { color: #7FB98F !important; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .quote-card .badge { color: #7FB98F !important; }
}

/* The bottom tab bar renders on every app page in the native build, so the
   .app-content bottom padding above always reserves room for it. */
html.is-native .native-tabbar { padding-top: 4px; }
/* Forest-green active tab in every theme (matches the design). */
html.is-native .native-tab.active { color: var(--forest-pill, var(--color-forest)); }

/* ---------- Native dark theme ---------- */
html.is-native[data-theme="dark"] .mobile-nav-toggle { background: rgba(255,255,255,0.07); color: var(--text-primary); }
html.is-native[data-theme="dark"] .app-topbar-brand-text b,
html.is-native[data-theme="dark"] .side-nav a.active,
html.is-native[data-theme="dark"] .native-tab.active,
html.is-native[data-theme="dark"] .side-foot::before { color: #7FB98F; }
html.is-native[data-theme="dark"] .side-nav a.active { background: rgba(255,255,255,0.06); }
html.is-native[data-theme="dark"] .side-nav a .nav-icon { background: rgba(255,255,255,0.06) !important; }
html.is-native[data-theme="dark"] .theme-toggle { background: var(--surface); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .mobile-nav-toggle { background: rgba(255,255,255,0.07); color: var(--text-primary); }
  html.is-native:not([data-theme="light"]) .app-topbar-brand-text b,
  html.is-native:not([data-theme="light"]) .side-nav a.active,
  html.is-native:not([data-theme="light"]) .native-tab.active,
  html.is-native:not([data-theme="light"]) .side-foot::before { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .side-nav a.active { background: rgba(255,255,255,0.06); }
  html.is-native:not([data-theme="light"]) .side-nav a .nav-icon { background: rgba(255,255,255,0.06) !important; }
}

/* ============================================================
   Native per-screen layout — restyles the existing desktop app
   pages to fit a phone. Still html.is-native only.
   ============================================================ */

/* ---------- Calendar ---------- */
/* On the web the toolbar controls stay inline in .cal-head; the wrapper is
   transparent to layout there. */
.cal-toolbar { display: contents; }

html.is-native .cal-body { display: block; }
/* .cal-head is a full-bleed container; the band bg sits on .titles. */
html.is-native .cal-head {
  display: block; margin: -16px -16px 14px; padding: 0;
  background: none; border: 0; overflow: visible;
}
/* Hero band — eyebrow date + serif greeting + botanical art (design ref 05). */
html.is-native .cal-head .titles {
  position: relative; overflow: hidden; max-width: none;
  padding: 18px 18px 20px; margin: 0;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint-sage) 62%, var(--bg)) 0%, color-mix(in srgb, var(--tint-sage) 28%, var(--bg)) 46%, var(--bg) 84%);
}
html.is-native .cal-head .cal-eyebrow {
  position: relative; z-index: 1;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-forest) 55%, var(--text-tertiary));
}
html.is-native .cal-head .cal-greeting {
  position: relative; z-index: 1; padding-right: 64px;
  font-family: var(--font-serif); font-size: 1.44rem; font-weight: 600; line-height: 1.16;
  margin: 6px 0 0; color: var(--color-forest); letter-spacing: -0.01em;
}
html.is-native .cal-head .sub { display: none; }
html.is-native .cal-head .titles .cal-head-art {
  position: absolute; top: -10px; right: -40px; width: 96px; height: auto; opacity: 0.6; z-index: 0; margin: 0;
}
/* Toolbar row below the band: nav pills left, Month/Week/Year segment right. */
html.is-native .cal-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px; margin-bottom: 14px;
}
html.is-native .cal-navbtns { display: flex; align-items: center; gap: 8px; }
html.is-native .cal-head .yr-seg { margin-left: auto; width: auto; }
html.is-native[data-theme="dark"] .cal-head .titles { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .cal-head .cal-greeting { color: #7FB98F; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .cal-head .titles { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .cal-head .cal-greeting { color: #7FB98F; }
}
/* Month grid: drop the 380px min-width that forces a horizontal scroll and
   let seven columns share the width. */
/* Use most of the screen width but keep the card contained with its border on
   all four sides; give the day cells more room. */
html.is-native .cal-panel {
  overflow-x: visible; border-radius: 16px;
  margin-left: -6px; margin-right: -6px; padding: 12px 8px 14px;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--card, var(--surface));
}
html.is-native .cal-dow,
html.is-native .cal-grid,
html.is-native .cal-week-grid { min-width: 0; gap: 4px; }
html.is-native .cal-dow { margin-bottom: 6px; }
html.is-native .cal-dow span { font-size: 0.6rem; letter-spacing: 0.03em; }
html.is-native .cal-grid { gap: 4px; grid-auto-rows: 62px; }
html.is-native .cal-day {
  position: relative; min-height: 0; padding: 6px 5px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--surface);
  display: block; overflow: hidden;
}
html.is-native .cal-day .n { font-size: 0.9rem; font-weight: 800; color: var(--color-forest); line-height: 1; }
html.is-native .cal-day .cnt {
  display: block; margin-top: 4px; line-height: 1.15; font-weight: 700;
  font-size: 0.6rem; letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--text-tertiary) 92%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Native shows a single mood-colour dot bottom-left, not the emoji. */
html.is-native .cal-day .mood-emoji,
html.is-native .cal-day .mood-emojis { display: none; }
html.is-native .cal-day .cal-dot {
  position: absolute; left: 7px; bottom: 7px; width: 6px; height: 6px; border-radius: 50%;
}
html.is-native .cal-day.today {
  border: 1.6px solid var(--forest-pill, var(--color-forest));
  background: color-mix(in srgb, var(--tint-green) 70%, var(--surface));
}
html.is-native .cal-day.today .pen { display: block; position: absolute; right: 5px; top: 5px; font-size: 0.7rem; }
html.is-native .cal-day.blank { background: color-mix(in srgb, var(--surface-muted) 22%, transparent); border-color: color-mix(in srgb, var(--color-forest) 5%, transparent); }
html.is-native .cal-day.blank .cnt { display: none; }
html.is-native .cal-day.empty { background: none; border: 0; }

/* ---- Native: cards below the grid sit in two columns (design ref 05) ---- */
html.is-native .cal-lower {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; margin-top: 16px;
}
html.is-native .cal-lower .cal-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
html.is-native .cal-lower .cal-card,
html.is-native .cal-lower .cal-legend { padding: 14px; border-radius: 16px; margin: 0; }
html.is-native .cal-lower .cal-card h3,
html.is-native .cal-lower .cal-legend .lt { font-size: 0.82rem; font-weight: 800; margin-bottom: 10px; color: var(--color-forest); }
html.is-native .cal-lower .cal-big { font-size: 1.5rem; margin-bottom: 2px; }
html.is-native .cal-lower .cal-lbl { font-size: 0.72rem; }
html.is-native .cal-lower .cal-pbar { margin: 8px 0 12px; }
html.is-native .cal-lower .cal-card .cal-big + .cal-lbl { margin-bottom: 0; }
html.is-native .cal-lower .cal-seal { position: absolute; right: 12px; bottom: 12px; width: 30px; height: 30px; font-size: 0.9rem; display: grid; place-items: center; border-radius: 50%; }
html.is-native .cal-lower .cal-mrow { gap: 6px; padding: 4px 0; font-size: 0.74rem; }
html.is-native .cal-lower .cal-mrow .em { font-size: 0.82rem; width: 14px; }
html.is-native .cal-lower .cal-mrow .nm { width: auto; flex: 0 1 auto; max-width: 56px; }
html.is-native .cal-lower .cal-mrow .bar { min-width: 16px; }
html.is-native .cal-lower .cal-mrow .n { width: 14px; font-size: 0.7rem; }
html.is-native .cal-lower .cal-link { display: block; margin-top: 10px; font-size: 0.72rem; font-weight: 800; white-space: nowrap; }
html.is-native .cal-lower .cal-legend .row { gap: 7px 10px; font-size: 0.7rem; }
html.is-native .cal-lower .cal-hi { gap: 9px; padding: 6px 0; }
html.is-native .cal-lower .cal-hi .th { width: 34px; height: 34px; border-radius: 10px; }
html.is-native .cal-lower .cal-hi .d { font-size: 0.62rem; margin-bottom: 1px; color: var(--text-tertiary); }
html.is-native .cal-lower .cal-hi .ti { font-size: 0.76rem; font-weight: 800; }
html.is-native .cal-lower .cal-hi .pg { font-size: 0.6rem; }

/* Toolbar controls */
html.is-native .cal-rnd { width: 34px; height: 34px; background: var(--surface); border: 1px solid var(--border-soft); color: var(--color-forest); }
html.is-native .cal-today-btn {
  padding: 8px 15px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border-soft); color: var(--color-forest); font-weight: 700; font-size: 0.82rem;
}
html.is-native .cal-today-btn svg { color: var(--forest-pill, var(--color-forest)); }
html.is-native .cal-head .yr-seg {
  padding: 3px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border-soft);
}
html.is-native .cal-head .yr-seg button { padding: 7px 13px; border-radius: var(--radius-full); font-size: 0.82rem; font-weight: 700; color: var(--text-tertiary); }
html.is-native .cal-head .yr-seg button.on { background: var(--forest-pill, var(--color-forest)); color: #fff; }
html.is-native .cal-rail { margin-top: 16px; }
html.is-native .cal-card { border-radius: 16px; padding: 18px; }
html.is-native .cal-link { color: var(--color-forest); }
html.is-native .cal-legend { border-radius: 16px; }
html.is-native .cal-legend .row { gap: 10px 16px; }
html.is-native .cal-pbar span,
html.is-native .cal-seal { background: var(--color-forest-100); }
html.is-native .cal-pbar span { background: linear-gradient(90deg, #6a9c74, var(--color-forest)); }

/* ---------- Archive (design ref 07) ---------- */
html.is-native .arc-head {
  min-height: 0; position: relative; overflow: hidden;
  margin: -16px -16px 16px; padding: 14px 18px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint-sage) 55%, var(--bg)) 0%, color-mix(in srgb, var(--tint-sage) 22%, var(--bg)) 50%, var(--bg) 85%);
}
html.is-native .arc-head::after {
  content: ""; position: absolute; right: -20px; top: -6px; width: 118px; height: 150px;
  background: url("../art/plant-hero.png") no-repeat top right / contain;
  opacity: 0.5; pointer-events: none;
}
html.is-native[data-theme="dark"] .arc-head::after { opacity: 0.28; }
@media (prefers-color-scheme: dark) { html.is-native:not([data-theme="light"]) .arc-head::after { opacity: 0.28; } }
html.is-native .arc-head .arc-head-art {
  position: relative; z-index: 1; display: block; width: 176px; max-width: 58%; height: auto;
  margin: 0 0 6px; opacity: 1;
}
html.is-native .arc-head h1, html.is-native .arc-head .sub { position: relative; z-index: 1; }
html.is-native .arc-head h1 {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-serif); font-size: 2.1rem; font-weight: 600; line-height: 1.05;
  color: var(--color-forest); max-width: 100%; letter-spacing: -0.01em;
}
html.is-native .arc-head h1 svg { flex-shrink: 0; }
html.is-native .arc-head .sub { max-width: 92%; margin-top: 3px; font-size: 0.86rem; color: color-mix(in srgb, var(--color-forest) 55%, var(--text-secondary)); }
html.is-native[data-theme="dark"] .arc-head { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .arc-head h1 { color: #7FB98F; }
html.is-native[data-theme="dark"] .arc-head .arc-head-art { opacity: 0.82; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .arc-head { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .arc-head h1 { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .arc-head .arc-head-art { opacity: 0.82; }
}
html.is-native .arc-filters { gap: 7px; margin-bottom: 8px; }
html.is-native .arc-search { flex: 1 1 100%; min-width: 0; }
html.is-native .arc-search input { padding: 12px 42px 12px 16px; border-radius: var(--radius-full); background: var(--surface); border-color: var(--border-soft); }
/* Design ref 07: the four filter selects sit as one tight row of pills. */
html.is-native .arc-filters .arc-pick {
  min-width: 0; flex: 1 1 0; gap: 3px; padding: 7px 6px; border-radius: var(--radius-full);
  background: var(--surface); border-color: var(--border-soft); font-size: 0.62rem;
}
html.is-native .arc-filters .arc-pick .ic { display: none; }
html.is-native .arc-filters .arc-pick select { -webkit-appearance: none; appearance: none; font-size: 0.62rem; font-weight: 700; color: var(--color-forest); text-overflow: ellipsis; }
html.is-native .arc-filters .arc-pick > svg { width: 10px; height: 10px; }

/* Phone archive filters: one search field, then three quick controls
   (Filters / Sort / Tags). Everything else lives in the Filters sheet. */
html.is-native .arc-filters-native { display: block; margin-bottom: 12px; }
html.is-native .arc-filters-native .arc-search { flex: none; display: block; margin-bottom: 8px; }
html.is-native .arc-quickrow { display: flex; gap: 6px; }
html.is-native .arc-quick {
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 5px; border-radius: var(--radius-full); border: 1px solid var(--border-soft);
  background: var(--surface); color: var(--color-forest); font-size: 0.7rem; font-weight: 700;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
html.is-native .arc-quick-link { flex: 0 1 auto; padding-left: 10px; padding-right: 12px; }
html.is-native .arc-quick svg { width: 14px; height: 14px; flex-shrink: 0; }
html.is-native .arc-quick > span { overflow: hidden; text-overflow: ellipsis; }
html.is-native .arc-quick .arc-quick-chev { width: 10px; height: 10px; color: var(--text-tertiary); }
html.is-native .arc-quick.has-active { border-color: var(--color-forest); background: var(--tint-green); }
html.is-native .arc-quick-badge {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--forest-pill, var(--color-forest));
  color: #fff; font-size: 0.6rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
html.is-native .arc-quick-badge:empty { display: none; }
html.is-native .arc-quick-sel select {
  -webkit-appearance: none; appearance: none; border: 0; background: none; padding: 0; margin: 0;
  font: inherit; color: inherit; font-weight: 700; cursor: pointer; min-width: 0; flex: 0 1 auto; text-overflow: ellipsis;
}

/* The Filters bottom sheet */
html.is-native .arc-fsheet-scrim {
  position: fixed; inset: 0; z-index: 120; background: rgba(20,30,25,0.34);
  display: flex; align-items: flex-end; justify-content: center;
}
html.is-native .arc-fsheet-scrim[hidden] { display: none; }
html.is-native body.arc-fsheet-open { overflow: hidden; }
html.is-native .arc-fsheet {
  width: 100%; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 44px -18px rgba(20,30,25,0.4);
}
html.is-native .arc-fs-head {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 2px 0 14px;
}
html.is-native .arc-fs-x { border: 0; background: none; font-size: 0.95rem; color: var(--text-tertiary); cursor: pointer; padding: 0; line-height: 1; }
html.is-native .arc-fs-title { text-align: center; font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; color: var(--color-forest); }
html.is-native .arc-fs-clear { border: 0; background: none; color: var(--color-forest); font-size: 0.78rem; font-weight: 700; cursor: pointer; padding: 0; white-space: nowrap; }
html.is-native .arc-fs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 10px; }
html.is-native .arc-fs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
html.is-native .arc-fs-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 700; color: var(--color-forest); }
html.is-native .arc-fs-lbl svg { width: 14px; height: 14px; color: var(--forest-pill, var(--color-forest)); flex-shrink: 0; }
html.is-native .arc-fsheet .arc-pick {
  min-width: 0; gap: 4px; padding: 9px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-soft);
}
html.is-native .arc-fsheet .arc-pick select {
  -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; border: 0; background: none; padding: 0;
  font-size: 0.76rem; font-weight: 600; color: var(--color-forest); text-overflow: ellipsis; cursor: pointer;
}
html.is-native .arc-fsheet .arc-pick > svg { width: 11px; height: 11px; color: var(--text-tertiary); flex-shrink: 0; }
html.is-native .arc-fs-dates { display: flex; align-items: center; gap: 5px; }
html.is-native .arc-fs-dates .arc-datefield {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden;
  border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); padding: 0 8px; height: 38px;
}
html.is-native .arc-fs-dates input.arc-date {
  flex: 1; min-width: 0; width: 100%; border: 0; background: none; padding: 0; height: 100%;
  font-size: 0.72rem; color: var(--color-forest);
}
html.is-native .arc-fs-dates .arc-datefield.is-empty::after {
  content: "mm/dd/yyyy"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 0.72rem; color: var(--text-tertiary); pointer-events: none;
}
html.is-native .arc-fs-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
html.is-native .arc-fs-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  padding: 11px 12px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface); cursor: pointer;
}
html.is-native .arc-fs-toggle .arc-fs-lbl { flex-wrap: wrap; }
html.is-native .arc-fs-sw {
  flex-shrink: 0; width: 40px; height: 24px; border-radius: 999px; background: var(--border);
  padding: 3px; transition: background 0.18s var(--ease);
}
html.is-native .arc-fs-sw::after {
  content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.18s var(--ease);
}
html.is-native .arc-fs-toggle.on .arc-fs-sw { background: var(--forest-pill, var(--color-forest)); }
html.is-native .arc-fs-toggle.on .arc-fs-sw::after { transform: translateX(16px); }
html.is-native .arc-fs-saved { display: flex; gap: 10px; margin-top: 14px; align-items: stretch; }
html.is-native .arc-fs-saved .arc-saved-wrap { flex: 1 1 58%; min-width: 0; }
html.is-native .arc-fs-savedbtn {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface); cursor: pointer;
}
html.is-native .arc-fs-savedbtn .arc-fs-chev { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; }
html.is-native .arc-fs-savedtxt b { display: block; font-size: 0.76rem; font-weight: 700; color: var(--color-forest); }
html.is-native .arc-fs-savedtxt i { display: block; font-style: normal; font-size: 0.66rem; color: var(--text-tertiary); }
html.is-native .arc-fs-savebtn {
  flex: 1 1 42%; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface);
  color: var(--color-forest); font-size: 0.76rem; font-weight: 700; cursor: pointer;
}
html.is-native .arc-fs-savebtn svg { width: 14px; height: 14px; }
html.is-native .arc-fsheet .arc-saved-panel {
  position: static; margin-top: 8px; width: 100%; min-width: 0; box-shadow: none;
  border-radius: 12px; border-color: var(--border-soft);
}
html.is-native .arc-fs-apply {
  width: 100%; margin-top: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: 999px; border: 0; background: var(--forest-pill, var(--color-forest));
  color: #fff; font-size: 0.88rem; font-weight: 700; cursor: pointer;
}
html.is-native .arc-fs-apply svg { width: 16px; height: 16px; }

/* Section headers (Pinned / Chronological order) + inline Select. */
html.is-native .arc-section { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
html.is-native .arc-section-lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-forest); }
html.is-native .arc-section-lbl svg { width: 14px; height: 14px; color: var(--forest-pill, var(--color-forest)); }
html.is-native .arc-section-select {
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 0.78rem; font-weight: 700; cursor: pointer;
  border: 1px solid var(--border-soft); background: var(--surface); color: var(--color-forest);
}

/* The list/grid toggle + result count are desktop-only chrome. */
html.is-native .arc-results { display: none; }
html.is-native .arc-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
html.is-native .arc-stat { padding: 13px 14px; gap: 10px; border-radius: 16px; align-items: flex-start; }
html.is-native .arc-stat { flex-direction: row; align-items: flex-start; gap: 12px; padding: 14px 14px; border-radius: 18px; background: var(--card, var(--surface)); border-color: color-mix(in srgb, var(--color-forest) 7%, transparent); }
html.is-native .arc-stat .ic { width: 38px; height: 38px; font-size: 1rem; }
html.is-native .arc-stat .a1 { background: var(--tint-green); color: var(--color-forest); }
html.is-native .arc-stat .a2 { background: var(--tint-pink); color: #d06b86; }
html.is-native .arc-stat .a3 { background: var(--tint-yellow); color: #d09a3a; }
html.is-native .arc-stat .a4 { background: var(--tint-purple); color: #7d73e6; }
html.is-native .arc-stat { gap: 11px; padding: 13px; }
html.is-native .arc-stat .k { font-size: 0.6rem; letter-spacing: 0.05em; margin-bottom: 3px; color: var(--text-tertiary); line-height: 1.25; }
html.is-native .arc-stat .v,
html.is-native .arc-stat .v.word { font-family: var(--font-serif); font-size: 1.18rem; font-weight: 600; color: var(--color-forest); margin-bottom: 2px; letter-spacing: -0.01em; line-height: 1.1; }
html.is-native .arc-stat .u { font-size: 0.66rem; line-height: 1.3; color: var(--text-tertiary); }
html.is-native .arc-list { gap: 10px; }
html.is-native .arc-entry { padding: 13px 14px; gap: 12px; flex-wrap: nowrap; border-radius: 16px; align-items: flex-start; }
html.is-native .arc-entry .fi { width: 40px; height: 40px; font-size: 1.05rem; }
html.is-native .arc-entry .ti { font-size: 1.02rem; }
html.is-native .arc-entry .ex { font-size: 0.8rem; }
html.is-native .arc-entry .side { flex-direction: column; align-items: flex-end; gap: 6px; width: auto; justify-content: flex-start; padding-top: 0; }
html.is-native .arc-entry .arc-mood { font-size: 0.66rem; padding: 4px 9px; }
html.is-native .arc-cards { grid-template-columns: 1fr; }
html.is-native .arc-fav-pill.on { background: var(--color-forest-100); border-color: var(--color-forest-100); color: var(--color-forest); }

/* ---------- Mobile Tags (design-ref 08-tags) ---------- */
html.is-native .tg-head {
  position: relative; overflow: hidden; display: block;
  margin: -16px -16px 14px; padding: 16px 18px 18px; gap: 0;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint-sage) 58%, var(--bg)) 0%, color-mix(in srgb, var(--tint-sage) 24%, var(--bg)) 48%, var(--bg) 85%);
}
html.is-native .tg-head::after {
  content: ""; position: absolute; right: -22px; top: -8px; width: 108px; height: 140px;
  background: url("../art/plant-hero.png") no-repeat top right / contain; opacity: 0.5; pointer-events: none;
}
html.is-native .tg-head > div { position: relative; z-index: 1; }
html.is-native .tg-head .tg-top-topic { display: none; }
html.is-native .tg-back { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin: 0 0 4px -6px; color: var(--color-forest); }
html.is-native .tg-back svg { width: 20px; height: 20px; }
html.is-native .tg-head h1 {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--font-serif); font-size: 1.7rem; font-weight: 600; color: var(--color-forest); letter-spacing: -0.015em;
}
html.is-native .tg-head .page-sub { max-width: 270px; font-size: 0.8rem; font-weight: 600; color: color-mix(in srgb, var(--color-forest) 58%, var(--text-secondary)); }

html.is-native .tg-toolbar { flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
html.is-native .tg-search { flex: 1 1 100%; }
html.is-native .tg-search input {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border-soft); font-size: 0.85rem; color: var(--text-primary);
}
html.is-native .tg-search .mg { left: 13px; }
html.is-native .tg-toolbar .hub-sel {
  flex: 0 1 auto; padding: 7px 11px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border-soft); font-size: 0.74rem; font-weight: 700; color: var(--color-forest);
}
html.is-native .tg-toolbar .hub-sel select { font-size: 0.74rem; font-weight: 700; color: var(--color-forest); }
html.is-native .tg-toolbar .hub-views { margin-left: auto; border-radius: var(--radius-full); background: var(--surface); border-color: var(--border-soft); }
html.is-native .tg-toolbar .hub-views button { width: 30px; height: 30px; }
html.is-native .tg-meta-row { display: none; }

html.is-native .tg-sec-t { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; color: var(--color-forest); margin: 20px 0 2px; }
html.is-native .tg-sec-s { font-size: 0.72rem; color: var(--text-tertiary); margin-bottom: 10px; }

html.is-native .tg-feat-row { grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
html.is-native .tg-fcard {
  border-radius: 18px; padding: 13px; border: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
  background: color-mix(in srgb, var(--tint-sage) 35%, var(--card, var(--surface)));
}
html.is-native .tg-fcard .ic { width: 34px; height: 34px; margin-bottom: 8px; font-size: 1rem; background: rgba(255,255,255,0.6) !important; }
html.is-native .tg-fcard h4 { font-size: 0.9rem; font-weight: 800; color: var(--color-forest); margin-bottom: 2px; }
html.is-native .tg-fcard .pg { font-size: 0.68rem; font-weight: 700; margin-bottom: 6px; }
html.is-native .tg-fcard p { font-size: 0.68rem; line-height: 1.35; min-height: 0; margin-bottom: 8px; }
html.is-native .tg-fcard .tg-spark { height: 22px; }

html.is-native .tg-split { display: block; }
html.is-native .tg-detail { display: none; }

html.is-native .tg-cloud { gap: 7px; margin-bottom: 4px; }
html.is-native .tg-chip,
html.is-native .tg-chip.xl,
html.is-native .tg-chip.lg,
html.is-native .tg-chip.md {
  font-size: 0.76rem; font-weight: 700; padding: 7px 12px; gap: 6px; border: 0;
}
html.is-native .tg-chip .ct { font-weight: 800; opacity: 0.7; }

html.is-native .tg-think-native { grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 4px; }
html.is-native .tg-think-native .tg-tk {
  padding: 11px 10px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
  background: var(--card, var(--surface));
}
html.is-native .tg-think-native .hd { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 6px; }
html.is-native .tg-think-native .ic { width: 26px; height: 26px; border-radius: 50%; font-size: 0.8rem; }
html.is-native .tg-think-native .lb { font-size: 0.58rem; font-weight: 700; color: var(--text-tertiary); line-height: 1.2; }
html.is-native .tg-think-native .mv { font-family: var(--font-serif); font-size: 0.95rem; font-weight: 600; color: var(--color-forest); line-height: 1.1; }
html.is-native .tg-think-native .ms { font-size: 0.6rem; font-weight: 600; color: var(--text-tertiary); margin-top: 2px; }

html.is-native .tg-tbl-wrap { border-radius: 16px; border-color: color-mix(in srgb, var(--color-forest) 7%, transparent); overflow: hidden; margin-top: 4px; }
html.is-native .tg-tbl-head { padding: 13px 14px 10px; }
html.is-native .tg-tbl-wrap .tg-sec-t { margin: 0; font-size: 1rem; }
html.is-native .tg-table { min-width: 0; width: 100%; table-layout: fixed; }
html.is-native .tg-table thead th { font-size: 0.54rem; padding: 0 6px 8px; }
html.is-native .tg-table thead th:nth-child(3) { display: none; }
html.is-native .tg-table tbody td { padding: 9px 6px; font-size: 0.76rem; }
html.is-native .tg-table tbody td:nth-child(3) { display: none; }
html.is-native .tg-table tbody td:nth-child(1) { width: 52%; }
html.is-native .tg-table tbody td:nth-child(2) { width: 30px; text-align: center; padding-left: 0; padding-right: 0; }
html.is-native .tg-table tbody td:nth-child(4) { width: 74px; }
html.is-native .tg-table tbody td:nth-child(4) svg { width: 100% !important; height: 20px !important; }
html.is-native .tg-table tbody td:nth-child(5) { width: 52px; text-align: right; }
html.is-native .tg-table .tg-color-dot { display: none; }
html.is-native .tg-table .tg-tcell .ds { display: none; }
html.is-native .tg-table .tg-tcell { gap: 6px; overflow: hidden; }
html.is-native .tg-table .tg-tcell > span:last-child { min-width: 0; flex: 1; }
html.is-native .tg-table .tg-tcell .ic { width: 20px; height: 20px; font-size: 0.68rem; flex-shrink: 0; }
html.is-native .tg-table .tg-tcell .nm { font-size: 0.78rem; font-weight: 700; color: var(--color-forest); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.is-native .tg-table .tg-vp { font-size: 0.62rem; white-space: nowrap; }
html.is-native .tg-toolbar .hub-views button.on { background: var(--tint-green); color: var(--color-forest); }
html.is-native .tg-more { font-size: 0.76rem; font-weight: 700; color: var(--color-forest); padding: 12px; }

html.is-native .tg-quote { margin-top: 18px; }

html.is-native[data-theme="dark"] .tg-head { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .tg-head h1,
html.is-native[data-theme="dark"] .tg-sec-t,
html.is-native[data-theme="dark"] .tg-fcard h4,
html.is-native[data-theme="dark"] .tg-think-native .mv { color: #7FB98F; }
html.is-native[data-theme="dark"] .tg-fcard,
html.is-native[data-theme="dark"] .tg-think-native .tg-tk,
html.is-native[data-theme="dark"] .tg-tbl-wrap { background: rgba(255,255,255,0.05); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .tg-head { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .tg-head h1,
  html.is-native:not([data-theme="light"]) .tg-sec-t,
  html.is-native:not([data-theme="light"]) .tg-fcard h4,
  html.is-native:not([data-theme="light"]) .tg-think-native .mv { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .tg-fcard,
  html.is-native:not([data-theme="light"]) .tg-think-native .tg-tk,
  html.is-native:not([data-theme="light"]) .tg-tbl-wrap { background: rgba(255,255,255,0.05); }
}

/* ---------- Profile (design ref 11-profile) ---------- */
html.is-native .pf-hero {
  position: relative; overflow: hidden;
  margin-bottom: 0; padding: 15px 15px 30px; border-radius: 22px;
  background: color-mix(in srgb, var(--tint-green) 70%, var(--card, var(--surface)));
}
html.is-native .pf-hero-art { position: absolute; right: -16px; top: 4px; width: 96px; height: auto; opacity: 0.65; pointer-events: none; }
html.is-native .pf-hero-row { position: relative; display: flex; align-items: flex-start; gap: 12px; }
html.is-native .pf-avatar {
  width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-forest-100); color: var(--color-forest); font-weight: 800; font-size: 1.05rem;
}
html.is-native .pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
html.is-native .pf-id { min-width: 0; flex: 1; }
html.is-native .pf-name { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; color: var(--color-forest); line-height: 1.15; }
html.is-native .pf-bio { margin: 2px 0 0; font-size: 0.8rem; font-weight: 600; line-height: 1.3; color: color-mix(in srgb, var(--color-forest) 55%, var(--text-secondary)); }
html.is-native .pf-edit {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  padding: 6px 11px; border-radius: var(--radius-full); background: var(--surface);
  font-size: 0.72rem; font-weight: 700; color: var(--color-forest); text-decoration: none;
  box-shadow: 0 1px 3px rgba(32,70,58,0.12);
}
html.is-native .pf-strip {
  position: relative; z-index: 3; display: flex; gap: 8px;
  margin: -20px 3px 12px; padding: 0; text-align: center;
}
html.is-native .pf-strip > div {
  flex: 1; min-width: 0; padding: 10px 4px 9px; border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 8px 20px -12px rgba(46,100,81,0.4), 0 1px 3px rgba(46,100,81,0.08);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
html.is-native .pf-strip svg { color: var(--color-forest); margin-bottom: 1px; }
html.is-native .pf-strip b { font-size: 0.62rem; font-weight: 700; color: color-mix(in srgb, var(--text-secondary) 80%, transparent); }
html.is-native .pf-strip span { font-size: 0.82rem; font-weight: 800; color: var(--color-forest); }

html.is-native .pf-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
html.is-native .pf-nav-card {
  display: flex; align-items: flex-start; gap: 9px; padding: 12px; border-radius: 18px;
  background: var(--card, var(--surface)); border: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
  text-decoration: none;
}
html.is-native .pf-nav-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
html.is-native .pf-nav-ic svg { width: 16px; height: 16px; }
html.is-native .pf-nav-ic.t-green  { background: var(--tint-green);  color: var(--color-forest); }
html.is-native .pf-nav-ic.t-pink   { background: var(--tint-pink);   color: #d06b86; }
html.is-native .pf-nav-ic.t-purple { background: var(--tint-purple); color: #7d73e6; }
html.is-native .pf-nav-ic.t-blue   { background: var(--tint-blue);   color: #5b9bd4; }
html.is-native .pf-nav-t { min-width: 0; flex: 1; }
html.is-native .pf-nav-t b { display: block; font-family: var(--font-sans); font-size: 0.86rem; font-weight: 800; color: var(--color-forest); line-height: 1.15; letter-spacing: -0.005em; }
html.is-native .pf-nav-t i { display: block; font-style: normal; margin-top: 2px; font-size: 0.66rem; font-weight: 600; line-height: 1.25; color: color-mix(in srgb, var(--text-secondary) 78%, transparent); }
html.is-native .pf-nav-chev { flex-shrink: 0; margin-top: 1px; color: var(--text-tertiary); font-size: 0.95rem; }

html.is-native .pf-card {
  position: relative; overflow: hidden;
  margin-bottom: 12px; padding: 14px; border-radius: 20px;
  background: var(--card, var(--surface)); border: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
}
html.is-native .pf-card-art {
  position: absolute; right: -14px; bottom: -10px; width: 100px; height: auto;
  opacity: 0.3; pointer-events: none;
}
html.is-native .pf-goal .pf-card-art { width: 84px; opacity: 0.24; }
html.is-native .pf-card-sparkle {
  position: absolute; right: 64px; bottom: 104px;
  font-size: 0.82rem; color: #e0a83c; opacity: 0.8; pointer-events: none;
}
html.is-native .pf-card-head,
html.is-native .pf-mood-body,
html.is-native .pf-themes,
html.is-native .pf-goal-label,
html.is-native .pf-goal-bar { position: relative; z-index: 1; }
html.is-native .pf-card-head { display: flex; align-items: center; gap: 8px; }
html.is-native .pf-card-emoji { font-size: 1.05rem; }
html.is-native .pf-card-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint-green); color: var(--color-forest); flex-shrink: 0; }
html.is-native .pf-card-head > div { line-height: 1.18; min-width: 0; }
html.is-native .pf-card-head > div b,
html.is-native .pf-card-title { display: block; font-family: var(--font-serif); font-size: 1.02rem; font-weight: 600; color: var(--color-forest); }
html.is-native .pf-card-head > div i { display: block; margin-top: 1px; font-style: normal; font-size: 0.7rem; font-weight: 600; color: color-mix(in srgb, var(--text-secondary) 78%, transparent); }
html.is-native .pf-viewall { margin-left: auto; flex-shrink: 0; font-size: 0.8rem; font-weight: 700; color: var(--color-forest); text-decoration: none; }
html.is-native .pf-mood-body { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
html.is-native .pf-donut { flex-shrink: 0; }
html.is-native .pf-legend { flex: 0 1 auto; width: 174px; max-width: 100%; list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
html.is-native .pf-legend li { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
html.is-native .pf-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
html.is-native .pf-legend b { margin-left: auto; font-weight: 800; color: var(--color-forest); }
html.is-native .pf-themes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
html.is-native .pf-theme { border-radius: var(--radius-full); padding: 5px 11px; font-size: 0.76rem; font-weight: 800; }
html.is-native .pf-theme.th-blue   { background: var(--tint-blue);   color: #5b9bd4; }
html.is-native .pf-theme.th-yellow { background: var(--tint-yellow); color: #d09a3a; }
html.is-native .pf-theme.th-green  { background: var(--tint-green);  color: var(--color-forest); }
html.is-native .pf-theme.th-pink   { background: var(--tint-pink);   color: #d06b86; }
html.is-native .pf-theme.th-purple { background: var(--tint-purple); color: #7d73e6; }
html.is-native .pf-goal-label { margin-top: 8px; font-size: 0.82rem; font-weight: 600; color: color-mix(in srgb, var(--color-forest) 60%, var(--text-secondary)); }
html.is-native .pf-goal-bar { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
html.is-native .pf-goal-bar .progress-bar { flex: 1; background: color-mix(in srgb, var(--color-forest) 12%, transparent); }
html.is-native .pf-goal-bar .progress-bar span { background: var(--forest-pill, var(--color-forest)); }
html.is-native .pf-goal-bar span { flex-shrink: 0; font-size: 0.72rem; font-weight: 800; color: color-mix(in srgb, var(--text-secondary) 85%, transparent); }
html.is-native .pf-print {
  display: block; text-align: center; margin: 14px auto 0; padding: 11px 18px;
  border-radius: var(--radius-full); border: 1px solid var(--border-soft); background: var(--surface);
  font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); text-decoration: none; max-width: 260px;
}
html.is-native[data-theme="dark"] .pf-hero { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .pf-name,
html.is-native[data-theme="dark"] .pf-strip span,
html.is-native[data-theme="dark"] .pf-nav-t b,
html.is-native[data-theme="dark"] .pf-card-title,
html.is-native[data-theme="dark"] .pf-card-head > div b { color: #7FB98F; }
html.is-native[data-theme="dark"] .pf-hero-art { opacity: 0.4; }
html.is-native[data-theme="dark"] .pf-strip > div { background: rgba(255,255,255,0.06); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .pf-hero { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .pf-name,
  html.is-native:not([data-theme="light"]) .pf-strip span,
  html.is-native:not([data-theme="light"]) .pf-nav-t b,
  html.is-native:not([data-theme="light"]) .pf-card-title,
  html.is-native:not([data-theme="light"]) .pf-card-head > div b { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .pf-hero-art { opacity: 0.4; }
  html.is-native:not([data-theme="light"]) .pf-strip > div { background: rgba(255,255,255,0.06); }
}

/* ---------- Profile › Achievements section (design ref 11 extension) ---------- */
html.is-native .pf-achv { scroll-margin-top: 74px; }
html.is-native .pf-achv .pf-card-head { margin-bottom: 12px; }
html.is-native .pf-achv .pf-card-head > div b { font-family: var(--font-serif); font-size: 1.02rem; font-weight: 600; color: var(--color-forest); }
html.is-native .pf-achv .pf-card-head > div i { display: block; font-style: normal; margin-top: 1px; font-size: 0.72rem; font-weight: 600; color: color-mix(in srgb, var(--text-secondary) 78%, transparent); }

html.is-native .pf-achv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
html.is-native .pf-achv-stat {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; border-radius: 13px;
  background: color-mix(in srgb, var(--tint-green) 34%, var(--card, var(--surface)));
}
html.is-native .pf-achv-stat .k { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: color-mix(in srgb, var(--color-forest) 55%, var(--text-secondary)); }
html.is-native .pf-achv-stat .v { font-family: var(--font-serif); font-size: 1.28rem; font-weight: 600; color: var(--color-forest); line-height: 1.1; }

html.is-native .pf-achv-sub { margin: 18px 0 9px; font-size: 0.82rem; font-weight: 800; color: var(--color-forest); }
html.is-native .pf-achv-mrow { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); }
html.is-native .pf-achv-mrow .nm { flex: 0 0 96px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.is-native .pf-achv-mrow .bar { flex: 1; height: 8px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-forest) 10%, transparent); overflow: hidden; }
html.is-native .pf-achv-mrow .bar > span { display: block; height: 100%; border-radius: inherit; }
html.is-native .pf-achv-mrow .pc { flex: 0 0 34px; text-align: right; font-weight: 700; color: var(--color-forest); }
html.is-native .pf-achv-empty { font-size: 0.78rem; color: var(--text-tertiary); }

html.is-native .pf-achv-crow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
}
html.is-native .pf-achv-crow:last-child { border-bottom: 0; }
html.is-native .pf-achv-crow .ci { font-size: 0.95rem; flex-shrink: 0; }
html.is-native .pf-achv-crow .cn { flex: 1; min-width: 0; font-size: 0.8rem; font-weight: 700; color: var(--color-forest); }
html.is-native .pf-achv-crow .cp { flex-shrink: 0; font-size: 0.72rem; font-weight: 700; color: var(--muted, var(--text-tertiary)); }
html.is-native .pf-achv-crow .ck {
  flex-shrink: 0; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%;
  background: var(--tint-green); color: var(--color-forest); font-size: 0.68rem; font-weight: 900;
}
html.is-native .pf-achv-crow .cbar { flex: 1 1 100%; height: 7px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-forest) 10%, transparent); overflow: hidden; }
html.is-native .pf-achv-crow .cbar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c07a4a, #a85f34); }
html.is-native .pf-achv-crow.done .cbar > span { background: linear-gradient(90deg, #6a9c74, var(--color-forest)); }

html.is-native .pf-achv-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
html.is-native .pf-achv-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 7px; border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--tint-yellow) 40%, var(--card, var(--surface)));
  font-size: 0.68rem; font-weight: 700; color: var(--color-forest);
}
html.is-native .pf-achv-badge .bi { font-size: 0.85rem; }
html.is-native .pf-achv-badge.locked { background: color-mix(in srgb, var(--surface-muted) 40%, transparent); color: var(--text-tertiary); opacity: 0.7; }
html.is-native .pf-achv-badge.locked .bi { filter: grayscale(1); opacity: 0.6; }

html.is-native[data-theme="dark"] .pf-achv .pf-card-head > div b,
html.is-native[data-theme="dark"] .pf-achv-stat .v,
html.is-native[data-theme="dark"] .pf-achv-sub { color: #7FB98F; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .pf-achv .pf-card-head > div b,
  html.is-native:not([data-theme="light"]) .pf-achv-stat .v,
  html.is-native:not([data-theme="light"]) .pf-achv-sub { color: #7FB98F; }
}

html.is-native .mprofile-quote {
  position: relative; overflow: hidden; text-align: center;
  margin-top: 18px; padding: 16px 46px 15px; border-radius: 22px;
  background: var(--tint-sage, #e4ede0);
}
html.is-native .mprofile-quote { padding: 18px 52px 18px; }
html.is-native .mprofile-quote::before, html.is-native .mprofile-quote::after {
  content: ""; position: absolute; bottom: -2px; width: 76px; height: 86px;
  background: url("../art/sprig-quote.png") no-repeat bottom / contain; opacity: 0.95; pointer-events: none;
}
html.is-native .mprofile-quote::before { left: -12px; }
html.is-native .mprofile-quote::after { right: -12px; transform: scaleX(-1); }
html.is-native .mprofile-quote-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: color-mix(in srgb, var(--color-forest) 72%, transparent); }
html.is-native .mprofile-quote-label span { font-family: var(--font-serif); font-size: 1rem; vertical-align: -3px; margin-right: 1px; }
html.is-native .mprofile-quote p { margin: 7px auto 0; max-width: 240px; font-family: var(--font-serif); font-style: italic; font-size: 0.95rem; font-weight: 500; line-height: 1.4; color: var(--color-forest); }

html.is-native[data-theme="dark"] .mprofile-head { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .mprofile-head h1,
html.is-native[data-theme="dark"] .mprofile-strip b,
html.is-native[data-theme="dark"] .mprofile-quote p { color: #7FB98F; }
html.is-native[data-theme="dark"] .mprofile-plant { opacity: 0.5; }
html.is-native[data-theme="dark"] .mprofile-quote { background: rgba(255,255,255,0.05); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .mprofile-head { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .mprofile-head h1,
  html.is-native:not([data-theme="light"]) .mprofile-strip b,
  html.is-native:not([data-theme="light"]) .mprofile-quote p { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .mprofile-plant { opacity: 0.5; }
  html.is-native:not([data-theme="light"]) .mprofile-quote { background: rgba(255,255,255,0.05); }
}

/* ---------- Primary actions read forest-green in the app (the design's
   CTA colour) without disturbing the page-theme accent tokens. ---------- */
html.is-native .btn-primary { background: var(--color-forest); }
html.is-native .btn-primary:hover { background: var(--color-forest-700); }
html.is-native .tab.active { color: var(--color-forest); border-color: var(--color-forest); }
html.is-native[data-theme="dark"] .btn-primary { background: #2f6e4e; }
html.is-native[data-theme="dark"] .tab.active { color: #7FB98F; border-color: #7FB98F; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .btn-primary { background: #2f6e4e; }
  html.is-native:not([data-theme="light"]) .tab.active { color: #7FB98F; border-color: #7FB98F; }
}

/* ---------- Settings (design ref 17) ---------- */
html.is-native .app-content > div[style*="max-width:640px"],
html.is-native .app-content > div[style*="max-width: 640px"] { max-width: 100% !important; }
html.is-native .field textarea { min-height: 84px; }

/* Hero */
html.is-native .mset .page-head {
  position: relative; overflow: hidden;
  margin: -4px -16px 16px; padding: 6px 18px 16px;
}
html.is-native .mset .page-head::after {
  content: ""; position: absolute; right: -10px; top: -8px; width: 128px; height: 150px;
  background: no-repeat right top / contain url("../art/plant-capsules.png");
  -webkit-mask-image: radial-gradient(135% 115% at 100% 0%, #000 42%, transparent 80%);
          mask-image: radial-gradient(135% 115% at 100% 0%, #000 42%, transparent 80%);
  opacity: 0.9; pointer-events: none;
}
html.is-native .mset .page-head h1 {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 600;
  color: var(--color-forest); letter-spacing: -0.02em;
}
html.is-native .mset .page-head h1::after { content: " 🌿"; font-size: 1.1rem; }
html.is-native .mset .page-head .page-sub { max-width: 62%; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }

/* The nine tabs become a pastel tile grid */
html.is-native .mset .tabs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px;
  border-bottom: 0; overflow: visible; margin-bottom: 22px;
}
html.is-native .mset .tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 3px 11px; margin-bottom: 0; text-align: center;
  border: 1px solid transparent; border-radius: 15px;
  background: var(--tint-green); color: var(--color-forest);
  font-weight: 700; font-size: 0.6rem; line-height: 1.15;
}
html.is-native .mset .tab::after {
  content: "›"; position: absolute; right: 6px; bottom: 4px;
  font-size: 0.7rem; font-weight: 700; color: color-mix(in srgb, currentColor 55%, transparent);
}
html.is-native .mset .tab:nth-child(5n+2) { background: var(--tint-blue); color: #4f7fa8; }
html.is-native .mset .tab:nth-child(5n+3) { background: var(--tint-purple); color: #7167c9; }
html.is-native .mset .tab:nth-child(5n+4) { background: var(--tint-yellow); color: #b98a3c; }
html.is-native .mset .tab:nth-child(5n+5) { background: color-mix(in srgb, var(--tint-green) 70%, var(--tint-blue)); color: var(--color-forest); }
html.is-native .mset .tab.active {
  border-color: var(--color-forest);
  background: color-mix(in srgb, var(--color-forest) 16%, var(--card));
  color: var(--color-forest);
}
html.is-native .mset .tab::before {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, #fff 55%, transparent); font-size: 0.95rem; font-weight: 400;
}
html.is-native[data-theme="dark"] .mset .tab::before { background: rgba(255,255,255,0.1); }
html.is-native .mset .tab[data-tab="profile"]::before { content: "👤"; }
html.is-native .mset .tab[data-tab="billing"]::before { content: "💳"; }
html.is-native .mset .tab[data-tab="journaling"]::before { content: "📖"; }
html.is-native .mset .tab[data-tab="notifications"]::before { content: "🔔"; }
html.is-native .mset .tab[data-tab="privacy"]::before { content: "✨"; }
html.is-native .mset .tab[data-tab="security"]::before { content: "🛡️"; }
html.is-native .mset .tab[data-tab="appearance"]::before { content: "🎨"; }
html.is-native .mset .tab[data-tab="data"]::before { content: "☁️"; }
html.is-native .mset .tab[data-tab="about"]::before { content: "ℹ️"; }

/* Section header above the form */
html.is-native .mset .set-sec { position: relative; margin-bottom: 14px; padding-right: 96px; }
html.is-native .mset .set-sec::after {
  content: ""; position: absolute; right: -4px; top: -6px; width: 92px; height: 78px;
  background: no-repeat right top / contain url("../art/plant-hero.png");
  opacity: 0.5; pointer-events: none;
}
html.is-native .mset .set-sec h2 {
  font-family: var(--font-serif); font-size: 1.65rem; font-weight: 600;
  color: var(--color-forest); letter-spacing: -0.015em; margin: 0 0 4px;
}
html.is-native .mset .set-sec p { margin: 0; font-size: 0.84rem; font-weight: 500; line-height: 1.4; color: var(--text-secondary); }

/* Form card */
html.is-native .mset .card { position: relative; overflow: hidden; padding: 16px; }
html.is-native .mset .card > .field:last-of-type { margin-bottom: 4px; }
html.is-native .mset .field > label {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 700; color: var(--color-forest); margin-bottom: 7px;
}
html.is-native .mset .field > label .fl-ic { color: var(--color-forest); opacity: 0.75; flex-shrink: 0; }
html.is-native .mset .field input,
html.is-native .mset .field select,
html.is-native .mset .field textarea {
  border-radius: 12px; border: 1px solid var(--border-soft); background: var(--surface);
  font-size: 0.92rem;
}

/* Photo row → tinted sub-card, stacked buttons */
html.is-native .mset .field-photo {
  padding: 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--tint-green) 45%, var(--card));
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
}
html.is-native .mset .field-photo > label { display: none; }
html.is-native .mset .field-photo .photo-row { align-items: flex-start; gap: 14px; }
html.is-native .mset .field-photo .avatar { width: 68px !important; height: 68px !important; flex-shrink: 0; }
html.is-native .mset .field-photo .photo-btns { flex-direction: column; gap: 8px; flex: 0 1 auto; min-width: 0; width: 200px; }
html.is-native .mset .field-photo .photo-btns .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  border-radius: var(--radius-full); font-weight: 700;
}
html.is-native .mset .field-photo .photo-btns .btn-ghost {
  border: 1px solid var(--border-soft); background: var(--surface); color: var(--text-secondary);
}
html.is-native .mset .field-photo .field-hint { margin-top: 10px; font-size: 0.76rem; color: color-mix(in srgb, var(--color-forest) 55%, var(--text-secondary)); }

html.is-native .mset #detectTz { display: none; }

html.is-native .mset .btn-save {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 78%; margin-top: 4px; padding: 13px 18px; border-radius: var(--radius-full);
  font-size: 0.95rem; font-weight: 800;
  box-shadow: 0 10px 20px -8px rgba(46,100,81,0.5);
}
html.is-native .mset .card::after {
  content: ""; position: absolute; right: -18px; bottom: -14px; width: 108px; height: 88px;
  background: no-repeat right bottom / contain url("../art/plant-hero.png");
  opacity: 0.28; pointer-events: none; transform: scaleX(-1);
}
html.is-native .mset .card > * { position: relative; z-index: 1; }
html.is-native .mset .card::after { z-index: 0; }

html.is-native[data-theme="dark"] .mset .page-head h1,
html.is-native[data-theme="dark"] .mset .set-sec h2,
html.is-native[data-theme="dark"] .mset .field > label { color: #7FB98F; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .mset .page-head h1,
  html.is-native:not([data-theme="light"]) .mset .set-sec h2,
  html.is-native:not([data-theme="light"]) .mset .field > label { color: #7FB98F; }
}

/* ---------- Writing flow: "How do you want to start this page?" ---------- */
html.is-native .editor-wrap { max-width: 100%; }
html.is-native .editor-wrap .editor-date {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--color-forest);
}
html.is-native .editor-wrap > h1 { font-family: var(--font-serif); font-size: 1.9rem; line-height: 1.2; }
html.is-native .editor-wrap .lede { font-size: 1.05rem; }
html.is-native .editor-wrap .grid-3,
html.is-native .editor-wrap .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
html.is-native .editor-wrap .feature-card { padding: 15px; border-radius: 16px; }
html.is-native .editor-wrap .feature-card h3 { font-size: 0.95rem; }
html.is-native .editor-wrap .feature-icon { width: 38px; height: 38px; margin-bottom: 10px; font-size: 1.05rem; }
html.is-native .choice-grid { grid-template-columns: 1fr; }
/* Typography cards stay compact enough for 2-up even on a phone, unlike
   the taller theme/display-mode choice-grids above. */
html.is-native .typo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* Native "Start a page" chooser — matches design-ref 03-startpage. */
html.is-native .mstart { display: block; }
html.is-native .mstart-band {
  position: relative; overflow: hidden;
  margin: -4px -16px 0; padding: 16px 16px 16px;
  border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--tint-sage) 55%, var(--bg));
}
html.is-native .mstart-band-art { position: absolute; right: 6px; top: -10px; width: 96px; height: auto; opacity: 0.95; pointer-events: none; }
html.is-native .mstart-band-day { position: relative; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: color-mix(in srgb, var(--color-forest) 55%, transparent); }
html.is-native .mstart-band-date { position: relative; margin-top: 3px; font-family: var(--font-serif); font-size: 1.72rem; font-weight: 700; line-height: 1.12; color: var(--color-forest); }
html.is-native .mstart-q { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 700; line-height: 1.16; color: var(--color-forest); margin: 20px 0 16px; max-width: 16ch; letter-spacing: -0.01em; }

html.is-native .mstart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
html.is-native .mstart-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  min-height: 158px; padding: 15px; border-radius: 18px; border: 0; cursor: pointer;
  background: var(--mc-bg, var(--surface-muted)); color: var(--text-primary);
}
html.is-native .mstart-card.c-green  { --mc-bg: var(--tint-green);  --mc-fg: var(--color-forest); }
html.is-native .mstart-card.c-peach  { --mc-bg: var(--tint-peach);  --mc-fg: #d99a2b; }
html.is-native .mstart-card.c-blue   { --mc-bg: var(--tint-blue);   --mc-fg: #4b8fc7; }
html.is-native .mstart-card.c-purple { --mc-bg: var(--tint-purple); --mc-fg: #7d73e6; }
html.is-native .mstart-card.is-ai { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #7d73e6 55%, transparent); }
html.is-native .mstart-card-top { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-bottom: 8px; }
html.is-native .mstart-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: color-mix(in srgb, var(--mc-fg) 18%, #fff); color: var(--mc-fg);
}
html.is-native .mstart-ic svg { width: 23px; height: 23px; }
html.is-native .mstart-chev { color: color-mix(in srgb, var(--color-forest) 42%, transparent); font-size: 1.15rem; line-height: 1; }
html.is-native .mstart-card b { font-size: 1rem; font-weight: 800; color: var(--color-forest); line-height: 1.16; }
html.is-native .mstart-card i { font-style: normal; margin-top: 1px; font-size: 0.82rem; font-weight: 600; line-height: 1.32; color: color-mix(in srgb, var(--text-secondary) 82%, transparent); }

html.is-native .mstart-here {
  position: relative; overflow: hidden; margin-top: 16px;
  display: flex; flex-direction: column;
  padding: 16px; border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--card, var(--surface));
}
html.is-native .mstart-here-head { position: relative; display: flex; align-items: center; gap: 9px; font-family: var(--font-serif); font-size: 1.22rem; font-weight: 700; color: var(--color-forest); }
html.is-native .mstart-here-head svg { width: 22px; height: 22px; flex-shrink: 0; }
html.is-native .mstart-here-hint { position: relative; margin: 8px 0 0; font-family: var(--font-serif); font-style: italic; font-size: 1.1rem; color: color-mix(in srgb, var(--text-tertiary) 82%, transparent); }
html.is-native .mstart-here-art {
  position: static; display: block; width: 100%; height: auto; margin: 14px 0;
  border-radius: 14px; opacity: 1; pointer-events: none;
  background: color-mix(in srgb, var(--tint-blue) 26%, var(--card, var(--surface)));
}
html.is-native .mstart-here-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 2px; padding: 15px 18px; border: 0; cursor: pointer;
  border-radius: var(--radius-full); background: var(--color-forest-700); color: #fff;
  font-weight: 800; font-size: 1rem; box-shadow: 0 4px 10px -4px rgba(46,100,81,0.4);
}
html.is-native .mstart-here-btn svg { width: 17px; height: 17px; }

html.is-native[data-theme="dark"] .mstart-band { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .mstart-band-date,
html.is-native[data-theme="dark"] .mstart-q,
html.is-native[data-theme="dark"] .mstart-card b,
html.is-native[data-theme="dark"] .mstart-here-head { color: #7FB98F; }
html.is-native[data-theme="dark"] .mstart-band-day,
html.is-native[data-theme="dark"] .mstart-band-date { color: #8FBF9A; }
html.is-native[data-theme="dark"] .mstart-card { background: rgba(255,255,255,0.05); }
html.is-native[data-theme="dark"] .mstart-ic { background: rgba(255,255,255,0.08); }
html.is-native[data-theme="dark"] .mstart-here-art { opacity: 0.9; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .mstart-band { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .mstart-band-date,
  html.is-native:not([data-theme="light"]) .mstart-q,
  html.is-native:not([data-theme="light"]) .mstart-card b,
  html.is-native:not([data-theme="light"]) .mstart-here-head { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .mstart-band-day { color: #8FBF9A; }
  html.is-native:not([data-theme="light"]) .mstart-card { background: rgba(255,255,255,0.05); }
  html.is-native:not([data-theme="light"]) .mstart-ic { background: rgba(255,255,255,0.08); }
  html.is-native:not([data-theme="light"]) .mstart-here-art { opacity: 0.9; }
}

/* ---------- Writing flow: the editor ---------- */
/* Single column, and keep the writing area above the mood/energy rail
   (the tablet layout floats the rail on top, backwards for writing). */
html.is-native .tp-cols { grid-template-columns: 1fr; }
/* The whole rich-text toolbar collapses to ONE row that scrolls
   sideways, instead of a stacked block of icon rows. */
html.is-native .editor-toolbar-row { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 4px; }
html.is-native .editor-toolbar-row::-webkit-scrollbar { display: none; }
html.is-native .toolbar-line { flex-wrap: nowrap; flex-shrink: 0; }
html.is-native .toolbar-btn.active { background: var(--color-forest-100); color: var(--color-forest); }
html.is-native .tp-card { border-radius: 16px; }
html.is-native .tp-editor .entry-body { min-height: 320px; padding: 18px; }

/* Slim the date hero down to a band — no lede paragraph, inline actions. */
html.is-native .tp-day { padding: 14px 16px 16px; border-radius: 16px; margin-bottom: 14px; }
html.is-native .tp-day h1 { font-size: 1.45rem; margin-bottom: 0; }
html.is-native .tp-day p { display: none; }
html.is-native .tp-day-photo { opacity: 0.45; }
html.is-native .tp-day-actions { position: static; justify-content: flex-end; margin-bottom: 6px; }
html.is-native .tp-round-btn { width: 34px; height: 34px; }
html.is-native .tp-round-btn.on { background: var(--color-forest-100); color: var(--color-forest); }

/* The editor head: give the title input the room, drop the badge/day/rule. */
html.is-native .tp-ed-head { flex-wrap: wrap; padding: 12px 14px; gap: 8px; }
html.is-native .tp-ed-badge,
html.is-native .tp-ed-day,
html.is-native .tp-ed-sep { display: none; }
html.is-native .tp-ed-head .entry-title-input { flex: 1 1 100%; font-size: 1.1rem; font-family: var(--font-serif); }
html.is-native .tp-editor .editor-toolbar-row { padding: 8px 12px; }

/* "Also written this day" + the prompt card get more compact. */
html.is-native .filter-bar { gap: 6px; }
html.is-native .tp-prompt { padding: 14px 16px; gap: 10px; margin-bottom: 14px; }
html.is-native .tp-prompt .txt { min-width: 0; font-size: 0.88rem; }
/* Keep the prompt actions — incl. the ✨ AI-reflection button — on one row. */
html.is-native .tp-prompt-btns { flex-wrap: nowrap; align-items: center; gap: 5px; }
html.is-native .tp-prompt-btns .tp-btn-rust,
html.is-native .tp-prompt-btns .tp-btn-shuffle { min-width: 0; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
html.is-native .tp-prompt-btns > span { flex-shrink: 0; }
html.is-native .tp-prompt-btns .tp-btn-ai { flex-shrink: 0; width: 30px; height: 30px; padding: 0; font-size: 0.85rem; }
html.is-native .tp-btn-rust { background: var(--color-forest); }

/* The mood / energy / attachments rail reads as "extras" below the page. */
html.is-native .tp-rail { order: 0; margin-top: 14px; gap: 12px; }
html.is-native .tp-card { padding: 16px; }

/* Save bar (fallback — replaced by the bottom sheet below when JS runs) */
html.is-native .tp-bottombar { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 14px; }
html.is-native .tp-bottombar .tp-bb-group { justify-content: center; flex-wrap: wrap; }
html.is-native .tp-btn-dark { background: var(--color-forest); }

/* ---------- Native editor: bottom sheet (App.initEditorSheet) ---------- */
html.is-native body.tp-sheet-mode .native-tabbar { display: none; }
html.is-native body.tp-sheet-mode .app-content { padding-bottom: calc(312px + env(safe-area-inset-bottom)); }
html.is-native body.tp-sheet-mode .tp-day {
  padding: 0 2px 4px; margin-bottom: 6px;
  background: none; border: 0; border-radius: 0;
}
html.is-native body.tp-sheet-mode .tp-day-photo,
html.is-native body.tp-sheet-mode .tp-day-actions,
html.is-native body.tp-sheet-mode .tp-day .tp-eyebrow,
html.is-native body.tp-sheet-mode .tp-day p { display: none; }
/* Editor date reads as one calm line, matching design-ref 04-editor. */
html.is-native body.tp-sheet-mode .tp-day h1 {
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 700; line-height: 1.3;
  color: color-mix(in srgb, var(--color-forest) 62%, var(--text-secondary)); margin: 0;
  display: flex; align-items: center; gap: 6px;
}
html.is-native body.tp-sheet-mode .tp-day h1 svg { width: 17px; height: 12px; flex-shrink: 0; }
html.is-native body.tp-sheet-mode .tp-editor { position: relative; border: 0; background: transparent; }
html.is-native body.tp-sheet-mode .tp-ed-foot { display: none; }
/* Keep the title field reachable in the sheet editor — just strip the head
   down to the "Add a title…" input (no badge / day chip / focus pills). */
html.is-native body.tp-sheet-mode .tp-ed-head {
  display: flex; flex-wrap: wrap; padding: 2px 2px 4px; margin-bottom: 2px;
  border-bottom: 1px solid var(--border-soft); gap: 6px;
}
html.is-native body.tp-sheet-mode .tp-ed-head .tp-ed-focus-actions { display: none; }
/* Focus mode on the phone hides the top bar and the sheet, so surface a
   floating "Exit focus" button — the only way back out without a keyboard. */
html.is-native body.tp-focus .tp-ed-head .tp-ed-focus-actions {
  display: flex; position: fixed; z-index: 95; margin: 0;
  top: calc(8px + env(safe-area-inset-top)); right: 12px;
}
html.is-native body.tp-focus .tp-ed-focus-actions .tp-fa-pill,
html.is-native body.tp-focus .tp-ed-focus-actions .tp-fa-btn { display: none; }
html.is-native body.tp-focus .tp-fa-exit {
  background: var(--surface); border-color: var(--border-soft);
  box-shadow: 0 6px 20px -6px rgba(20,30,25,0.35); color: var(--color-forest);
  font-weight: 700;
}
html.is-native body.tp-sheet-mode .tp-ed-head .entry-title-input {
  flex: 1 1 100%; font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; padding: 4px 0;
}
/* Prompt reads as the page heading (design-ref 04-editor), not a tinted card. */
html.is-native body.tp-sheet-mode #promptZone { margin: 8px 0 2px; }
html.is-native body.tp-sheet-mode .tp-prompt {
  background: none; border: 0; box-shadow: none; padding: 0; margin: 0;
}
html.is-native body.tp-sheet-mode .tp-prompt .q { display: none; }
html.is-native body.tp-sheet-mode .tp-prompt .txt {
  font-family: var(--font-serif); font-size: 1.55rem; font-weight: 600; line-height: 1.2;
  color: var(--color-forest); margin: 0;
}
html.is-native body.tp-sheet-mode .tp-prompt-btns { margin-top: 10px; gap: 5px; }
html.is-native body.tp-sheet-mode .tp-prompt-btns button:not(.tp-btn-ai) {
  font-size: 0.7rem; padding: 5px 8px; opacity: 0.9; white-space: nowrap;
}
html.is-native body.tp-sheet-mode .tp-prompt-btns .tp-btn-ai {
  width: 30px; height: 30px; font-size: 0.85rem; opacity: 0.9;
}
html.is-native body.tp-sheet-mode .tp-editor .entry-body { position: relative; z-index: 1; background: transparent; min-height: 44vh; padding: 8px 2px; }
/* Calm botanical accent low-right of the writing area (design-ref 04-editor). */
html.is-native body.tp-sheet-mode .tp-editor::after {
  content: ""; position: absolute; right: -6px; bottom: 54px; width: 122px; height: 150px;
  background: url("../art/plant-start.png") no-repeat bottom right / contain;
  opacity: 0.5; pointer-events: none; z-index: 0;
}
html.is-native[data-theme="dark"] body.tp-sheet-mode .tp-editor::after { opacity: 0.22; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) body.tp-sheet-mode .tp-editor::after { opacity: 0.22; }
}
/* The phone editor is a calm writing surface (design-ref 04): the rich-text
   toolbar collapses to a single scrollable strip and only shows once the
   body has focus, so an untouched page reads clean. It docks to the bottom
   of the screen like a keyboard accessory bar, sitting directly above the
   collapsed bottom sheet — JS (initKeyboardToolbar, wired in
   initEditorSheet) keeps --kb-toolbar-offset equal to the sheet's live
   height. That's enough on its own: this WebView's layout viewport already
   shrinks to exclude the on-screen keyboard, and since both the toolbar and
   the sheet are position:fixed, they ride up together the moment the
   keyboard opens — no separate keyboard-height offset needed (an earlier
   version added one and it just pushed the toolbar high above the sheet). */
html.is-native body.tp-sheet-mode .editor-toolbar-row {
  position: fixed; left: 0; right: 0; bottom: var(--kb-toolbar-offset, 0px); z-index: 90;
  border: 1px solid var(--border-soft); border-width: 1px 0 0 0; background: var(--surface);
  margin-bottom: 0; max-height: 0; padding-top: 0; padding-bottom: 0;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; box-shadow: 0 -6px 18px -12px rgba(20,30,25,0.25);
  transition: max-height 0.2s var(--ease), bottom 0.15s var(--ease);
}
html.is-native body.tp-sheet-mode .tp-editor:focus-within .editor-toolbar-row {
  max-height: 200px; padding-top: 8px; padding-bottom: 8px;
}
/* Both button rows sit on ONE scrolling line so the last tools (align,
   undo/redo) are reachable by swiping the strip sideways. */
html.is-native body.tp-sheet-mode .editor-toolbar-row .toolbar-line { flex-shrink: 0; }
html.is-native body.tp-sheet-mode .editor-toolbar-row .toolbar-line + .toolbar-line {
  border-left: 1px solid var(--border-soft); margin-left: 4px; padding-left: 6px;
}
/* Reserve room at the bottom of the writing area so the docked toolbar
   never covers the line you're actually typing. */
html.is-native body.tp-sheet-mode.tp-toolbar-docked .tp-editor .entry-body {
  padding-bottom: var(--kb-toolbar-reserve, 0px);
}

.tp-sheet-scrim {
  position: fixed; inset: 0; z-index: 84; background: rgba(20,16,8,0.30);
  opacity: 0; pointer-events: none; transition: opacity 0.28s var(--ease);
}
.tp-sheet-scrim.open { opacity: 1; pointer-events: auto; }

html.is-native .tp-rail.tp-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 86;
  display: block; margin: 0; gap: 0; order: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -14px 44px -18px rgba(20,30,25,0.28);
  padding: 0 14px calc(20px + env(safe-area-inset-bottom));
  max-height: calc(302px + env(safe-area-inset-bottom));
  overflow: hidden;
  transition: max-height 0.32s var(--ease), transform 0.32s var(--ease);
}
html.is-native .tp-rail.tp-sheet.open {
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
html.is-native .tp-rail.tp-sheet.dismissed {
  transform: translateY(calc(100% - 34px));
}
.tp-sheet-peek { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.tp-sheet-grip-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 30px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--forest-pill, var(--color-forest));
}
.tp-sheet-grip-btn svg { width: 22px; height: 22px; }

.tp-sheet-actions { display: flex; align-items: flex-start; justify-content: space-around; gap: 4px; padding: 8px 2px 14px; }
.tp-sheet-act {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 2px; border: 0; background: none; cursor: pointer;
  color: var(--color-forest); font-size: 0.72rem; font-weight: 700;
}
.tp-sheet-act-ic {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-full);
  background: var(--tint-green, #E8F3EC); color: var(--forest-pill, var(--color-forest));
}
.tp-sheet-act-ic svg { width: 22px; height: 22px; }

.tp-sheet-fm, .tp-sheet-tag {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  margin-top: 10px; padding: 14px; border-radius: 16px; cursor: pointer;
  border: 1px solid var(--border-soft); background: var(--card, var(--surface));
}
.tp-sheet-tag { border: 1px solid var(--border-soft); }
.tp-sheet-row-ic {
  flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--radius-full); background: var(--tint-green, #E8F3EC);
}
.tp-sheet-row-ic svg { width: 20px; height: 20px; }
.tp-sheet-row-txt { flex: 1; min-width: 0; }
.tp-sheet-row-txt b { display: block; font-size: 0.92rem; font-weight: 800; color: var(--color-forest); }
.tp-sheet-row-txt i { display: block; font-style: normal; margin-top: 2px; font-size: 0.76rem; font-weight: 600; color: color-mix(in srgb, var(--text-secondary) 80%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-sheet-row-chev { flex-shrink: 0; color: var(--muted, var(--text-tertiary)); font-size: 1.2rem; line-height: 1; }
.tp-sheet-switch {
  flex-shrink: 0; width: 44px; height: 26px; border-radius: var(--radius-full);
  background: var(--border); padding: 3px; transition: background 0.2s var(--ease);
}
.tp-sheet-switch > span { display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.2s var(--ease); }
.tp-sheet-switch.on { background: var(--forest-pill, var(--color-forest)); }
.tp-sheet-switch.on > span { transform: translateX(18px); }

html.is-native .tp-rail.tp-sheet .tp-card {
  border: 1px solid var(--border-soft); box-shadow: none; margin-bottom: 12px; padding: 16px;
}
html.is-native .tp-rail.tp-sheet .tp-card:first-of-type { margin-top: 14px; }
.tp-sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 6px; }
.tp-sheet-foot > * { flex: 1 1 44%; justify-content: center; }
html.is-native .tp-rail.tp-sheet .tp-sheet-foot #focusModeBtn { display: none; }

/* Template picker modal (sheet "Template" tool) */
.tp-tpl-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.tp-tpl-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border-soft); background: var(--surface);
}
.tp-tpl-emoji { flex-shrink: 0; font-size: 1.3rem; width: 34px; text-align: center; }
.tp-tpl-txt { min-width: 0; }
.tp-tpl-txt b { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.tp-tpl-txt i { display: block; font-style: normal; font-size: 0.78rem; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Nature-illustration header bands ---------- */
/* Each of these pages ships a decorative SVG that the desktop CSS hides
   below its breakpoint; the phone design keeps it, just smaller. */
html.is-native .cal-head-art,
html.is-native .arc-head-art,
html.is-native .recap-head-art,
html.is-native .yr-head-art {
  display: block; position: absolute; right: -6px; top: -6px;
  width: 132px; height: auto; opacity: 0.9; z-index: 0; pointer-events: none;
}
html.is-native .recap-head > *:not(.recap-head-art) { position: relative; z-index: 1; }
html.is-native .arc-head h1,
html.is-native .recap-head h1,
html.is-native .yr-head h1 { max-width: 74%; }
html.is-native .arc-head .sub,
html.is-native .recap-head p,
html.is-native .yr-head .sub { max-width: 80%; }
html.is-native[data-theme="dark"] .cal-head-art,
html.is-native[data-theme="dark"] .arc-head-art,
html.is-native[data-theme="dark"] .recap-head-art,
html.is-native[data-theme="dark"] .yr-head-art { opacity: 0.4; }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .cal-head-art,
  html.is-native:not([data-theme="light"]) .arc-head-art,
  html.is-native:not([data-theme="light"]) .recap-head-art,
  html.is-native:not([data-theme="light"]) .yr-head-art { opacity: 0.4; }
}

/* ---------- Mobile Recaps (design-ref 09-recaps) ---------- */
html.is-native .recap-head {
  position: relative; overflow: hidden;
  margin: -16px -16px 12px; padding: 16px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint-sage) 58%, var(--bg)) 0%, color-mix(in srgb, var(--tint-sage) 24%, var(--bg)) 48%, var(--bg) 85%);
}
html.is-native .recap-head .recap-head-art {
  position: absolute; right: 4px; top: 14px; width: 138px; height: auto; z-index: 0; opacity: 0.95;
  clip-path: inset(3% 14% 12% 2%);
}
html.is-native .recap-head .eyebrow {
  margin-bottom: 4px; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-forest) 55%, var(--text-tertiary));
}
html.is-native .recap-head h1 {
  display: flex; align-items: center; gap: 6px; margin: 0; max-width: 62%;
  font-family: var(--font-serif); font-size: 1.75rem; font-weight: 600; color: var(--color-forest); letter-spacing: -0.015em;
}
html.is-native .recap-head h1 svg { color: color-mix(in srgb, var(--color-forest) 55%, transparent); }
html.is-native .recap-head p { max-width: 260px; margin: 6px 0 0; font-size: 0.8rem; font-weight: 600; color: color-mix(in srgb, var(--color-forest) 58%, var(--text-secondary)); }

html.is-native .recap-tabs-row {
  display: flex; align-items: center; gap: 7px; flex-wrap: nowrap;
  background: none; border: 0; border-radius: 0; padding: 0 0 2px; margin-bottom: 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
html.is-native .recap-tabs-row::-webkit-scrollbar { display: none; }
html.is-native .recap-tabs-row .recap-tabs { flex-wrap: nowrap; gap: 6px; width: max-content; }
html.is-native .recap-tabs button {
  flex-shrink: 0; gap: 5px; padding: 7px 12px; border-radius: var(--radius-full);
  background: var(--surface); border-color: var(--border-soft); color: var(--color-forest);
  font-size: 0.76rem; font-weight: 700; white-space: nowrap;
}
html.is-native .recap-tabs button.on { background: var(--forest-pill, var(--color-forest)); color: #fff; }
html.is-native .recap-tabs button svg { width: 12px; height: 12px; }
html.is-native .recap-tabs-row .recap-yr {
  flex-shrink: 0; width: auto; margin: 0; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px;
  border-radius: var(--radius-full); background: var(--tint-purple, #efeafb); border: 0;
  font-size: 0.76rem; font-weight: 700; color: #7d73e6; white-space: nowrap;
}
html.is-native .recap-tabs-row .recap-yr[hidden] { display: none; }
html.is-native .recap-tabs-row .recap-yr svg { width: 12px; height: 12px; }
html.is-native .recap-tabs-row .recap-yr select { border: 0; background: none; font-size: 0.76rem; font-weight: 700; color: var(--color-forest); }

html.is-native .recap-glance {
  margin-bottom: 12px; padding: 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--tint-purple) 75%, var(--card, var(--surface)));
}
html.is-native .recap-glance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
html.is-native .recap-glance-head .lb { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 800; color: var(--color-forest); }
html.is-native .recap-glance-head .lb svg { color: #7d73e6; }
html.is-native .recap-glance-head .pd { text-align: right; font-size: 0.62rem; font-weight: 700; color: #7d73e6; line-height: 1.4; }
html.is-native .recap-glance-head .pd b { font-size: 0.82rem; }
html.is-native .recap-glance p { margin: 8px 0 0; font-size: 0.76rem; font-weight: 600; line-height: 1.4; color: color-mix(in srgb, var(--color-forest) 62%, var(--text-secondary)); }

html.is-native .recap-stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
html.is-native .recap-stat {
  display: block; padding: 13px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent); background: var(--card, var(--surface));
}
html.is-native .recap-stat .recap-stat-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
html.is-native .recap-stat .ic { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; font-size: 0.9rem; }
html.is-native .recap-stat .k { margin: 0; font-size: 0.56rem; font-weight: 800; letter-spacing: 0.05em; color: var(--text-tertiary); line-height: 1.2; }
html.is-native .recap-stat .v { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; color: var(--color-forest); margin-bottom: 2px; }
html.is-native .recap-stat .v.word { font-size: 1.25rem; }
html.is-native .recap-stat .up { font-size: 0.66rem; font-weight: 800; color: var(--success); margin-bottom: 2px; }
html.is-native .recap-stat .up.grey { color: var(--text-tertiary); }
html.is-native .recap-stat .u { margin: 0; font-size: 0.64rem; line-height: 1.3; color: var(--text-tertiary); }
html.is-native .recap-stat .lnk { display: none; }

html.is-native .recap-two, html.is-native .recap-two2, html.is-native .recap-two3 { display: block; margin-bottom: 0; }
html.is-native .recap-two > .recap-panel { margin-bottom: 12px; }
html.is-native .recap-panel { padding: 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent); background: var(--card, var(--surface)); }
html.is-native .recap-panel h3 { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; color: var(--color-forest); margin-bottom: 10px; }
html.is-native .recap-donut-wrap { flex-direction: column; align-items: stretch; gap: 12px; }
html.is-native .recap-donut { width: 100px; height: 100px; min-width: 100px; margin: 0 auto; }
html.is-native .recap-donut::after { background: var(--card, var(--surface)); }
html.is-native .recap-legend { display: flex; flex-direction: column; gap: 4px; }
html.is-native .recap-legend .li { display: flex; align-items: center; gap: 7px; font-size: 0.74rem; }
html.is-native .recap-legend .li .swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
html.is-native .recap-legend .li .pc { margin-left: auto; font-weight: 700; color: var(--text-tertiary); }
html.is-native .recap-chart { height: 116px; padding-left: 22px; gap: 4px; overflow: hidden; }
html.is-native .recap-chart .recap-yaxis { width: 18px; font-size: 0.56rem; }
html.is-native .recap-chart .recap-col .b { max-width: 16px; background: #a8c9a2; }
html.is-native .recap-chart .recap-col .cl { font-size: 0.56rem; }
html.is-native .recap-note[hidden] { display: none; }

html.is-native .recap-h2 { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; color: var(--color-forest); margin: 18px 0 2px; }
html.is-native .recap-insights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 0; }
html.is-native .recap-ins {
  border-radius: 16px; padding: 13px; border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--card, var(--surface));
}
html.is-native .recap-ins .recap-ins-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
html.is-native .recap-ins .ic { width: 32px; height: 32px; border-radius: 50%; font-size: 0.9rem; margin: 0; }
html.is-native .recap-ins .recap-ins-top .chev { color: var(--muted, var(--text-tertiary)); font-size: 1.05rem; line-height: 1; }
html.is-native .recap-ins h4 { font-family: var(--font-sans); font-size: 0.86rem; font-weight: 800; color: var(--color-forest); margin-bottom: 3px; }
html.is-native .recap-ins p { font-size: 0.68rem; line-height: 1.32; color: var(--text-tertiary); margin: 0; }

html.is-native .recap-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0 0; }
html.is-native .recap-chip { padding: 7px 12px; border-radius: var(--radius-full); font-size: 0.76rem; font-weight: 800; text-decoration: none; }
html.is-native .recap-chip.tint-green  { background: var(--tint-green);  color: var(--color-forest); }
html.is-native .recap-chip.tint-yellow { background: var(--tint-yellow); color: #c99a3a; }
html.is-native .recap-chip.tint-blue   { background: var(--tint-blue);   color: #5b9bd4; }
html.is-native .recap-chip.tint-pink   { background: var(--tint-pink);   color: #d06b86; }
html.is-native .recap-chip.tint-purple { background: var(--tint-purple); color: #7d73e6; }
html.is-native .recap-chip.tint-peach  { background: var(--tint-peach);  color: #ef8f68; }
html.is-native .recap-chip-more { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-soft); color: var(--color-forest); font-weight: 700; text-decoration: none; }

html.is-native .recap-panel .recap-trow { font-size: 0.78rem; padding: 6px 0; gap: 9px; }
html.is-native .recap-panel .recap-trow .em { width: 10px; display: flex; align-items: center; justify-content: center; }
html.is-native .recap-panel .recap-trow .em .recap-dot-sm { width: 8px; height: 8px; border-radius: 50%; display: block; }
html.is-native .recap-panel .recap-trow .tg { width: 76px; font-weight: 700; color: var(--color-forest); }
html.is-native .recap-panel .recap-trow .n { width: 52px; font-size: 0.66rem; }
html.is-native .recap-panel .recap-plink { margin-top: 10px; font-size: 0.74rem; font-weight: 800; color: var(--forest-pill, var(--color-forest)); }
html.is-native .recap-quote { margin-top: 18px; margin-bottom: 4px; }

html.is-native[data-theme="dark"] .recap-head { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .recap-head h1,
html.is-native[data-theme="dark"] .recap-h2,
html.is-native[data-theme="dark"] .recap-panel h3,
html.is-native[data-theme="dark"] .recap-stat .v,
html.is-native[data-theme="dark"] .recap-ins h4 { color: #7FB98F; }
html.is-native[data-theme="dark"] .recap-stat,
html.is-native[data-theme="dark"] .recap-panel,
html.is-native[data-theme="dark"] .recap-ins { background: rgba(255,255,255,0.05); }
html.is-native[data-theme="dark"] .recap-glance { background: rgba(255,255,255,0.07); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .recap-head { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .recap-head h1,
  html.is-native:not([data-theme="light"]) .recap-h2,
  html.is-native:not([data-theme="light"]) .recap-panel h3,
  html.is-native:not([data-theme="light"]) .recap-stat .v,
  html.is-native:not([data-theme="light"]) .recap-ins h4 { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .recap-stat,
  html.is-native:not([data-theme="light"]) .recap-panel,
  html.is-native:not([data-theme="light"]) .recap-ins { background: rgba(255,255,255,0.05); }
  html.is-native:not([data-theme="light"]) .recap-glance { background: rgba(255,255,255,0.07); }
}

/* ---------- Mobile Year View (design-ref 06-yearview) ---------- */
html.is-native .yr-head {
  position: relative; overflow: hidden; min-height: 0;
  margin: -16px -16px 14px; padding: 18px 18px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(150deg, color-mix(in srgb, var(--tint-sage) 62%, var(--bg)) 0%, color-mix(in srgb, var(--tint-sage) 26%, var(--bg)) 46%, var(--bg) 84%);
}
html.is-native .yr-head > *:not(.yr-head-art) { position: relative; z-index: 1; }
html.is-native .yr-head .yr-head-art { position: absolute; z-index: 0; left: auto; width: 100px; right: -14px; top: -12px; opacity: 0.55; }
html.is-native .yr-eyebrow {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-forest) 55%, var(--text-tertiary));
}
html.is-native .yr-head h1 {
  font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; line-height: 1.12;
  margin: 5px 0 0; color: var(--color-forest); letter-spacing: -0.015em; max-width: 84%;
  display: flex; align-items: baseline; gap: 8px;
}
html.is-native .yr-head h1 svg { width: 22px; height: 16px; flex-shrink: 0; align-self: center; }
html.is-native .yr-head .sub { margin-top: 7px; max-width: 250px; font-size: 0.84rem; font-weight: 600; color: color-mix(in srgb, var(--color-forest) 58%, var(--text-secondary)); }

html.is-native .yr-controls {
  display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 6px;
  margin-bottom: 14px; padding: 0 2px;
}
html.is-native .yr-controls .arc-pick {
  min-width: 0; flex-shrink: 1; padding: 6px 9px; gap: 4px; font-size: 0.72rem;
}
html.is-native .yr-controls .arc-pick select { font-size: 0.72rem; min-width: 0; }
html.is-native .yr-controls .arc-pick .ic svg { width: 13px; height: 13px; }
html.is-native .yr-controls .yr-seg { width: auto; margin-left: auto; flex-shrink: 0; padding: 3px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border-soft); }
html.is-native .yr-controls .yr-seg button { padding: 6px 10px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; color: var(--text-tertiary); }
html.is-native .yr-controls .yr-seg button.on { background: var(--forest-pill, var(--color-forest)); color: #fff; }

html.is-native .yr-stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
html.is-native .yr-stat {
  display: block; padding: 13px; border-radius: 16px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--card, var(--surface));
}
html.is-native .yr-stat .yr-sprig { display: none; }
html.is-native .yr-stat-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
html.is-native .yr-stat .ic { width: 30px; height: 30px; font-size: 0.88rem; flex-shrink: 0; }
html.is-native .yr-stat .ic.y1 { background: var(--tint-green); }
html.is-native .yr-stat .ic.y2 { background: var(--tint-peach); }
html.is-native .yr-stat .ic.y3 { background: var(--tint-pink); }
html.is-native .yr-stat .ic.y4 { background: var(--tint-yellow); }
html.is-native .yr-stat .k { margin: 0; font-size: 0.58rem; letter-spacing: 0.05em; font-weight: 800; color: var(--text-tertiary); line-height: 1.2; }
html.is-native .yr-stat .v { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 600; color: var(--color-forest); margin-bottom: 3px; letter-spacing: -0.01em; }
html.is-native .yr-stat .u { font-size: 0.68rem; line-height: 1.32; color: color-mix(in srgb, var(--text-tertiary) 92%, transparent); }
html.is-native .yr-stat .yr-pbar { margin-top: 9px; height: 5px; }

html.is-native .yr-heat {
  padding: 14px 12px; border-radius: 16px; margin-bottom: 14px; overflow: hidden;
  background: var(--card, var(--surface)); border: 1px solid color-mix(in srgb, var(--color-forest) 7%, transparent);
}
/* Native heatmap: one scrolling row, each month's name sitting directly on top
   of that month's own week columns. */
html.is-native .yr-heat .yr-grid-wrap {
  display: flex; align-items: flex-start; gap: 6px; width: auto;
  overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px;
}
html.is-native .yr-heat .yr-daylabels { display: flex; flex-direction: column; gap: 2px; width: 24px; flex-shrink: 0; padding-top: 0; }
html.is-native .yr-heat .yr-daylabels .sp { height: 13px; }
html.is-native .yr-heat .yr-daylabels span { font-size: 0.52rem; height: 8px; line-height: 8px; }
html.is-native .yr-heat .yr-mrow { display: flex; gap: 7px; margin: 0 !important; width: max-content; }
html.is-native .yr-heat .yr-mgroup {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex-shrink: 0;
}
html.is-native .yr-heat .yr-mname {
  height: 10px; line-height: 10px; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--color-forest) 62%, var(--text-tertiary));
}
html.is-native .yr-heat .yr-mweeks { display: flex; gap: 2px; }
html.is-native .yr-heat .yr-week { gap: 2px; }
html.is-native .yr-heat .yr-cell { width: 8px; height: 8px; border-radius: 2px; }
html.is-native .yr-heat .yr-legend { gap: 6px 12px; margin-top: 14px; font-size: 0.62rem; justify-content: flex-start; flex-wrap: wrap; }
html.is-native .yr-heat .yr-legend i { width: 8px; height: 8px; }

html.is-native .yr-story {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  position: relative; overflow: hidden; cursor: pointer;
  margin: 0 0 14px; padding: 14px 16px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: color-mix(in srgb, var(--tint-sage) 78%, var(--card, var(--surface)));
}
html.is-native .yr-story-ic { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.55); }
html.is-native .yr-story-ic svg { width: 22px; height: 22px; }
html.is-native .yr-story-txt { flex: 1; min-width: 0; }
html.is-native .yr-story-txt b { display: block; font-family: var(--font-serif); font-size: 1.02rem; font-weight: 600; color: var(--color-forest); }
html.is-native .yr-story-txt i { display: block; font-style: normal; margin-top: 3px; font-size: 0.76rem; font-weight: 600; line-height: 1.36; color: color-mix(in srgb, var(--color-forest) 60%, var(--text-secondary)); }
html.is-native .yr-story-link { position: relative; z-index: 1; flex-shrink: 0; align-self: flex-start; font-size: 0.7rem; font-weight: 800; color: var(--forest-pill, var(--color-forest)); }
html.is-native .yr-story-sprig { position: absolute; right: -8px; bottom: -10px; width: 62px; height: auto; opacity: 0.55; pointer-events: none; }

html.is-native .yr-trio { grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
html.is-native .yr-trio .yr-panel { padding: 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent); background: var(--card, var(--surface)); }
html.is-native .yr-trio .yr-panel:nth-child(3) { grid-column: 1 / -1; }
html.is-native .yr-panel h3 { font-size: 0.9rem; font-weight: 800; color: var(--color-forest); margin-bottom: 2px; }
html.is-native .yr-panel .psub { font-size: 0.66rem; margin-bottom: 12px; }
html.is-native .yr-plink { display: inline-flex; margin-top: 10px; font-size: 0.74rem; font-weight: 800; color: var(--color-forest); }
html.is-native .yr-donut-row { flex-direction: column; align-items: stretch; gap: 12px; }
html.is-native .yr-donut { width: 92px; height: 92px; margin: 0 auto; }
html.is-native .yr-dlegend { display: flex; flex-direction: column; gap: 4px; }
html.is-native .yr-dlegend .li { font-size: 0.72rem; gap: 6px; }
html.is-native .yr-dlegend .li .swatch { width: 9px; height: 9px; }
html.is-native .yr-hi { gap: 9px; padding: 6px 0; align-items: center; }
html.is-native .yr-hi .th { width: 32px; height: 32px; border-radius: 9px; }
html.is-native .yr-hi .d { font-size: 0.58rem; letter-spacing: 0.04em; margin-bottom: 1px; }
html.is-native .yr-hi .ti { font-size: 0.76rem; font-weight: 800; margin-bottom: 0; }
html.is-native .yr-hi .ex { display: none; }
html.is-native .yr-hi .star { font-size: 0.9rem; }

html.is-native[data-theme="dark"] .yr-head { background: var(--surface-muted); }
html.is-native[data-theme="dark"] .yr-head h1,
html.is-native[data-theme="dark"] .yr-stat .v,
html.is-native[data-theme="dark"] .yr-panel h3,
html.is-native[data-theme="dark"] .yr-story-txt b { color: #7FB98F; }
html.is-native[data-theme="dark"] .yr-stat,
html.is-native[data-theme="dark"] .yr-heat,
html.is-native[data-theme="dark"] .yr-trio .yr-panel { background: rgba(255,255,255,0.05); }
html.is-native[data-theme="dark"] .yr-story { background: rgba(255,255,255,0.06); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .yr-head { background: var(--surface-muted); }
  html.is-native:not([data-theme="light"]) .yr-head h1,
  html.is-native:not([data-theme="light"]) .yr-stat .v,
  html.is-native:not([data-theme="light"]) .yr-panel h3,
  html.is-native:not([data-theme="light"]) .yr-story-txt b { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .yr-stat,
  html.is-native:not([data-theme="light"]) .yr-heat,
  html.is-native:not([data-theme="light"]) .yr-trio .yr-panel { background: rgba(255,255,255,0.05); }
  html.is-native:not([data-theme="light"]) .yr-story { background: rgba(255,255,255,0.06); }
}

/* ---------- Native dark: tame the hard-coded decorative colours ---------- */
html.is-native[data-theme="dark"] .arc-stat .ic,
html.is-native[data-theme="dark"] .cal-seal,
html.is-native[data-theme="dark"] .tp-ed-badge,
html.is-native[data-theme="dark"] .feature-icon { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
html.is-native[data-theme="dark"] .tp-day-photo,
html.is-native[data-theme="dark"] .tp-prompt { background: var(--surface-muted); background-image: none; }
html.is-native[data-theme="dark"] .tp-prompt .txt,
html.is-native[data-theme="dark"] .tp-prompt .q { color: var(--text-primary); }
html.is-native[data-theme="dark"] .tp-btn-shuffle,
html.is-native[data-theme="dark"] .tp-btn-x,
html.is-native[data-theme="dark"] .tp-round-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); color: var(--text-secondary); }
html.is-native[data-theme="dark"] .hub-views,
html.is-native[data-theme="dark"] .hub-views button { background: var(--surface); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .arc-stat .ic,
  html.is-native:not([data-theme="light"]) .cal-seal,
  html.is-native:not([data-theme="light"]) .tp-ed-badge,
  html.is-native:not([data-theme="light"]) .feature-icon { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
  html.is-native:not([data-theme="light"]) .tp-day-photo,
  html.is-native:not([data-theme="light"]) .tp-prompt { background: var(--surface-muted); background-image: none; }
  html.is-native:not([data-theme="light"]) .tp-prompt .txt,
  html.is-native:not([data-theme="light"]) .tp-prompt .q { color: var(--text-primary); }
  html.is-native:not([data-theme="light"]) .tp-btn-shuffle,
  html.is-native:not([data-theme="light"]) .tp-btn-x,
  html.is-native:not([data-theme="light"]) .tp-round-btn { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); color: var(--text-secondary); }
  html.is-native:not([data-theme="light"]) .hub-views,
  html.is-native:not([data-theme="light"]) .hub-views button { background: var(--surface); }
}

/* ---------- Mobile Time Capsules (design-ref 12-timecapsules) ---------- */
html.is-native .cap-head-wrap { position: relative; overflow: hidden; margin: -16px -16px 12px; padding: 16px 18px 14px; }
html.is-native .cap-head-wrap .cap-plane { display: none; }
html.is-native .cap-head-wrap .cap-capsule-art {
  position: absolute; right: -12px; top: -2px; width: 146px; height: auto; opacity: 0.96; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
html.is-native .cap-page-head { display: block; margin: 0; }
html.is-native .cap-page-head > div { position: relative; z-index: 1; }
html.is-native .cap-page-head h1 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-family: var(--font-serif); font-size: 1.85rem; font-weight: 600; color: var(--color-forest); letter-spacing: -0.015em;
}
html.is-native .cap-page-head h1 .sp { font-size: 1rem; }
html.is-native .cap-page-head .page-sub { max-width: 250px; font-size: 0.8rem; font-weight: 600; color: color-mix(in srgb, var(--color-forest) 58%, var(--text-secondary)); }
html.is-native .cap-page-head #newCapsule {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 70%; margin-top: 14px; padding: 13px 18px; border-radius: var(--radius-full);
  background: var(--forest-pill, var(--color-forest)); color: #fff; border: 0;
  font-family: var(--font-sans); font-size: 0.98rem; font-weight: 800;
  box-shadow: 0 10px 20px -8px rgba(46,100,81,0.5);
}

html.is-native .cap-banner {
  position: relative; overflow: hidden; z-index: 1; gap: 10px;
  margin: 12px 0 0; padding: 13px 62px 13px 16px; max-width: none; border-radius: 16px;
  background: color-mix(in srgb, var(--tint-green) 72%, var(--card, var(--surface)));
  font-size: 0.82rem; font-weight: 700; color: var(--color-forest);
}
html.is-native .cap-banner .lk { color: var(--color-forest); flex-shrink: 0; }
html.is-native .cap-banner::after {
  content: ""; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 54px; height: 54px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none'%3E%3Cpath d='M8 44C18 36 28 24 36 8' stroke='%237f9d6f' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M36 8c-11 2-19 10-21 24 11 0 19-8 21-24z' fill='%239cbd86'/%3E%3Cpath d='M36 8c2 11 8 18 21 20 0-11-8-18-21-20z' fill='%23bcd4a8'/%3E%3C/svg%3E");
  opacity: 0.55; pointer-events: none;
}

html.is-native .cap-sec-head { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 20px 0 10px; }
html.is-native .cap-sec-head h2 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; color: var(--color-forest); gap: 8px; }
html.is-native .cap-count { background: color-mix(in srgb, var(--color-forest) 10%, transparent); border: 0; color: var(--color-forest); font-weight: 800; font-size: 0.7rem; }
html.is-native .cap-sec-tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
html.is-native .cap-sec-tools::-webkit-scrollbar { display: none; }
html.is-native .cap-seg { flex: 0 0 auto; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-forest) 7%, transparent); border: 1px solid var(--border-soft); padding: 3px; }
html.is-native .cap-seg button { flex: 0 0 auto; padding: 5px 9px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; color: var(--color-forest); background: none; border: 0; white-space: nowrap; }
html.is-native .cap-seg button.on { background: var(--forest-pill, var(--color-forest)); color: #fff; }
html.is-native .cap-seg button .n { font-weight: 700; opacity: 0.75; }
html.is-native .cap-sec-tools .hub-sel {
  flex: 0 0 auto; padding: 6px 9px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border-soft); font-size: 0.7rem; font-weight: 700; color: var(--color-forest); white-space: nowrap;
}
html.is-native .cap-sec-tools .hub-sel select { font-size: 0.7rem; font-weight: 700; color: var(--color-forest); }
html.is-native .cap-sec-tools .hub-views { flex: 0 0 auto; border-radius: var(--radius-full); background: var(--surface); border-color: var(--border-soft); }
html.is-native .cap-sec-tools .hub-views button { width: 28px; height: 28px; }
html.is-native .cap-sec-tools .hub-views button.on { background: var(--tint-green); color: var(--color-forest); }

html.is-native .cap-cards { grid-template-columns: 1fr; gap: 12px; }
/* Row layout: envelope thumb left, content right, colour foot spanning below. */
html.is-native .cap-cards .cap-card {
  display: grid; grid-template-columns: 128px 1fr; grid-template-areas: "thumb body" "foot foot";
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 8px 20px -14px rgba(46,100,81,0.28);
  border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent); background: var(--card, var(--surface));
}
html.is-native .cap-cards .cap-card .cap-top {
  grid-area: thumb; width: 116px; height: 96px; min-height: 0; margin: 12px 0 12px 12px;
  border-radius: 12px; overflow: hidden;
}
html.is-native .cap-cards .cap-card .cap-seal { left: 58px; top: 54px; width: 34px; height: 34px; box-shadow: 0 3px 8px rgba(40,35,15,0.22); }
html.is-native .cap-cards .cap-card .cap-status {
  top: 6px; left: 6px; font-size: 0.52rem; padding: 3px 6px; gap: 3px; max-width: 106px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.is-native .cap-cards .cap-card .cap-badges-extra,
html.is-native .cap-cards .cap-card .cap-media-view,
html.is-native .cap-cards .cap-card .cap-open-row,
html.is-native .cap-cards .cap-card .cap-archived-flag { display: none; }
html.is-native .cap-cards .cap-card .cap-body { grid-area: body; align-self: center; padding: 12px 14px 12px 12px; }
html.is-native .cap-cards .cap-card .cap-body h3 {
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 700; color: var(--color-forest);
  margin-bottom: 5px; gap: 6px; align-items: center;
}
html.is-native .cap-cards .cap-card .cap-body h3 .cap-chev { margin-left: auto; color: var(--muted, var(--text-tertiary)); font-size: 1.05rem; line-height: 1; }
html.is-native .cap-cards .cap-card .cap-body p {
  font-size: 0.78rem; line-height: 1.4; color: color-mix(in srgb, var(--color-forest) 55%, var(--text-secondary));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
html.is-native .cap-cards .cap-card .cap-foot {
  grid-area: foot; padding: 7px 14px; border-top: 0;
  flex-direction: row; align-items: center; justify-content: space-between; width: auto; text-align: left;
}
html.is-native .cap-cards .cap-card .cap-foot > div:first-child { display: flex; flex-direction: column; }
html.is-native .cap-cards .cap-card .cap-foot .lbl { font-size: 0.62rem; }
html.is-native .cap-cards .cap-card .cap-foot .dt { font-size: 0.86rem; font-weight: 800; }
html.is-native .cap-cards .cap-card .cap-foot .cap-foot-icon { display: block; opacity: 0.5; width: 24px; height: auto; margin: 0; }

html.is-native .cap-letter { display: none; }
html.is-native .cap-quote { margin-top: 16px; }

html.is-native[data-theme="dark"] .cap-page-head h1,
html.is-native[data-theme="dark"] .cap-sec-head h2,
html.is-native[data-theme="dark"] .cap-cards .cap-card .cap-body h3 { color: #7FB98F; }
html.is-native[data-theme="dark"] .cap-cards .cap-card { background: rgba(255,255,255,0.05); }
@media (prefers-color-scheme: dark) {
  html.is-native:not([data-theme="light"]) .cap-page-head h1,
  html.is-native:not([data-theme="light"]) .cap-sec-head h2,
  html.is-native:not([data-theme="light"]) .cap-cards .cap-card .cap-body h3 { color: #7FB98F; }
  html.is-native:not([data-theme="light"]) .cap-cards .cap-card { background: rgba(255,255,255,0.05); }
}

/* ---------- Resource Hub (design ref 16 — marketing shell reached from the drawer) ---------- */
html.is-native #site-footer { display: none; }
html.is-native .site-header.is-native-mkt {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
html.is-native .site-header.is-native-mkt .brand { font-family: var(--font-wordmark, var(--font-serif)); font-weight: 800; font-size: 1.18rem; color: var(--color-forest); gap: 9px; }
html.is-native .site-header.is-native-mkt .brand-mark { width: 34px; height: 34px; font-size: 0.7rem; }
html.is-native .site-header.is-native-mkt .mkt-head-actions { display: flex; align-items: center; gap: 10px; }
html.is-native .site-header.is-native-mkt .mkt-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--tint-green); color: var(--color-forest); font-weight: 800; font-size: 0.8rem; text-decoration: none;
}
html.is-native .site-header.is-native-mkt .mkt-menu {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft); background: var(--surface); color: var(--color-forest);
}

html.is-native #main-content .section { padding-top: 14px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
html.is-native #main-content .container { padding-left: 16px; padding-right: 16px; }

/* Hero */
html.is-native .hub-head { padding: 4px 0 14px; }
html.is-native .hub-head h1 {
  position: relative; z-index: 1;
  font-family: var(--font-serif); font-size: 1.95rem; font-weight: 600;
  color: var(--color-forest); letter-spacing: -0.02em; margin-bottom: 8px; max-width: 62%;
}
html.is-native .hub-head h1 span { font-size: 1.05rem; }
html.is-native .hub-head p { position: relative; z-index: 1; max-width: 54%; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 16px; }
html.is-native .hub-art { display: none; }
html.is-native .hub-head .hub-art-photo {
  display: block; position: absolute; right: -14px; top: -12px; width: 150px; height: auto;
  pointer-events: none; opacity: 0.95;
}
html.is-native .hub-search { max-width: none; margin-top: 2px; }
html.is-native .hub-search input {
  padding: 14px 16px 14px 44px; border-radius: 16px;
  border: 1px solid var(--border-soft); background: var(--surface); font-size: 0.9rem;
}
html.is-native .hub-search .mg { left: 16px; color: var(--color-forest); }

/* Panels stripped back to bare sections */
html.is-native .hub-panel { background: none; border: 0; padding: 0; margin-bottom: 20px; }
html.is-native .hub-panel:first-of-type .hub-panel-head,
html.is-native .hub-panel:first-of-type .hub-panel-sub { display: none; }
html.is-native .hub-panel + .hub-panel .hub-panel-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-family: var(--font-serif); font-size: 1.28rem; font-weight: 600; color: var(--color-forest);
}
html.is-native .hub-panel + .hub-panel .hub-panel-head::after {
  content: "›"; margin-left: 2px; color: var(--muted, var(--text-tertiary)); font-size: 1.2rem; font-weight: 400;
}
html.is-native .hub-panel + .hub-panel .hub-panel-sub { display: none; }

/* Featured card — horizontal, sage wash */
html.is-native .feat-row { display: block; }
html.is-native .feat-card.feat-native {
  display: grid; grid-template-columns: 1fr 116px; gap: 12px; align-items: center;
  min-height: 0; padding: 15px; border-radius: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tint-green) 80%, var(--card)) 0%, color-mix(in srgb, var(--tint-blue) 45%, var(--card)) 100%);
}
html.is-native .feat-card.feat-native .feat-native-body { min-width: 0; }
html.is-native .feat-card.feat-native .tag {
  display: inline-block; margin-bottom: 9px; padding: 4px 10px; border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-forest) 16%, transparent); color: var(--color-forest);
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.09em;
}
html.is-native .feat-card.feat-native h3 {
  max-width: 100%; margin-bottom: 7px; font-family: var(--font-serif); font-size: 1.12rem;
  font-weight: 600; line-height: 1.24; color: var(--color-forest);
}
html.is-native .feat-card.feat-native p {
  max-width: 100%; margin-bottom: 10px; font-size: 0.76rem; line-height: 1.45;
  color: color-mix(in srgb, var(--color-forest) 62%, var(--text-secondary));
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
html.is-native .feat-card.feat-native .meta {
  position: static; max-width: 100%; font-size: 0.68rem;
  color: color-mix(in srgb, var(--color-forest) 55%, var(--text-secondary));
}
html.is-native .feat-card.feat-native .feat-card-art {
  position: static; width: 116px; height: 116px; margin: 0;
  border-radius: 14px; box-shadow: 0 10px 22px -12px rgba(46,100,81,0.4);
}

/* Browse by topic — horizontal scroll of tinted tiles */
html.is-native .topics {
  display: flex; gap: 9px; grid-template-columns: none;
  overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px;
}
html.is-native .topics::-webkit-scrollbar { display: none; }
html.is-native .topic-btn {
  flex: 0 0 auto; width: 92px; padding: 14px 8px 12px; border-radius: 16px;
  border: 0; background: var(--tint-green); color: var(--color-forest);
  font-size: 0.7rem; font-weight: 700; line-height: 1.2;
}
html.is-native .topic-btn .em { font-size: 1.3rem; margin-bottom: 8px; }
html.is-native .topic-btn:nth-child(5n+2) { background: var(--tint-purple); color: #7d73e6; }
html.is-native .topic-btn:nth-child(5n+3) { background: var(--tint-blue); color: #5b9bd4; }
html.is-native .topic-btn:nth-child(5n+4) { background: var(--tint-peach, var(--tint-yellow)); color: #c9803f; }
html.is-native .topic-btn:nth-child(5n+5) { background: var(--tint-purple); color: #7d73e6; }
html.is-native .topic-btn.on { outline: 2px solid color-mix(in srgb, var(--color-forest) 40%, transparent); outline-offset: 1px; }

/* Filter row */
html.is-native .hub-filters { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 14px; }
html.is-native .hub-filters .hub-sel {
  flex: 1; min-width: 0; justify-content: space-between;
  border-radius: var(--radius-full); border: 1px solid var(--border-soft);
  background: var(--surface); padding: 9px 13px; font-size: 0.76rem; font-weight: 700; color: var(--color-forest);
}
html.is-native .hub-filters .hub-sel select { font-size: 0.76rem; font-weight: 700; color: var(--color-forest); flex: 1; }
html.is-native .hub-filters .right { flex: 1; gap: 8px; }
html.is-native .hub-filters .right .hub-sel { flex: 1; }
html.is-native .hub-filters .hub-views { display: none; }

/* Article cards — text left, thumb + bookmark right */
html.is-native .hub-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
html.is-native .hub-grid .hub-card {
  display: grid; grid-template-columns: 1fr 118px; gap: 0; align-items: stretch;
  border-radius: 18px; border: 1px solid color-mix(in srgb, var(--color-forest) 8%, transparent);
  background: var(--card, var(--surface)); overflow: hidden;
}
html.is-native .hub-grid .hub-card-body { padding: 13px 12px 13px 14px; }
html.is-native .hub-grid .hub-chip {
  margin-bottom: 7px; padding: 3px 9px; font-size: 0.56rem; letter-spacing: 0.07em; border-radius: var(--radius-full);
}
html.is-native .hub-grid .hub-card h4 {
  margin-bottom: 6px; font-family: var(--font-serif); font-size: 0.98rem; font-weight: 600;
  line-height: 1.22; color: var(--color-forest);
}
html.is-native .hub-grid .hub-card p {
  margin-bottom: 9px; font-size: 0.74rem; line-height: 1.4; color: color-mix(in srgb, var(--color-forest) 52%, var(--text-secondary));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
html.is-native .hub-grid .hub-card .meta { font-size: 0.66rem; color: color-mix(in srgb, var(--color-forest) 50%, var(--text-secondary)); }
html.is-native .hub-grid .hub-thumb { position: relative; height: auto; min-height: 118px; }
html.is-native .hub-grid .hub-thumb img { width: 100%; height: 100%; object-fit: cover; }
html.is-native .hub-bookmark {
  position: absolute; right: 9px; bottom: 9px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--color-forest); box-shadow: 0 3px 9px -2px rgba(40,35,15,0.3);
}

/* Newsletter block isn't in the ref */
html.is-native .hub-news { display: none; }
