:root {
  /* Default: Turquoise + Simple */
  --bg: #e8f1f0;
  --bg-wash: #ddeae8;
  --bg-panel: #0a1a1c;
  --bg-panel-2: #061214;
  --surface: #f3f9f8;
  --surface-raised: #fbfdfe;
  --ink: #0d1f22;
  --muted: #5a7270;
  --accent: #1f8f89;
  --accent-bright: #2aa9a2;
  --accent-soft: rgba(31, 143, 137, 0.12);
  --clay: #c47d5a;
  --clay-bright: #d4926e;
  --clay-soft: rgba(196, 125, 90, 0.12);
  --dusk: #2a5660;
  --dusk-bright: #3a6d79;
  --dusk-soft: rgba(42, 86, 96, 0.12);
  --line: rgba(13, 31, 34, 0.08);
  --danger: #a33d3d;
  --wash-1: rgba(31, 143, 137, 0.08);
  --wash-2: rgba(196, 125, 90, 0.05);
  --wash-3: rgba(42, 86, 96, 0.05);
  --sidebar-glow: rgba(42, 169, 162, 0.18);
  --sidebar-fg: #e8f6f5;
  --sidebar-muted: rgba(232, 246, 245, 0.5);
  --sidebar-link: rgba(232, 246, 245, 0.68);
  --topbar-bg: rgba(243, 249, 248, 0.93);
  --nav-bg: rgba(243, 249, 248, 0.97);
  --btn-on-accent: #fff;
  --radius: 4px 20px 20px 20px;
  --radius-sm: 3px 12px 12px 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 8px 28px rgba(13, 31, 34, 0.05);
  --shadow-lift: 0 14px 36px rgba(13, 31, 34, 0.09);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --sidebar: 264px;
  --topbar-h: 64px;
  --bottom-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Breakpoint ladder (media queries cannot read these vars; they document the
   scale used throughout this file):
   360  extra-small phones
   720  phone / tablet  (max-width: 719 / min-width: 720)
   900  tablet / desktop (max-width: 899 / min-width: 900)
   1100 wide desktop     (max-width: 1099 / min-width: 1100)
*/

/* Theme: Violet */
html[data-theme="violet"] {
  --bg: #ece6f4;
  --bg-wash: #e3dae9;
  --bg-panel: #140c1f;
  --bg-panel-2: #0e0816;
  --surface: #f7f2fb;
  --surface-raised: #fcfaff;
  --ink: #140c1f;
  --muted: #655873;
  --accent: #684099;
  --accent-bright: #7e52b6;
  --accent-soft: rgba(104, 64, 153, 0.12);
  --clay: #b03c76;
  --clay-bright: #c94f8b;
  --clay-soft: rgba(176, 60, 118, 0.12);
  --dusk: #3a2866;
  --dusk-bright: #4f3d98;
  --dusk-soft: rgba(58, 40, 102, 0.12);
  --line: rgba(20, 12, 31, 0.09);
  --danger: #942845;
  --wash-1: rgba(104, 64, 153, 0.08);
  --wash-2: rgba(176, 60, 118, 0.06);
  --wash-3: rgba(58, 40, 102, 0.055);
  --sidebar-glow: rgba(126, 82, 182, 0.24);
  --sidebar-fg: #f4ecff;
  --sidebar-muted: rgba(244, 236, 255, 0.5);
  --sidebar-link: rgba(244, 236, 255, 0.68);
  --topbar-bg: rgba(247, 242, 251, 0.92);
  --nav-bg: rgba(247, 242, 251, 0.96);
  --btn-on-accent: #fff;
  --shadow-soft: 0 10px 32px rgba(20, 12, 31, 0.07);
  --shadow-lift: 0 16px 42px rgba(20, 12, 31, 0.12);
}

/* Theme: Black */
html[data-theme="black"] {
  --bg: #0a0a0a;
  --bg-wash: #121212;
  --bg-panel: #050505;
  --bg-panel-2: #000000;
  --surface: #151515;
  --surface-raised: #1c1c1c;
  --ink: #f3f1eb;
  --muted: #9c988e;
  --accent: #e6e0d4;
  --accent-bright: #fff9ef;
  --accent-soft: rgba(230, 224, 212, 0.11);
  --clay: #c99a1c;
  --clay-bright: #dfb12a;
  --clay-soft: rgba(201, 154, 28, 0.14);
  --dusk: #8a9bf5;
  --dusk-bright: #a6b4ff;
  --dusk-soft: rgba(138, 155, 245, 0.12);
  --line: rgba(243, 241, 235, 0.09);
  --danger: #ff7b7b;
  --wash-1: rgba(230, 224, 212, 0.04);
  --wash-2: rgba(201, 154, 28, 0.05);
  --wash-3: rgba(138, 155, 245, 0.04);
  --sidebar-glow: rgba(230, 224, 212, 0.07);
  --sidebar-fg: #f3f1eb;
  --sidebar-muted: rgba(243, 241, 235, 0.46);
  --sidebar-link: rgba(243, 241, 235, 0.64);
  --topbar-bg: rgba(18, 18, 18, 0.94);
  --nav-bg: rgba(12, 12, 12, 0.96);
  --btn-on-accent: #0a0a0a;
  --shadow-soft: 0 10px 36px rgba(0, 0, 0, 0.38);
  --shadow-lift: 0 18px 48px rgba(0, 0, 0, 0.48);
}

/* Theme: Pink */
html[data-theme="pink"] {
  --bg: #f6e9ef;
  --bg-wash: #efdde6;
  --bg-panel: #2a101c;
  --bg-panel-2: #1a0a12;
  --surface: #fbf2f6;
  --surface-raised: #fff8fb;
  --ink: #2a101c;
  --muted: #7a5a68;
  --accent: #c24a7a;
  --accent-bright: #d65f8e;
  --accent-soft: rgba(194, 74, 122, 0.12);
  --clay: #d4784a;
  --clay-bright: #e48d62;
  --clay-soft: rgba(212, 120, 74, 0.12);
  --dusk: #6b3a5c;
  --dusk-bright: #855072;
  --dusk-soft: rgba(107, 58, 92, 0.12);
  --line: rgba(42, 16, 28, 0.09);
  --danger: #a32d4a;
  --wash-1: rgba(194, 74, 122, 0.09);
  --wash-2: rgba(212, 120, 74, 0.06);
  --wash-3: rgba(107, 58, 92, 0.05);
  --sidebar-glow: rgba(214, 95, 142, 0.22);
  --sidebar-fg: #ffeaf2;
  --sidebar-muted: rgba(255, 234, 242, 0.5);
  --sidebar-link: rgba(255, 234, 242, 0.68);
  --topbar-bg: rgba(251, 242, 246, 0.93);
  --nav-bg: rgba(251, 242, 246, 0.97);
  --btn-on-accent: #fff;
  --shadow-soft: 0 10px 32px rgba(42, 16, 28, 0.07);
  --shadow-lift: 0 16px 42px rgba(42, 16, 28, 0.12);
}

/* Theme: Transformative Teal */
html[data-theme="xteal"] {
  --bg: #dceeed;
  --bg-wash: #cfe4e3;
  --bg-panel: #042f2e;
  --bg-panel-2: #021f1e;
  --surface: #eef7f6;
  --surface-raised: #f7fcfb;
  --ink: #042f2e;
  --muted: #4a6e6c;
  --accent: #0d7370;
  --accent-bright: #14918d;
  --accent-soft: rgba(13, 115, 112, 0.12);
  --clay: #e07a3a;
  --clay-bright: #ef8f52;
  --clay-soft: rgba(224, 122, 58, 0.12);
  --dusk: #1a4d5c;
  --dusk-bright: #2a6475;
  --dusk-soft: rgba(26, 77, 92, 0.12);
  --line: rgba(4, 47, 46, 0.09);
  --danger: #a33d3d;
  --wash-1: rgba(13, 115, 112, 0.1);
  --wash-2: rgba(224, 122, 58, 0.06);
  --wash-3: rgba(26, 77, 92, 0.05);
  --sidebar-glow: rgba(20, 145, 141, 0.22);
  --sidebar-fg: #e6faf8;
  --sidebar-muted: rgba(230, 250, 248, 0.5);
  --sidebar-link: rgba(230, 250, 248, 0.68);
  --topbar-bg: rgba(238, 247, 246, 0.93);
  --nav-bg: rgba(238, 247, 246, 0.97);
  --btn-on-accent: #fff;
  --shadow-soft: 0 10px 32px rgba(4, 47, 46, 0.07);
  --shadow-lift: 0 16px 42px rgba(4, 47, 46, 0.12);
}

/* Theme: Butter Yellow */
html[data-theme="butter"] {
  --bg: #f5efd4;
  --bg-wash: #ebe3c2;
  --bg-panel: #2a2410;
  --bg-panel-2: #1a1608;
  --surface: #faf6e4;
  --surface-raised: #fffced;
  --ink: #2a2410;
  --muted: #6e6648;
  --accent: #c9a227;
  --accent-bright: #dbb53a;
  --accent-soft: rgba(201, 162, 39, 0.16);
  --clay: #c45c26;
  --clay-bright: #d9783a;
  --clay-soft: rgba(196, 92, 38, 0.12);
  --dusk: #5a4a28;
  --dusk-bright: #72603a;
  --dusk-soft: rgba(90, 74, 40, 0.12);
  --line: rgba(42, 36, 16, 0.1);
  --danger: #a33d3d;
  --wash-1: rgba(201, 162, 39, 0.12);
  --wash-2: rgba(196, 92, 38, 0.06);
  --wash-3: rgba(90, 74, 40, 0.05);
  --sidebar-glow: rgba(219, 181, 58, 0.2);
  --sidebar-fg: #fff8d9;
  --sidebar-muted: rgba(255, 248, 217, 0.5);
  --sidebar-link: rgba(255, 248, 217, 0.68);
  --topbar-bg: rgba(250, 246, 228, 0.93);
  --nav-bg: rgba(250, 246, 228, 0.97);
  --btn-on-accent: #2a2410;
  --shadow-soft: 0 10px 32px rgba(42, 36, 16, 0.07);
  --shadow-lift: 0 16px 42px rgba(42, 36, 16, 0.12);
}

/* Theme: Cream */
html[data-theme="cream"] {
  --bg: #f3eee4;
  --bg-wash: #e8e1d4;
  --bg-panel: #2c241c;
  --bg-panel-2: #1c1610;
  --surface: #faf7f0;
  --surface-raised: #fffcf7;
  --ink: #2c241c;
  --muted: #6e6458;
  --accent: #8b6f4e;
  --accent-bright: #a3845e;
  --accent-soft: rgba(139, 111, 78, 0.14);
  --clay: #c4785a;
  --clay-bright: #d4926e;
  --clay-soft: rgba(196, 120, 90, 0.12);
  --dusk: #5a4e42;
  --dusk-bright: #726558;
  --dusk-soft: rgba(90, 78, 66, 0.12);
  --line: rgba(44, 36, 28, 0.1);
  --danger: #8c2e2e;
  --wash-1: rgba(139, 111, 78, 0.08);
  --wash-2: rgba(196, 120, 90, 0.06);
  --wash-3: rgba(90, 78, 66, 0.05);
  --sidebar-glow: rgba(163, 132, 94, 0.18);
  --sidebar-fg: #f7f0e4;
  --sidebar-muted: rgba(247, 240, 228, 0.5);
  --sidebar-link: rgba(247, 240, 228, 0.68);
  --topbar-bg: rgba(250, 247, 240, 0.93);
  --nav-bg: rgba(250, 247, 240, 0.97);
  --btn-on-accent: #fff;
  --shadow-soft: 0 10px 32px rgba(44, 36, 28, 0.06);
  --shadow-lift: 0 16px 42px rgba(44, 36, 28, 0.1);
}

/* Theme: Peach */
html[data-theme="peach"] {
  --bg: #f6e6dc;
  --bg-wash: #edd8cb;
  --bg-panel: #2e1a12;
  --bg-panel-2: #1c100a;
  --surface: #fbf0e8;
  --surface-raised: #fff7f1;
  --ink: #2e1a12;
  --muted: #7a5c50;
  --accent: #e08a5c;
  --accent-bright: #ef9d72;
  --accent-soft: rgba(224, 138, 92, 0.14);
  --clay: #c45c4a;
  --clay-bright: #d67462;
  --clay-soft: rgba(196, 92, 74, 0.12);
  --dusk: #6b4538;
  --dusk-bright: #855a4a;
  --dusk-soft: rgba(107, 69, 56, 0.12);
  --line: rgba(46, 26, 18, 0.09);
  --danger: #a33d3d;
  --wash-1: rgba(224, 138, 92, 0.1);
  --wash-2: rgba(196, 92, 74, 0.06);
  --wash-3: rgba(107, 69, 56, 0.05);
  --sidebar-glow: rgba(239, 157, 114, 0.2);
  --sidebar-fg: #ffeee4;
  --sidebar-muted: rgba(255, 238, 228, 0.5);
  --sidebar-link: rgba(255, 238, 228, 0.68);
  --topbar-bg: rgba(251, 240, 232, 0.93);
  --nav-bg: rgba(251, 240, 232, 0.97);
  --btn-on-accent: #2e1a12;
  --shadow-soft: 0 10px 32px rgba(46, 26, 18, 0.07);
  --shadow-lift: 0 16px 42px rgba(46, 26, 18, 0.11);
}

/* Theme: Graphite Black */
html[data-theme="graphite"] {
  --bg: #1a1c1e;
  --bg-wash: #121416;
  --bg-panel: #0c0d0e;
  --bg-panel-2: #050506;
  --surface: #232628;
  --surface-raised: #2c3033;
  --ink: #eceef0;
  --muted: #9aa0a6;
  --accent: #8a939c;
  --accent-bright: #a4adb6;
  --accent-soft: rgba(138, 147, 156, 0.14);
  --clay: #c9a066;
  --clay-bright: #dbb47a;
  --clay-soft: rgba(201, 160, 102, 0.14);
  --dusk: #6b8cae;
  --dusk-bright: #84a3c2;
  --dusk-soft: rgba(107, 140, 174, 0.14);
  --line: rgba(236, 238, 240, 0.1);
  --danger: #ff7b7b;
  --wash-1: rgba(138, 147, 156, 0.06);
  --wash-2: rgba(201, 160, 102, 0.05);
  --wash-3: rgba(107, 140, 174, 0.05);
  --sidebar-glow: rgba(164, 173, 182, 0.1);
  --sidebar-fg: #eceef0;
  --sidebar-muted: rgba(236, 238, 240, 0.46);
  --sidebar-link: rgba(236, 238, 240, 0.64);
  --topbar-bg: rgba(28, 30, 32, 0.94);
  --nav-bg: rgba(20, 22, 24, 0.96);
  --btn-on-accent: #121416;
  --shadow-soft: 0 10px 36px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 18px 48px rgba(0, 0, 0, 0.5);
}

/* Theme: Mauve / Dusty Purple */
html[data-theme="mauve"] {
  --bg: #ebe4ea;
  --bg-wash: #dfd5dd;
  --bg-panel: #241820;
  --bg-panel-2: #160f14;
  --surface: #f4eef3;
  --surface-raised: #faf6f9;
  --ink: #241820;
  --muted: #6a5a66;
  --accent: #8a6a82;
  --accent-bright: #a28298;
  --accent-soft: rgba(138, 106, 130, 0.14);
  --clay: #c4786a;
  --clay-bright: #d49284;
  --clay-soft: rgba(196, 120, 106, 0.12);
  --dusk: #4a3848;
  --dusk-bright: #624e5e;
  --dusk-soft: rgba(74, 56, 72, 0.12);
  --line: rgba(36, 24, 32, 0.1);
  --danger: #942845;
  --wash-1: rgba(138, 106, 130, 0.1);
  --wash-2: rgba(196, 120, 106, 0.06);
  --wash-3: rgba(74, 56, 72, 0.05);
  --sidebar-glow: rgba(162, 130, 152, 0.2);
  --sidebar-fg: #f4e8f1;
  --sidebar-muted: rgba(244, 232, 241, 0.5);
  --sidebar-link: rgba(244, 232, 241, 0.68);
  --topbar-bg: rgba(244, 238, 243, 0.93);
  --nav-bg: rgba(244, 238, 243, 0.97);
  --btn-on-accent: #fff;
  --shadow-soft: 0 10px 32px rgba(36, 24, 32, 0.07);
  --shadow-lift: 0 16px 42px rgba(36, 24, 32, 0.11);
}


/* ——— Per-profile immersion (html[data-profile-style]; site = Global styles) ——— */
html[data-profile-style="space"] {
  --bg: #070812;
  --bg-wash: #0d1024;
  --bg-panel: #0a0d1e;
  --bg-panel-2: #05060f;
  --surface: #12152c;
  --surface-raised: #1a1f3a;
  --ink: #e8ecff;
  --muted: #8b93c4;
  --accent: #7b8cff;
  --accent-bright: #a8b4ff;
  --accent-soft: rgba(123, 140, 255, 0.16);
  --clay: #c77dff;
  --clay-bright: #dda6ff;
  --clay-soft: rgba(199, 125, 255, 0.14);
  --dusk: #4fd2ff;
  --dusk-bright: #7de0ff;
  --dusk-soft: rgba(79, 210, 255, 0.12);
  --line: rgba(232, 236, 255, 0.1);
  --wash-1: rgba(123, 140, 255, 0.12);
  --wash-2: rgba(199, 125, 255, 0.1);
  --wash-3: rgba(79, 210, 255, 0.08);
  --sidebar-glow: rgba(123, 140, 255, 0.22);
  --sidebar-fg: #e8ecff;
  --sidebar-muted: rgba(232, 236, 255, 0.48);
  --sidebar-link: rgba(232, 236, 255, 0.68);
  --topbar-bg: rgba(10, 12, 28, 0.94);
  --nav-bg: rgba(8, 10, 22, 0.97);
  --btn-on-accent: #0a0c1a;
  --shadow-soft: 0 10px 36px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 16px 42px rgba(0, 0, 0, 0.55);
  color: var(--ink);
}

html[data-profile-style="space"] .profile-hero {
  background:
    radial-gradient(2px 2px at 12% 18%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 28% 42%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(2.5px 2.5px at 46% 14%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 62% 36%, rgba(200, 220, 255, 0.95), transparent),
    radial-gradient(2px 2px at 78% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 88% 48%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1.5px 1.5px at 18% 68%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 38% 82%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 58% 72%, rgba(180, 200, 255, 0.9), transparent),
    radial-gradient(1.5px 1.5px at 84% 78%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(123, 140, 255, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(199, 125, 255, 0.22), transparent 50%),
    linear-gradient(160deg, #12152c 0%, #0a0d1e 100%);
}

/* Ocean — Maldives lagoon: turquoise shallows, bright sun shaft */
html[data-profile-style="ocean"] {
  --bg: #0c4a5c;
  --bg-wash: #12708a;
  --bg-panel: #0a3d4c;
  --bg-panel-2: #083340;
  --surface: #145a6e;
  --surface-raised: #1a6d84;
  --ink: #f2fbfc;
  --muted: #a8d4de;
  --accent: #3ecfbf;
  --accent-bright: #6ee7d8;
  --accent-soft: rgba(62, 207, 191, 0.18);
  --clay: #e8c9a0;
  --clay-bright: #f2d9b8;
  --clay-soft: rgba(232, 201, 160, 0.16);
  --dusk: #2a9bb0;
  --dusk-bright: #48b8cc;
  --dusk-soft: rgba(42, 155, 176, 0.18);
  --line: rgba(242, 251, 252, 0.12);
  --wash-1: rgba(62, 207, 191, 0.14);
  --wash-2: rgba(232, 201, 160, 0.1);
  --wash-3: rgba(42, 155, 176, 0.14);
  --sidebar-glow: rgba(62, 207, 191, 0.28);
  --sidebar-fg: #f2fbfc;
  --sidebar-muted: rgba(242, 251, 252, 0.55);
  --sidebar-link: rgba(242, 251, 252, 0.75);
  --topbar-bg: rgba(12, 74, 92, 0.94);
  --nav-bg: rgba(10, 61, 76, 0.97);
  --btn-on-accent: #063640;
  --shadow-soft: 0 10px 36px rgba(4, 40, 50, 0.35);
  --shadow-lift: 0 16px 42px rgba(4, 40, 50, 0.45);
  color: var(--ink);
}

html[data-profile-style="ocean"] .profile-hero {
  background:
    radial-gradient(ellipse 55% 60% at 62% -10%, rgba(255, 255, 250, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(110, 230, 220, 0.28), transparent 58%),
    radial-gradient(ellipse 60% 40% at 85% 90%, rgba(232, 201, 160, 0.22), transparent 55%),
    linear-gradient(180deg, transparent 40%, rgba(42, 155, 176, 0.35) 100%),
    linear-gradient(165deg, #1a8a9e 0%, #0c4a5c 100%);
}

/* Fire — camera inside the blaze: charcoal volume, white-hot cores */
html[data-profile-style="fire"] {
  --bg: #1a0c06;
  --bg-wash: #2a1208;
  --bg-panel: #120805;
  --bg-panel-2: #0a0503;
  --surface: #2a140c;
  --surface-raised: #3a1c10;
  --ink: #fff4e8;
  --muted: #c9a890;
  --accent: #ff7a2e;
  --accent-bright: #ffb347;
  --accent-soft: rgba(255, 122, 46, 0.18);
  --clay: #ffcf6b;
  --clay-bright: #ffe29a;
  --clay-soft: rgba(255, 207, 107, 0.16);
  --dusk: #c43218;
  --dusk-bright: #e84820;
  --dusk-soft: rgba(196, 50, 24, 0.18);
  --line: rgba(255, 244, 232, 0.11);
  --wash-1: rgba(255, 122, 46, 0.16);
  --wash-2: rgba(255, 207, 107, 0.12);
  --wash-3: rgba(196, 50, 24, 0.14);
  --sidebar-glow: rgba(255, 122, 46, 0.32);
  --sidebar-fg: #fff4e8;
  --sidebar-muted: rgba(255, 244, 232, 0.52);
  --sidebar-link: rgba(255, 244, 232, 0.72);
  --topbar-bg: rgba(18, 8, 5, 0.92);
  --nav-bg: rgba(12, 5, 3, 0.96);
  --btn-on-accent: #1a0804;
  --shadow-soft: 0 10px 36px rgba(40, 8, 0, 0.5);
  --shadow-lift: 0 16px 42px rgba(40, 8, 0, 0.58);
  color: var(--ink);
}

html[data-profile-style="fire"] .profile-hero {
  background:
    radial-gradient(ellipse 55% 50% at 50% 45%, rgba(255, 252, 240, 0.7), transparent 55%),
    radial-gradient(ellipse 70% 58% at 48% 50%, rgba(255, 190, 70, 0.55), transparent 62%),
    radial-gradient(ellipse 80% 65% at 30% 65%, rgba(255, 80, 15, 0.45), transparent 60%),
    radial-gradient(ellipse 60% 50% at 78% 30%, rgba(200, 30, 8, 0.35), transparent 55%),
    linear-gradient(160deg, #4a1a08 0%, #1a0c06 55%, #080302 100%);
}

/* Immersion FX: starfield / ocean / inside the fire */
.profile-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.profile-fx[hidden] {
  display: none !important;
}

html[data-profile-style="space"] .app-topbar,
html[data-profile-style="ocean"] .app-topbar,
html[data-profile-style="fire"] .app-topbar,
html[data-profile-style="space"] .app-nav-mobile,
html[data-profile-style="ocean"] .app-nav-mobile,
html[data-profile-style="fire"] .app-nav-mobile,
html[data-profile-style="space"] .app-sidebar,
html[data-profile-style="ocean"] .app-sidebar,
html[data-profile-style="fire"] .app-sidebar {
  z-index: 6;
}

/* ——— Space ——— */
.profile-fx--space .pfx-milky {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    118deg,
    transparent 28%,
    rgba(123, 140, 255, 0.08) 42%,
    rgba(232, 236, 255, 0.14) 50%,
    rgba(199, 125, 255, 0.1) 58%,
    transparent 72%
  );
  filter: blur(10px);
  animation: pfx-nebula-drift 18s ease-in-out infinite alternate;
}

.profile-fx--space .pfx-nebula {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(ellipse 42% 32% at 16% 20%, rgba(123, 140, 255, 0.28), transparent 68%),
    radial-gradient(ellipse 38% 28% at 84% 70%, rgba(199, 125, 255, 0.22), transparent 64%),
    radial-gradient(ellipse 28% 22% at 58% 38%, rgba(79, 210, 255, 0.12), transparent 58%);
  animation: pfx-nebula-drift 12s ease-in-out infinite alternate-reverse;
}

.profile-fx--space .pfx-stars {
  position: absolute;
  inset: 0;
}

.profile-fx--space .pfx-star {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  margin: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.95);
  animation: pfx-twinkle 2.2s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}

.profile-fx--space .pfx-star--bright {
  background: #f2f6ff;
  box-shadow:
    0 0 12px #fff,
    0 0 28px rgba(123, 140, 255, 0.7);
}

.profile-fx--space .pfx-star--cross {
  width: 4px;
  height: 4px;
  background: #fff;
  box-shadow:
    0 -10px 0 -1px #fff,
    0 10px 0 -1px #fff,
    -10px 0 0 -1px #fff,
    10px 0 0 -1px #fff,
    0 0 18px rgba(200, 220, 255, 1);
  animation-duration: 1.8s;
}

.profile-fx--space .pfx-shoot {
  position: absolute;
  width: 140px;
  height: 2px;
  left: -25%;
  background: linear-gradient(90deg, transparent, #fff 45%, rgba(168, 180, 255, 0.2));
  border-radius: 2px;
  filter: drop-shadow(0 0 8px rgba(200, 220, 255, 0.95));
}

.profile-fx--space .pfx-shoot--a {
  top: 16%;
  animation: pfx-shoot-a 6.8s linear infinite;
}

.profile-fx--space .pfx-shoot--b {
  top: 42%;
  width: 90px;
  animation: pfx-shoot-b 9.4s linear infinite;
  animation-delay: 3.2s;
}

html[data-profile-style="space"] .profile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(2.5px 2.5px at 72% 16%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 84% 34%, rgba(255, 255, 255, 0.95), transparent),
    radial-gradient(3px 3px at 93% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 78% 56%, rgba(200, 220, 255, 1), transparent),
    radial-gradient(2px 2px at 90% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 66% 46%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(2px 2px at 58% 28%, #fff, transparent);
  animation: pfx-twinkle 2.6s ease-in-out infinite alternate-reverse;
}

html[data-profile-style="space"] .profile-hero::after {
  content: "";
  width: 10px;
  height: 10px;
  right: 22px;
  bottom: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 -14px 0 -3px #fff,
    0 14px 0 -3px #fff,
    -14px 0 0 -3px #fff,
    14px 0 0 -3px #fff,
    0 0 22px rgba(168, 180, 255, 1),
    -36px -18px 0 -4px rgba(255, 255, 255, 0.85),
    28px -40px 0 -4.5px rgba(200, 220, 255, 0.9);
  animation: pfx-twinkle 1.9s ease-in-out infinite alternate;
}

/* ——— Ocean (Maldives lagoon — shallow turquoise, diagonal sun shaft) ——— */
.profile-fx--ocean .pfx-sea {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -4%;
  height: calc(var(--bottom-h, 64px) + 260px);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(62, 207, 191, 0.12) 22%,
    rgba(42, 155, 176, 0.22) 55%,
    rgba(20, 100, 118, 0.32) 100%
  );
  transform-origin: 50% 70%;
  animation: pfx-ocean-zoom 16s ease-in-out infinite alternate;
}

.profile-fx--ocean .pfx-lagoon {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 70% 55% at 70% -5%, rgba(255, 255, 245, 0.2), transparent 52%),
    radial-gradient(ellipse 55% 40% at 25% 20%, rgba(110, 230, 220, 0.14), transparent 58%),
    radial-gradient(ellipse 50% 35% at 80% 85%, rgba(232, 201, 160, 0.12), transparent 60%);
  pointer-events: none;
  transform-origin: 60% 30%;
  animation: pfx-ocean-zoom 18s ease-in-out infinite alternate-reverse;
}

.profile-fx--ocean .pfx-surface {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: calc(var(--bottom-h, 64px) + 120px);
  height: 70px;
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(180, 240, 235, 0.08) 40%,
      rgba(110, 220, 210, 0.12) 60%,
      transparent 100%
    );
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  animation: pfx-surface-drift 18s ease-in-out infinite alternate;
  opacity: 0.65;
  filter: blur(1px);
}

.profile-fx--ocean .pfx-surface--b {
  bottom: calc(var(--bottom-h, 64px) + 95px);
  height: 55px;
  opacity: 0.4;
  animation-duration: 24s;
  animation-direction: alternate-reverse;
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(232, 201, 160, 0.06) 45%,
      rgba(110, 220, 210, 0.1) 62%,
      transparent 100%
    );
}

.profile-fx--ocean .pfx-rays {
  position: absolute;
  inset: -22%;
  overflow: hidden;
  mix-blend-mode: screen;
  transform-origin: 70% 0%;
  animation: pfx-ocean-zoom 14s ease-in-out infinite alternate;
}

.profile-fx--ocean .pfx-ray {
  position: absolute;
  top: -30%;
  left: 40%;
  width: var(--w, 200px);
  height: 160%;
  margin-left: calc(var(--w, 200px) / -2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 245, 0.4) 0%,
    rgba(180, 240, 235, 0.22) 24%,
    rgba(62, 207, 191, 0.1) 55%,
    transparent 88%
  );
  transform: rotate(var(--rot, -28deg));
  filter: blur(16px);
  opacity: 0.55;
  animation: pfx-ray-pierce 9s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
  transform-origin: 50% 0%;
}

.profile-fx--ocean .pfx-ray:not(.pfx-ray--inside) {
  animation-duration: 11s;
  filter: blur(20px);
  opacity: 0.4;
}

/* Camera inside the diagonal sun shaft */
.profile-fx--ocean .pfx-ray--inside {
  width: var(--w, 520px);
  margin-left: calc(var(--w, 520px) / -2);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 250, 0.58) 0%,
      rgba(200, 245, 240, 0.34) 18%,
      rgba(110, 220, 210, 0.16) 45%,
      rgba(62, 207, 191, 0.06) 70%,
      transparent 92%
    ),
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(180, 240, 235, 0.2) 32%,
      rgba(255, 255, 250, 0.4) 50%,
      rgba(180, 240, 235, 0.2) 68%,
      transparent 100%
    );
  filter: blur(24px);
  opacity: 0.88;
  animation: pfx-ray-inside 7s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}

.profile-fx--ocean .pfx-sand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--bottom-h, 64px) + 90px);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(232, 201, 160, 0.1) 45%,
    rgba(214, 176, 130, 0.18) 100%
  );
  opacity: 0.7;
  pointer-events: none;
}

.profile-fx--ocean .pfx-caustics {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: calc(var(--bottom-h, 64px) + 8px);
  height: 160px;
  background:
    radial-gradient(ellipse 200px 22px at 28% 40%, rgba(110, 230, 220, 0.2), transparent 72%),
    radial-gradient(ellipse 260px 28px at 52% 55%, rgba(255, 255, 245, 0.14), transparent 72%),
    radial-gradient(ellipse 160px 18px at 76% 36%, rgba(232, 201, 160, 0.12), transparent 72%);
  filter: blur(10px);
  opacity: 0.6;
  transform-origin: 50% 100%;
  animation: pfx-caustics 12s ease-in-out infinite alternate;
}

html[data-profile-style="ocean"] .profile-hero::before {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(128deg, transparent 22%, rgba(255, 255, 245, 0.22) 42%, transparent 58%),
    linear-gradient(140deg, transparent 40%, rgba(110, 230, 220, 0.12) 55%, transparent 70%);
  mix-blend-mode: screen;
  animation: pfx-hero-rays 8s ease-in-out infinite alternate;
}

html[data-profile-style="ocean"] .profile-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  width: auto;
  border-radius: 0 0 var(--radius) var(--radius);
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(42, 155, 176, 0.14) 50%,
      rgba(232, 201, 160, 0.16) 100%
    );
  animation: none;
  box-shadow: none;
  filter: none;
  pointer-events: none;
  z-index: 0;
}

/* ——— Fire (camera inside visible flames) ——— */
.profile-fx--fire .pfx-volume {
  position: absolute;
  inset: -16%;
  background:
    radial-gradient(ellipse 95% 80% at 50% 50%, rgba(255, 120, 30, 0.22), transparent 68%),
    radial-gradient(ellipse 55% 85% at 5% 45%, rgba(140, 18, 4, 0.48), transparent 58%),
    radial-gradient(ellipse 50% 80% at 96% 50%, rgba(180, 30, 6, 0.4), transparent 56%),
    radial-gradient(ellipse 85% 55% at 50% 115%, rgba(255, 140, 30, 0.45), transparent 52%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 42%, rgba(8, 2, 0, 0.5) 100%);
  transform-origin: 50% 55%;
  animation: pfx-fire-zoom 8s ease-in-out infinite alternate;
}

.profile-fx--fire .pfx-core {
  position: absolute;
  left: 22%;
  top: 28%;
  width: 56%;
  height: 48%;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 255, 250, 0.88) 0%,
    rgba(255, 230, 160, 0.62) 22%,
    rgba(255, 150, 50, 0.35) 48%,
    transparent 72%
  );
  filter: blur(24px);
  animation: pfx-core-pulse 3.2s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}

.profile-fx--fire .pfx-core--b {
  left: 5%;
  top: 42%;
  width: 42%;
  height: 40%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 240, 200, 0.5) 0%,
    rgba(255, 110, 20, 0.32) 40%,
    transparent 70%
  );
  filter: blur(30px);
  animation: pfx-core-pulse 4.6s ease-in-out infinite alternate-reverse;
  animation-delay: -1.4s;
}

.profile-fx--fire .pfx-flames {
  position: absolute;
  inset: -5% 0 -8%;
  overflow: hidden;
  pointer-events: none;
}

.profile-fx--fire .pfx-flame {
  position: absolute;
  bottom: -8%;
  width: var(--w, 22%);
  height: var(--h, 55%);
  margin-left: calc(var(--w, 22%) / -2);
  border-radius: 50% 50% 40% 40% / 65% 65% 35% 35%;
  background:
    radial-gradient(
      ellipse 70% 55% at 50% 78%,
      rgba(255, 250, 230, 0.85) 0%,
      rgba(255, 190, 70, 0.7) 28%,
      rgba(255, 100, 20, 0.45) 55%,
      rgba(180, 30, 5, 0.15) 78%,
      transparent 92%
    );
  filter: blur(10px);
  mix-blend-mode: screen;
  opacity: 0.85;
  transform-origin: 50% 100%;
  animation: pfx-flame-lick var(--dur, 1.8s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.profile-fx--fire .pfx-flame:nth-child(odd) {
  animation-name: pfx-flame-lick-alt;
  filter: blur(12px);
}

.profile-fx--fire .pfx-flame:nth-child(3n) {
  height: calc(var(--h, 55%) + 12%);
  opacity: 0.7;
  filter: blur(14px);
}

.profile-fx--fire .pfx-flame:nth-child(4n) {
  border-radius: 45% 55% 42% 38% / 70% 62% 38% 30%;
}

.profile-fx--fire .pfx-veil {
  position: absolute;
  inset: -30% -15%;
  background:
    radial-gradient(ellipse 38% 60% at 18% 55%, rgba(255, 140, 35, 0.42), transparent 68%),
    radial-gradient(ellipse 30% 55% at 78% 40%, rgba(255, 80, 15, 0.35), transparent 64%),
    radial-gradient(ellipse 34% 48% at 55% 70%, rgba(255, 190, 60, 0.28), transparent 66%);
  filter: blur(38px);
  opacity: 0.8;
  animation: pfx-veil-drift 8s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}

.profile-fx--fire .pfx-veil--b {
  background:
    radial-gradient(ellipse 42% 50% at 68% 25%, rgba(255, 110, 25, 0.38), transparent 65%),
    radial-gradient(ellipse 34% 62% at 30% 75%, rgba(255, 200, 70, 0.3), transparent 62%);
  animation: pfx-veil-drift-b 10s ease-in-out infinite alternate-reverse;
  animation-delay: -2s;
  opacity: 0.72;
}

.profile-fx--fire .pfx-sparks {
  position: absolute;
  inset: 0;
}

.profile-fx--fire .pfx-spark {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  margin-left: calc(var(--s, 2px) / -2);
  margin-top: calc(var(--s, 2px) / -2);
  border-radius: 50%;
  background: rgba(255, 245, 210, 0.95);
  box-shadow:
    0 0 6px rgba(255, 180, 60, 0.9),
    0 0 14px rgba(255, 100, 20, 0.45);
  animation: pfx-spark-drift var(--dur, 5s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0;
}

html[data-profile-style="fire"] .profile-hero::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -18%;
  height: 75%;
  width: auto;
  border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      ellipse 55% 70% at 50% 80%,
      rgba(255, 250, 230, 0.65) 0%,
      rgba(255, 170, 50, 0.45) 35%,
      rgba(255, 80, 15, 0.28) 60%,
      transparent 78%
    );
  border: none;
  box-shadow: none;
  filter: blur(10px);
  animation: pfx-flame-lick 2.1s ease-in-out infinite;
  transform-origin: 50% 100%;
  opacity: 0.9;
  mix-blend-mode: screen;
}

html[data-profile-style="fire"] .profile-hero::after {
  content: "";
  position: absolute;
  left: 35%;
  right: 28%;
  bottom: -12%;
  height: 58%;
  width: auto;
  border-radius: 48% 52% 42% 38% / 68% 65% 32% 30%;
  pointer-events: none;
  z-index: 0;
  border: none;
  background:
    radial-gradient(
      ellipse 50% 65% at 50% 85%,
      rgba(255, 240, 180, 0.55) 0%,
      rgba(255, 120, 30, 0.35) 45%,
      transparent 75%
    );
  box-shadow: none;
  filter: blur(12px);
  animation: pfx-flame-lick-alt 2.4s ease-in-out infinite;
  animation-delay: 0.35s;
  transform-origin: 50% 100%;
  opacity: 0.8;
  mix-blend-mode: screen;
}

@keyframes pfx-twinkle {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

@keyframes pfx-nebula-drift {
  from { transform: translate3d(-2%, 1%, 0) scale(1); }
  to { transform: translate3d(2.5%, -1.5%, 0) scale(1.05); }
}

@keyframes pfx-shoot-a {
  0%, 72% { transform: rotate(-20deg) translateX(0); opacity: 0; }
  75% { opacity: 1; }
  100% { transform: rotate(-20deg) translateX(145vw); opacity: 0; }
}

@keyframes pfx-shoot-b {
  0%, 80% { transform: rotate(-12deg) translateX(0); opacity: 0; }
  83% { opacity: 1; }
  100% { transform: rotate(-12deg) translateX(145vw); opacity: 0; }
}

@keyframes pfx-ray-pierce {
  from {
    opacity: 0.28;
    transform: rotate(var(--rot, -28deg)) translateX(-8px) scaleY(0.96);
  }
  to {
    opacity: 0.7;
    transform: rotate(var(--rot, -28deg)) translateX(10px) scaleY(1.04);
  }
}

@keyframes pfx-ray-inside {
  from {
    opacity: 0.52;
    transform: rotate(var(--rot, -28deg)) translateX(-6px) scale(1.02, 0.98);
  }
  to {
    opacity: 0.92;
    transform: rotate(var(--rot, -28deg)) translateX(8px) scale(1.08, 1.05);
  }
}

@keyframes pfx-flame-lick {
  0%, 100% {
    transform: scaleY(1) scaleX(1) rotate(-2deg) translateX(0);
    opacity: 0.72;
  }
  30% {
    transform: scaleY(1.12) scaleX(0.9) rotate(3deg) translateX(2%);
    opacity: 0.95;
  }
  60% {
    transform: scaleY(0.94) scaleX(1.08) rotate(-3.5deg) translateX(-2%);
    opacity: 0.78;
  }
}

@keyframes pfx-flame-lick-alt {
  0%, 100% {
    transform: scaleY(1.05) scaleX(0.94) rotate(2.5deg) translateX(1%);
    opacity: 0.68;
  }
  35% {
    transform: scaleY(0.9) scaleX(1.1) rotate(-3deg) translateX(-2%);
    opacity: 0.92;
  }
  70% {
    transform: scaleY(1.14) scaleX(0.88) rotate(2deg) translateX(1.5%);
    opacity: 0.75;
  }
}

@keyframes pfx-ocean-zoom {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(0, -2%, 0); }
}

@keyframes pfx-fire-zoom {
  from { transform: scale(1.04) translate3d(0, 1%, 0); opacity: 0.85; }
  to { transform: scale(1.14) translate3d(0, -1.5%, 0); opacity: 1; }
}

@keyframes pfx-hero-rays {
  from { opacity: 0.45; transform: scale(1); }
  to { opacity: 0.95; transform: scale(1.06); }
}

@keyframes pfx-surface-drift {
  from { transform: translate3d(-1.5%, 0, 0); opacity: 0.45; }
  to { transform: translate3d(1.8%, -4px, 0); opacity: 0.75; }
}

@keyframes pfx-caustics {
  from { transform: translate3d(-2%, 3px, 0) scale(1); opacity: 0.35; }
  to { transform: translate3d(3%, -4px, 0) scale(1.03); opacity: 0.65; }
}

@keyframes pfx-horizon-glow {
  from { opacity: 0.3; }
  to { opacity: 0.65; }
}

@keyframes pfx-volume-breathe {
  from { opacity: 0.75; transform: scale(1) translate3d(0, 1%, 0); }
  to { opacity: 1; transform: scale(1.04) translate3d(0, -1.5%, 0); }
}

@keyframes pfx-core-pulse {
  from { opacity: 0.55; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1.08); }
}

@keyframes pfx-veil-drift {
  from { transform: translate3d(-4%, 2%, 0) scale(1) rotate(-1deg); opacity: 0.55; }
  to { transform: translate3d(5%, -3%, 0) scale(1.08) rotate(1.5deg); opacity: 0.95; }
}

@keyframes pfx-veil-drift-b {
  from { transform: translate3d(3%, -2%, 0) scale(1.05) rotate(1deg); opacity: 0.5; }
  to { transform: translate3d(-5%, 4%, 0) scale(0.96) rotate(-1.2deg); opacity: 0.9; }
}

@keyframes pfx-shimmer-rise {
  from { transform: translateY(12%); opacity: 0.45; }
  to { transform: translateY(-18%); opacity: 0.85; }
}

@keyframes pfx-spark-drift {
  0% {
    transform: translate3d(0, 8px, 0) scale(0.4);
    opacity: 0;
  }
  15% { opacity: 0.95; }
  70% {
    transform: translate3d(var(--dx, 12px), -48px, 0) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translate3d(calc(var(--dx, 12px) * 1.4), -90px, 0) scale(0.2);
    opacity: 0;
  }
}

html[data-profile-style]:not([data-profile-style="site"]) .card {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--ink);
}

html[data-profile-style]:not([data-profile-style="site"]) .profile-hero {
  border-color: var(--line);
  color: var(--ink);
}

html[data-profile-style]:not([data-profile-style="site"]) .app-topbar,
html[data-profile-style]:not([data-profile-style="site"]) .app-nav-mobile {
  border-color: var(--line);
  color: var(--ink);
}

html[data-profile-style]:not([data-profile-style="site"]) .app-topbar .brand,
html[data-profile-style]:not([data-profile-style="site"]) .app-topbar .btn.ghost {
  color: var(--ink);
}

html[data-profile-style]:not([data-profile-style="site"]) .app-nav-mobile button {
  color: var(--muted);
}

html[data-profile-style]:not([data-profile-style="site"]) .app-nav-mobile button.nav-post-btn {
  color: #fff;
  background: var(--clay);
}

html[data-profile-style]:not([data-profile-style="site"]) .app-nav-mobile button.nav-post-btn:hover,
html[data-profile-style]:not([data-profile-style="site"]) .app-nav-mobile button.nav-post-btn.is-composing {
  color: #fff;
  background: var(--clay-bright);
}

html[data-profile-style]:not([data-profile-style="site"]) .page-kicker {
  color: var(--accent-bright);
}

html[data-profile-style]:not([data-profile-style="site"]) .section-title,
html[data-profile-style]:not([data-profile-style="site"]) .user-displayname,
html[data-profile-style]:not([data-profile-style="site"]) .profile-masthead-name {
  color: var(--ink);
}

html[data-profile-style]:not([data-profile-style="site"]) .muted,
html[data-profile-style]:not([data-profile-style="site"]) .handle {
  color: var(--muted);
}

html[data-profile-style]:not([data-profile-style="site"]) .btn.secondary,
html[data-profile-style]:not([data-profile-style="site"]) .btn.ghost {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}

html[data-profile-style]:not([data-profile-style="site"]) .btn:not(.secondary):not(.ghost) {
  background: var(--accent);
  color: var(--btn-on-accent);
  border-color: transparent;
}

html[data-profile-style]:not([data-profile-style="site"]) input,
html[data-profile-style]:not([data-profile-style="site"]) textarea {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

html[data-profile-style]:not([data-profile-style="site"]) .stat {
  background: var(--surface);
  border-color: var(--line);
}

html[data-profile-style]:not([data-profile-style="site"]) .stat .num {
  color: var(--accent-bright);
}

@media (min-width: 900px) {
  html[data-profile-style]:not([data-profile-style="site"]) .app-sidebar nav button.active {
    background: var(--accent-soft);
    color: var(--ink);
    box-shadow: inset 3px 0 0 var(--clay-bright);
  }

  html[data-profile-style]:not([data-profile-style="site"]) .app-sidebar nav button.nav-post-btn {
    background: var(--clay);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  }

  html[data-profile-style]:not([data-profile-style="site"]) .app-sidebar nav button.nav-post-btn:hover,
  html[data-profile-style]:not([data-profile-style="site"]) .app-sidebar nav button.nav-post-btn.is-composing {
    background: var(--clay-bright);
    color: #fff;
  }

  html[data-profile-style]:not([data-profile-style="site"]) .app-sidebar .btn.secondary {
    color: var(--sidebar-fg);
    border-color: rgba(255, 255, 255, 0.22);
  }
}

* { box-sizing: border-box; }

/* Author display rules (label, .actions, …) must not override the hidden attribute. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 600px at 12% -10%, var(--wash-1), transparent 55%),
    radial-gradient(700px 420px at 88% 8%, var(--wash-2), transparent 50%),
    radial-gradient(900px 500px at 70% 100%, var(--wash-3), transparent 48%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-wash) 100%);
  background-attachment: fixed;
}

button, input, textarea, select { font: inherit; }

#app {
  height: 100%;
  min-height: 100%;
  position: relative;
  z-index: 1;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow: visible;
}

button.brand-link {
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 2px 2px 4px 0;
  margin: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
  font: inherit;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow: visible;
}

button.brand-link:hover,
button.brand-link:focus-visible {
  opacity: 0.88;
}

.desktop-only { display: none; }

/* ——— Guest public feed ——— */
.guest-shell {
  height: 100%;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #070a08;
  color: #f2f7f4;
  overflow: hidden;
}

.guest-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(7, 10, 8, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.guest-topbar .brand {
  font-size: 1.5rem;
  color: #f2f7f4;
}

.guest-join-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 10, 8, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.guest-join-btn {
  width: 100%;
  padding: 14px 22px;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.guest-feed {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.guest-hint {
  margin: 0;
  padding: 0;
  text-align: center;
  color: rgba(242, 247, 244, 0.45);
}

.guest-shell .card {
  background: #141a16;
  border-color: rgba(255, 255, 255, 0.08);
  color: #f2f7f4;
  border-radius: 20px;
}

.guest-shell .muted,
.guest-shell .meta {
  color: rgba(242, 247, 244, 0.55);
}

.guest-shell .chip,
.guest-shell a.chip {
  background: rgba(61, 255, 181, 0.14);
  color: #3dffb5;
}

.guest-shell .avatar {
  border-color: rgba(61, 255, 181, 0.25);
  background: rgba(61, 255, 181, 0.14);
  color: #3dffb5;
}

.guest-shell .empty {
  color: rgba(242, 247, 244, 0.55);
}

/* Guest pages sit on a dark field. Signed-in themes keep their own ink color. */
.guest-shell .article-page-body,
.guest-shell .article-page-title,
.guest-shell .article-title-link,
.guest-shell .article-section,
.guest-shell .article-pull,
.guest-shell .post-body,
.guest-shell .article-publisher-name,
.guest-shell .article-byline-name {
  color: rgba(242, 247, 244, 0.92);
}

.guest-shell .article-dek,
.guest-shell .article-teaser-text,
.guest-shell .article-publisher-handle,
.guest-shell .article-publisher-bio,
.guest-shell .article-back-btn,
.guest-shell .article-tool-btn {
  color: rgba(242, 247, 244, 0.78);
}

@media (min-width: 900px) {
  .guest-shell {
    max-width: 720px;
    margin: 0 auto;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
  .guest-feed {
    padding: 24px;
  }
}

/* ——— Auth ——— */
.auth-shell {
  height: 100%;
  min-height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  background: #070a08;
  color: #f2f7f4;
}

.auth-hero {
  display: none;
  padding: 48px;
  align-content: end;
  gap: 12px;
  background:
    linear-gradient(160deg, #0f1f18 0%, #1a3a2c 45%, #0f1f18 100%);
}

.auth-hero h1 {
  font-family: var(--display);
  font-size: clamp(3rem, 6vw, 5rem);
  margin: 0;
  line-height: 0.95;
  color: #eef6f1;
}

.auth-hero .lead {
  margin: 0;
  max-width: 28rem;
  color: rgba(238, 246, 241, 0.72);
  font-size: 1.15rem;
}

/* Shown in index.html until the first render(). Signed-in reloads exchange the
   HttpOnly refresh cookie for an access token before drawing, and this fills
   that gap instead of leaving the page blank. */
.boot-splash {
  height: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}

.boot-splash-mark {
  font-family: var(--display, inherit);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted, #8aa39a);
  animation: boot-splash-pulse 1.4s ease-in-out infinite;
}

@keyframes boot-splash-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-splash-mark { animation: none; opacity: 0.6; }
}

.btn-app-primary {
  border: 0;
  border-radius: 999px;
  padding: 16px 20px;
  width: 100%;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  background: #3dffb5;
  color: #04140e;
}

.auth-panel {
  display: none;
  align-content: start;
  padding: 20px 20px calc(28px + var(--safe-bottom));
  background: #070a08;
  color: #f2f7f4;
  min-height: 100%;
}

.auth-shell.auth-form-open .auth-panel { display: grid; }

.auth-back {
  border: 0;
  background: transparent;
  color: #3dffb5;
  font-weight: 700;
  padding: 8px 0 16px;
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.auth-form-title {
  margin: 0 0 4px;
  font-size: 1.6rem;
  font-weight: 700;
}

.auth-panel .auth-card {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.auth-panel label { color: rgba(242, 247, 244, 0.62); }
.auth-panel input,
.auth-panel textarea {
  background: #121814;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f2f7f4;
}
.auth-panel .muted { color: rgba(242, 247, 244, 0.5); }
.auth-panel .btn.btn-app-primary {
  background: #3dffb5;
  color: #04140e;
}

.auth-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #3dffb5;
  cursor: pointer;
  text-align: center;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-panel .success {
  color: #3dffb5;
  font-size: 0.9rem;
}

@media (min-width: 900px) {
  .desktop-only { display: initial; }
  .mobile-only { display: none !important; }

  .auth-shell {
    grid-template-columns: 1.15fr 0.85fr;
    background: var(--bg);
    color: var(--ink);
  }
  .auth-hero {
    display: grid;
  }
  .auth-panel,
  .auth-shell.auth-form-open .auth-panel {
    display: grid;
    min-height: auto;
    height: 100%;
    padding: 48px;
    align-content: center;
    background: var(--surface);
    color: var(--ink);
  }
  .auth-panel .auth-card {
    background: transparent;
  }
  .auth-panel label { color: var(--muted); }
  .auth-panel input,
  .auth-panel textarea {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
  }
  .auth-panel .muted { color: var(--muted); }
  .auth-panel .btn.btn-app-primary {
    background: var(--accent);
    color: #fff;
    width: auto;
  }
  .auth-tabs .btn { width: auto; }
}

/* ——— App shell ——— */
.app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
}

.app-sidebar {
  display: none;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 5;
  overflow: visible;
}

.app-topbar .brand {
  font-size: 1.45rem;
  color: var(--ink);
  letter-spacing: -0.03em;
  flex-shrink: 0;
  line-height: 1.15;
  padding: 4px 4px 6px 0;
}

.topbar-search {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.topbar-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
}

.topbar-search input::placeholder {
  color: var(--muted);
}

.app-topbar #signout-mobile {
  flex-shrink: 0;
}

.topbar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-search {
  margin: 0 0 14px;
}

.sidebar-search input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #f2f7f4;
}

.sidebar-search input::placeholder {
  color: rgba(242, 247, 244, 0.45);
}

.search-page .search-form {
  max-width: 100%;
}

.search-page .card {
  max-width: 100%;
}

.search-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.search-form input {
  flex: 1;
}

.search-page .entity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.app-main {
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  padding: 18px 16px 28px;
  background: transparent;
}

.app-nav-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  overflow: visible;
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 2px calc(8px + var(--safe-bottom));
  z-index: 5;
}

.app-nav-mobile button {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 140ms ease, background 140ms ease, transform 140ms var(--ease-out);
}

.app-nav-mobile button .nav-ico {
  display: block;
  width: 22px;
  height: 22px;
  transition: transform 140ms var(--ease-out);
}

.app-nav-mobile button.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.app-nav-mobile button.active .nav-ico {
  transform: scale(1.08);
}

.app-nav-mobile button.nav-post-btn {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  margin: 0 4px;
  padding: 0;
  align-self: center;
  overflow: visible;
  border-radius: 50%;
  background: var(--clay);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--clay) 42%, transparent);
}

.app-nav-mobile button.nav-post-btn .nav-post-ico {
  width: 20px;
  height: 20px;
}

.app-nav-mobile button.nav-post-btn:hover,
.app-nav-mobile button.nav-post-btn:active {
  background: var(--clay-bright);
  color: #fff;
}

.app-nav-mobile button.nav-post-btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.app-nav-mobile button.nav-post-btn.is-composing {
  box-shadow: 0 0 0 2px var(--nav-bg), 0 0 0 4px var(--clay);
}

.app-nav-mobile .nav-badge-count {
  position: absolute;
  top: 4px;
  right: max(2px, calc(50% - 18px));
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 3px;
  font-size: 0.58rem;
  box-shadow: 0 0 0 2px var(--nav-bg);
}

.app-nav-mobile .nav-badge-dot {
  position: absolute;
  top: 7px;
  right: max(6px, calc(50% - 12px));
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 2px var(--nav-bg);
}

@media (max-width: 360px) {
  .app-nav-mobile button .nav-ico {
    width: 20px;
    height: 20px;
  }

  .app-nav-mobile button {
    min-height: 42px;
    padding: 7px 0;
    border-radius: 10px;
  }
}

@media (min-width: 900px) {
  .app-shell {
    grid-template-columns: var(--sidebar) 1fr;
    grid-template-rows: 1fr;
    background: transparent;
    color: var(--ink);
  }

  .app-sidebar {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: 100%;
    min-height: 100%;
    gap: 6px;
    padding: 32px 20px 24px;
    background:
      linear-gradient(165deg, var(--sidebar-glow) 0%, transparent 36%),
      linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-panel-2) 100%);
    color: var(--sidebar-fg);
    overflow-x: hidden;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    min-width: 0;
  }

  .app-sidebar::after {
    content: "PEOPLE FIRST";
    position: absolute;
    right: 0;
    top: 42%;
    transform: rotate(90deg);
    transform-origin: right center;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    color: color-mix(in srgb, var(--sidebar-fg) 14%, transparent);
    pointer-events: none;
    white-space: nowrap;
  }

  .app-sidebar .brand {
    font-size: clamp(1.8rem, 2vw, 2.35rem);
    padding: 4px 10px 6px;
    letter-spacing: -0.03em;
    line-height: 1.1;
  }

  .app-sidebar .tagline {
    color: var(--sidebar-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0 10px 20px;
  }

  .app-sidebar nav {
    display: grid;
    gap: 2px;
    flex: 1;
  }

  .app-sidebar nav button {
    border: 0;
    text-align: left;
    background: transparent;
    color: var(--sidebar-link);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 140ms ease, color 140ms ease, transform 140ms var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .app-sidebar nav button .nav-btn-label {
    flex: 1;
    text-align: left;
  }

  .app-sidebar nav button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }

  .app-sidebar nav button.active {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--clay-bright);
  }

  .app-sidebar nav button.nav-post-btn {
    margin-top: 12px;
    justify-content: flex-start;
    gap: 10px;
    background: var(--clay);
    color: #fff;
    font-family: var(--display);
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    padding: 12px 16px;
    border-radius: 3px 16px 16px 16px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  }

  .app-sidebar nav button.nav-post-btn .nav-btn-label {
    flex: 0 1 auto;
    font-weight: 600;
  }

  .app-sidebar nav button.nav-post-btn:hover {
    background: var(--clay-bright);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.26);
  }

  .app-sidebar nav button.nav-post-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }

  .app-sidebar nav button.nav-post-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
  }

  .app-sidebar nav button.nav-post-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .app-sidebar nav button.nav-post-btn.is-composing {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85), 0 10px 22px rgba(0, 0, 0, 0.22);
  }

  .app-sidebar .sidebar-foot {
    margin-top: auto;
    padding-top: 16px;
  }

  .app-sidebar .btn.secondary {
    width: 100%;
    color: var(--sidebar-fg);
    border-color: color-mix(in srgb, var(--sidebar-fg) 25%, transparent);
    border-radius: var(--radius-sm);
  }

  .app-topbar,
  .app-nav-mobile {
    display: none !important;
  }

  .app-main {
    padding: 32px 40px 48px;
    background: transparent;
    color: inherit;
  }
}

/* Mobile refinements — same Civic Editorial language as desktop */
@media (max-width: 899px) {
  .app-shell .card {
    border-radius: var(--radius);
  }

  .app-shell .page-masthead {
    margin: 0 -4px 4px;
    padding-top: 12px;
  }

  .app-shell .stat {
    background: var(--surface-raised);
    border-radius: var(--radius-sm);
  }

  .app-shell .chat-bubble {
    background: var(--surface);
  }

  .app-shell .chat-bubble.mine {
    background: var(--accent-soft);
  }

  .app-shell .chat-thread {
    background: var(--surface);
    border-color: var(--line);
  }
}

/* ——— Shared UI ——— */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.card.post {
  position: relative;
}

.card.post:hover {
  box-shadow: var(--shadow-lift);
}

.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-raised);
  color: var(--ink);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(20, 107, 78, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { min-height: 110px; resize: vertical; }

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--accent);
  color: var(--btn-on-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms var(--ease-out), background 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  background: var(--accent-bright);
  box-shadow: 0 8px 20px rgba(20, 107, 78, 0.22);
}

.btn:active { transform: translateY(1px); }

/* Keyboard-only focus ring. Interactive elements across the app removed the
   default outline without providing a replacement. */
.btn:focus-visible,
.lang-chip:focus-visible,
.chip:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(20, 107, 78, 0.35);
  box-shadow: none;
}

.btn.secondary:hover {
  background: var(--accent-soft);
  box-shadow: none;
}

.btn.ghost {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(155, 44, 44, 0.3);
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.upload-progress {
  display: grid;
  gap: 6px;
  margin: 4px 0 2px;
}

.upload-progress[hidden] {
  display: none !important;
}

.upload-progress-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.12s linear;
}

.upload-progress.is-indeterminate .upload-progress-bar {
  width: 30%;
  animation: upload-indeterminate 1.15s ease-in-out infinite;
}

.upload-progress-meta {
  margin: 0;
}

@keyframes upload-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(380%); }
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
}

.media-preview {
  width: 100%;
  max-height: 420px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--bg-wash);
  display: block;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.post-footer-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.post-footer-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.keep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out),
    border-color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

.keep-btn .keep-glyph {
  display: block;
}

.keep-btn:hover,
.keep-btn:focus-visible {
  color: var(--clay);
  border-color: color-mix(in srgb, var(--clay) 45%, transparent);
  background: var(--clay-soft);
}

.keep-btn:active {
  transform: scale(0.94);
}

.keep-btn.active {
  color: var(--clay);
  background: var(--clay-soft);
  border-color: transparent;
}

.keep-btn.active .keep-glyph {
  fill: currentColor;
  stroke: currentColor;
}

.keep-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}

.favorites-count {
  margin: -6px 0 0;
  letter-spacing: 0.04em;
}

.favorites-empty .brand {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.topbar-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  cursor: pointer;
}

.topbar-notif-btn .nav-ico {
  display: block;
  width: 22px;
  height: 22px;
}

.topbar-notif-btn:hover,
.topbar-notif-btn:focus-visible,
.topbar-notif-btn.active {
  color: var(--clay);
  background: var(--clay-soft);
}

.topbar-notif-btn .nav-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
}

.post-reactions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.post-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid rgba(20, 107, 78, 0.35);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--accent);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.post-edit-btn:hover {
  background: var(--accent-soft);
  box-shadow: var(--shadow-lift);
}

.post-edit-btn:active {
  transform: translateY(1px);
}

.post-edit-icon {
  display: block;
}

.card.post:has(.post-edit-btn) .actions:empty {
  display: none;
}

.post-reactions {
  position: relative;
  flex-shrink: 0;
}

.react-stack {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.react-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  z-index: 12;
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  pointer-events: none;
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.react-stack.picker-open .react-picker {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.react-picker::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateY(-5px) rotate(45deg);
}

.react-btn.react-picker-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  animation: react-pop-in 220ms var(--ease-out) both;
}

.react-btn.react-trigger {
  position: relative;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.react-btn.react-trigger.is-heart .react-trigger-icon {
  color: #b42318;
  opacity: 0.55;
}

.react-btn.react-trigger.is-heart.active {
  background: rgba(180, 35, 24, 0.1);
  color: #9b1c1c;
  border-color: transparent;
}

.react-btn.react-trigger.is-heart.active .react-trigger-icon {
  opacity: 1;
}

.react-btn.react-trigger.is-fire .react-trigger-icon {
  opacity: 0.7;
}

.react-btn.react-trigger.is-fire.active {
  background: rgba(194, 94, 12, 0.12);
  color: #9a3412;
  border-color: transparent;
}

.react-btn.react-trigger.is-fire.active .react-trigger-icon {
  opacity: 1;
}

.react-btn.react-picker-btn[data-react="heart"] .react-alt-icon {
  color: #b42318;
  opacity: 0.55;
}

.react-btn.react-picker-btn[data-react="heart"].active .react-alt-icon {
  opacity: 1;
}

.react-btn.react-picker-btn[data-react="fire"] .react-alt-icon {
  opacity: 0.7;
}

@keyframes react-pop-in {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 36px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.react-btn:hover,
.react-btn:focus-visible {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.react-btn:active {
  transform: scale(0.96);
}

.react-btn .react-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.react-btn[data-react="heart"] .react-icon {
  color: #b42318;
  opacity: 0.55;
}

.react-btn[data-react="fire"] .react-icon {
  opacity: 0.7;
}

.react-btn.active {
  border-color: transparent;
}

.react-btn[data-react="heart"].active {
  background: rgba(180, 35, 24, 0.1);
  color: #9b1c1c;
}

.react-btn[data-react="heart"].active .react-icon {
  opacity: 1;
}

.react-btn[data-react="fire"].active {
  background: rgba(194, 94, 12, 0.12);
  color: #9a3412;
}

.react-btn[data-react="fire"].active .react-icon {
  opacity: 1;
}

.react-count {
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 0.75em;
}

.react-count:empty {
  display: none;
}

.guest-shell .keep-btn {
  border-color: rgba(242, 247, 244, 0.18);
  color: rgba(242, 247, 244, 0.72);
}

.guest-shell .keep-btn:hover,
.guest-shell .keep-btn:focus-visible,
.guest-shell .keep-btn.active {
  color: var(--clay-bright);
  background: var(--clay-soft);
}

.guest-shell .react-btn {
  border-color: rgba(242, 247, 244, 0.18);
  color: rgba(242, 247, 244, 0.72);
}

.guest-shell .react-btn:hover,
.guest-shell .react-btn:focus-visible {
  color: #f2f7f4;
  background: rgba(242, 247, 244, 0.08);
}

.profile-public {
  text-align: center;
  align-items: center;
}

.profile-public .avatar.lg { margin: 0 auto; }

.profile-public .handle {
  color: var(--muted);
  margin-top: 2px;
}

.profile-public .bio {
  max-width: 36rem;
  margin: 12px auto 0;
  white-space: pre-wrap;
}

.post {
  position: relative;
  display: grid;
  gap: 12px;
  align-content: start;
}

.post.article-teaser {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.post .meta { color: var(--muted); font-size: 0.88rem; }

.post .post-body {
  font-size: 1.02rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.post .post-body a.post-link {
  color: var(--accent, #2f6fed);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.post .post-media {
  position: relative;
}

.card.post > .post-media {
  margin: 0 -20px;
  width: calc(100% + 40px);
}

.card.post.has-media {
  padding: 0 0 18px;
  overflow: hidden;
  gap: 0;
}

.card.post.has-media > .avatar-row {
  display: none;
}

.card.post.has-media:has(.lang-switch) > .avatar-row {
  display: none;
}

.card.post.has-media > .post-media {
  margin: 0;
  width: 100%;
  overflow: hidden;
}

.card.post.has-media .post-body,
.card.post.has-media .post-footer,
.card.post.has-media .actions {
  padding-left: 20px;
  padding-right: 20px;
}

.card.post.has-media .post-reactions-row {
  padding-left: 20px;
  padding-right: 20px;
}

.card.post.has-media .post-body {
  padding-top: 14px;
}

.card.post.has-media .post-tags {
  margin: 10px 20px 0;
  padding-top: 12px;
  padding-bottom: 2px;
}

.post .post-media .media-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  max-height: 440px;
  object-fit: cover;
}

.post .post-media video.media-preview {
  min-height: 240px;
  aspect-ratio: 16 / 9;
  max-height: 440px;
  background: #0b1a1c;
  cursor: pointer;
}

.post .post-media video.media-preview::-webkit-media-controls,
.post .post-media video.media-preview::-webkit-media-controls-enclosure,
.post .post-media video.media-preview::-webkit-media-controls-panel {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.post-photo-grid {
  display: grid;
  gap: 2px;
  width: 100%;
  overflow: hidden;
}

.post-photo-grid--count-1 {
  grid-template-columns: 1fr;
}

.post-photo-grid--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-photo-grid--count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-photo-grid--count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.post-photo-grid-item {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.post-photo-grid-item .media-preview {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.post-photo-grid--count-1 .post-photo-grid-item .media-preview {
  aspect-ratio: auto;
  width: 100%;
  height: auto;
  max-height: min(72vh, 720px);
  object-fit: contain;
}

.post-media.has-photo-grid {
  overflow: hidden;
}

.post-media.has-photo-grid .post-media-overlay {
  z-index: 5;
  pointer-events: none;
}

.post-media.has-photo-grid .post-media-overlay .avatar-row,
.post-media.has-photo-grid .post-media-overlay a {
  pointer-events: auto;
}

.post-media-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 28px 10px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.18) 55%, transparent 100%);
  pointer-events: none;
}

.post-media-actions-start,
.post-media-actions-end {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.post-media-actions-end {
  margin-left: auto;
}

.card.post.has-photo-grid .post-media-actions .keep-btn,
.card.post.has-photo-grid .post-media-actions .react-btn {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card.post.has-photo-grid .post-media-actions .keep-btn .keep-glyph {
  /* Keep outline readable on light/white photo regions */
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.9)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.card.post.has-photo-grid .post-media-actions .post-edit-btn {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card.post.has-photo-grid .post-media-actions .post-edit-btn:hover {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}

.card.post.has-photo-grid .post-media-actions .keep-btn.active {
  color: #fff;
  border-color: color-mix(in srgb, var(--clay) 70%, #fff 20%);
  background: color-mix(in srgb, var(--clay) 65%, rgba(0, 0, 0, 0.45));
}

.card.post.has-photo-grid .post-media-actions .react-btn.active {
  color: #fff;
}

.card.post.has-photo-grid .post-footer:not(.post-footer-status-only) {
  display: none;
}

.card.post.has-photo-grid .post-footer-status-only {
  margin-top: 8px;
}

.post-photo-viewer-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.92);
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}

.post-photo-viewer-root.is-enter {
  opacity: 1;
}

.post-photo-viewer-root.is-leave {
  opacity: 0;
}

.post-photo-viewer-backdrop {
  position: absolute;
  inset: 0;
}

.post-photo-viewer-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  /* Equal inset on all sides so the photo sits centered in the viewport. */
  padding: max(24px, env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px))
           max(20px, env(safe-area-inset-right, 0px), env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.post-photo-viewer-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}

.post-photo-viewer-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  pointer-events: none;
}

.post-photo-viewer-close,
.post-photo-viewer-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.post-photo-viewer-edit {
  margin-left: auto;
}

.compose-photo-preview .post-photo-grid-item {
  position: relative;
  cursor: default;
}

.compose-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

/* Extends the touch target to ~40px without changing how the button looks. */
.compose-photo-remove::after {
  content: "";
  position: absolute;
  inset: -7px;
}

.card.post > .post-media .media-preview,
.card.post.has-media .post-media .media-preview {
  border-radius: 0;
}

.card.post.has-media .post-media video.media-preview {
  border-radius: 0;
  width: 100%;
  height: auto;
  min-height: 240px;
  max-height: min(72vh, 520px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-page-media video.media-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(72vh, 640px);
  object-fit: cover;
  border-radius: 0;
}

.article-cover video.media-preview {
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: cover;
}

.card.post > .post-media .post-media-overlay,
.card.post.has-media .post-media-overlay {
  border-radius: 0;
}

.card.post.has-media .post-media-overlay {
  pointer-events: none;
}

.card.post.has-media .post-media-overlay .avatar-row,
.card.post.has-media .post-media-overlay a {
  pointer-events: auto;
}

.post-media-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 14px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.post-media-overlay .avatar-row .user-displayname,
.post-media-overlay .avatar-row .user-handle {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.post-media-overlay .article-byline-name,
.post-media-overlay .article-byline-handle {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.post-media-overlay .article-byline .avatar {
  border: 2px solid rgba(255,255,255,0.7);
}

.post:has(.lang-switch) .avatar-row {
  padding-right: 120px;
}

.post.article-full:has(.lang-switch-select) .avatar-row {
  padding-right: 148px;
}

.post.article-full:has(.lang-switch-select) .article-page-title {
  padding-right: 0;
}

.lang-switch {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: calc(100% - 20px);
}

.lang-switch-select {
  flex-wrap: nowrap;
  max-width: none;
}

.lang-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card, #fff);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 10px 3px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.lang-select-icon {
  font-size: 0.78rem;
  line-height: 1;
  color: var(--text);
  pointer-events: none;
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right center;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 4px 16px 4px 0;
  margin: 0;
  min-width: 6.5rem;
  max-width: 9.5rem;
  cursor: pointer;
}

.lang-select:focus {
  outline: none;
}

.lang-select-wrap:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.lang-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.lang-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
  font-weight: 600;
}

.translation-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
}

.translate-panel textarea {
  min-height: 120px;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

a.chip {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
a.chip:hover { text-decoration: underline; }

.entity-item, .tag-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.entity-item-media {
  width: 96px;
  height: 96px;
  max-height: 96px;
  flex: 0 0 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.entity-hero-media,
.entity-card-media {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.entity-hero-media.video,
.entity-card-media.video {
  max-height: 420px;
  background: #111;
}

/* Hashtag feed: places & events — vertical hierarchy (not entity-item row) */
.entity-card {
  display: grid;
  gap: 10px;
  padding: 18px 18px 16px 20px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 42%),
    var(--surface-raised);
  border-left: 3px solid var(--accent);
  transition: box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.entity-card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.entity-card--place {
  border-left-color: var(--dusk, var(--accent));
}

.entity-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.entity-card-kind {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.entity-card-handle {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.entity-card-handle:hover {
  color: var(--accent);
  text-decoration: underline;
}

.entity-card-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.25rem, 3.6vw, 1.55rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.entity-card-title .entity-name-link {
  color: inherit;
  text-decoration: none;
}

.entity-card-title .entity-name-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.entity-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.entity-card-dot {
  opacity: 0.45;
}

.entity-card-city {
  font-weight: 600;
  color: var(--ink);
}

.entity-card-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
  max-width: 36rem;
}

.entity-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.entity-card-tags .chip {
  font-size: 0.78rem;
  padding: 4px 9px;
}

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

.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

.notif-list {
  display: grid;
  gap: 7px;
}

.notif-card {
  cursor: pointer;
  display: grid;
  gap: 0;
  padding: 0;
  overflow: visible;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.notif-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}

.notif-tile {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  padding: 11px 20px 11px 13px;
  border-left-width: 3px;
  border-left-style: solid;
  border-left-color: color-mix(in srgb, var(--ink) 18%, transparent);
}

.notif-kind-article {
  border-left-color: var(--clay);
}

.notif-kind-video {
  border-left-color: var(--dusk);
}

.notif-kind-photo {
  border-left-color: color-mix(in srgb, var(--accent) 70%, var(--clay));
}

.notif-kind-audio {
  border-left-color: var(--accent);
}

.notif-kind-event {
  border-left-color: var(--accent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 42%);
}

.notif-kind-heart,
.notif-kind-flame {
  border-left-color: color-mix(in srgb, var(--clay) 55%, var(--ink));
}

.notif-tile-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  grid-column: 1;
  grid-row: 1;
}

.notif-kicker {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 1px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

.notif-kicker time {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

.notif-tile .notif-title,
.notif-tile .notif-title.article-title-link {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.08rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin: 0;
  color: inherit;
  display: block;
}

.notif-kind-article .notif-title {
  font-size: 1.18rem;
  line-height: 1.16;
}

.notif-title.notif-action {
  font-family: var(--font);
  font-weight: 650;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.notif-tile .notif-teaser {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.38;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-kind-article .notif-teaser {
  font-size: 0.84rem;
  -webkit-line-clamp: 3;
}

.notif-react-icon {
  flex-shrink: 0;
  font-size: 0.9rem;
  line-height: 1;
}

.notif-card[data-reaction="heart"] .notif-react-icon {
  color: #c45c6a;
}

.notif-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-top: 5px;
}

.notif-byline {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.notif-byline .avatar {
  width: 22px;
  height: 22px;
  font-size: 0.62rem;
  border-width: 1px;
}

.notif-byline .user-displayname {
  font-size: 0.8rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-byline .handle {
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.notif-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.notif-tags .chip {
  font-size: 0.68rem;
  padding: 2px 7px;
}

.notif-stamp {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: 83px;
  height: 104px;
  margin: 0 4px 0 12px;
  object-fit: cover;
  border-radius: 2px 7px 2px 7px;
  flex-shrink: 0;
  background: var(--accent-soft);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ink) 12%, transparent);
  transform: rotate(2.2deg);
}

.notif-stamp-video,
.notif-kind-video .notif-stamp {
  width: 122px;
  height: 76px;
  margin-top: 0;
  border-radius: 3px;
  transform: none;
}

.notif-tile .lang-badge {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  top: auto;
  right: auto;
  justify-self: end;
  align-self: start;
  z-index: 3;
  padding: 2px 7px;
}

.notif-tile:has(.lang-badge):not(.has-stamp) .notif-kicker {
  padding-right: 56px;
}

.notif-tile.has-stamp .lang-badge {
  grid-column: 1;
  justify-self: end;
}

.notif-cover {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-wash);
}

.notif-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 719px) {
  .notif-tile {
    padding: 10px 16px 10px 11px;
  }

  .notif-tile .notif-title,
  .notif-tile .notif-title.article-title-link {
    font-size: 1.02rem;
  }

  .notif-kind-article .notif-title {
    font-size: 1.1rem;
  }

  .notif-stamp {
    width: 68px;
    height: 90px;
    margin-left: 8px;
  }

  .notif-stamp-video,
  .notif-kind-video .notif-stamp {
    width: 101px;
    height: 65px;
  }

  .notif-byline .handle {
    display: none;
  }
}

.article-title-link,
.notif-title.article-title-link {
  color: inherit;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.22rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  display: inline-block;
  cursor: pointer;
}

.article-title-link:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* ——— Article Design Language (shared DNA) ——— */
.article-label {
  display: inline-block;
  margin: 0;
  font-family: var(--font);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
  line-height: 1.2;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.article-meta-dot {
  color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.article-tags,
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.article-tags .chip,
.post-tags .chip,
.chip.post-tag {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  padding: 3px 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

a.chip.post-tag:hover {
  color: var(--accent-bright);
  text-decoration-thickness: 2px;
  opacity: 1;
}

.article-page-body + .article-actions + .post-tags,
.article-page-body + .article-actions + .article-tags,
.post-footer + .post-tags {
  margin-top: 16px;
}

.article-teaser .post-tags,
.article-teaser .article-tags {
  margin-top: 12px;
  padding-top: 10px;
}

.card.post .post-tags {
  margin-top: 12px;
}

.post-em,
.article-page-body strong.post-em,
.post-body strong.post-em {
  font-weight: 700;
  /* Match surrounding body color so emphasis stays readable on light and dark cards */
  color: inherit;
  letter-spacing: -0.01em;
}

.guest-shell .post-em,
.guest-shell .post-body strong.post-em,
.guest-shell .article-page-body strong.post-em {
  color: #f2f7f4;
}

.chip-inline {
  display: inline;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

a.chip-inline:hover {
  color: var(--accent-bright);
  text-decoration-thickness: 2px;
}

.post .post-body a.chip-inline,
.track-note-body a.chip-inline,
.article-page-body a.chip-inline,
.article-teaser-text a.chip-inline,
.chat-body a.chip-inline,
.notif-title a.chip-inline,
.notif-teaser a.chip-inline {
  color: var(--accent);
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.article-byline .avatar {
  width: 36px;
  height: 36px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.article-byline-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.article-byline-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}

.article-byline-handle {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
}

.article-byline-name:hover,
.article-byline-handle:hover {
  color: var(--accent);
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.article-actions-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
}

.article-action-keep,
.article-action-react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 6px;
}

.article-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.article-action-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.article-action-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-action-keep:hover .article-action-label,
.article-action-react:hover .article-action-label {
  color: var(--ink);
}

.article-read-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
}

.article-read-link:hover {
  color: var(--accent-bright);
  text-decoration: underline;
}

/* Feed + Profile teasers */
.article-teaser {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
  gap: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.article-teaser.is-feed {
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.article-teaser.is-profile {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 3px 0 0 var(--clay), var(--shadow-soft);
  transition: box-shadow 180ms var(--ease-out), transform 180ms var(--ease-out), border-color 160ms ease;
}

.article-teaser.is-profile:hover {
  box-shadow: inset 3px 0 0 var(--clay), var(--shadow-lift);
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.article-cover {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-wash);
  border-radius: 0;
  position: relative;
  display: block;
}

.article-teaser.is-feed .article-cover,
.article-teaser.has-cover .article-cover,
.article-teaser.is-profile .article-cover {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  aspect-ratio: 16 / 9;
  justify-self: stretch;
}

.article-cover .teaser-thumb,
.article-cover .media-preview {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}

.article-cover .post-media-overlay {
  border-radius: 0;
}

.article-teaser-body {
  display: grid;
  gap: 8px;
  padding: 14px 2px 10px;
  min-width: 0;
  align-content: start;
}

.article-teaser.is-feed .article-teaser-body {
  padding: 12px 18px 18px;
}

.article-teaser.is-feed .article-tags,
.article-teaser.is-feed .post-tags {
  margin: 6px 0 0;
  padding: 8px 0 4px;
}

.article-teaser.is-profile .article-teaser-body {
  padding: 16px 18px 16px;
  gap: 10px;
}

.article-teaser-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.article-teaser-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-teaser.is-profile .article-teaser-text {
  -webkit-line-clamp: 4;
  font-size: 0.95rem;
  color: var(--ink);
  opacity: 0.82;
}

.article-teaser .article-title-link {
  font-family: var(--display);
  font-weight: 650;
  font-size: clamp(1.28rem, 4vw, 1.55rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: var(--ink);
  text-decoration: none;
  margin: 0;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.article-teaser.is-profile .article-title-link {
  font-size: clamp(1.35rem, 4.2vw, 1.75rem);
  line-height: 1.12;
}

.article-teaser.is-feed .article-actions {
  border-top: 0;
  padding-top: 2px;
  margin-top: 0;
}

.article-teaser .article-action-label {
  display: none;
}

@media (min-width: 720px) {
  .article-teaser .article-action-label {
    display: inline;
  }
}

.lang-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-badge:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.lang-badge-icon {
  font-size: 0.78rem;
  line-height: 1;
}

/* ——— Article Detail (magazine) ——— */
.article-loading {
  padding: 24px 4px;
}

.article-layout {
  display: grid;
  gap: 28px;
  align-items: start;
  max-width: 1180px;
}

.article-main {
  min-width: 0;
  max-width: 42rem;
}

.article-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.article-back-btn,
.article-tool-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 40px;
  padding: 0 4px;
  cursor: pointer;
}

.article-back-btn:hover,
.article-tool-btn:hover {
  color: var(--accent);
}

.article-toolbar-owner {
  display: flex;
  gap: 8px;
}

.article-full {
  position: relative;
  display: grid;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.article-full:has(.lang-switch-select) .article-header-kicker {
  padding-right: 118px;
}

.article-header {
  display: grid;
  gap: 14px;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.article-header-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
}

.article-page-title {
  font-family: var(--display);
  font-size: clamp(2rem, 7.2vw, 3.05rem);
  font-weight: 650;
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.article-dek {
  margin: 0;
  font-size: clamp(1.05rem, 2.8vw, 1.22rem);
  line-height: 1.45;
  color: var(--muted);
  font-weight: 500;
  max-width: 36em;
}

.article-page-media {
  margin: 0 0 22px;
  width: 100%;
}

.article-page-media .media-preview {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  max-height: min(52vh, 420px);
  object-fit: cover;
}

.article-publisher {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 4px 0 22px;
  margin-bottom: 8px;
}

.article-publisher-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.article-publisher-avatar .avatar,
.article-publisher .avatar {
  width: 48px;
  height: 48px;
  font-size: 1rem;
  flex-shrink: 0;
}

.article-publisher-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.article-publisher-name {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.12rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}

.article-publisher-handle {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
}

.article-publisher-name:hover,
.article-publisher-handle:hover {
  color: var(--accent);
}

.article-publisher-bio {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 34em;
}

.article-follow-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  flex-shrink: 0;
}

.article-follow-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.article-follow-btn.is-following {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.article-page-body {
  font-size: 1.05rem;
  line-height: 1.72;
  color: var(--ink);
  max-width: 38em;
}

.article-page-body p {
  margin: 0 0 1.15em;
}

.article-page-body p:last-child {
  margin-bottom: 0;
}

.article-page-body a.post-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-page-body .chip {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: var(--accent);
  font-weight: 650;
}

.article-section {
  font-family: var(--display);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 1.75em 0 0.65em;
  color: var(--ink);
}

.article-pull {
  margin: 1.6em 0;
  padding: 0.2em 0 0.2em 1em;
  border-left: 3px solid var(--clay);
  background: transparent;
}

.article-pull p {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  font-weight: 550;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

.article-full > .article-actions {
  margin-top: 28px;
  padding-top: 16px;
}

.article-full .article-action-label {
  display: inline;
}

.article-rail {
  display: none;
  min-width: 0;
}

.article-rail-block {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
}

.article-rail-block + .article-rail-block {
  margin-top: 14px;
}

.article-rail-block-alt {
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.article-rail-title {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.25;
}

.article-rail-sub {
  margin: 4px 0 12px;
}

.article-rail-list {
  display: grid;
  gap: 10px;
}

.article-side-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease;
}

.article-side-card:hover {
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  border-color: var(--line);
}

.article-side-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-wash);
}

.article-side-thumb-empty {
  background:
    linear-gradient(145deg, var(--accent-soft), var(--wash-3));
}

.article-side-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.article-side-cat {
  display: inline-flex;
  align-self: start;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.article-side-title {
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 1100px) {
  .article-layout {
    grid-template-columns: minmax(0, 42rem) minmax(240px, 1fr);
    gap: 40px;
  }

  .article-rail {
    display: block;
    position: sticky;
    top: 20px;
  }
}

@media (max-width: 1099px) {
  .article-rail {
    display: grid;
    gap: 14px;
  }

  .article-rail-block + .article-rail-block {
    margin-top: 0;
  }
}

@media (max-width: 719px) {
  .article-page-title {
    font-size: clamp(1.85rem, 8.5vw, 2.35rem);
  }

  .article-publisher {
    flex-direction: column;
    align-items: stretch;
  }

  .article-follow-btn {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-teaser.is-profile,
  .article-teaser.is-profile:hover {
    transition: none;
    transform: none;
  }
}

.city-hero {
  background:
    linear-gradient(145deg, var(--accent-soft), var(--wash-3));
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Cities magazine atlas ——— */
.cities-discover {
  display: grid;
  gap: 42px;
  max-width: 1080px;
  padding-bottom: 32px;
}

.city-mag-intro {
  display: grid;
  gap: 8px;
  max-width: 34rem;
}

.city-mag-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.city-mag-page-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.city-mag-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.city-mag-section {
  display: grid;
  gap: 18px;
}

.city-mag-masthead {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 18px;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}

.city-mag-index {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.85;
  color: color-mix(in srgb, var(--ink) 14%, transparent);
  letter-spacing: -0.04em;
}

.city-mag-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.1;
}

.city-mag-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.city-follow-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.city-follow-chip {
  flex: 1 1 160px;
  max-width: 220px;
  min-width: 148px;
  display: grid;
  gap: 6px;
  padding: 14px 14px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 10px 24px rgba(16, 26, 20, 0.04);
}

.city-follow-chip.is-primary {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background:
    linear-gradient(145deg, var(--accent-soft), var(--surface-raised) 55%);
}

.city-follow-name {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  line-height: 1.1;
}

.city-follow-name:hover { color: var(--accent); }

.city-follow-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.city-follow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.city-follow-btn {
  border: 0;
  background: rgba(16, 26, 20, 0.05);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.city-follow-btn:hover { background: var(--accent-soft); color: var(--accent); }
.city-follow-btn.is-danger:hover { background: rgba(155, 44, 44, 0.12); color: var(--danger); }

.city-follow-empty { padding: 8px 0; }

.city-mag-rail {
  display: grid;
  gap: 0;
}

.city-spread {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(0, 1.45fr);
  gap: 18px 28px;
  align-items: stretch;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.city-spread.is-feature {
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.55fr);
  padding-top: 8px;
  padding-bottom: 36px;
}

.city-spread.is-flip {
  grid-template-columns: minmax(0, 1.45fr) minmax(150px, 0.85fr);
}

.city-spread.is-flip .city-spread-identity { order: 2; }
.city-spread.is-flip .city-spread-mosaic { order: 1; }

.city-spread-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  position: relative;
}

.city-spread-cc {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 6px;
}

.city-spread-copy {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 4px;
}

.city-spread-name {
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: inherit;
  text-decoration: none;
}

.city-spread.is-feature .city-spread-name {
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
}

.city-spread-name:hover { color: var(--accent); }

.city-spread-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.city-spread-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.city-spread-mosaic {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  grid-auto-rows: minmax(88px, auto);
  gap: 10px;
  min-height: 140px;
}

.city-spread.is-feature .city-spread-mosaic {
  grid-template-columns: 1.25fr 1fr;
  grid-auto-rows: minmax(110px, auto);
  min-height: 220px;
}

.city-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px;
  border-radius: 4px 20px 20px 20px;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg-wash);
  overflow: hidden;
  min-height: 88px;
  border: 1px solid var(--line);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.city-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.city-tile-lg {
  grid-row: span 2;
  min-height: 200px;
}

.city-tile.has-image {
  color: var(--sidebar-fg);
  background-color: var(--bg-panel);
  background-image:
    linear-gradient(
      165deg,
      color-mix(in srgb, var(--accent) 24%, transparent) 0%,
      color-mix(in srgb, var(--dusk) 58%, transparent) 46%,
      color-mix(in srgb, var(--bg-panel) 94%, transparent) 100%
    ),
    var(--tile-image);
  background-size: cover;
  background-position: center;
  border-color: transparent;
}

.city-tile-event:not(.has-image) {
  background:
    linear-gradient(145deg, var(--accent-soft), var(--surface) 60%);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.city-tile-post:not(.has-image) {
  background:
    linear-gradient(160deg, var(--wash-2), var(--surface-raised) 55%);
}

.city-tile-article:not(.has-image) {
  background:
    linear-gradient(160deg, var(--dusk-soft, var(--accent-soft)), var(--surface-raised) 52%);
  border-color: color-mix(in srgb, var(--dusk, var(--accent)) 14%, transparent);
}

.city-tile-cat {
  align-self: start;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.city-tile-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.city-tile-lg .city-tile-title {
  font-size: 1.25rem;
  -webkit-line-clamp: 4;
}

.city-tile-meta {
  font-size: 0.78rem;
  opacity: 0.75;
}

.city-tile-empty {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 120px;
}

.city-mag-empty { padding: 12px 0; }

.city-mag-search-label input {
  width: min(100%, 420px);
}

.city-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.city-search-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.city-search-name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  line-height: 1.1;
}

.city-search-name:hover { color: var(--accent); }
.city-search-meta { font-size: 0.78rem; color: var(--muted); }

@media (max-width: 899px) {
  .city-spread,
  .city-spread.is-feature,
  .city-spread.is-flip {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .city-spread.is-flip .city-spread-identity,
  .city-spread.is-flip .city-spread-mosaic {
    order: initial;
  }

  .city-spread-name,
  .city-spread.is-feature .city-spread-name {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }

  .city-spread-mosaic,
  .city-spread.is-feature .city-spread-mosaic {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }

  .city-tile-lg {
    grid-row: span 1;
    grid-column: 1 / -1;
    min-height: 140px;
  }

  .city-follow-chip {
    max-width: none;
  }
}

@media (min-width: 1100px) {
  .discover-page:has(.cities-discover) {
    max-width: 1100px;
  }
}

.feed-tab-add {
  min-width: 2.4rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  padding-left: 12px;
  padding-right: 12px;
}

.feed-tab-add.is-open {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* The tab and its remove control are sibling buttons (a button cannot nest
   inside a button) drawn as a single chip. */
.feed-custom-tab-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.feed-custom-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 11rem;
}

/* Specificity has to match `.filter-rail .lang-chip`, which sets the padding
   shorthand, or the remove button would sit on top of the label. */
.filter-rail .lang-chip.feed-custom-tab,
.feed-custom-tab {
  padding-right: 28px;
}

.feed-custom-tab > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-tab-remove {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

/* Keeps the glyph small inside the chip while giving the control a ~40px
   touch target. */
.feed-tab-remove::after {
  content: "";
  position: absolute;
  inset: -7px;
}

.feed-tab-remove:hover,
.feed-tab-remove:focus-visible {
  opacity: 1;
}

/* The remove button is a sibling of the chip, so it cannot inherit the
   active chip's foreground colour — restate it here. */
.feed-custom-tab-wrap.active .feed-tab-remove {
  opacity: 1;
  color: var(--btn-on-accent);
}

.home-masthead {
  position: relative;
}

.feed-tab-picker {
  position: relative;
  z-index: 6;
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.feed-tab-picker[hidden] {
  display: none !important;
}

.feed-tab-picker-input {
  width: 100%;
  margin: 0;
}

.feed-tab-picker-kinds {
  padding-top: 0;
}

.feed-tab-picker-results {
  min-height: 2.2rem;
}

.feed-tab-picker-list {
  display: grid;
  gap: 6px;
  max-height: min(48dvh, 320px);
  overflow: auto;
}

.feed-tab-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 246, 0.55);
  color: inherit;
  cursor: pointer;
}

.feed-tab-picker-row:hover,
.feed-tab-picker-row:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.feed-tab-picker-row.is-pinned,
.feed-tab-picker-row:disabled {
  opacity: 0.55;
  cursor: default;
}

.feed-tab-picker-glyph {
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
}

.feed-tab-picker-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.feed-tab-picker-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-masthead.page-masthead {
  gap: 0;
}

@media (max-width: 899px) {
  body {
    background-attachment: scroll;
  }

  .home-masthead.page-masthead {
    padding: 2px 0 8px;
    margin-bottom: 0;
    border-bottom: 0;
  }

  .home-masthead.page-masthead::before,
  .home-masthead.page-masthead::after {
    display: none;
  }

  .feed-filters-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px 2px;
  }

  .feed-filters-scroll::-webkit-scrollbar {
    display: none;
  }

  .feed-filters.filter-rail {
    flex-wrap: nowrap;
    gap: 8px;
    width: max-content;
    max-width: none;
    min-width: 100%;
  }

  .feed-filters .lang-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .app-topbar {
    min-height: 52px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  }

  .app-topbar .brand {
    font-size: 1.25rem;
  }

  .app-main {
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .content-feed,
  .content-feed > .stack,
  .feed-list,
  .card.post,
  .article-teaser-body {
    min-width: 0;
    max-width: 100%;
  }

  .card.post > .post-media {
    margin: 0;
    width: 100%;
  }

  .post .post-body,
  .post .avatar-row,
  .post-footer {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .article-teaser .article-title-link {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

.publish-popup-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 8, 0.45);
}

.publish-popup {
  position: relative;
  min-width: min(280px, 90vw);
  max-width: 360px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px 20px;
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.publish-popup .muted {
  color: var(--muted);
}

.publish-popup-close {
  position: absolute;
  top: 4px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  /* The popup sits on a light surface, so the glyph follows --muted/--ink. */
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.publish-popup-close:hover,
.publish-popup-close:focus-visible {
  color: var(--ink);
}

.page-hint-popup-body {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.action-toast-root {
  position: fixed;
  inset: 0;
  /* Status feedback is the top layer: it must stay readable above every
     dialog, including the fullscreen photo viewer (12000). */
  z-index: 12100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}
.action-toast {
  pointer-events: auto;
  min-width: min(240px, 90vw);
  max-width: 360px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-lift);
  text-align: center;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.35;
}
.action-toast.is-ok {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.action-toast.is-error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.notif-card .notif-teaser {
  font-size: 0.82rem;
  line-height: 1.38;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow: visible;
}

.grid-2 {
  display: grid;
  gap: 14px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  border: 2px solid rgba(20, 107, 78, 0.22);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar.lg {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}

.avatar.xl {
  width: 128px;
  height: 128px;
  font-size: 2.4rem;
  border-width: 3px;
}

.avatar-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-identity-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.post-nearby {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

a.avatar-link,
a.user-displayname,
a.user-handle,
a.avatar-link-wrap,
a.entity-name-link,
a.bot-channel-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.avatar-link,
a.avatar-link-wrap {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 50%;
}

a.avatar-link .avatar,
a.avatar-link-wrap .avatar {
  pointer-events: none;
}

a.user-displayname {
  font-weight: 700;
  line-height: 1.2;
}

a.user-handle {
  display: inline-block;
  line-height: 1.2;
}

a.avatar-link:hover,
a.user-displayname:hover,
a.user-handle:hover,
a.entity-name-link:hover,
a.bot-channel-link:hover {
  text-decoration: underline;
}

a.avatar-link:hover {
  text-decoration: none;
  opacity: 0.88;
}

a.avatar-link-wrap {
  margin: 0 auto;
}

.avatar-upload {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.stat {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat .num {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat .label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.stat-reason {
  margin-top: 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--muted);
}

.status-line {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.conversation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.conversation-row-main { min-width: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--btn-on-accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.nav-badge {
  flex-shrink: 0;
  pointer-events: none;
}

.nav-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--clay-bright);
  color: var(--btn-on-accent);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.nav-badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay-bright);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--clay-bright) 35%, transparent);
}

.chat-sender-link,
.chat-member-link,
.chat-title-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.chat-sender-link:hover,
.chat-member-link:hover,
.chat-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.chat-header-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.chat-unread-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  font-size: 0.72rem;
}

.messages-page {
  gap: 20px;
}

.messages-section-label {
  margin-bottom: 8px;
}

.messages-conversations-section {
  display: grid;
  gap: 8px;
}

.messages-people-section {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.messages-list {
  gap: 10px;
}

.message-contact-picker {
  max-width: 100%;
}

.chat {
  height: 100%;
  min-height: calc(100dvh - var(--topbar-h) - var(--bottom-h) - 32px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
}

.chat-thread {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  min-height: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chat-bubble {
  max-width: min(85%, 520px);
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-wash);
  justify-self: start;
}

.chat-bubble.mine {
  background: var(--accent-soft);
  justify-self: end;
}

.chat-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.chat-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-compose {
  align-items: stretch;
}

.msg-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  align-items: end;
  padding: 12px;
  padding-bottom: calc(12px + var(--safe-bottom));
}

.msg-modal {
  width: min(520px, 100%);
  margin: 0 auto;
  /* dvh, not vh: mobile browser chrome makes vh taller than the visible area. */
  max-height: min(82dvh, 720px);
  overflow: auto;
  border-radius: 20px;
}

.modal-contact-list {
  max-height: 42vh;
  overflow: auto;
}

.contact-pick {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
}

.contact-pick.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.content-wide {
  max-width: 760px;
}

.content-feed {
  max-width: 640px;
}

.content-feed > .stack,
.feed-list {
  display: grid;
  gap: 18px;
  align-items: start;
  align-content: start;
}

.feed-sentinel {
  height: 1px;
  pointer-events: none;
}

.feed-load-more {
  text-align: center;
  padding: 8px 0 4px;
}

.profile-more-feed {
  margin-top: 18px;
}

.profile-posts-section {
  margin-top: 4px;
}

.profile-posts-head {
  padding-left: 2px;
  padding-right: 2px;
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.profile-posts-head::before {
  display: none;
}

.profile-posts-head::after {
  bottom: -1px;
}

.profile-hero-public .profile-masthead-cta .btn {
  width: fit-content;
}

.profile-masthead-name {
  text-decoration: none;
  color: inherit;
}

.article-teaser .article-cover {
  margin-top: 0;
}

.article-page-media .media-preview {
  border-radius: var(--radius-sm);
}

.search-page.content-feed,
.search-page {
  max-width: 760px;
}

/* ——— Page mastheads (editorial) ——— */
.page-masthead {
  display: grid;
  gap: 10px;
  padding: 8px 0 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.page-masthead::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--clay));
  border-radius: 2px;
}

.page-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--clay);
}

.page-masthead .section-title {
  margin: 0;
}

.page-masthead::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 28%;
  max-width: 160px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--dusk));
  border-radius: 2px;
  opacity: 0.55;
}

.page-lede {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
}

.page-masthead-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.filter-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 2px;
}

.filter-rail .lang-chip {
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 246, 0.65);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.filter-rail .lang-chip.active {
  background: var(--accent);
  color: var(--btn-on-accent);
  border-color: transparent;
}

.filter-rail .lang-chip[data-ff="city"].active {
  background: var(--clay);
}

.filter-rail .lang-chip[data-ff="locals"].active {
  background: var(--dusk);
}

.filter-rail .lang-chip.feed-tab-a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 12px;
  letter-spacing: 0.02em;
}

.filter-rail .lang-chip.feed-tab-a .feed-tab-a-mark {
  display: block;
  flex-shrink: 0;
}

.filter-rail .lang-chip.feed-tab-a .feed-tab-a-letter {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

.filter-rail .lang-chip.feed-tab-a.active {
  background: color-mix(in srgb, var(--accent) 82%, #0b1f24);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}

.home-empty {
  padding: 36px 28px;
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 40%),
    linear-gradient(225deg, var(--clay-soft), transparent 45%),
    var(--surface-raised);
  border-left: 4px solid var(--clay);
}

.home-empty .brand {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.compose-studio {
  max-width: none;
  position: relative;
  overflow: hidden;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.compose-dialog-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.compose-main.stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}

.compose-main-body {
  display: grid;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-content: start;
  scrollbar-width: none;
}

.compose-main-body::-webkit-scrollbar {
  display: none;
}

.compose-post-text {
  min-height: 88px;
}

.compose-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.compose-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.compose-overlay.is-uploading .compose-dialog {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-lift);
}

.compose-overlay.is-uploading .compose-dialog-actions #publish {
  opacity: 1;
}

.compose-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 16, 0.5);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.compose-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(96dvh, 900px);
  overflow: hidden;
  scrollbar-width: none;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 20px 22px 16px;
  transform: translateY(14px);
  transition: transform 200ms ease;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.compose-dialog::-webkit-scrollbar {
  display: none;
}

.compose-dialog .media-preview,
.compose-dialog .media-preview.video {
  max-height: 160px;
}

.compose-overlay.is-open .compose-dialog {
  transform: none;
}

.compose-dialog-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 36px;
  height: 36px;
  margin: -4px -8px 0 12px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.compose-dialog-close:hover,
.compose-dialog-close:focus-visible {
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  outline: none;
}

.compose-dialog-head {
  display: grid;
  gap: 6px;
  margin: 0 40px 4px 0;
}

.compose-dialog-head .section-title {
  margin: 0;
}

.compose-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.compose-author .avatar {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.compose-author-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.compose-author-copy strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.compose-dialog-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 10px;
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-raised);
}

.compose-dialog-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.compose-dialog-actions .upload-progress {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
}

.compose-dialog-actions .upload-progress[hidden] {
  display: none;
}

.compose-overlay.is-uploading .compose-dialog-actions .upload-progress {
  display: block;
}

.compose-dialog-actions .upload-progress-label {
  font-weight: 700;
  font-size: 0.95rem;
}

.compose-dialog-actions .upload-progress-track {
  height: 10px;
}

.compose-dialog-actions #publish {
  min-width: 8.4rem;
}

.compose-more-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
}

.compose-more-toggle::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--accent);
  font-weight: 800;
}

.compose-more-toggle.is-open {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.compose-more-toggle.is-open::before {
  content: "–";
}

.compose-more-panel[hidden] {
  display: none !important;
}

.compose-more-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.compose-more-title {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.compose-more-head .compose-dialog-close {
  position: static;
  float: none;
  margin: -4px -6px 0 0;
}

.compose-more-scrim[hidden] {
  display: none !important;
}

.compose-more-scrim {
  display: none;
}

@media (min-width: 900px) {
  .compose-overlay.is-more-open .compose-dialog {
    width: min(1080px, calc(100vw - 32px));
    height: min(96dvh, 900px);
    max-height: min(96dvh, 900px);
    padding: 0;
    overflow: hidden;
  }

  .compose-overlay.is-more-open .compose-dialog > .compose-dialog-close {
    position: absolute;
    top: 16px;
    right: calc(360px + 10px);
    float: none;
    margin: 0;
  }

  .compose-overlay.is-more-open .compose-dialog-body {
    max-height: min(96dvh, 900px);
    min-height: 0;
    overflow: hidden;
  }

  .compose-overlay.is-more-open .compose-studio {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    height: min(96dvh, 900px);
    max-height: min(96dvh, 900px);
  }

  .compose-overlay.is-more-open .compose-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 22px 24px 18px;
  }

  .compose-overlay.is-more-open .compose-main::-webkit-scrollbar,
  .compose-overlay.is-more-open .compose-more-panel::-webkit-scrollbar {
    display: none;
  }

  .compose-overlay.is-more-open .compose-more-panel {
    display: flex;
    flex-direction: column;
    flex: 0 0 360px;
    width: 360px;
    max-width: 360px;
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
    padding: 22px 20px 18px;
    border-left: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 78%, var(--surface-raised));
  }
}

@media (max-width: 899px) {
  /* Scrim + panel share the dialog stacking context so the panel stays above the dimmer. */
  .compose-overlay.is-more-open .compose-more-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 4;
    background: rgba(6, 10, 16, 0.55);
  }

  .compose-overlay.is-more-open .compose-more-panel {
    position: absolute;
    z-index: 5;
    left: 12px;
    right: 12px;
    top: max(8vh, env(safe-area-inset-top, 0px));
    width: auto;
    max-height: min(84vh, 720px);
    overflow: auto;
    padding: 18px 16px calc(16px + var(--safe-bottom));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
    color: var(--ink);
    box-shadow: var(--shadow-lift);
    pointer-events: auto;
  }
}

html.is-composing,
html.is-composing body {
  overflow: hidden;
}

@media (max-width: 719px) {
  .compose-overlay {
    padding: 0;
    place-items: stretch;
  }

  .compose-dialog {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    padding: 16px 16px calc(16px + var(--safe-bottom));
    transform: translateY(18px);
    overflow: hidden;
  }

  .compose-dialog-head {
    margin-right: 44px;
  }

  .compose-post-text {
    min-height: 88px;
  }
}

.compose-mode-tabs .btn {
  border-radius: var(--radius-sm);
}

.compose-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  font-size: 0.92rem;
}

.compose-target-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.compose-target-clear:hover {
  color: var(--ink);
}

.compose-extra {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}

.compose-extra-summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  user-select: none;
}

.compose-extra-summary::-webkit-details-marker { display: none; }

.compose-extra-summary::before {
  content: "+";
  display: inline-block;
  width: 1.1em;
  color: var(--accent);
  font-weight: 800;
}

.compose-extra[open] .compose-extra-summary::before {
  content: "–";
}

.compose-extra[open] .compose-extra-summary {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.compose-extra-body {
  padding: 14px;
}

.post-edit-panel,
.article-edit-panel {
  padding: 16px 20px 20px;
  gap: 16px;
}

.post-edit-panel .compose-extra + .actions,
.article-edit-panel .compose-extra + .actions {
  margin-top: 14px;
  padding-top: 2px;
}

.edit-media-actions {
  gap: 8px;
}

.post-edit-panel [data-edit-preview] .media-preview,
.article-edit-panel [data-edit-preview] .media-preview {
  max-height: 220px;
  border-radius: var(--radius-sm);
}

.card.post.has-media .post-edit-panel,
.card.post.has-media .article-edit-panel {
  padding: 16px 20px 20px;
}

.card.post.has-media .post-edit-panel .actions,
.card.post.has-media .article-edit-panel .actions {
  padding-left: 0;
  padding-right: 0;
}

.card.post.has-media:has(.post-edit-panel),
.card.post.has-media:has(.article-edit-panel) {
  padding-bottom: 20px;
}

.card.post.has-media:has(.post-edit-panel) .post-footer,
.card.post.has-media:has(.article-edit-panel) .post-footer {
  padding: 12px 20px 8px;
}

.compose-schedule-pickers {
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

.compose-schedule-date,
.compose-schedule-time {
  flex: 1;
  min-width: 130px;
}

.compose-schedule-fields[hidden] {
  display: none !important;
}

.publish-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-right: auto;
}

.publish-status-badge.scheduled {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}

.publish-status-badge.draft {
  color: var(--muted);
}

.profile-spread,
.profile-folio {
  display: grid;
  gap: 28px;
  max-width: 1180px;
  width: 100%;
}

.profile-hero.profile-masthead {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
  background:
    linear-gradient(145deg, var(--accent-soft) 0%, transparent 42%),
    linear-gradient(320deg, var(--dusk-soft) 0%, transparent 38%),
    var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  --mood-bass: 0;
  --mood-mid: 0;
  --mood-high: 0;
  --mood-energy: 0;
  --mood-x: 0.5;
}

.profile-hero::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--clay-soft);
  pointer-events: none;
  z-index: 0;
}

.profile-mood-scatter {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.profile-mood-scatter-item {
  position: absolute;
  top: var(--mood-top, 20%);
  left: var(--mood-left, 20%);
  width: var(--mood-size, 48px);
  height: var(--mood-size, 48px);
  transform: translate(-50%, -50%) rotate(var(--mood-tilt, 0deg));
  pointer-events: auto;
  opacity: 0.92;
  transition: transform 180ms var(--ease-out), opacity 180ms ease, box-shadow 180ms ease;
  z-index: 6;
}

.profile-mood-scatter-item:nth-child(3n) { --mood-tilt: -9deg; }
.profile-mood-scatter-item:nth-child(3n+1) { --mood-tilt: 7deg; }
.profile-mood-scatter-item:nth-child(3n+2) { --mood-tilt: -4deg; }

.profile-mood-scatter-item:hover,
.profile-mood-scatter-item:focus-visible {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--mood-tilt, 0deg)) scale(1.06);
  outline: none;
  box-shadow: 0 12px 28px rgba(8, 10, 24, 0.42);
}

.profile-mood-scatter-item video,
.profile-mood-scatter-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-mood-scatter-item .mood-orb {
  width: 100%;
  height: 100%;
}

.profile-hero.profile-masthead:has(.profile-mood-scatter) {
  min-height: clamp(168px, 22vw, 240px);
}

@media (max-width: 719px) {
  .profile-mood-scatter-item {
    opacity: 0.88;
  }

  .profile-hero.profile-masthead:has(.profile-mood-scatter) {
    min-height: 168px;
  }
}

.mood-listen {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.65s ease;
}

.profile-hero.is-mood-listening .mood-listen {
  opacity: 1;
}

.mood-listen-wash,
.mood-listen-bloom {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}

.mood-listen-wash {
  inset: -28%;
  background:
    radial-gradient(
      ellipse 58% 72% at calc(18% + var(--mood-x) * 22%) 32%,
      color-mix(in srgb, var(--accent-bright) calc(14% + var(--mood-bass) * 38%), transparent),
      transparent 64%
    ),
    radial-gradient(
      ellipse 52% 58% at calc(86% - var(--mood-x) * 18%) 78%,
      color-mix(in srgb, var(--dusk-bright) calc(10% + var(--mood-high) * 34%), transparent),
      transparent 60%
    ),
    radial-gradient(
      ellipse 40% 36% at 48% 48%,
      color-mix(in srgb, var(--ink) calc(4% + var(--mood-mid) * 10%), transparent),
      transparent 70%
    );
  transform: scale(calc(1.02 + var(--mood-bass) * 0.055));
  opacity: calc(0.55 + var(--mood-energy) * 0.45);
}

.mood-listen-bloom--bass {
  left: -18%;
  bottom: -28%;
  width: 58%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 42%, transparent), transparent 68%);
  filter: blur(28px);
  opacity: calc(0.12 + var(--mood-bass) * 0.5);
  transform: scale(calc(0.86 + var(--mood-bass) * 0.28));
}

.mood-listen-bloom--high {
  right: -12%;
  top: -22%;
  width: 46%;
  height: 52%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--dusk-bright) 50%, transparent), transparent 70%);
  filter: blur(22px);
  opacity: calc(0.08 + var(--mood-high) * 0.42);
  transform: translate3d(calc(var(--mood-x) * -18px), calc(var(--mood-high) * -10px), 0) scale(calc(0.9 + var(--mood-high) * 0.2));
}

.mood-listen-wave {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 420px);
  height: 40px;
  margin: 2px 0 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.9;
}

.mood-listen-wave[hidden] {
  display: none;
}

.profile-hero.is-mood-listening .profile-masthead-name,
.profile-hero.is-mood-listening .page-kicker,
.profile-hero.is-mood-listening .profile-masthead-bio {
  text-shadow: 0 1px 16px rgba(4, 8, 18, 0.35);
}

.mood-peek-root.has-audio:not(.has-photo) {
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(
    180deg,
    rgba(4, 10, 8, 0.16) 0%,
    rgba(4, 10, 8, 0.38) 48%,
    rgba(4, 10, 8, 0.58) 100%
  );
}

html[data-profile-style="space"] .profile-hero.is-mood-listening::before {
  opacity: calc(0.55 + var(--mood-high) * 0.45);
}

html[data-profile-style="space"] .profile-hero.is-mood-listening::after {
  transform: scale(calc(1 + var(--mood-bass) * 0.35));
  box-shadow:
    0 -14px 0 -3px #fff,
    0 14px 0 -3px #fff,
    -14px 0 0 -3px #fff,
    14px 0 0 -3px #fff,
    0 0 calc(22px + var(--mood-energy) * 28px) rgba(168, 180, 255, 1),
    -36px -18px 0 -4px rgba(255, 255, 255, 0.85),
    28px -40px 0 -4.5px rgba(200, 220, 255, 0.9);
}

.profile-fx--space .pfx-stars {
  opacity: calc(0.82 + var(--mood-energy, 0) * 0.18);
}

.profile-fx--space .pfx-nebula {
  opacity: calc(0.9 + var(--mood-bass, 0) * 0.2);
}

@media (max-width: 719px) {
  .mood-listen-wave {
    width: 100%;
    height: 32px;
  }

  .mood-listen-bloom--bass,
  .mood-listen-bloom--high {
    filter: blur(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mood-listen-wash,
  .mood-listen-bloom {
    transform: none !important;
    will-change: opacity;
  }
}

.profile-masthead-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 8;
  min-height: 40px;
  margin: 0 0 10px;
  pointer-events: auto;
}

.profile-masthead-chrome-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-masthead-chrome-start .page-kicker {
  margin: 0;
}

.profile-back {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(8, 18, 24, 0.06);
}

.profile-back:hover,
.profile-back:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
  outline: none;
}

.profile-back svg {
  display: block;
}

.profile-masthead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
}

.profile-masthead-actions:empty {
  display: none;
}

.profile-masthead-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-follow-cta {
  min-width: 118px;
  justify-content: center;
  font-weight: 700;
}

.profile-follow-cta.is-following {
  font-weight: 600;
}

.profile-masthead-edit {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #05060c 48%, transparent);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.profile-masthead-edit:hover,
.profile-masthead-edit:focus-visible {
  background: color-mix(in srgb, #05060c 62%, transparent);
  outline: none;
}

.profile-masthead-edit svg {
  display: block;
}

.profile-masthead-stage {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 20px;
  align-items: start;
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.profile-masthead-copy {
  min-width: 0;
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.profile-masthead-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.35rem, 10vw, 3.4rem);
  letter-spacing: -0.045em;
  line-height: 0.9;
  font-weight: 700;
}

.profile-masthead-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
  margin-top: 12px;
}

.profile-masthead-byline .handle {
  color: var(--muted);
  font-size: 1rem;
}

.profile-masthead-dot {
  color: var(--muted);
}

.profile-masthead .avatar.xl {
  width: clamp(96px, 22vw, 148px);
  height: clamp(96px, 22vw, 148px);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* Same rainbow ring as small mood badges when the profile has a live mood. */
.profile-masthead .avatar.xl.has-mood {
  border: 4px solid transparent;
  background-image:
    linear-gradient(var(--accent-soft), var(--accent-soft)),
    conic-gradient(from 160deg, #ff4d6d, #ff9f1c, #ffe066, #80ffdb, #4cc9f0, #c77dff, #ff4d6d);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 8px 20px rgba(8, 10, 24, 0.35);
}

.profile-masthead .avatar.xl.has-mood img {
  background: var(--surface-raised);
}

button.avatar-mood-hit {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  flex-shrink: 0;
}

button.avatar-mood-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.profile-avatar-cluster {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  z-index: 5;
  pointer-events: auto;
}

.profile-mood-rail {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  max-width: min(52vw, 220px);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
}

.profile-mood-rail::-webkit-scrollbar {
  display: none;
}

.profile-mood-rail .mood-badge {
  position: static;
  left: auto;
  bottom: auto;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
}

.mood-badge {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 8px 20px rgba(8, 10, 24, 0.35);
  line-height: 0;
}

.profile-avatar-cluster > .mood-badge {
  /* legacy single-badge fallback if any remain outside the rail */
  position: absolute;
  left: -10px;
  bottom: 2px;
  z-index: 3;
}

.mood-badge.is-add {
  display: grid;
  place-items: center;
  padding: 3px;
  /* No box-shadow: on iOS/WebKit it paints as a rounded square behind the circle. */
  overflow: visible;
  background: conic-gradient(from 160deg, #ff4d6d, #ff9f1c, #ffe066, #80ffdb, #4cc9f0, #c77dff, #ff4d6d);
  border: 3px solid transparent;
  color: var(--ink);
  box-shadow: none;
}

.mood-plus {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--ink);
}

.mood-plus svg {
  width: 42%;
  height: 42%;
  display: block;
}

.mood-badge.has-photo {
  padding: 3px;
  background: conic-gradient(from 160deg, #ff4d6d, #ff9f1c, #ffe066, #80ffdb, #4cc9f0, #c77dff, #ff4d6d);
}

.mood-badge.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  background: var(--surface);
}

.mood-orb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.92), transparent 34%),
    radial-gradient(circle at 72% 78%, rgba(90, 40, 160, 0.28), transparent 46%),
    conic-gradient(from 130deg, #ff3d6e, #ff8a3d, #ffd84d, #5dffc0, #4cc9f0, #7b61ff, #ff3d6e);
  animation: mood-orb-spin 9s linear infinite;
}

.mood-orb-sheen {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 68% 80%, rgba(12, 10, 30, 0.22), transparent 44%);
}

@keyframes mood-orb-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .mood-orb { animation: none; }
}

.mood-peek-root {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: color-mix(in srgb, var(--bg-panel) 42%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mood-peek-root.is-enter {
  z-index: 93;
  animation: mood-peek-fade-in 520ms var(--ease-out) both;
}

.mood-peek-root.is-leave {
  z-index: 91;
  pointer-events: none;
  animation: mood-peek-fade-out 420ms ease both;
}

.mood-peek-root.is-enter-next .mood-peek-media,
.mood-peek-root.is-enter-next .mood-peek {
  animation: mood-peek-shift-in-next 560ms var(--ease-out) both;
}

.mood-peek-root.is-enter-prev .mood-peek-media,
.mood-peek-root.is-enter-prev .mood-peek {
  animation: mood-peek-shift-in-prev 560ms var(--ease-out) both;
}

.mood-peek-root.is-leave-next .mood-peek-media,
.mood-peek-root.is-leave-next .mood-peek {
  animation: mood-peek-shift-out-next 420ms ease both;
}

.mood-peek-root.is-leave-prev .mood-peek-media,
.mood-peek-root.is-leave-prev .mood-peek {
  animation: mood-peek-shift-out-prev 420ms ease both;
}

@keyframes mood-peek-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mood-peek-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes mood-peek-shift-in-next {
  from { transform: translate3d(18px, 0, 0) scale(1.02); }
  to { transform: none; }
}

@keyframes mood-peek-shift-in-prev {
  from { transform: translate3d(-18px, 0, 0) scale(1.02); }
  to { transform: none; }
}

@keyframes mood-peek-shift-out-next {
  from { transform: none; }
  to { transform: translate3d(-14px, 0, 0) scale(0.985); }
}

@keyframes mood-peek-shift-out-prev {
  from { transform: none; }
  to { transform: translate3d(14px, 0, 0) scale(0.985); }
}

@media (prefers-reduced-motion: reduce) {
  .mood-peek-root.is-enter,
  .mood-peek-root.is-leave,
  .mood-peek-root.is-enter-next .mood-peek-media,
  .mood-peek-root.is-enter-next .mood-peek,
  .mood-peek-root.is-enter-prev .mood-peek-media,
  .mood-peek-root.is-enter-prev .mood-peek,
  .mood-peek-root.is-leave-next .mood-peek-media,
  .mood-peek-root.is-leave-next .mood-peek,
  .mood-peek-root.is-leave-prev .mood-peek-media,
  .mood-peek-root.is-leave-prev .mood-peek {
    animation: none !important;
  }
}

.mood-peek-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.mood-peek-root.has-photo .mood-peek-media {
  position: relative;
  flex: 0 1 auto;
  width: min(420px, calc(100vw - 40px));
  aspect-ratio: 9 / 16;
  max-height: min(82dvh, 880px);
  height: auto;
  overflow: hidden;
  border-radius: 16px;
  background: #111;
}

.mood-peek-stage {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: stretch;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
}

.mood-peek-stage .mood-peek-media {
  grid-area: 1 / 1;
  flex: none;
}

.mood-peek-stage .mood-peek-chrome {
  grid-area: 1 / 1;
  align-self: start;
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  width: 100%;
  z-index: 20;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, #05060c 55%, transparent), transparent);
  padding: 12px 12px 28px;
  box-sizing: border-box;
  pointer-events: none;
  overflow: hidden;
}

.mood-peek-root.has-photo:not(.is-phone) .mood-peek-photo,
.mood-peek-root.has-photo:not(.is-phone) .mood-peek-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: var(--mood-media-x, 50%) var(--mood-media-y, 50%);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
}

.mood-peek-photo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: var(--mood-media-x, 50%) var(--mood-media-y, 50%);
  border-radius: 0;
  box-shadow: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}

.mood-peek {
  width: min(440px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px 20px 18px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  position: relative;
}

.mood-peek-root.has-photo .mood-peek {
  width: min(480px, 100%);
}

.mood-peek-root.has-photo .mood-peek-media.is-panning,
.mood-peek-root.has-photo.is-panning .mood-peek-media {
  cursor: grabbing;
}

.mood-peek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}

.mood-peek-remaining {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.mood-peek-scheduled {
  margin: 0;
}

.mood-peek .publish-popup-close {
  position: static;
  flex-shrink: 0;
  margin: -4px -6px -4px auto;
  color: var(--muted);
}

.mood-peek-visual {
  width: 112px;
  height: 112px;
  margin: 8px auto 0;
  border-radius: 50%;
  overflow: hidden;
}

.mood-peek-visual.has-photo {
  padding: 4px;
  background: conic-gradient(from 160deg, #ff4d6d, #ff9f1c, #ffe066, #80ffdb, #4cc9f0, #c77dff, #ff4d6d);
}

.mood-peek-visual.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.mood-peek-caption {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
}

.mood-peek-stack {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mood-peek-chip {
  appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mood-peek-chip.has-photo {
  padding: 2px;
  background: conic-gradient(from 160deg, #ff4d6d, #ff9f1c, #ffe066, #80ffdb, #4cc9f0, #c77dff, #ff4d6d);
}

.mood-peek-chip img,
.mood-peek-chip video,
.mood-peek-chip .mood-orb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.mood-peek-chip.is-on {
  border-color: var(--ink);
}

.mood-peek-manage,
.mood-peek-editor {
  display: grid;
  gap: 10px;
}

.mood-peek-editor {
  max-height: min(88dvh, 620px);
  overflow: auto;
  scrollbar-width: none;
}

.mood-stage-root {
  position: fixed;
  inset: 0;
  z-index: 94;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg-panel) 38%, transparent);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out);
}

.mood-stage-root.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mood-stage-root.is-leaving {
  opacity: 0;
}

.mood-stage {
  position: relative;
  width: min(1080px, 100%);
  height: min(760px, 86dvh);
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(340px, 1.08fr);
  overflow: hidden;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-lift), 0 30px 80px color-mix(in srgb, var(--bg-panel) 28%, transparent);
  transform: translateY(18px) scale(0.985);
  transition: transform 280ms var(--ease-out);
}

.mood-stage-root.is-open .mood-stage {
  transform: none;
}

.mood-stage-root.is-leaving .mood-stage {
  transform: translateY(10px) scale(0.99);
}

.mood-stage-visual {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg-panel);
  color: var(--sidebar-fg);
}

.mood-stage-wash {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse at 20% 20%, color-mix(in srgb, var(--accent-bright) 32%, transparent), transparent 46%),
    radial-gradient(ellipse at 80% 75%, color-mix(in srgb, var(--dusk-bright) 28%, transparent), transparent 42%),
    radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--clay-bright) 16%, transparent), transparent 50%);
  pointer-events: none;
}

.mood-stage-visual-inner {
  position: relative;
  z-index: 1;
  width: min(86%, 360px);
  display: grid;
  justify-items: center;
  gap: 16px;
}

.mood-stage-orb-wrap {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.mood-stage-orb-wrap .mood-orb {
  width: 148px;
  height: 148px;
}

.mood-stage-orb-wrap.is-spin .mood-orb {
  animation: mood-orb-spin 4s linear infinite;
}

.mood-stage-visual-note {
  margin: 0;
  max-width: 16rem;
  color: var(--sidebar-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.mood-stage-drop {
  appearance: none;
  width: min(100%, 280px);
  min-height: 220px;
  padding: 28px 22px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--sidebar-fg);
  background: color-mix(in srgb, #fff 6%, transparent);
  border: 1px dashed color-mix(in srgb, #fff 22%, transparent);
  border-radius: 22px;
  cursor: pointer;
}

.mood-stage-drop p {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.mood-stage-drop span {
  color: var(--sidebar-muted);
  font-size: 0.86rem;
}

.mood-stage-film {
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  max-height: min(58vh, 520px);
  height: auto;
  object-fit: cover;
  object-position: var(--mood-media-x, 50%) var(--mood-media-y, 50%);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  background: #111;
}

.mood-stage-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 28px 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 28%),
    var(--surface-raised);
}

.mood-stage-header {
  position: relative;
  display: grid;
  gap: 8px;
  padding-right: 52px;
  margin-bottom: 18px;
}

.mood-stage-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.mood-stage-lede {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.mood-stage-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink);
  cursor: pointer;
}

.mood-stage-close:hover,
.mood-stage-close:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  outline: none;
}

.mood-stage-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding-right: 4px;
  scrollbar-width: thin;
}

.mood-stage-field {
  display: grid;
  gap: 8px;
}

.mood-stage-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

.mood-stage-input {
  width: 100%;
  max-width: none;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
}

.mood-stage-input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.mood-stage-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.mood-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.mood-stage-actions .btn {
  min-height: 44px;
  padding: 0 18px;
}

.mood-stage-actions .btn.is-disabled,
.mood-stage-body .btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mood-stage .mood-ai-preview {
  width: min(100%, 220px);
  aspect-ratio: 9 / 16;
  max-height: min(42vh, 420px);
  height: auto;
  object-fit: cover;
}

.mood-stage .mood-feeling-hint {
  margin: 0;
}

@media (max-width: 899px) {
  .mood-stage-root {
    padding: 0;
    align-items: stretch;
  }

  .mood-stage {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, 32dvh) 1fr;
    border-radius: 0;
  }

  .mood-stage-panel {
    padding: 20px 18px calc(18px + var(--safe-bottom));
  }

  .mood-stage-title {
    font-size: clamp(1.55rem, 8vw, 2.1rem);
  }

  .mood-stage-film,
  .mood-stage-drop {
    width: min(100%, 280px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mood-stage-root,
  .mood-stage-root .mood-stage {
    transition: none;
  }
}

.mood-feeling-hint {
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.mood-ai-loader {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px 8px 10px;
  text-align: center;
}

.mood-ai-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, #7ee0c8, #c9a7ff, #ffb38a, #7ee0c8);
  animation: mood-ai-spin 2.4s linear infinite;
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 35%, transparent);
}

.mood-ai-preview,
.mood-peek-video {
  width: min(100%, 420px);
  aspect-ratio: 9 / 16;
  max-height: min(82vh, 880px);
  height: auto;
  object-fit: cover;
  border-radius: 16px;
  background: #111;
}

.mood-badge video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

@keyframes mood-ai-spin {
  to { transform: rotate(360deg); }
}

.mood-peek-editor::-webkit-scrollbar,
.mood-peek-root.has-photo.is-phone .mood-peek::-webkit-scrollbar {
  display: none;
}

.mood-peek .grande-track {
  width: 100%;
}

/* Mobile mood peek — fullscreen (Stories-style). Desktop rules live in min-width:720px below. */
@media (max-width: 719px) {
  .mood-peek-root.has-photo,
  .mood-peek-root.has-photo.is-phone,
  .mood-peek-root.is-media-focus.is-phone {
    display: block;
    padding: 0;
    gap: 0;
    background: #05060c;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .mood-peek-root.has-photo .mood-peek-media,
  .mood-peek-root.has-photo.is-phone .mood-peek-media,
  .mood-peek-root.is-media-focus.is-phone .mood-peek-media {
    position: absolute;
    inset: 0;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    flex: none;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    min-width: 0;
    min-height: 0;
    margin: 0;
    aspect-ratio: auto;
    display: block;
    overflow: hidden;
    border-radius: 0;
    background: #05060c;
    cursor: default;
    touch-action: none;
  }

  .mood-peek-root.has-photo .mood-peek-stage,
  .mood-peek-root.has-photo.is-phone .mood-peek-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    display: block;
  }

  .mood-peek-root.has-photo .mood-peek-stage .mood-peek-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .mood-peek-root.has-photo .mood-peek-stage .mood-peek-chrome {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: auto;
  }

  .mood-peek-root.has-photo .mood-peek-photo,
  .mood-peek-root.has-photo .mood-peek-video,
  .mood-peek-root.has-photo.is-phone .mood-peek-photo,
  .mood-peek-root.has-photo.is-phone .mood-peek-video,
  .mood-peek-root.is-media-focus.is-phone .mood-peek-photo,
  .mood-peek-root.is-media-focus.is-phone .mood-peek-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: var(--mood-media-x, 50%) var(--mood-media-y, 50%);
    border-radius: 0;
    box-shadow: none;
  }

  .mood-peek-root.has-photo .mood-peek-chrome,
  .mood-peek-root.is-media-focus .mood-peek-chrome,
  .mood-peek-root.has-photo .mood-peek-stage .mood-peek-chrome {
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    transform: none;
    border-radius: 0;
    padding: calc(10px + var(--safe-top, 0px)) 14px 28px;
    background: linear-gradient(180deg, color-mix(in srgb, #05060c 55%, transparent), transparent);
  }

  .mood-peek-root.has-photo .mood-peek,
  .mood-peek-root.has-photo.is-phone .mood-peek {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    width: 100%;
    max-width: none;
  }

  .mood-peek-root.has-photo.is-own .mood-peek.is-compact:not(.is-settings-open),
  .mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact:not(.is-settings-open) {
    background: transparent;
    border: none;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    border-radius: 0;
    padding: 12px 20px calc(12px + var(--safe-bottom));
  }

  .mood-peek-root.has-photo.is-own .mood-peek.is-compact.is-settings-open,
  .mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact.is-settings-open {
    background: var(--surface-raised);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lift);
    max-height: min(44vh, 380px);
    overflow: auto;
    scrollbar-width: none;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-bottom: calc(16px + var(--safe-bottom));
  }

  .mood-peek-root.has-photo.is-own .mood-peek.is-compact.is-settings-open .mood-peek-head,
  .mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact.is-settings-open .mood-peek-head {
    display: flex;
  }
}

.mood-peek-root.has-photo .mood-peek-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* Above media+nav stacking context so X / remaining stay tappable */
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: calc(10px + var(--safe-top, 0px)) 14px 12px;
  pointer-events: none;
  box-sizing: border-box;
}

.mood-peek-root.has-photo .mood-peek-stage .mood-peek-chrome {
  /* Grid overlay on the photo card — no safe-area inset on desktop card */
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  padding: 12px 12px 28px;
}

.mood-peek-segments {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 3px;
  flex-shrink: 0;
  pointer-events: none;
}

.mood-peek-segment {
  flex: 1 1 0;
  min-width: 0;
  height: 3px;
  min-height: 3px;
  max-height: 3px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: none;
  overflow: hidden;
}

.mood-peek-segment.is-done,
.mood-peek-segment.is-on {
  background: #fff;
}

.mood-peek-count {
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #05060c 55%, transparent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mood-peek-chevron {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 50%;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  transform: translateY(-50%);
  background: color-mix(in srgb, #05060c 42%, transparent);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.mood-peek-chevron-prev {
  left: 10px;
}

.mood-peek-chevron-next {
  right: 10px;
}

.mood-peek-chevron:hover,
.mood-peek-chevron:focus-visible {
  background: color-mix(in srgb, #05060c 62%, transparent);
  outline: none;
}

.mood-peek-chrome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 40px;
}

.mood-peek-chrome-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-left: auto;
}

.mood-peek-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: min(58%, 240px);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: color-mix(in srgb, #05060c 42%, transparent);
  color: #fff;
  text-decoration: none;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mood-peek-author.is-static {
  pointer-events: none;
}

.mood-peek-author:hover,
.mood-peek-author:focus-visible {
  background: color-mix(in srgb, #05060c 58%, transparent);
  outline: none;
}

.mood-peek-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: color-mix(in srgb, #fff 16%, transparent);
}

.mood-peek-author-avatar.is-fallback {
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.mood-peek-author-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mood-peek-root.has-photo .mood-peek-chrome .publish-popup-close,
.mood-peek-root.has-photo .mood-peek-chrome .mood-peek-remaining,
.mood-peek-root.has-photo .mood-peek-chrome .mood-peek-author {
  pointer-events: auto;
}

.mood-peek-root.has-photo .mood-peek-chrome .publish-popup-close {
  position: static;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, #05060c 55%, transparent);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0;
  line-height: 0;
}

.mood-peek-root.has-photo .mood-peek-chrome .publish-popup-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

.mood-peek-root.is-media-focus .mood-peek-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: calc(10px + var(--safe-top, 0px)) 14px 12px;
  pointer-events: none;
}

.mood-peek-root.is-media-focus .mood-peek-chrome .publish-popup-close,
.mood-peek-root.is-media-focus .mood-peek-chrome .mood-peek-remaining,
.mood-peek-root.is-media-focus .mood-peek-chrome .mood-peek-author {
  pointer-events: auto;
}

.mood-peek-root.is-media-focus .mood-peek-remaining,
.mood-peek-root.has-photo .mood-peek-chrome .mood-peek-remaining {
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, #05060c 55%, transparent);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mood-peek-root.is-media-focus .grande-track,
.mood-peek-root.has-photo .mood-peek > .grande-track {
  display: none !important;
}

.mood-peek-root.has-photo:not(.is-own):not(.is-phone) .mood-peek:has(.grande-track:only-of-type),
.mood-peek-root.is-media-focus .mood-peek {
  display: none;
}

@media (min-width: 720px) {
  .mood-peek-root.has-photo.is-media-focus,
  .mood-peek-root.is-media-focus {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px;
  }

  .mood-peek-root.is-media-focus .mood-peek-media {
    position: relative;
    width: min(420px, 92vw);
    aspect-ratio: 9 / 16;
    max-height: min(82vh, 880px);
    height: auto;
    margin: 0;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background: #111;
  }

  .mood-peek-root.is-media-focus .mood-peek-photo,
  .mood-peek-root.is-media-focus .mood-peek-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: var(--mood-media-x, 50%) var(--mood-media-y, 50%);
    border-radius: 16px;
    box-shadow: var(--shadow-lift);
  }

  .mood-peek-root.is-media-focus .mood-peek-chrome {
    top: calc(20px + var(--safe-top, 0px));
    left: 50%;
    right: auto;
    width: min(420px, 92vw);
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
  }
}

.mood-peek-dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 2px;
}

.mood-dock-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.mood-dock-add-ring {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 160deg, #ff4d6d, #ff9f1c, #ffe066, #80ffdb, #4cc9f0, #c77dff, #ff4d6d);
  box-shadow: 0 8px 20px rgba(8, 10, 24, 0.35);
}

.mood-dock-add-ring .mood-plus {
  width: 100%;
  height: 100%;
  background: var(--surface-raised);
  color: var(--ink);
}

.mood-dock-settings {
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.mood-dock-settings.is-on {
  color: var(--accent);
}

.mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact:not(.is-settings-open) {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 12px 20px;
}

.mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact:not(.is-settings-open) .mood-peek-head {
  display: none;
}

.mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact:not(.is-settings-open) .mood-peek-dock {
  margin-top: 0;
}

.mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact:not(.is-settings-open) {
  max-width: 100%;
  width: 100%;
  grid-row: 2;
  align-self: end;
  justify-self: stretch;
}

.mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact.is-settings-open {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  grid-row: 2;
  align-self: end;
  justify-self: stretch;
}

.mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact.is-settings-open .mood-peek-head {
  display: flex;
}

.mood-peek-root.has-photo.is-own.is-phone .mood-peek.is-compact.is-settings-open .mood-dock-settings {
  color: var(--ink);
  filter: none;
}

.mood-peek-root.is-own:not(.has-photo) {
  justify-content: flex-end;
  padding-bottom: calc(20px + var(--safe-bottom, 0px));
}

.mood-peek-root.is-own:not(.has-photo) .mood-dock-settings {
  color: var(--ink);
  filter: none;
}

.mood-peek.is-compact:not(.is-settings-open) {
  width: auto;
  min-width: 0;
  max-width: min(280px, 100%);
  padding: 12px 14px;
  gap: 10px;
}

.mood-peek.is-compact:not(.is-settings-open) .mood-peek-visual,
.mood-peek.is-compact:not(.is-settings-open) .mood-peek-stack,
.mood-peek.is-compact:not(.is-settings-open) .mood-peek-caption,
.mood-peek.is-compact:not(.is-settings-open) .mood-peek-tags,
.mood-peek.is-compact:not(.is-settings-open) .grande-track,
.mood-peek.is-compact:not(.is-settings-open) .mood-peek-scheduled {
  display: none;
}

.mood-peek.is-compact .mood-peek-manage {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.mood-peek.is-compact .mood-peek-manage[hidden] {
  display: none;
}

.mood-peek-settings.is-on,
.btn.secondary.small.is-on {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.profile-mood-scatter-following {
  z-index: 6;
}

.profile-mood-scatter-following .profile-mood-scatter-item {
  z-index: 6;
  /* Size already −15% via --mood-size from orbit packer */
  width: var(--mood-size, 41px);
  height: var(--mood-size, 41px);
}

.profile-hero.profile-masthead:has(.profile-mood-scatter-following) {
  min-height: clamp(180px, 26vw, 260px);
}

.profile-mood-scatter-item.is-following,
.mood-badge.is-following {
  border: 3px solid #ff2d55;
  box-shadow:
    0 0 0 2px color-mix(in srgb, #ff2d55 35%, transparent),
    0 8px 20px rgba(8, 10, 24, 0.35);
  background: #12060c;
}

.profile-mood-scatter-item.is-following.has-photo,
.mood-badge.is-following.has-photo {
  padding: 2px;
  background: #ff2d55;
}

/* Following moods always keep the red ring — never the rainbow photo frame. */
.profile-mood-scatter-item.is-following.has-photo {
  background: #ff2d55 !important;
  border-color: #ff2d55;
}

/* Desktop mood peek — centered 9:16 card (mobile fullscreen is in max-width:719px above). */
@media (min-width: 720px) {
  .mood-peek-root.has-photo {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    background: color-mix(in srgb, var(--bg-panel) 42%, transparent);
    overscroll-behavior: auto;
  }

  .mood-peek-root.has-photo .mood-peek-media {
    position: relative;
    inset: auto;
    left: auto;
    top: auto;
    right: auto;
    bottom: auto;
    flex: none;
    width: min(420px, min(92vw, calc(82vh * 9 / 16)));
    aspect-ratio: 9 / 16;
    max-height: min(82vh, 880px);
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #111;
    cursor: grab;
    touch-action: none;
  }

  .mood-peek-root.has-photo.has-mood-stack .mood-peek-media,
  .mood-peek-root.has-photo.has-mood-stack .mood-peek-stage {
    cursor: default;
  }

  .mood-peek-root.has-photo .mood-peek-stage {
    width: min(420px, min(92vw, calc(82vh * 9 / 16)));
    max-height: min(82vh, 880px);
    display: grid;
    grid-template: 1fr / 1fr;
  }

  .mood-peek-root.has-photo .mood-peek-stage .mood-peek-media {
    width: 100%;
    grid-area: 1 / 1;
  }

  .mood-peek-root.has-photo .mood-peek-stage .mood-peek-chrome {
    grid-area: 1 / 1;
    align-self: start;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    border-radius: 16px 16px 0 0;
    padding: 12px 12px 28px;
  }

  .mood-peek-root.has-photo .mood-peek-photo,
  .mood-peek-root.has-photo .mood-peek-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: var(--mood-media-x, 50%) var(--mood-media-y, 50%);
    border-radius: 16px;
    box-shadow: var(--shadow-lift);
  }

  .mood-peek-root.has-photo .mood-peek {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    width: min(480px, 92vw);
    max-width: min(480px, 92vw);
    max-height: min(84vh, 760px);
    overflow: auto;
    align-self: center;
    left: auto;
    right: auto;
    bottom: auto;
    scrollbar-width: none;
  }

  .mood-peek-root.has-photo.is-own .mood-peek.is-compact:not(.is-settings-open) {
    width: min(280px, 92vw);
    max-width: min(280px, 92vw);
    max-height: none;
    overflow: visible;
    align-self: center;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lift);
  }

  .mood-peek-root.has-photo.is-own .mood-peek.is-compact.is-settings-open {
    width: min(420px, 92vw);
    max-height: min(84vh, 760px);
    overflow: auto;
    margin: 0;
    border-radius: 18px;
  }
}

.profile-masthead-bio {
  position: relative;
  z-index: 1;
  margin: 4px 0 0;
  max-width: 46rem;
  white-space: pre-wrap;
  font-size: 1.08rem;
  line-height: 1.5;
}

.profile-hero-meta {
  margin: 0;
  line-height: 1.35;
  position: relative;
  z-index: 1;
}

.profile-city {
  display: inline-flex;
  align-items: center;
}

.profile-city-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--display);
  font-size: 1.12rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-decoration: none;
  background: linear-gradient(115deg, var(--accent-bright) 0%, var(--clay) 55%, var(--dusk) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

a.profile-city-name:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

.profile-city-pin {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--clay);
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.profile-hero .status-line {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 10px 0 0;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--dusk);
}

.profile-folio-index {
  display: grid;
  gap: 16px 28px;
  align-items: end;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.profile-folio-issues {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 28px;
}

.profile-folio-issue {
  display: grid;
  gap: 4px;
}

button.profile-folio-fav,
button.profile-folio-followers {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.profile-folio-fav:hover .profile-folio-issue-num,
button.profile-folio-fav:hover .profile-folio-issue-label,
button.profile-folio-followers:hover .profile-folio-issue-num,
button.profile-folio-followers:hover .profile-folio-issue-label {
  color: var(--accent);
}

.profile-folio-issue-num {
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.05em;
  color: var(--accent);
}

.profile-folio-issue-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
}

.profile-folio-fav .profile-folio-issue-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.12em;
}

.profile-folio-fav .keep-glyph {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.profile-folio-follows-kicker {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-folio-follows {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile-folio-follows li {
  display: grid;
  gap: 2px;
  min-width: 3.2rem;
}

.profile-folio-follows em {
  font-family: var(--display);
  font-style: normal;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.profile-folio-follows span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.following-stat {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.profile-folio-follows-kicker.following-stat {
  display: block;
}

.following-stat:hover em,
.following-stat:hover {
  color: var(--accent);
}

.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}

.privacy-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.following-popup-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 10, 8, 0.5);
}

.following-popup {
  width: min(520px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 20px 20px 18px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}

.following-popup-title {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.following-popup-list {
  min-height: 120px;
  max-height: 48vh;
  overflow: auto;
}

.following-popup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

.following-popup-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.following-popup-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.following-popup-glyph {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  flex-shrink: 0;
}

.profile-upcoming {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.profile-upcoming-list {
  display: grid;
  gap: 10px;
}

.profile-upcoming-link {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--clay);
}

.profile-folio-stream {
  display: grid;
  gap: 18px;
}

.profile-posts-mount {
  min-width: 0;
}

.profile-ad {
  display: none;
}

.layout-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.layout-pick {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
}

.layout-pick strong {
  font-size: 0.92rem;
}

.layout-pick > span:last-child {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.layout-pick.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.layout-pick-preview {
  display: block;
  height: 46px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 6%, var(--surface));
  position: relative;
  overflow: hidden;
}

.layout-preview-simple::before {
  content: "";
  position: absolute;
  inset: 8px 10px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 8px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 16px / 100% 8px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 32px / 70% 8px no-repeat;
  opacity: 0.22;
}

.layout-preview-editorial::before {
  content: "";
  position: absolute;
  inset: 7px 8px;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / 58% 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 64% 0 / 36% 42% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 64% 58% / 36% 42% no-repeat;
  opacity: 0.35;
}

.layout-preview-visual::before {
  content: "";
  position: absolute;
  inset: 7px 8px;
  background:
    linear-gradient(var(--dusk), var(--dusk)) 0 0 / 48% 48% no-repeat,
    linear-gradient(var(--clay), var(--clay)) 52% 0 / 48% 48% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 52% / 48% 48% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 52% 52% / 48% 48% no-repeat;
  opacity: 0.4;
}

.layout-preview-music::before {
  content: "";
  position: absolute;
  inset: 8px 10px;
  background:
    linear-gradient(var(--clay), var(--clay)) 0 0 / 18px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) 26px 4px / calc(100% - 26px) 8px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 26px 18px / calc(100% - 26px) 8px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 26px 32px / 70% 8px no-repeat;
  opacity: 0.32;
}

.audio-player {
  width: 100%;
  height: 40px;
}

.card.post > .post-media:has(.grande-track):not(:has(img)):not(:has(video)),
.card.post.has-audio:not(:has(img)):not(:has(video)) > .post-media {
  margin: 0;
  width: 100%;
}

.card.post.has-audio:not(:has(img)):not(:has(video)) {
  padding: 18px 20px 16px;
  gap: 10px;
}

.card.post.has-audio:not(:has(img)):not(:has(video)) .post-audio {
  padding: 2px 2px 4px;
}

.card.post.has-audio:not(:has(img)):not(:has(video)) .grande-track {
  gap: 14px;
  padding: 2px 4px 2px 2px;
}

.card.post.has-audio:not(:has(img)):not(:has(video)) > .post-body {
  padding: 2px 4px 0;
}

.card.post.has-audio:not(:has(img)):not(:has(video)) > .post-footer {
  margin-top: 2px;
  padding: 0 4px;
  align-items: center;
}

.card.post.has-audio:not(:has(img)):not(:has(video)) > .post-tags {
  margin: 8px 4px 0;
  padding-top: 12px;
}

.grande-track {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  position: relative;
}

.track-play {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--accent-bright) 90%, #fff), var(--accent) 46%, #141018 72%);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--clay) 45%, transparent),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

.track-play > * {
  grid-area: 1 / 1;
}

.track-disc {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18) 0 5px, transparent 6px),
    repeating-radial-gradient(circle, transparent 0 3px, rgba(0, 0, 0, 0.28) 3px 4px);
}

.grande-track.is-playing .track-disc {
  animation: track-spin 3.4s linear infinite;
}

.track-icon {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.track-icon-pause,
.grande-track.is-playing .track-icon-play {
  display: none;
}

.grande-track.is-playing .track-icon-pause {
  display: block;
}

.track-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  min-width: 0;
  cursor: pointer;
}

.track-bar {
  flex: 1 1 0;
  height: calc(var(--h, 0.4) * 100%);
  min-height: 5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  transform-origin: center bottom;
}

.track-bar.is-on {
  background: linear-gradient(180deg, var(--accent-bright), var(--clay));
}

.grande-track.is-playing .track-bar.is-on {
  animation: track-pulse 0.9s ease-in-out infinite;
}

.track-times {
  display: grid;
  justify-items: end;
  gap: 1px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 2.6rem;
}

.track-audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.track-deck-list {
  display: grid;
  gap: 10px;
}

.track-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 22px 8px 22px 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  outline: none;
}

.track-strip .grande-track {
  grid-column: 1;
}

.track-strip-edit {
  grid-column: 2;
  opacity: 0.55;
}

.track-strip:hover .track-strip-edit,
.track-strip:focus-within .track-strip-edit {
  opacity: 1;
}

.track-note {
  position: absolute;
  left: 64px;
  right: 18px;
  bottom: calc(100% + 10px);
  padding: 12px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface-raised);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 6;
}

.track-note::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--surface-raised);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.track-strip:hover,
.track-strip:focus-within {
  z-index: 5;
}

.track-strip:hover .track-note,
.track-strip:focus-within .track-note {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.track-note-kicker {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

.track-note-body {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.track-add-btn {
  flex: 0 0 auto;
}

.profile-music-layout,
.profile-music-deck {
  overflow: visible;
}

@keyframes track-spin {
  to { transform: rotate(360deg); }
}

@keyframes track-pulse {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.18); }
}

.profile-visual-photo-run .card.post.is-just-published,
.profile-visual-photo-solo .card.post.is-just-published,
.profile-visual-grid .card.post.is-just-published,
.profile-simple-feed .card.post.is-just-published,
.profile-edition .card.post.is-just-published,
#profile-posts .card.post.is-just-published,
.feed-list .card.post.is-just-published,
.home-empty + .feed-sentinel ~ .card.post.is-just-published,
.content-feed .card.post.is-just-published {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent), var(--shadow-lift);
  animation: just-published-glow 1.1s ease-in-out 3;
}

@keyframes just-published-glow {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 85%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); }
}

.profile-visual-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-visual-photo-run {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.profile-visual-photo-row {
  display: grid;
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

.profile-visual-photo-row--cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

.profile-visual-photo-row--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-visual-photo-row--cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Mobile: never squeeze Visual into multi-column desktop tiles / pairs. */
@media (max-width: 899px) {
  .profile-visual-photo-row--cols-2,
  .profile-visual-photo-row--cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-visual-photo-pair {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .profile-visual-photo-pair-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .profile-visual-photo-pair-side .edition-copy,
  .profile-visual-photo-pair-side .edition-feature,
  .profile-visual-photo-pair-side .article-teaser {
    width: 100%;
  }
}

.profile-visual-grid .avatar-row,
.profile-visual-grid .post-media-overlay,
.profile-music-layout .avatar-row,
.profile-music-layout .post-media-overlay {
  display: none;
}

.profile-visual-grid .edition-copy,
.profile-visual-grid .edition-cinema,
.profile-visual-grid .edition-track {
  width: 100%;
}

/* Equal tile frames — crop to fit; tap opens full photo. */
.profile-visual-photo-run .card.post.has-media,
.profile-visual-photo-run .card.post.has-photo-grid {
  padding: 0;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  height: auto;
  min-width: 0;
  width: 100%;
  align-self: stretch;
}

.profile-visual-photo-run .card.post.has-media:has(.post-edit-panel),
.profile-visual-photo-run .card.post.has-photo-grid:has(.post-edit-panel),
.profile-visual-photo-solo .card.post.has-media:has(.post-edit-panel),
.profile-visual-photo-solo .card.post.has-photo-grid:has(.post-edit-panel) {
  aspect-ratio: auto;
  overflow: visible;
  height: auto;
  padding: 0 0 16px;
}

.profile-visual-grid .card.post.has-media:has(.post-edit-panel) .post-edit-panel {
  display: grid;
  position: relative;
  z-index: 2;
  padding: 16px 20px 20px;
}

.profile-visual-photo-run .card.post.has-media:has(.post-edit-panel) .post-footer,
.profile-visual-photo-run .card.post.has-photo-grid:has(.post-edit-panel) .post-footer,
.profile-visual-photo-solo .card.post.has-media:has(.post-edit-panel) .post-footer,
.profile-visual-photo-solo .card.post.has-photo-grid:has(.post-edit-panel) .post-footer {
  display: block;
}

.profile-visual-photo-run .card.post.has-photo-grid .post-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid {
  width: 100%;
  height: 100%;
}

.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-1,
.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-2,
.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-3,
.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-4 {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid-item,
.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid-item .media-preview {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  max-height: none;
  object-fit: cover;
  display: block;
}

.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-1 {
  grid-template-columns: 1fr;
}

.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-visual-photo-run .card.post.has-photo-grid .post-photo-grid--count-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.profile-visual-photo-solo .card.post.has-media,
.profile-visual-photo-solo .card.post.has-photo-grid {
  padding: 0;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

.profile-visual-photo-solo .card.post.has-photo-grid .post-media {
  position: relative;
  width: 100%;
  height: auto;
}

.profile-visual-photo-solo .card.post.has-photo-grid .post-photo-grid--count-1 .post-photo-grid-item .media-preview {
  aspect-ratio: auto;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
}

.profile-visual-grid .card.post.has-media .post-body {
  display: none;
}

.profile-visual-photo-run .card.post.has-photo-grid .post-footer,
.profile-visual-photo-solo .card.post.has-photo-grid .post-footer {
  display: none;
}

.profile-visual-photo-run .media-preview,
.profile-visual-photo-solo .media-preview {
  max-height: none;
}

.profile-visual-grid .edition-cinema .media-preview.video {
  aspect-ratio: 16 / 9;
}

.profile-music-layout,
.profile-music-deck,
.profile-music-rest {
  display: grid;
  gap: 12px;
}

.profile-music-layout {
  gap: 28px;
}

.profile-music-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.profile-music-head-copy {
  min-width: 0;
}

.profile-music-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.profile-music-rest-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.profile-mood {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  max-width: 42rem;
}

.profile-mood-head {
  display: grid;
  gap: 4px;
}

.profile-mood-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.profile-mood-player {
  display: grid;
  gap: 8px;
}

.profile-mood-caption {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.profile-mood-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-mood-caption-input {
  width: 100%;
  max-width: 28rem;
}

.profile-mood-now {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-mood-now .mood-badge {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  cursor: default;
}

.profile-mood-now-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-mood-archive {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.mood-peek-manage .profile-mood-archive {
  max-height: min(280px, 34vh);
  overflow: auto;
  padding-top: 12px;
  scrollbar-width: thin;
}

.mood-peek-manage .profile-mood-archive-list {
  gap: 8px;
}

.mood-peek-manage .profile-mood-archive-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}

.mood-peek-manage .profile-mood-archive .mood-ai-preview,
.mood-peek-manage .profile-mood-archive .audio-player {
  width: 100%;
  max-width: 100%;
}

.profile-mood-archive-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.profile-mood-archive-list {
  display: grid;
  gap: 10px;
}

.profile-mood-archive-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mood-archive-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.mood-archive-thumb.has-photo {
  padding: 2px;
  background: conic-gradient(from 160deg, #ff4d6d, #ff9f1c, #ffe066, #80ffdb, #4cc9f0, #c77dff, #ff4d6d);
}

.mood-archive-thumb img,
.mood-archive-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.profile-mood-archive-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.profile-mood-archive-copy p {
  margin: 0;
}

.edition-track.card.post {
  padding: 18px 20px 16px;
  gap: 12px;
}

.profile-music-rest-list {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .profile-visual-grid {
    gap: 12px;
  }

  .profile-visual-grid .edition-cinema {
    grid-column: unset;
  }

  /* Desktop only: vertical single photo (4:5 / 2:3 / 9:16) + companion column. */
  .profile-visual-photo-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    width: 100%;
  }

  .profile-visual-photo-pair-media,
  .profile-visual-photo-pair-side {
    min-width: 0;
  }

  .profile-visual-photo-pair-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .profile-visual-photo-pair-media .card.post.has-media,
  .profile-visual-photo-pair-media .card.post.has-photo-grid {
    padding: 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
  }

  .profile-visual-photo-pair--mid .profile-visual-photo-pair-media .card.post.has-media,
  .profile-visual-photo-pair--mid .profile-visual-photo-pair-media .card.post.has-photo-grid {
    aspect-ratio: 4 / 5;
  }

  .profile-visual-photo-pair--tall .profile-visual-photo-pair-media .card.post.has-media,
  .profile-visual-photo-pair--tall .profile-visual-photo-pair-media .card.post.has-photo-grid {
    aspect-ratio: 9 / 16;
  }

  .profile-visual-photo-pair-media .card.post.has-media:has(.post-edit-panel),
  .profile-visual-photo-pair-media .card.post.has-photo-grid:has(.post-edit-panel) {
    aspect-ratio: auto;
    overflow: visible;
    height: auto;
    padding: 0 0 16px;
  }

  .profile-visual-photo-pair-media .card.post.has-photo-grid .post-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .profile-visual-photo-pair-media .card.post.has-photo-grid:has(.post-edit-panel) .post-media {
    position: relative;
    inset: auto;
    height: auto;
  }

  .profile-visual-photo-pair-media .card.post.has-photo-grid .post-photo-grid,
  .profile-visual-photo-pair-media .card.post.has-photo-grid .post-photo-grid--count-1,
  .profile-visual-photo-pair-media .card.post.has-photo-grid .post-photo-grid-item,
  .profile-visual-photo-pair-media .card.post.has-photo-grid .post-photo-grid-item .media-preview {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    max-height: none;
    object-fit: cover;
    display: block;
  }

  .profile-visual-photo-pair-media .card.post.has-photo-grid .post-footer {
    display: none;
  }

  .profile-visual-photo-pair-media .card.post.has-photo-grid:has(.post-edit-panel) .post-footer {
    display: block;
  }

  .profile-visual-photo-pair-side .edition-copy,
  .profile-visual-photo-pair-side .edition-feature,
  .profile-visual-photo-pair-side .article-teaser {
    width: 100%;
  }

  .profile-music-rest-list {
    grid-template-columns: 1fr 1fr;
  }

  .layout-picker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.profile-edition,
.profile-edition-spread,
.profile-edition-rail,
.profile-edition-cinema,
.profile-edition-grid {
  display: grid;
  gap: 18px;
  align-items: start;
  align-content: start;
}

.profile-edition-empty {
  padding: 36px 8px 12px;
}

.profile-edition-empty-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
}

.profile-edition-empty-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.05;
}

.profile-edition .card.post:not(.has-media) > .avatar-row,
.profile-edition .article-teaser:not(.has-cover) .article-byline {
  display: none;
}

.profile-edition-lead .article-title-link,
.profile-edition-lead.edition-lead .article-title-link,
.edition-lead .article-title-link {
  font-size: clamp(1.65rem, 3.8vw, 2.45rem);
  line-height: 1.06;
}

.edition-lead .article-teaser-text {
  -webkit-line-clamp: 5;
  font-size: 1.05rem;
}

.edition-lead .post-body {
  font-size: 1.08rem;
  line-height: 1.55;
}

.edition-lead .media-preview,
.edition-cinema .media-preview.video {
  max-height: none;
}

.edition-cinema .media-preview.video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #0d1f22;
}

.edition-lead .article-cover {
  aspect-ratio: 16 / 9;
  min-height: 200px;
}

.edition-rail .article-title-link {
  font-size: 1.22rem;
}

.edition-rail .article-teaser-text {
  -webkit-line-clamp: 3;
}

.edition-feature .article-title-link {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}

.edition-lead.is-profile .article-teaser-body,
.edition-lead.article-teaser .article-teaser-body {
  padding: 20px 20px 16px;
  gap: 14px;
}

@media (min-width: 720px) {
  .profile-edition-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
  }

  .profile-edition-grid .edition-feature {
    grid-column: 1 / -1;
  }

  .profile-edition-grid > .card.post.has-media,
  .profile-edition-rail > .card.post.has-media {
    height: 420px;
    min-height: 420px;
    max-height: 420px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    align-content: stretch;
  }

  .profile-edition-grid > .card.post.has-media > .post-media,
  .profile-edition-rail > .card.post.has-media > .post-media {
    grid-row: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .profile-edition-grid > .card.post.has-media .media-preview,
  .profile-edition-rail > .card.post.has-media .media-preview {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
  }

  .profile-edition-grid > .card.post.has-media > .post-body,
  .profile-edition-rail > .card.post.has-media > .post-body {
    grid-row: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }

  .profile-edition-grid > .card.post.has-media > .post-footer,
  .profile-edition-rail > .card.post.has-media > .post-footer {
    grid-row: 3;
  }

  .profile-edition-grid > .card.post.has-media > .post-tags,
  .profile-edition-rail > .card.post.has-media > .post-tags {
    grid-row: 4;
  }

  .profile-upcoming-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .profile-hero.profile-masthead {
    padding: 14px 28px 22px;
    gap: 12px;
  }

  .profile-masthead-chrome {
    margin-bottom: 12px;
  }

  .profile-mood-scatter-item {
    width: calc(var(--mood-size, 48px) * 1.55);
    height: calc(var(--mood-size, 48px) * 1.55);
  }

  .profile-mood-scatter-following .profile-mood-scatter-item {
    /* Same desktop scale; base --mood-size is already −15% */
    width: calc(var(--mood-size, 41px) * 1.55);
    height: calc(var(--mood-size, 41px) * 1.55);
  }

  .profile-masthead-name {
    font-size: clamp(3.4rem, 5.6vw, 5.6rem);
  }

  .profile-masthead .avatar.xl {
    width: 176px;
    height: 176px;
    font-size: 3rem;
  }

  .profile-mood-rail .mood-badge,
  .profile-avatar-cluster > .mood-badge {
    width: 64px;
    height: 64px;
  }

  .profile-avatar-cluster > .mood-badge {
    left: -14px;
    bottom: 6px;
  }

  .profile-mood-rail {
    gap: 10px;
    max-width: min(40vw, 280px);
  }

  .profile-masthead-bio {
    font-size: 1.14rem;
    max-width: 52rem;
  }

  .profile-folio-index {
    grid-template-columns: auto 1fr;
    align-items: end;
  }

  .profile-folio {
    max-width: none;
  }

  .profile-edition-spread:not(.solo),
  .profile-edition-spread.solo {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
  }

  .profile-edition-lead,
  .profile-edition-lead > .card {
    height: auto;
    min-height: 0;
    max-width: none;
  }

  .profile-edition-lead > .card.post {
    align-content: start;
  }

  /* Side rail layouts leave a dead left column when the lead is shorter —
     keep any leftover rail markup stacked full-width instead. */
  .profile-edition-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    align-content: start;
  }

  .profile-edition-rail > * {
    width: 100%;
    min-height: 0;
  }

  .profile-edition-cinema .edition-cinema {
    max-width: none;
  }

  .profile-upcoming-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .profile-folio-stream {
    grid-template-columns: minmax(0, 820px) minmax(28px, 1fr) 200px;
    align-items: start;
    gap: 0;
  }

  .profile-posts-mount {
    grid-column: 1;
  }

  .profile-ad {
    grid-column: 3;
    display: grid;
    align-content: start;
    justify-items: center;
    position: sticky;
    top: 20px;
    width: 200px;
    min-height: 260px;
    padding: 16px 12px;
    border: 1px dashed color-mix(in srgb, var(--muted) 45%, var(--line));
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
    color: var(--muted);
  }

  .profile-ad-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
}

@media (max-width: 719px) {
  .profile-masthead-stage {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .profile-masthead-name {
    font-size: clamp(2.15rem, 11vw, 2.85rem);
  }

  .profile-hero-public .profile-masthead-chrome {
    margin-bottom: 8px;
  }

  .profile-hero-public .profile-masthead-cta .btn {
    white-space: nowrap;
  }

  .profile-folio-follows {
    gap: 12px 16px;
  }
}

.discover-page > .page-masthead {
  gap: 0;
  margin-bottom: 4px;
  padding: 10px 0 12px;
}

.discover-page > .page-masthead .page-kicker {
  font-family: var(--font);
  line-height: 1.2;
}

.discover-tabs.filter-rail {
  margin-bottom: 8px;
}

.hashtag-discover-page {
  gap: 14px;
}

.hashtag-discover-compose {
  padding: 16px 18px;
}

.hashtag-discover-lede {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hashtag-discover {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hashtag-discover-card {
  display: grid;
  gap: 10px;
  padding: 16px 16px 14px;
  min-width: 0;
  border-left: 3px solid color-mix(in srgb, var(--clay) 70%, var(--accent));
  background:
    linear-gradient(135deg, var(--clay-soft), transparent 46%),
    var(--surface-raised);
}

.hashtag-discover-card.is-empty {
  border-left-color: color-mix(in srgb, var(--ink) 18%, transparent);
  background: var(--surface-raised);
}

.hashtag-discover-head {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.hashtag-discover-name {
  font-family: var(--display);
  font-size: 1.42rem;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.hashtag-discover-name span {
  color: var(--clay);
  margin-right: 1px;
}

.hashtag-discover-name:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.hashtag-discover-stats {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.hashtag-discover-teasers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hashtag-discover-teasers li {
  display: grid;
  gap: 1px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.hashtag-discover-headline {
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hashtag-discover-headline:hover {
  text-decoration: underline;
}

.hashtag-discover-teasers time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.hashtag-discover-empty {
  margin: 0;
  padding-top: 6px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--muted);
  font-style: italic;
}

.hashtag-discover-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

@media (min-width: 1100px) {
  .discover-page:has(.hashtag-discover) {
    max-width: 1040px;
  }
}

@media (max-width: 719px) {
  .hashtag-discover {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hashtag-discover-name {
    font-size: 1.32rem;
  }

  .hashtag-discover-foot .btn {
    min-height: 36px;
  }
}

/* ——— Floating article stream (desktop ambient) ——— */
.float-stream {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.float-stream.is-app-right {
  right: auto;
  left: auto;
  width: auto;
  max-width: none;
}

.float-stream.is-side-left {
  left: auto;
  right: auto;
  width: auto;
}

.float-stream.is-side-right {
  right: auto;
  left: auto;
  width: auto;
}

.float-stream.is-active {
  display: block;
}

.float-stream.is-guest .float-card {
  background: rgba(255, 252, 246, 0.96);
  border-color: rgba(16, 26, 20, 0.1);
  box-shadow:
    0 10px 28px rgba(16, 26, 20, 0.12),
    0 2px 8px rgba(16, 26, 20, 0.06);
}

.float-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 168px;
  min-height: 82px;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  opacity: 0;
  z-index: 1;
  will-change: transform, opacity;
  transform: translate3d(-9999px, -9999px, 0);
  transform-origin: center center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 26, 20, 0.08);
  box-shadow:
    0 8px 20px rgba(16, 26, 20, 0.1),
    0 2px 6px rgba(16, 26, 20, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 280ms ease, filter 280ms ease;
  box-sizing: border-box;
}

.float-card.is-text {
  display: block;
  padding: 11px 12px;
}

.float-card.is-image {
  display: grid;
  grid-template-columns: 30% 1fr;
  min-height: 88px;
  height: auto;
  padding: 0;
}

.float-card-media {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.float-card.is-image .float-card-media {
  display: block;
  min-height: 88px;
  height: 100%;
}

.float-card.is-text .float-card-media {
  display: none !important;
}

.float-card-body {
  min-width: 0;
  pointer-events: none;
}

.float-card.is-text .float-card-body {
  display: block;
  overflow: visible;
  line-height: 1.25;
}

.float-card.is-text .float-card-title {
  display: inline;
  overflow: visible;
  vertical-align: top;
  word-wrap: break-word;
}

.float-card.is-text .float-card-cat {
  float: left;
  margin: 0 7px 3px 0;
  shape-outside: margin-box;
}

.float-card.is-text .float-card-body::after {
  content: "";
  display: table;
  clear: both;
}

.float-card.is-image .float-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 10px 10px 8px;
  min-width: 0;
}

.float-card-title {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--ink);
  pointer-events: none;
  word-wrap: break-word;
}

.float-card.is-image .float-card-title {
  display: block;
  overflow: visible;
  font-size: 0.76rem;
}

.float-card-cat {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 7px;
  border-radius: 999px;
  pointer-events: none;
  line-height: 1.1;
}

/* Image cards: category sits on the thumbnail */
.float-card.is-image .float-card-cat {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  max-width: calc(30% - 10px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--ink) 16%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.float-card:hover,
.float-card.is-paused {
  opacity: 1 !important;
  z-index: 12;
  box-shadow:
    0 22px 48px rgba(16, 26, 20, 0.22),
    0 6px 16px rgba(16, 26, 20, 0.12);
  filter: saturate(1.06);
}

@media (max-width: 1099px) {
  .float-stream,
  .float-stream.is-active {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-stream,
  .float-stream.is-active {
    display: none !important;
  }

  .profile-fx *,
  html[data-profile-style="space"] .profile-hero::before,
  html[data-profile-style="space"] .profile-hero::after,
  html[data-profile-style="ocean"] .profile-hero::before,
  html[data-profile-style="ocean"] .profile-hero::after,
  html[data-profile-style="fire"] .profile-hero::before,
  html[data-profile-style="fire"] .profile-hero::after {
    animation: none !important;
  }
}

@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
  .chat {
    min-height: calc(100dvh - 56px);
  }
  .app-main.chat-mode {
    padding-bottom: 20px;
  }
  .msg-modal-backdrop {
    align-items: center;
  }
}

/* City typeahead */
.city-typeahead {
  position: relative;
}

.city-typeahead-input {
  width: 100%;
}

.city-typeahead-list {
  position: absolute;
  /* Must clear .msg-modal-backdrop (40): the typeahead is used inside modals. */
  z-index: 45;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(16, 26, 20, 0.12);
  padding: 4px;
}

.city-typeahead-option {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.city-typeahead-option:hover,
.city-typeahead-option:focus-visible {
  background: var(--accent-soft);
}

.city-typeahead-name {
  font-weight: 600;
}

.city-typeahead-empty {
  padding: 10px 12px;
}

.guest-shell .city-typeahead-list {
  background: #12241c;
  border-color: rgba(242, 247, 244, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  color: #f2f7f4;
}

.guest-shell .city-typeahead-option:hover,
.guest-shell .city-typeahead-option:focus-visible {
  background: var(--accent-soft);
}

/* ——— Theme picker ——— */
.theme-picker {
  display: grid;
  gap: 8px;
}

.profile-style-panels {
  gap: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.profile-style-panels .style-panel {
  display: grid;
  gap: 8px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
}

.profile-style-panels .style-panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.profile-style-panels .style-panel-help {
  margin: 0;
}

.profile-style-panels .theme-picker-card {
  padding: 0;
}

.profile-style-panels .theme-picker-label {
  display: none;
}

.theme-picker-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms var(--ease-out);
}

.theme-swatch:hover {
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
}

.theme-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.theme-swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: none;
  background: linear-gradient(145deg, var(--swatch-a, var(--accent)) 0%, var(--swatch-b, var(--clay)) 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(0, 0, 0, 0.18);
}

.theme-swatch[data-theme-pick="turquoise"] { --swatch-a: #1f8f89; --swatch-b: #c47d5a; }
.theme-swatch[data-theme-pick="violet"] { --swatch-a: #684099; --swatch-b: #b03c76; }
.theme-swatch[data-theme-pick="black"] { --swatch-a: #c99a1c; --swatch-b: #e6e0d4; }
.theme-swatch[data-theme-pick="pink"] { --swatch-a: #c24a7a; --swatch-b: #d4784a; }
.theme-swatch[data-theme-pick="xteal"] { --swatch-a: #0d7370; --swatch-b: #e07a3a; }
.theme-swatch[data-theme-pick="butter"] { --swatch-a: #c9a227; --swatch-b: #c45c26; }
.theme-swatch[data-theme-pick="cream"] { --swatch-a: #8b6f4e; --swatch-b: #a3845e; }
.theme-swatch[data-theme-pick="peach"] { --swatch-a: #e08a5c; --swatch-b: #c45c4a; }
.theme-swatch[data-theme-pick="graphite"] { --swatch-a: #8a939c; --swatch-b: #c9a066; }
.theme-swatch[data-theme-pick="mauve"] { --swatch-a: #8a6a82; --swatch-b: #c4786a; }

.theme-swatch[data-profile-style-pick="site"] { --swatch-a: #1f8f89; --swatch-b: #c47d5a; }
.theme-swatch[data-profile-style-pick="space"] { --swatch-a: #7b8cff; --swatch-b: #c77dff; }
.theme-swatch[data-profile-style-pick="ocean"] { --swatch-a: #3ecfbf; --swatch-b: #e8c9a0; }
.theme-swatch[data-profile-style-pick="fire"] { --swatch-a: #ff7a2e; --swatch-b: #ffcf6b; }

.theme-picker-sidebar {
  margin-bottom: 12px;
  padding: 0 4px;
}

.theme-picker-sidebar .theme-picker-label {
  color: var(--sidebar-muted);
  margin-bottom: 2px;
}

.theme-picker-sidebar .theme-swatch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--sidebar-fg);
  flex: 1;
  justify-content: center;
  padding: 8px 6px;
  font-size: 0.72rem;
}

.theme-picker-sidebar .theme-swatch.is-active {
  border-color: var(--clay-bright);
  box-shadow: 0 0 0 1px var(--clay-bright);
}

.theme-picker-sidebar .theme-swatches {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.theme-picker-card {
  padding: 16px 18px;
}

/* ——— Creator studio tools ——— */
.creator-compose .section-title {
  letter-spacing: -0.02em;
}

/* ——— Create groups ——— */
.compose-groups-wrap {
  gap: 8px;
}

.compose-groups-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compose-group-chip {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  cursor: pointer;
  max-width: 100%;
}

.compose-group-chip:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.compose-group-chip input {
  width: auto;
  margin-top: 3px;
}

.compose-group-chip-body {
  display: grid;
  gap: 2px;
}

.compose-groups-preview {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}

.publish-group-name {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.publish-group-picker {
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.publish-pick-btn {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.publish-group-selected-row {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.event-invite-field {
  margin-top: 4px;
}

.event-invite-picker {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.event-invite-selected {
  margin-top: 10px;
  gap: 8px;
}

.event-invite-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.event-invite-hashtag-results {
  max-height: 180px;
  overflow: auto;
}

.notif-event-invite .chip {
  margin-left: 8px;
}

/* ——— Admin bot management ——— */
.admin-bots-page .page-masthead { margin-bottom: 8px; }
.pollinations-settings .pollinations-keys-list {
  gap: 10px;
}
.pollinations-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 10px;
}
.pollinations-key-actions {
  flex-shrink: 0;
}
.pollinations-key-row .pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}
.pollinations-key-row .pill-ok {
  background: rgba(80, 200, 120, 0.18);
  color: #6fd89a;
}
.admin-bots-list {
  width: 100%;
  max-width: none;
}
.admin-bots-list .bots-table-wrap {
  width: 100%;
}
.admin-bots-list table.bots-table {
  width: 100%;
  table-layout: auto;
}
.bot-create-card { margin-bottom: 4px; }
.bot-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bot-create-grid > * { min-width: 0; }
.bot-create-grid .bot-create-span { grid-column: 1 / -1; }
.bot-create-grid textarea,
#bot-desc {
  min-height: 200px;
}
.bot-publish-at {
  display: grid;
  gap: 8px;
  align-content: start;
  grid-column: 1 / -1;
  min-width: 0;
}
.bot-publish-at .days-grid {
  margin-top: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}
.bot-publish-at .day-chip {
  min-width: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-publish-at #new-bot-time-label {
  max-width: 220px;
}
.bot-publish-at input[type="time"] {
  min-width: 0;
  max-width: 220px;
  width: 100%;
}
.bot-publish-hint { margin: 0; }
@media (max-width: 719px) {
  .bot-create-grid { grid-template-columns: 1fr; }
}
.bots-table-wrap { overflow-x: auto; }
table.bots-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.bots-table th,
table.bots-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.92rem;
}
table.bots-table th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--wash-1);
}
table.bots-table tr:last-child td { border-bottom: 0; }
table.bots-table tbody tr { cursor: pointer; }
table.bots-table tbody tr:hover td { background: var(--accent-soft); }
.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.bot-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.bot-status.on .bot-status-dot { background: #1f8f89; box-shadow: 0 0 0 4px var(--accent-soft); }
.bot-status.off .bot-status-dot { background: var(--danger); }
.bot-status.paused .bot-status-dot { background: var(--clay); }
.bot-status.failed { color: var(--danger); }
.bot-status.running { color: var(--dusk-bright); }
.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: rgba(13, 31, 34, 0.18);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms var(--ease-out);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }
.bot-topics-cell { max-width: 180px; color: var(--muted); font-size: 0.82rem; }
.bot-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 16px;
}
@media (max-width: 899px) {
  .bot-detail-grid { grid-template-columns: 1fr; }
}
.topic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.topic-row:last-child { border-bottom: 0; }
.topic-row input[type="text"] { flex: 1; min-width: 0; }
.days-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.day-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.day-chip.on {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.times-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.time-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wash-1);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.85rem;
}
.time-pill button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 1rem; }
.run-row { display: grid; grid-template-columns: 110px 1fr 80px 80px; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.run-ok { color: var(--accent); font-weight: 700; }
.run-fail { color: var(--danger); font-weight: 700; }
.run-skip { color: var(--muted); font-weight: 700; }
.run-running { color: var(--dusk-bright); font-weight: 700; }
.bot-next { font-family: var(--display); font-weight: 600; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }


/* Mood document composer */
.mood-stage.is-classic-composer {
  grid-template-columns: minmax(320px, 1.15fr) minmax(300px, 0.85fr);
}

.mood-stage-root.is-media-full {
  padding: 0;
  background: #05060c;
  place-items: stretch;
}

.mood-stage.is-classic-composer.is-media-full {
  width: 100%;
  height: 100%;
  height: 100dvh;
  border: none;
  border-radius: 0;
  box-shadow: none;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #05060c;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-visual-inner,
.mood-stage.is-classic-composer.is-media-full .mood-stage-canvas,
.mood-stage.is-classic-composer.is-media-full .mood-stage-media {
  position: relative;
  inset: auto;
  width: min(100vw, calc(100dvh * 9 / 16));
  height: min(100dvh, calc(100vw * 16 / 9));
  aspect-ratio: 9 / 16;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

@media (min-width: 720px) {
  .mood-stage-root.is-media-full {
    padding: 20px;
    background: color-mix(in srgb, var(--bg-panel) 42%, transparent);
    place-items: center;
  }

  .mood-stage.is-classic-composer.is-media-full {
    width: min(420px, min(92vw, calc(82vh * 9 / 16)));
    height: auto;
    max-height: min(92dvh, 880px);
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lift);
  }

  .mood-stage.is-classic-composer.is-media-full .mood-stage-visual-inner,
  .mood-stage.is-classic-composer.is-media-full .mood-stage-canvas,
  .mood-stage.is-classic-composer.is-media-full .mood-stage-media {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-panel {
  position: relative;
  z-index: 5;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(5, 6, 12, 0.28) 0%, transparent 22%, transparent 62%, rgba(5, 6, 12, 0.62) 100%);
  color: #fff;
  pointer-events: none;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-header,
.mood-stage.is-classic-composer.is-media-full .mood-stage-body {
  pointer-events: none;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-close,
.mood-stage.is-classic-composer.is-media-full .mood-stage-actions,
.mood-stage.is-classic-composer.is-media-full .mood-stage-settings,
.mood-stage.is-classic-composer.is-media-full [data-mood-file-hint],
.mood-stage.is-classic-composer.is-media-full [data-mood-err],
.mood-stage.is-classic-composer.is-media-full .upload-progress {
  pointer-events: auto;
}

.mood-stage.is-classic-composer.is-media-full .page-kicker,
.mood-stage.is-classic-composer.is-media-full .mood-stage-title,
.mood-stage.is-classic-composer.is-media-full .mood-stage-lede,
.mood-stage.is-classic-composer.is-media-full [data-mood-feeling-wrap] {
  display: none;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-header {
  padding-right: 0;
  margin-bottom: 0;
  min-height: 44px;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-close {
  top: 0;
  right: 0;
  background: color-mix(in srgb, #05060c 48%, transparent);
  color: #fff;
  border-color: color-mix(in srgb, #fff 22%, transparent);
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-body {
  overflow: visible;
  background: none;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-overlay {
  justify-content: flex-start;
  align-items: flex-start;
  padding: calc(14px + var(--safe-top)) 72px 16px 14px;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-overlay-tools {
  justify-content: flex-start;
  width: auto;
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-settings {
  background: color-mix(in srgb, #05060c 72%, transparent);
  color: #fff;
  border-color: color-mix(in srgb, #fff 18%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-label {
  color: color-mix(in srgb, #fff 78%, transparent);
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-input {
  background: color-mix(in srgb, #05060c 42%, transparent);
  color: #fff;
  border-color: color-mix(in srgb, #fff 18%, transparent);
}

.mood-stage.is-classic-composer.is-media-full .mood-stage-actions .btn.secondary {
  background: color-mix(in srgb, #05060c 48%, transparent);
  color: #fff;
  border-color: color-mix(in srgb, #fff 22%, transparent);
}

.mood-stage.is-classic-composer.is-media-full [data-mood-file-hint] {
  color: color-mix(in srgb, #fff 72%, transparent);
}

.mood-stage-visual.is-canvas {
  padding: 0;
}

.mood-stage-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.mood-stage-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.mood-stage-media .mood-stage-film,
.mood-stage-media .mood-stage-drop,
.mood-stage-media .mood-stage-orb-wrap {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
  object-position: var(--mood-media-x, 50%) var(--mood-media-y, 50%);
}

.mood-stage-media.is-pannable {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mood-stage-media.is-pannable .mood-stage-film {
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}

.mood-stage-media.is-panning,
.mood-stage-media.is-panning .mood-stage-film {
  cursor: grabbing;
}

.mood-stage-media .mood-stage-drop {
  width: min(100%, 320px);
  height: auto;
  min-height: 220px;
  margin: auto;
  border-radius: 22px;
}

.mood-stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 12px 16px;
  background: none;
  pointer-events: none;
}

.mood-stage-overlay > * {
  pointer-events: auto;
}

.mood-stage-overlay-caption,
.mood-stage-overlay-tags {
  width: 100%;
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, #05060c 42%, transparent);
  color: #fff;
  font: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mood-stage-overlay-caption {
  min-height: 56px;
  padding: 12px 14px;
  resize: none;
  line-height: 1.45;
}

.mood-stage-overlay-tags {
  min-height: 44px;
  padding: 10px 14px;
}

.mood-stage-overlay-caption::placeholder,
.mood-stage-overlay-tags::placeholder {
  color: color-mix(in srgb, #fff 62%, transparent);
}

.mood-stage-overlay-tools {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
}

.mood-stage-tool svg {
  display: block;
}

.mood-stage-tool {
  appearance: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #05060c 48%, transparent);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mood-stage-tool-aa {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.mood-stage-tool.is-on,
.mood-stage-tool:hover,
.mood-stage-tool:focus-visible {
  background: color-mix(in srgb, var(--accent) 28%, #05060c);
  outline: none;
}

.mood-stage-tool[hidden] {
  display: none !important;
}

.mood-stage-stickers,
.mood-peek-stickers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.mood-sticker {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--sticker-scale, 1));
  transform-origin: center center;
  max-width: min(82%, 22rem);
  margin: 0;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35);
  outline: none;
}

.mood-sticker.is-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.35rem, 4.6vw, 2.1rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
  min-width: 2ch;
}

.mood-sticker.is-text:empty::before,
.mood-sticker.is-text.is-blank::before,
.mood-sticker.is-text.is-editing:empty::before {
  content: "Tap to type";
  opacity: 0.55;
  font-weight: 600;
}

.mood-sticker.is-tag {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, #fff 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, #05060c 52%, transparent);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow: none;
}

.mood-sticker.is-tag .mood-sticker-value {
  outline: none;
  min-width: 1ch;
}

.mood-sticker.is-tag .mood-sticker-value:empty::before,
.mood-sticker.is-tag.is-blank .mood-sticker-value:empty::before {
  content: "hashtag";
  opacity: 0.5;
}

.mood-sticker.is-editing {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  z-index: 3;
}

.mood-sticker.is-text.is-editing {
  text-shadow: 0 0 0 transparent, 0 1px 2px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px color-mix(in srgb, #fff 55%, transparent);
  border-radius: 8px;
  padding: 4px 8px;
}

.mood-stage-settings {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.mood-stage-settings[hidden] {
  display: none !important;
}

.mood-stage-textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.45;
}

.mood-stage-input.is-disabled,
.mood-stage-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mood-stage-overlay.is-inactive {
  opacity: 1;
}

.mood-stage-overlay-tags-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mood-stage-overlay-tags-layer .mood-tag-chip {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  appearance: none;
  border: 1px solid color-mix(in srgb, #fff 30%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  background: color-mix(in srgb, #05060c 52%, transparent);
  color: #fff;
  font-size: 0.82rem;
  cursor: grab;
  touch-action: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mood-stage-tag-draft {
  flex: 1;
  min-width: 0;
  max-width: 140px;
  border: 1px solid color-mix(in srgb, #fff 22%, transparent);
  border-radius: 999px;
  padding: 8px 12px;
  background: color-mix(in srgb, #05060c 48%, transparent);
  color: #fff;
  font: inherit;
}

.mood-stage-music-only {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  overflow: hidden;
  display: grid;
  place-items: end center;
}

.mood-stage-music-bg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
}

.mood-stage-music-bg.is-live {
  animation: mood-music-pan 18s ease-in-out infinite alternate;
}

.mood-stage-music-bg.is-fallback,
.mood-stage-music-bg.is-loading {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(255, 120, 180, 0.35), transparent 55%),
    radial-gradient(circle at 70% 80%, rgba(90, 180, 255, 0.35), transparent 50%),
    #0a0c14;
}

.mood-stage-music-title {
  position: relative;
  z-index: 2;
  margin: 0 0 18px;
  padding: 10px 16px;
  border-radius: 999px;
  background: color-mix(in srgb, #05060c 58%, transparent);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@keyframes mood-music-pan {
  from { transform: scale(1.05) translate3d(-2%, -1%, 0); }
  to { transform: scale(1.12) translate3d(2%, 2%, 0); }
}

.mood-peek-media {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.mood-peek-nav {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  /* Edge tap zones — above photo/video (pointer-events:none on film). */
  top: calc(56px + var(--safe-top, 0px));
  bottom: 0;
  width: 40%;
  z-index: 9;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Let gestures hit the media container — iOS Safari video steals taps from siblings. */
.mood-peek-media > .mood-peek-photo,
.mood-peek-media > .mood-peek-video {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.mood-peek-nav-prev {
  left: 0;
}

.mood-peek-nav-next {
  right: 0;
}

.mood-peek-video-playctl {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: color-mix(in srgb, #05060c 42%, transparent);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mood-peek-video-playctl[hidden] {
  display: none;
}

.mood-peek-video-playctl svg {
  width: 28px;
  height: 28px;
  display: block;
}

.mood-peek-media-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 28px 18px 18px;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 18, 0.78));
  pointer-events: none;
}

.mood-peek-media-overlay .mood-peek-caption {
  margin: 0;
  text-align: left;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.mood-peek-media-overlay .mood-peek-tags {
  margin: 0;
}

.mood-peek-media-overlay .mood-peek-tag {
  color: #fff;
  border-color: color-mix(in srgb, #fff 28%, transparent);
  background: color-mix(in srgb, #05060c 36%, transparent);
}

.mood-peek-root.is-pulling .mood-peek-media,
.mood-peek-root.is-pulling .mood-peek {
  transform: translateY(var(--mood-pull, 0));
  transition: transform 80ms linear;
}

@media (max-width: 899px) {
  .mood-stage.is-classic-composer:not(.is-media-full) {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(280px, 52dvh) 1fr;
  }

  .mood-stage.is-classic-composer:not(.is-media-full) .mood-stage-panel {
    min-height: 0;
  }
}

.mood-stage-textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}
.mood-stage-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mood-stage-schedule {
  margin-top: 4px;
}
.mood-peek-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
}
.mood-peek-tag {
  text-decoration: none;
  opacity: 0.9;
}
.mood-peek-tag:hover {
  opacity: 1;
}

.sitemap-lang {
  display: grid;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.sitemap-lang a { overflow-wrap: anywhere; }
@media (min-width: 760px) {
  .sitemap-lang { grid-template-columns: 120px 120px 90px 1fr; }
}
.sitemap-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.sitemap-section,
.sitemap-extra,
.sitemap-filter {
  display: grid;
  gap: 8px;
  align-items: center;
}
.sitemap-section {
  grid-template-columns: 1fr;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}
.sitemap-include {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.sitemap-include em {
  margin-left: auto;
  font-style: normal;
}
.sitemap-section-fields,
.sitemap-extra,
.sitemap-filter {
  grid-template-columns: 1fr;
}
table.bots-table.sitemap-table tbody tr { cursor: default; }
table.bots-table.sitemap-table tbody tr:hover td { background: transparent; }
.sitemap-table a { color: inherit; }
@media (min-width: 760px) {
  .sitemap-sections { grid-template-columns: 1fr 1fr; }
  .sitemap-section-fields { grid-template-columns: 1fr 96px; }
  .sitemap-extra { grid-template-columns: 1.4fr 140px 96px auto; }
  .sitemap-filter { grid-template-columns: 1fr 180px; }
}

/* ——— Security Bot panel ——— */
.bots-subtabs { margin-top: -4px; }
.sec-section-tabs { margin-top: -8px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent-ink, var(--ink)); font: inherit; text-decoration: underline; cursor: pointer; }
.sec-status-row { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.sec-status-title { font-family: var(--display); font-size: 1.15rem; margin-bottom: 4px; }
.sec-health { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.sec-health-running { background: color-mix(in srgb, var(--accent) 22%, white); color: var(--ink); }
.sec-health-degraded { background: color-mix(in srgb, #c47a2c 28%, white); color: #5a3208; }
.sec-health-stopped { background: color-mix(in srgb, #b42318 22%, white); color: #7a140e; }
.sec-reasons { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 0.9rem; }
.sec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sec-h { font-family: var(--display); font-size: 1.05rem; margin: 0 0 10px; }
.sec-sev-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-sev { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; }
.sec-sev.s5 { background: #f8d7d4; color: #7a140e; }
.sec-sev.s4 { background: #f7e1c8; color: #7a3b08; }
.sec-sev.s3 { background: #efe6c8; color: #5c4a10; }
.sec-sev.s2 { background: #dce9f5; color: #1d3d5c; }
.sec-sev.s1 { background: #e7ebea; color: #334; }
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sec-table td, .sec-table th { vertical-align: top; }
.sec-inc-row { cursor: pointer; }
.sec-inc-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sec-src-ok { color: #1a5c45; font-weight: 700; }
.sec-src-warn { color: #8a4b08; font-weight: 700; }
.sec-src-fail, .sec-src-unavailable { color: #8a1f16; font-weight: 700; }
@media (max-width: 900px) {
  .sec-grid { grid-template-columns: 1fr; }
}
