/* Atlas Social — visual system
   Vibrant and playful: deep ink, electric violet, warm coral and soft cream. Pill buttons,
   round cards, bold headings, lively motion that switches off under reduced-motion.
   All colour lives in the tokens below (light first, dark in the prefers-color-scheme block).
   Inter is self-hosted (SIL Open Font License, see /assets/fonts/OFL.txt). */

@font-face {
  font-family: 'Inter Atlas';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-var.woff2') format('woff2-variations'), url('/assets/fonts/inter-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  /* Brand */
  --ink: #1b1440;
  --ink-2: #2a2160;
  --violet: #7c5cff;            /* brand violet: fills, glows, illustrations */
  --primary: #6847f5;           /* accessible violet for text, buttons and focus (5.5:1 on white) */
  --primary-strong: #5533db;
  --primary-soft: #f0ebff;
  --primary-line: #dcd2ff;
  --on-primary: #fff;
  --coral: #ff7a59;             /* accent fill; text on coral is ink */
  --coral-strong: #ff6440;
  --coral-soft: #ffeae3;
  --coral-ink: #b23e1f;         /* coral for text */
  --sun: #ffc94d;
  --mint: #2bd9a8;
  --pink: #ff6fae;
  --bg: #fff8f1;

  /* Surfaces and lines */
  --surface: #fff;
  --surface-2: #fffbf7;
  --surface-3: #f5f0fa;
  --line: #ece4f0;
  --line-strong: #d9cfe3;
  --chrome: #1b1440;            /* sidebar */
  --chrome-text: #d2cbef;
  --chrome-muted: #a69ed0;
  --topbar-bg: rgba(255, 248, 241, .86);
  --inverse-bg: #1b1440;        /* toast, small dark chips */
  --inverse-text: #fff;
  --media-bg: #120d2b;          /* behind video and Moments */

  /* Text */
  --text: var(--ink);
  --text-2: #3e3666;
  --muted: #5e5778;
  --subtle: #716a8a;
  --danger: #c2334d;
  --danger-strong: #a02640;
  --danger-soft: #ffeef0;
  --danger-line: #f6cdd4;
  --on-danger: #fff;
  --warn-soft: #fff4db;
  --warn-line: #f5dfa6;
  --warn-ink: #7a5200;

  /* Playful accents for icon chips (all ≥3:1 on white) */
  --c-violet: #6847f5;
  --c-coral: #e5532f;
  --c-pink: #d6336c;
  --c-mint: #0b8f6e;
  --c-sun: #b57a00;
  --c-blue: #2f5bd3;
  --tint-violet: #f0ebff;
  --tint-coral: #ffeae3;
  --tint-pink: #ffe8f1;
  --tint-mint: #defaf0;
  --tint-sun: #fff2cf;
  --tint-blue: #e5edff;

  /* Reactions */
  --react-like: #6847f5;
  --react-love: #d6336c;
  --react-laugh: #9a6400;
  --react-support: #0b7a62;

  /* Radius */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(27, 20, 64, .05);
  --shadow-sm: 0 1px 2px rgba(27, 20, 64, .04), 0 6px 18px rgba(27, 20, 64, .05);
  --shadow-md: 0 2px 6px rgba(27, 20, 64, .06), 0 16px 40px rgba(27, 20, 64, .1);
  --shadow-lg: 0 30px 80px rgba(27, 20, 64, .28);
  --shadow-pop: 0 8px 20px -8px rgba(104, 71, 245, .65);
  --ring: 0 0 0 4px rgba(124, 92, 255, .28);
  --focus: var(--primary);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --fast: 150ms;
  --base: 220ms;
  --slow: 420ms;

  /* Type */
  --fs-display: 44px;
  --fs-h1: 34px;
  --fs-h2: 24px;
  --fs-h3: 18px;

  /* Layout */
  --sidebar-w: 240px;
  --topbar-h: 68px;

  font-family: 'Inter Atlas', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #1b1440;
    --ink-2: #2a2160;
    --primary: #a48dff;
    --primary-strong: #bcaaff;
    --primary-soft: #2a2163;
    --primary-line: #4a3c99;
    --on-primary: #1b1440;
    --coral-soft: #3b1f3d;
    --coral-ink: #ff9c82;
    --bg: #110c29;

    --surface: #1c1640;
    --surface-2: #221b4b;
    --surface-3: #2c2459;
    --line: #332a63;
    --line-strong: #4a3f85;
    --chrome: #0b0720;
    --topbar-bg: rgba(17, 12, 41, .86);
    --inverse-bg: #f7f2ff;
    --inverse-text: #1b1440;
    --media-bg: #07041a;

    --text: #f7f2ff;
    --text-2: #dad1f3;
    --muted: #b0a6d4;
    --subtle: #9d93c4;
    --danger: #ff6b81;
    --danger-strong: #ff8a9b;
    --danger-soft: #3a1631;
    --danger-line: #6b2a4a;
    --on-danger: #1b1440;
    --warn-soft: #362a12;
    --warn-line: #66501d;
    --warn-ink: #ffd27a;

    --c-violet: #b29fff;
    --c-coral: #ff9c82;
    --c-pink: #ff8cc0;
    --c-mint: #4fe0b6;
    --c-sun: #ffc94d;
    --c-blue: #8fb0ff;
    --tint-violet: #2c2366;
    --tint-coral: #3d2240;
    --tint-pink: #3d1f47;
    --tint-mint: #173a48;
    --tint-sun: #3a2f2c;
    --tint-blue: #22295e;

    --react-like: #b29fff;
    --react-love: #ff7aa8;
    --react-laugh: #ffc94d;
    --react-support: #4fe0b6;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px rgba(0, 0, 0, .22);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 44px rgba(0, 0, 0, .4);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
    --shadow-pop: 0 8px 22px -8px rgba(164, 141, 255, .55);
    --ring: 0 0 0 4px rgba(164, 141, 255, .35);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; background: transparent; padding: 0; }
button:disabled { cursor: wait; opacity: .55; }
button, a { touch-action: manipulation; }
a { color: var(--primary); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -.035em; font-weight: 800; }
h2 { font-size: var(--fs-h2); line-height: 1.2; letter-spacing: -.025em; font-weight: 750; }
h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -.015em; font-weight: 700; }
h4 { font-weight: 700; }
::placeholder { color: var(--subtle); opacity: 1; }
::selection { background: rgba(124, 92, 255, .25); }

svg.icon {
  width: 20px; height: 20px;
  stroke: currentColor; stroke-width: 1.9; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* Visible keyboard focus everywhere */
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}
.sidebar :focus-visible, .promise-hero :focus-visible { outline-color: #c9b8ff; }

.skip-link {
  position: fixed; top: -80px; left: 12px; z-index: 100;
  background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--r-pill); box-shadow: var(--shadow-md);
  font-weight: 700; font-size: 14px;
}
.skip-link:focus { top: 10px; }

.startup {
  height: 100vh; display: grid; place-content: center; gap: 10px;
  text-align: center; font-size: 28px; font-weight: 800; letter-spacing: -.03em;
}
.startup span { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

/* ---------- App chrome: sidebar ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
  background:
    radial-gradient(120% 40% at 0% 100%, rgba(124, 92, 255, .32), transparent 70%),
    radial-gradient(70% 26% at 100% 100%, rgba(255, 122, 89, .22), transparent 70%),
    var(--chrome);
  color: var(--chrome-text);
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; letter-spacing: -.035em;
  text-decoration: none; color: inherit; white-space: nowrap;
}
.brand img { width: 24px; height: 28px; transition: transform var(--base) var(--spring); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.sidebar .brand { color: #fff; margin: 2px 12px 26px; }

.nav { display: grid; gap: 3px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 550; text-align: left;
  color: var(--chrome-text);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.nav-item svg { width: 19px; height: 19px; color: var(--chrome-muted); transition: color var(--fast) var(--ease), transform var(--base) var(--spring); }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item:hover svg { color: #fff; transform: scale(1.12) rotate(-6deg); }
.nav-item:active { transform: scale(.97); }
.nav-item.active {
  background: linear-gradient(135deg, #6847f5, #5a3be6);
  color: #fff; font-weight: 700;
  box-shadow: 0 8px 22px -10px rgba(124, 92, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.nav-item.active svg { color: #fff; }
.nav-item.active::after {
  content: ''; position: absolute; right: 12px; top: 50%;
  width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--coral);
}
.nav-item.active:has(.count:not([hidden]))::after { display: none; }

.nav-divider { margin: 18px 12px 14px; border-top: 1px dashed rgba(255, 255, 255, .14); }
.sidebar-label {
  margin: 0 14px 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--chrome-muted);
}
.sidebar-foot {
  margin-top: auto; margin-left: 2px; margin-right: 2px; padding: 16px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
}
.support { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #fff; }
.support svg { width: 16px; height: 16px; color: var(--coral); fill: var(--coral); }
.sidebar-foot p { font-size: 12px; color: var(--chrome-text); line-height: 1.6; margin-top: 6px; }
.sidebar-foot button {
  margin-top: 10px; font-size: 12px; font-weight: 700; color: #fff;
  text-decoration: underline; text-decoration-color: rgba(255, 122, 89, .7); text-decoration-thickness: 2px; text-underline-offset: 4px;
  transition: color var(--fast) var(--ease), text-decoration-color var(--fast) var(--ease);
}
.sidebar-foot button:hover { text-decoration-color: var(--coral); }

/* ---------- App chrome: top bar ---------- */
.workspace { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 36px;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}

.search {
  display: flex; align-items: center; gap: 9px;
  width: 100%; max-width: 440px; height: 42px;
  padding: 0 8px 0 16px;
  background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  color: var(--subtle);
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.search svg { width: 17px; height: 17px; }
.search:hover { border-color: var(--line-strong); }
.search:focus-within { background: var(--surface); border-color: var(--primary); box-shadow: var(--ring); }
.search input { flex: 1; min-width: 0; background: none; border: none; outline: none !important; font-size: 14px; color: var(--text); }
.search kbd {
  font-family: inherit; font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface-3);
  padding: 3px 9px; border-radius: var(--r-pill); white-space: nowrap;
}
.search button { color: var(--on-primary); background: var(--primary); display: inline-flex; padding: 7px; border-radius: var(--r-pill); transition: transform var(--fast) var(--spring), background-color var(--fast) var(--ease); }
.search button:hover { background: var(--primary-strong); transform: translateX(2px); }
.content-wrap > .search { max-width: 540px; box-shadow: var(--shadow-xs); }

.top-actions { display: flex; align-items: center; gap: 6px; }
.top-actions > button:not(.button) { border-radius: var(--r-pill); }
.top-actions .divider { height: 24px; width: 1px; background: var(--line); margin: 0 8px; }
.top-actions .button + .button { margin-left: 2px; }
.top-actions > [data-view="profile"] { transition: transform var(--fast) var(--spring); }
.top-actions > [data-view="profile"]:hover { transform: scale(1.06) rotate(-3deg); }

.icon-button {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  display: inline-flex; justify-content: center; align-items: center;
  color: var(--text-2);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.icon-button svg { width: 20px; height: 20px; }
.icon-button:hover { background: var(--primary-soft); color: var(--primary); }
.icon-button:active { transform: scale(.9); }
.top-actions [data-action="compose"] { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-pop); }
.top-actions [data-action="compose"]:hover { background: var(--primary-strong); color: var(--on-primary); transform: rotate(90deg); }

.mobile-brand, .menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 20px;
  border: 1.5px solid var(--primary); border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary);
  font-size: 14px; font-weight: 700; line-height: 1.25; white-space: nowrap;
  box-shadow: var(--shadow-pop);
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.button svg { width: 17px; height: 17px; transition: transform var(--base) var(--spring); }
.button:hover { background: var(--primary-strong); border-color: var(--primary-strong); transform: translateY(-1px); }
.button:hover svg { transform: translateX(2px); }
.button:active { transform: translateY(1px) scale(.96); box-shadow: none; }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.button.secondary:hover { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary-strong); }
.button.soft { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--primary-line); box-shadow: none; }
.button.soft:hover { background: var(--primary-line); }
.button.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); box-shadow: none; }
.button.danger:hover { background: var(--danger-strong); border-color: var(--danger-strong); }
.button.full { width: 100%; }
.button.small { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.button.small svg { width: 15px; height: 15px; }
.button.text {
  min-height: 0; padding: 4px 0; background: none; border-color: transparent; box-shadow: none;
  color: var(--primary); font-weight: 700;
}
.button.text:hover { background: none; color: var(--primary-strong); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; transform: none; }
.button.text:active { transform: scale(.97); }

/* ---------- Avatars ---------- */
.avatar {
  height: 42px; width: 42px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--c-violet); color: #fff;
  font-weight: 800; font-size: 13.5px; letter-spacing: .02em;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.avatar.small { height: 30px; width: 30px; font-size: 10.5px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.avatar.large { height: 80px; width: 80px; font-size: 27px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12), 0 0 0 4px var(--surface), 0 0 0 7px var(--coral); }
.top-actions .avatar { height: 36px; width: 36px; font-size: 12px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--coral); }
/* Avatar tones are fixed (not themed) so white initials stay ≥4.5:1 in both modes. */
.tone-0 { background: #6847f5; }
.tone-1 { background: #c2410c; }
.tone-2 { background: #0b7a62; }
.tone-3 { background: #b4237a; }
.tone-4 { background: #2f5bd3; }
.tone-5 { background: #8a5a00; }

/* ---------- Page layout ---------- */
.content-wrap { padding: 32px 36px 56px; max-width: 1480px; margin: auto; }
.content-wrap:focus { outline: none; }
.content-wrap > * { animation: page-in var(--slow) var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }
.main-column { min-width: 0; }

.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
.page-heading h2 { font-size: 22px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 10px; padding: 4px 11px;
  border-radius: var(--r-pill); background: var(--coral-soft); color: var(--coral-ink);
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.page-heading p { color: var(--muted); font-size: 15px; margin-top: 8px; }
.heading-mark {
  position: relative; flex: none;
  width: 56px; height: 56px; border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: var(--ink); box-shadow: 0 10px 24px -10px rgba(255, 122, 89, .8);
  animation: wobble 6s ease-in-out infinite;
}
.heading-mark svg { width: 26px; height: 26px; stroke-width: 2.2; }
@keyframes wobble { 50% { border-radius: 55% 45% 42% 58% / 45% 55% 50% 50%; transform: rotate(8deg); } }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- Feed: banner, tabs, compass ---------- */
.preview-banner {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  font-size: 13px; line-height: 1.5; color: var(--muted);
}
.preview-banner > .icon {
  width: 36px; height: 36px; padding: 8px;
  border-radius: 50%; background: var(--coral-soft); color: var(--coral-ink);
}
.preview-banner strong { color: var(--text); font-weight: 700; }
.preview-banner .button { margin-left: auto; min-height: 36px; padding: 6px 16px; font-size: 13px; }

/* Tabs are a pill track; the active tab is a filled pill that pops in. */
.tabs {
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 20px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  box-shadow: var(--shadow-xs);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.tab:hover { color: var(--text); background: var(--surface-3); }
.tab:active { transform: scale(.95); }
.tab.active { color: var(--on-primary); background: var(--primary); font-weight: 700; box-shadow: var(--shadow-pop); animation: tab-in var(--base) var(--spring); }
.tab.active:hover { color: var(--on-primary); background: var(--primary-strong); }
@keyframes tab-in { from { transform: scale(.88); opacity: .6; } }
.tab:focus-visible { outline-offset: -3px; }
.tab.active:focus-visible { outline-color: var(--on-primary); }

.compass-trigger {
  margin-left: auto; align-self: center; flex: none;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border: 1.5px dashed var(--primary-line); border-radius: var(--r-pill);
  background: var(--primary-soft);
  font-size: 13px; font-weight: 700; color: var(--primary-strong); white-space: nowrap;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.compass-trigger svg { width: 16px; height: 16px; color: var(--primary); transition: transform var(--slow) var(--spring); }
.compass-trigger:hover { border-style: solid; border-color: var(--primary); }
.compass-trigger:hover svg { transform: rotate(180deg); }

/* ---------- Composer ---------- */
.composer { padding: 18px 18px 12px; margin-bottom: 22px; }
.composer-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.composer-prompt {
  flex: 1; text-align: left;
  height: 48px; padding: 0 20px;
  background: var(--surface-3);
  border: 1.5px solid transparent; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; color: var(--muted);
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.composer-prompt:hover { border-color: var(--primary-line); background: var(--surface); color: var(--text-2); }
.composer-bottom {
  display: flex; align-items: center; gap: 4px;
  padding-top: 10px; border-top: 1px dashed var(--line-strong);
}
.composer-bottom button {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.composer-bottom button svg {
  width: 30px; height: 30px; padding: 6.5px; border-radius: 50%;
  color: var(--c-violet); background: var(--tint-violet);
  transition: transform var(--base) var(--spring);
}
.composer-bottom button:nth-child(1) svg { color: var(--c-coral); background: var(--tint-coral); }
.composer-bottom button:nth-child(2) svg { color: var(--c-violet); background: var(--tint-violet); }
.composer-bottom button:nth-child(3) svg { color: var(--c-pink); background: var(--tint-pink); }
.composer-bottom button:nth-child(4) svg { color: var(--c-mint); background: var(--tint-mint); }
.composer-bottom button:nth-child(5) svg { color: var(--c-sun); background: var(--tint-sun); }
.composer-bottom button:hover { background: var(--surface-3); color: var(--text); }
.composer-bottom button:hover svg { transform: rotate(-10deg) scale(1.1); }
.composer-bottom button:active { transform: scale(.95); }
.composer-bottom .audience-hint {
  margin-left: auto; display: flex; gap: 5px; align-items: center;
  font-size: 12px; color: var(--muted);
}
.audience-hint svg { width: 13px; height: 13px; }

/* ---------- Posts ---------- */
.post { margin-bottom: 18px; overflow: hidden; transition: box-shadow var(--base) var(--ease), transform var(--base) var(--ease); }
.post:hover { box-shadow: var(--shadow-md); }
.post-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.author-name {
  font-size: 15px; font-weight: 700; text-align: left; padding: 0; color: var(--text);
  transition: color var(--fast) var(--ease);
}
.author-name:hover { color: var(--primary); }
.post-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.post-meta svg { width: 12px; height: 12px; }
.post-head > .icon-button { margin-left: auto; color: var(--muted); }
.post-body {
  padding: 12px 20px 14px;
  font-size: 15.5px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.post-photo {
  width: calc(100% - 40px); max-height: 460px; margin: 0 20px 12px;
  object-fit: cover; border-radius: var(--r-md);
  background: var(--surface-3);
}
.post-stats {
  display: flex; justify-content: space-between;
  padding: 2px 20px 10px;
  font-size: 12.5px; color: var(--muted);
}
.post-stats span { display: flex; align-items: center; gap: 5px; }
.post-stats svg { height: 13px; width: 13px; color: var(--react-love); }
.post-actions { display: flex; gap: 4px; margin: 0 12px; padding: 8px 0 10px; border-top: 1px solid var(--line); }
.post-actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 8px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.post-actions button svg { transition: transform var(--base) var(--spring); }
.post-actions button:hover { background: var(--primary-soft); color: var(--primary-strong); }
.post-actions button:hover svg { transform: scale(1.15) rotate(-6deg); }
.post-actions button:active { transform: scale(.92); }
.post-actions .selected { color: var(--primary); font-weight: 700; }
.post-actions .selected:hover { color: var(--primary-strong); }
.post-actions .selected svg { fill: currentColor; fill-opacity: .18; }
.post-actions svg { width: 19px; height: 19px; }

.comments { background: var(--surface-2); border-top: 1px solid var(--line); padding: 16px 20px 18px; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; font-size: 13.5px; animation: pop var(--base) var(--ease); }
.comment > div { background: var(--surface); border: 1px solid var(--line); border-radius: 6px var(--r-lg) var(--r-lg) var(--r-lg); padding: 9px 14px; min-width: 0; }
.comment strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.comment p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; color: var(--text-2); }
.comment-form { display: flex; gap: 8px; }
.comment-form input {
  flex: 1; min-width: 0; height: 40px; padding: 0 16px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: 13.5px; outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.comment-form input:focus-visible { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.comment-form .button { min-height: 40px; width: 40px; padding: 0; }

.sample-label {
  margin-left: 6px; padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--tint-sun); color: var(--warn-ink);
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  vertical-align: 1px;
}

/* ---------- Right rail ---------- */
.rail { display: flex; flex-direction: column; gap: 18px; }
.rail .card { padding: 18px; }
.section-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-label h3 { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.section-label > svg { width: 17px; height: 17px; color: var(--coral); }
.section-label button { color: var(--primary); font-size: 13px; font-weight: 700; }
.section-label button:hover { color: var(--primary-strong); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rail-picture { width: 100%; margin-bottom: 14px; aspect-ratio: 1.64; object-fit: cover; border-radius: var(--r-md); }
.rail h4 { font-size: 17px; letter-spacing: -.02em; margin: 0 0 6px; }
.rail p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.rail .button { margin-top: 14px; }
.mini-community { display: flex; gap: 11px; align-items: center; margin: 12px 0 0; }
.mini-community img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-sm); }
.mini-community strong { font-size: 13.5px; font-weight: 700; }
.mini-community p { font-size: 12px; line-height: 1.4; margin-top: 1px; }
.mini-community button {
  margin-left: auto; width: 32px; height: 32px; border-radius: var(--r-pill);
  display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary); font-size: 18px; font-weight: 700; line-height: 1;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.mini-community button:hover { background: var(--primary); color: var(--on-primary); transform: translateX(2px); }
.pledge {
  position: relative; overflow: hidden;
  padding: 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(140deg, #5a3be6, #7a3fd8 55%, #b4237a);
  color: #fff;
}
.pledge::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: rgba(255, 201, 77, .35);
}
.pledge .icon { position: relative; color: var(--sun); margin-bottom: 8px; width: 24px; height: 24px; }
.pledge h3 { position: relative; font-size: 16px; line-height: 1.35; margin-bottom: 6px; font-weight: 800; }
.pledge p { position: relative; font-size: 12.5px; line-height: 1.6; color: #fff; }
.rail-footer { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 4px; font-size: 12px; color: var(--muted); }
.rail-footer button { font-size: 12px; color: var(--muted); padding: 0; }
.rail-footer button:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Status blocks ---------- */
.caught-up { padding: 30px 20px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.caught-up > span {
  width: 48px; height: 48px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%; background: linear-gradient(135deg, var(--mint), #1fb88d);
  color: var(--ink); box-shadow: 0 10px 22px -10px rgba(43, 217, 168, .9);
}
.caught-up > span svg { width: 22px; height: 22px; stroke-width: 2.6; }
.caught-up strong { display: block; color: var(--text); font-weight: 800; font-size: 16px; }

/* Empty states: a small illustration (blob, icon, confetti) drawn in CSS so it follows the theme. */
.empty { padding: 48px 24px; text-align: center; line-height: 1.6; }
.empty-art { position: relative; display: inline-grid; place-items: center; width: 108px; height: 96px; margin-bottom: 14px; }
.empty-art::before {
  content: ''; position: absolute; inset: 6px 10px;
  border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%;
  background: linear-gradient(135deg, var(--tint-violet), var(--tint-coral));
  animation: wobble 7s ease-in-out infinite;
}
.empty-art > .icon {
  position: relative; width: 52px; height: 52px; padding: 12px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-pop);
  transform: rotate(-8deg);
}
.empty-art .confetti { position: absolute; border-radius: 50%; }
.empty-art .c1 { width: 14px; height: 14px; top: 4px; right: 12px; background: var(--coral); }
.empty-art .c2 { width: 10px; height: 10px; bottom: 8px; left: 10px; background: var(--sun); }
.empty-art .c3 { width: 8px; height: 8px; top: 18px; left: 4px; background: var(--mint); }
.empty-art .c4 { width: 18px; height: 6px; bottom: 16px; right: 2px; border-radius: 3px; background: var(--pink); transform: rotate(-30deg); }
.empty h3 { margin-bottom: 6px; font-size: 20px; font-weight: 800; }
.empty p { font-size: 14.5px; color: var(--muted); max-width: 400px; margin: 0 auto 22px; }

.loading { padding: 56px; text-align: center; color: var(--muted); font-size: 13.5px; }
.spinner {
  display: inline-block; width: 24px; height: 24px; margin-bottom: 10px;
  border: 3px solid var(--primary-line); border-top-color: var(--primary); border-right-color: var(--coral); border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading: placeholder cards that shimmer while a page loads. */
.loading.skeleton { padding: 0; text-align: left; display: grid; gap: 18px; max-width: 760px; }
.skel-card { padding: 20px; display: grid; gap: 12px; }
.skel-row { display: flex; align-items: center; gap: 12px; }
.skel-lines { flex: 1; display: grid; gap: 8px; }
.skel-circle, .skel-line, .skel-block {
  display: block; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--primary-soft) 40%, var(--surface-3) 80%) 0 0 / 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skel-circle { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.skel-line { height: 12px; width: 100%; }
.skel-line.w-25 { width: 25%; }
.skel-line.w-40 { width: 40%; }
.skel-line.w-80 { width: 80%; }
.skel-block { height: 140px; border-radius: var(--r-md); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Grids, circle and plan cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.circle-card { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--base) var(--ease), border-color var(--base) var(--ease), transform var(--base) var(--spring); }
.circle-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-line); transform: translateY(-3px); }
.circle-card > img { width: 100%; height: 156px; object-fit: cover; transition: transform var(--slow) var(--ease); }
.circle-card:hover > img { transform: scale(1.03); }
.circle-card .card-content { position: relative; flex: 1; display: flex; flex-direction: column; background: var(--surface); }
.circle-card .card-bottom { margin-top: auto; }
.card-content { padding: 20px 22px 22px; }
.card-content p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 8px 0 16px; }
.card-content .badge { margin-bottom: 10px; align-self: flex-start; }
.card-content .role-pill { align-self: flex-start; margin: -4px 0 10px; }
.card-content h3 { font-size: 19px; font-weight: 800; }
.card-content blockquote {
  margin: 0 0 16px; padding: 10px 14px;
  border-left: 4px solid var(--primary-line); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
#modal .card + .card { margin-top: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
}
.badge svg { width: 12px; height: 12px; color: currentColor; stroke-width: 2.4; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }

.stack { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.circle-cover { overflow: hidden; margin-bottom: 20px; }
.circle-cover > img { height: 210px; width: 100%; object-fit: cover; }
.circle-cover .card-content { background: var(--surface); }
.circle-cover h2 { font-size: 28px; font-weight: 800; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 16px; padding: 6px 14px 6px 8px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--primary);
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.back svg { width: 17px; height: 17px; transition: transform var(--base) var(--spring); }
.back:hover { background: var(--primary-soft); }
.back:hover svg { transform: translateX(-3px); }

/* People */
.person { padding: 16px; display: flex; gap: 12px; align-items: center; }
.person-info { flex: 1; min-width: 0; }
.person strong { display: block; font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }
.person p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.person .stack { justify-content: flex-end; gap: 4px; }
.card.person { transition: transform var(--base) var(--spring), box-shadow var(--base) var(--ease); }
.card.person:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.settings .person { padding: 12px 0; border-bottom: 1px solid var(--line); justify-content: space-between; font-size: 14px; }

/* Plans */
.event-detail { display: grid; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--text-2); margin-bottom: 16px; }
.event-detail > div { display: flex; gap: 10px; align-items: center; }
.event-detail svg { width: 26px; height: 26px; padding: 5px; border-radius: 50%; color: var(--c-coral); background: var(--tint-coral); }
.event-detail > div:nth-child(2) svg { color: var(--c-violet); background: var(--tint-violet); }
.event-detail > div:nth-child(3) svg { color: var(--c-mint); background: var(--tint-mint); }
.rsvp { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.rsvp button {
  padding: 7px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.rsvp button:hover { border-color: var(--primary-line); background: var(--primary-soft); color: var(--text); }
.rsvp button:active { transform: scale(.94); }
.rsvp .selected, .rsvp .selected:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 700; box-shadow: var(--shadow-pop); animation: tab-in var(--base) var(--spring); }

/* ---------- Settings & forms ---------- */
.settings { padding: 30px; max-width: 780px; }
.settings h3 { margin: 0 0 6px; font-weight: 800; }
.settings p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; }
.settings hr { border: 0; border-top: 1.5px dashed var(--line-strong); margin: 28px 0; }

.form-grid { display: grid; gap: 16px; }
.settings .form-grid > .button:not(.full) { justify-self: start; }
label.field { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: var(--text); }
.field input, .field textarea, .field select, .field-input {
  width: 100%; min-width: 0; min-height: 46px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 500;
  outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; border-radius: var(--r-pill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c5cff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field input:not([type="color"]):not([type="file"]), .field-input { border-radius: var(--r-pill); }
.field input:hover, .field textarea:hover, .field select:hover, .field-input:hover { border-color: var(--primary-line); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, .field-input:focus-visible {
  outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
.field input[readonly], .field-input[readonly] { background: var(--surface-2); }
.field textarea { resize: vertical; min-height: 104px; line-height: 1.55; border-radius: var(--r-lg); }
.field small { color: var(--muted); font-weight: 500; font-size: 12px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error {
  display: none;
  padding: 11px 14px; border-radius: var(--r-md);
  background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger);
  font-size: 13px; font-weight: 600;
  animation: shake 360ms var(--ease);
}
.form-error:not(:empty) { display: block; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--primary-soft); border: 1px solid var(--primary-line);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
}
.note svg { width: 16px; height: 16px; margin-top: 1px; color: var(--primary); }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.row-toggle {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.row-toggle input {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; margin: 0;
  position: relative; width: 46px; height: 28px; border-radius: var(--r-pill);
  background: var(--line-strong); cursor: pointer;
  transition: background-color var(--base) var(--ease);
}
.row-toggle input::after {
  content: ''; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px;
  background: #fff; border-radius: 50%; box-shadow: 0 2px 4px rgba(27, 20, 64, .25);
  transition: transform var(--base) var(--spring);
}
.row-toggle input:checked { background: var(--primary); }
.row-toggle input:checked::after { transform: translateX(18px); }
.row-toggle input:focus-visible { box-shadow: var(--ring); }
.row-toggle input:disabled { opacity: .45; cursor: not-allowed; }

.image-input {
  display: grid; gap: 6px; justify-items: start;
  padding: 16px; cursor: pointer;
  border: 2px dashed var(--primary-line); border-radius: var(--r-lg);
  background: var(--primary-soft);
  font-size: 13.5px; font-weight: 700;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.image-input:hover { border-color: var(--primary); }
.image-input > svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; color: var(--on-primary); background: var(--primary); }
.image-input .help { font-weight: 500; }
.image-input input { font-size: 12px; max-width: 100%; font-weight: 500; }
.photo-preview { max-height: 230px; width: 100%; object-fit: cover; border-radius: var(--r-md); }
/* "Preparing your photo…" while a large phone photo is shrunk on the device before sharing */
.photo-preparing { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; }
.photo-preparing .spinner { flex: none; width: 18px; height: 18px; margin: 0; border-width: 2.5px; }
#album-preparing:empty { display: none; }

/* ---------- Account safety ---------- */
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.link-button { color: var(--primary); font-size: 12.5px; font-weight: 700; }
.link-button:hover { color: var(--primary-strong); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sent-mark {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px;
  border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%; background: linear-gradient(135deg, #6847f5, #b4237a); color: #fff;
  box-shadow: var(--shadow-pop);
}
.sent-mark svg { width: 24px; height: 24px; stroke-width: 2.3; }
.modal-body .note { margin-bottom: 4px; }
.modal-body .share-note { margin-bottom: 12px; }
.modal-body .note strong, .settings .note strong { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.modal-actions .button:not(.full) { flex: 1 1 auto; }
.account-banner .button { white-space: nowrap; }
.status {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--tint-mint); color: var(--react-support);
  font-size: 11.5px; font-weight: 700; white-space: nowrap; vertical-align: 1px;
}
.status svg { width: 13px; height: 13px; stroke-width: 2.4; }
.status.warn { background: var(--warn-soft); color: var(--warn-ink); }
.account-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.account-row strong { display: block; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.row-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.settings-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 18px; }
.settings-split h4 { font-size: 14.5px; font-weight: 750; }
.settings-split .button { justify-self: start; }

/* ---------- Moderation ---------- */
.mod-list { display: grid; gap: 14px; }
.mod-item { padding: 20px 22px; }
.mod-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.mod-meta { font-size: 12.5px; color: var(--muted); }
.mod-meta strong { color: var(--text); font-weight: 700; }
.mod-quote {
  margin: 12px 0; padding: 11px 16px;
  border-left: 4px solid var(--coral); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-2);
  font-size: 14px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.mod-reason { display: flex; gap: 8px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.mod-reason strong { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 1px; }
.appeal-state { display: grid; justify-items: start; gap: 8px; margin-top: 4px; }
.appeal-state .mod-quote { justify-self: stretch; margin: 4px 0 0; }
.mod-item .stack .button.text { padding-left: 6px; padding-right: 6px; }
.content-wrap > .search { margin-bottom: 20px; }
.mod-section { margin-bottom: 26px; }
.mod-section > h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.mod-section > .help { margin-bottom: 10px; }
.mod-section > h3 + .card { margin-top: 10px; }
.mod-people { overflow: hidden; }
.mod-person { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); transition: background-color var(--fast) var(--ease); }
.mod-person:hover { background: var(--surface-2); }
.mod-person:last-child { border-bottom: 0; }
.mod-person strong { display: block; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.mod-person p { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.mod-person .stack { justify-content: flex-end; }
.mod-empty { padding: 16px; }
.history-row { align-items: flex-start; }
.mod-person p.history-text { font-size: 14px; color: var(--text-2); margin-top: 0; overflow-wrap: anywhere; }
.history-text strong { display: inline; color: var(--text); }
.history-row time { white-space: nowrap; }
.mod-log { padding: 4px 22px; }
.log-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.log-row:last-child { border-bottom: 0; }
.log-row time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log-row strong { color: var(--text); font-weight: 700; }
.log-row p { margin-top: 2px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.comment-tools { display: flex; gap: 2px; margin-left: auto; align-self: flex-start; opacity: .7; transition: opacity var(--fast) var(--ease); }
.comment:hover .comment-tools, .comment-tools:focus-within { opacity: 1; }
.comment-tools .icon-button { width: 30px; height: 30px; }
.comment-tools .icon-button svg { width: 14px; height: 14px; }

/* ---------- Dialogs ---------- */
dialog {
  width: min(540px, calc(100vw - 28px)); max-height: 90dvh;
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl);
  color: var(--text); background: var(--surface);
  box-shadow: var(--shadow-lg);
}
dialog[open] { animation: dialog-in var(--slow) var(--spring); }
dialog::backdrop { background: rgba(27, 20, 64, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog[open]::backdrop { animation: fade-in var(--base) var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes fade-in { from { opacity: 0; } }
.modal-head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 22px 20px 16px 26px;
}
.modal-head::after {
  content: ''; position: absolute; left: 26px; bottom: 4px;
  width: 44px; height: 5px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--violet), var(--coral));
}
.modal-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.025em; }
.modal-head .icon-button { background: var(--surface-3); }
.modal-head .icon-button:hover { transform: rotate(90deg); }
.modal-body { padding: 18px 26px 26px; }
.modal-body > p { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin-bottom: 18px; }
.modal-bottom { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 18px; }
.modal-bottom button { color: var(--primary); font-weight: 700; }
.modal-bottom button:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 100;
  max-width: 90vw; padding: 12px 20px;
  background: var(--inverse-bg); color: var(--inverse-text); border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px) scale(.92);
  transition: opacity var(--base) var(--ease), transform var(--slow) var(--spring);
}
#toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
#toast.has-action { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
#toast.has-action.visible { pointer-events: auto; }
.toast-action {
  padding: 4px 2px; border: 0; background: none; color: inherit; font: inherit; font-weight: 800; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.toast-action:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

/* ---------- Profile ---------- */
.profile-head { position: relative; overflow: hidden; padding: 26px; display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.profile-head::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 64px;
  background: linear-gradient(110deg, var(--tint-violet), var(--tint-coral) 60%, var(--tint-sun));
}
.profile-head > * { position: relative; }
.profile-head h2 { margin-bottom: 2px; font-size: 26px; font-weight: 800; }
.profile-head p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.profile-head p + p { color: var(--text-2); margin-top: 6px; }
.profile-head .button { margin-left: auto; }

/* ---------- Messages ---------- */
.inbox { display: grid; grid-template-columns: 270px minmax(0, 1fr); overflow: hidden; min-height: 540px; }
.thread-list { border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 3px; background: var(--surface-2); }
.thread {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--r-md); text-align: left;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.thread > span:last-child { min-width: 0; }
.thread:hover { background: var(--surface-3); }
.thread:active { transform: scale(.98); }
.thread.active { background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--primary-line); }
.thread strong { font-size: 13.5px; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { min-width: 0; display: flex; flex-direction: column; padding: 18px 22px 20px; min-height: 540px; }
.chat-title { padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.chat-messages { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 0; max-height: 430px; overflow: auto; }
.message {
  max-width: 78%; align-self: flex-start;
  padding: 10px 15px;
  background: var(--surface-3); border-radius: 20px 20px 20px 6px;
  font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
  animation: bubble-in var(--base) var(--spring);
  transform-origin: bottom left;
}
.message.mine { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-radius: 20px 20px 6px 20px; transform-origin: bottom right; }
.message small { display: block; font-size: 11px; opacity: .8; margin-top: 3px; }
@keyframes bubble-in { from { opacity: 0; transform: scale(.85); } }
.chat-compose { display: flex; gap: 8px; }
.chat-compose input { flex: 1; }
.chat-compose .button { min-height: 46px; padding: 0 18px; }

.thread .thread-text { flex: 1; min-width: 0; }
.thread-top { display: flex; align-items: baseline; gap: 8px; }
.thread-top strong { flex: 1; min-width: 0; }
.thread-top time { flex: none; font-size: 11.5px; color: var(--subtle); }
.thread.unread strong { font-weight: 800; }
.thread.unread small { color: var(--text-2); font-weight: 600; }
.thread .count { position: static; flex: none; }
.thread-list .load-more { margin: 8px auto; }
.chat-title { display: flex; align-items: center; gap: 10px; }
.chat-title > div { min-width: 0; }
.chat-title strong { display: block; font-size: 16px; font-weight: 800; }
.chat-title small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.chat-title .button { margin-left: auto; }
.chat-messages .older { align-self: center; }
.chat-empty, .chat-note { margin: auto; text-align: center; }
.pick-list { display: grid; gap: 2px; margin-top: 14px; max-height: 340px; overflow: auto; }

/* ---------- Notifications ---------- */
.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 6px; margin-left: auto;
  border-radius: var(--r-pill); background: var(--coral); color: var(--ink);
  font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  animation: count-in var(--slow) var(--spring);
}
@keyframes count-in { from { transform: scale(0); } }
.count[hidden] { display: none; }
.icon-button { position: relative; }
.icon-button .count { position: absolute; top: 0; right: -3px; margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; box-shadow: 0 0 0 2.5px var(--bg); }
.nav-item .count { background: var(--coral); color: var(--ink); }
.notif-wrap { position: relative; }
.notif-panel {
  position: absolute; top: calc(100% + 12px); right: -6px; z-index: 40;
  width: 396px; max-height: min(620px, calc(100vh - var(--topbar-h) - 24px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dialog-in var(--base) var(--spring);
  transform-origin: top right;
}
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.notif-head h2 { font-size: 18px; font-weight: 800; margin: 0; }
.notif-head .button { margin-left: auto; }
.notif-list { overflow: auto; padding: 8px; flex: 1; }
.notif-item {
  width: 100%; display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-md); text-align: left;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.notif-item + .notif-item { margin-top: 2px; }
.notif-item:hover { background: var(--surface-3); }
.notif-item:active { transform: scale(.98); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item.unread:hover { background: var(--primary-line); }
.notif-avatar { position: relative; flex: none; }
.notif-type {
  position: absolute; right: -5px; bottom: -5px;
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #6847f5; color: #fff; box-shadow: 0 0 0 2.5px var(--surface);
}
.notif-type svg { width: 11px; height: 11px; stroke-width: 2.8; }
.notif-type.type-like { background: #d6336c; }
.notif-type.type-rsvp, .notif-type.type-member { background: #0b7a62; }
.notif-type.type-comment, .notif-type.type-reply, .notif-type.type-message { background: #c2410c; }
.notif-type.type-post_removed { background: #1b1440; }
.notif-text { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.notif-text > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notif-text strong { color: var(--text); font-weight: 700; }
.notif-text small { display: block; margin-top: 2px; font-size: 12px; color: var(--subtle); }
.notif-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.notif-empty { padding: 36px 24px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.notif-empty svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); margin: 0 auto 10px; }
.notif-empty strong { display: block; color: var(--text); font-size: 15px; font-weight: 800; }
.notif-foot { border-top: 1px solid var(--line); padding: 8px 10px; display: flex; justify-content: center; }
.notif-list .load-more { margin: 10px auto 6px; }
.loading.compact { padding: 32px; }
.spotlight { box-shadow: var(--shadow-md), 0 0 0 3px var(--violet); animation: spotlight 1.2s var(--ease); }
@keyframes spotlight { 30% { box-shadow: var(--shadow-md), 0 0 0 8px rgba(124, 92, 255, .35); } }
.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; }

/* ---------- Promise ---------- */
.promise-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(255, 122, 89, .45), transparent 70%),
    radial-gradient(60% 80% at 0% 100%, rgba(124, 92, 255, .55), transparent 70%),
    #1b1440;
  color: #fff; padding: 36px; border-radius: var(--r-xl); margin-bottom: 24px;
}
.promise-hero > svg { color: var(--sun); width: 30px; height: 30px; }
.promise-hero h2 { font-size: 40px; line-height: 1.05; letter-spacing: -.04em; margin: 16px 0 12px; font-weight: 800; }
.promise-hero p { color: #ddd6ff; line-height: 1.6; font-size: 15.5px; }
.promise-list { display: grid; gap: 10px; padding-left: 22px; margin: 0 0 4px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.promise-list li::marker { content: '✦  '; color: var(--coral); }

/* ---------- Misc ---------- */
.mobile-nav { display: none; }
.load-more { display: flex; margin: 20px auto; }
.post-link { padding: 10px; word-break: break-all; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* ---------- Responsive ---------- */
@media (min-width: 1550px) {
  .layout { grid-template-columns: minmax(0, 760px) 300px; justify-content: center; }
  .content-wrap { padding-top: 40px; }
}

@media (max-width: 1220px) {
  :root { --sidebar-w: 212px; }
  .topbar { padding: 0 28px; }
  .content-wrap { padding: 28px 28px 44px; }
  .layout { gap: 20px; grid-template-columns: minmax(0, 1fr) 248px; }
  .rail .card { padding: 16px; }
  .composer-bottom button { padding: 7px 8px; }
}

@media (max-width: 1040px) {
  .rail { display: none; }
  .layout { grid-template-columns: 1fr; }
  .content-wrap { max-width: 840px; }
  .grid { gap: 14px; }
  .topbar .search kbd { display: none; }
  .inbox { grid-template-columns: 220px 1fr; }
}

@media (max-width: 760px) {
  :root { font-size: 14px; --topbar-h: 56px; }
  .shell { display: block; }

  .sidebar {
    top: var(--topbar-h); bottom: 60px; width: 256px;
    padding-top: 12px;
    transform: translateX(-100%);
    transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 12px 0 40px rgba(27, 20, 64, .35); border-radius: 0 var(--r-xl) var(--r-xl) 0; }
  .sidebar .brand { display: none; }

  .topbar { padding: 0 12px 0 8px; gap: 8px; }
  .mobile-brand { display: flex; flex: 1; font-size: 17px; gap: 8px; }
  .mobile-brand img { width: 19px; height: 23px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--r-pill); color: var(--text-2); }
  .menu-toggle:hover { background: var(--surface-3); }
  .topbar .search { display: none; }
  .top-actions { gap: 6px; }
  .top-actions .divider, .top-actions .desktop-action { display: none; }
  .top-actions .button { min-height: 32px; padding: 5px 11px; font-size: 12.5px; }
  .top-actions .avatar { width: 32px; height: 32px; font-size: 11px; }

  .content-wrap { padding: 20px 16px 88px; }
  .page-heading { margin-bottom: 18px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 13.5px; }
  .eyebrow { font-size: 11px; margin-bottom: 6px; }
  .heading-mark { width: 42px; height: 42px; }
  .heading-mark svg { width: 18px; height: 18px; }
  .page-heading > .button { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
  .page-heading > .button svg { width: 15px; height: 15px; }

  .preview-banner { font-size: 12.5px; padding: 10px 10px 10px 12px; gap: 10px; }
  .preview-banner > .icon { display: none; }
  .preview-banner .button { min-height: 32px; padding: 5px 11px; font-size: 12.5px; }

  .tabs { gap: 2px; margin-bottom: 16px; padding: 4px; }
  .tab { font-size: 13.5px; padding: 7px 12px; }
  .compass-trigger { padding: 5px 9px; font-size: 12px; gap: 5px; }
  .compass-trigger .compass-word { display: none; }

  .composer { padding: 14px 14px 10px; margin-bottom: 16px; }
  .composer-top { gap: 10px; margin-bottom: 10px; }
  .composer-prompt { font-size: 13.5px; height: 40px; padding: 0 14px; }
  .composer .avatar { width: 36px; height: 36px; font-size: 11px; }
  .composer-bottom { gap: 2px; }
  .composer-bottom button { font-size: 12.5px; padding: 7px 8px; }
  .audience-hint { display: none !important; }

  .post { margin-bottom: 12px; }
  .post-head { padding: 14px 14px 0; }
  .post-body { padding: 10px 14px 12px; font-size: 14.5px; }
  .post-photo { width: calc(100% - 28px); margin: 0 14px 12px; }
  .post-stats { padding: 0 14px 10px; }
  .post-actions { margin: 0 8px; gap: 0; }
  .post-actions button { font-size: 12.5px; gap: 5px; padding: 8px 4px; }
  .comments { padding: 14px; }

  .grid { grid-template-columns: 1fr; gap: 14px; }
  .settings-split { grid-template-columns: 1fr; gap: 22px; }
  .mod-item { padding: 16px; }
  .mod-person { flex-wrap: wrap; padding: 12px 14px; }
  .mod-person .stack { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .mod-log { padding: 2px 14px; }
  .log-row { grid-template-columns: 1fr; gap: 2px; }
  .account-banner { flex-wrap: wrap; }
  .account-banner .button { margin-left: 0; }

  .mobile-nav {
    display: flex; justify-content: space-around;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--topbar-bg);
    -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(27, 20, 64, .06);
  }
  .mobile-nav button {
    position: relative; width: 20%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; font-weight: 600; color: var(--muted);
    transition: color var(--fast) var(--ease), transform var(--fast) var(--spring);
  }
  .mobile-nav button svg { width: 44px; height: 28px; padding: 4px 12px; border-radius: var(--r-pill); transition: background-color var(--base) var(--ease), transform var(--base) var(--spring); }
  .mobile-nav button:active { transform: scale(.92); }
  .mobile-nav button:focus-visible { outline-offset: -4px; border-radius: var(--r-md); }
  .mobile-nav button.active { color: var(--primary); font-weight: 800; }
  .mobile-nav button.active svg { background: var(--primary-soft); transform: translateY(-1px); animation: tab-in var(--base) var(--spring); }

  dialog { border-radius: var(--r-xl); }
  .modal-head { padding: 16px 14px 14px 18px; }
  .modal-head::after { left: 18px; }
  .modal-body { padding: 18px; }
  .modal-head h2 { font-size: 18px; }
  .settings { padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .profile-head { padding: 18px; flex-wrap: wrap; gap: 14px; }
  .profile-head .button { margin-left: 0; }
  .avatar.large { width: 56px; height: 56px; font-size: 19px; }
  .profile-head h2 { font-size: 20px; }

  .inbox { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .thread-list { flex-direction: row; overflow: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .thread { min-width: 215px; max-width: 240px; }
  .chat { padding: 14px 16px 16px; min-height: 420px; }
  .chat-messages { max-height: 350px; }
  .notif-panel { position: fixed; top: calc(var(--topbar-h) + 6px); left: 8px; right: 8px; width: auto; max-height: calc(100vh - var(--topbar-h) - 90px); }
  .mobile-nav button .count { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }

  .person { padding: 14px; gap: 10px; }
  .person .button { font-size: 12px; padding: 5px 10px; }
  .person .icon-button { width: 32px; height: 32px; }
  #toast { bottom: 76px; }
  .circle-cover > img { height: 160px; }
  .circle-card > img { height: 140px; }
  .card-content { padding: 18px; }
  .promise-hero { padding: 24px; }
  .promise-hero h2 { font-size: 28px; }
}

@media (max-width: 370px) {
  .compass-trigger { gap: 0; padding: 6px; }
  .compass-trigger span { display: none; }
  .tab { padding-left: 8px; padding-right: 8px; }
  .page-heading h1 { font-size: 23px; }
  .post-actions button { font-size: 11.5px; }
  .preview-banner .button { padding: 5px 9px; }
  .mobile-brand { font-size: 16px; }
}
@media (max-width: 760px) {
  .mod-person .stack:has(> .help:only-child) { width: auto; padding-left: 0; margin-left: auto; }
}

/* ---------- Circle management ---------- */
.role-pill {
  display: inline-flex; align-items: center; margin-left: 4px; padding: 1px 8px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.5;
  white-space: nowrap; vertical-align: 1px;
}
.role-pill.role-owner { border-color: var(--coral); background: var(--coral-soft); color: var(--coral-ink); }
.role-pill.role-admin { border-color: var(--primary-line); color: var(--primary-strong); }
.badge + .role-pill { margin-left: 6px; vertical-align: 0; }
.you { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.mod-person .person-info { flex: 1; min-width: 0; }
.mod-person .stack:empty { display: none; }
.button.danger-text { color: var(--danger); }
.button.text.danger-text:hover { color: var(--danger-strong); }
.button.secondary.danger-text:hover { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.button .count, .tab .count { position: static; margin-left: 6px; }

.manage-tabs { overflow-x: auto; scrollbar-width: none; }
.manage-tabs::-webkit-scrollbar { display: none; }
.manage-note { margin-bottom: 16px; }
.manage-card { max-width: none; }
.manage-card > .button { justify-self: start; }

.invite-line { display: flex; gap: 8px; align-items: center; }
.invite-line .field-input { flex: 1; min-width: 0; font-size: 13px; }
.modal-body .invite-line { margin-top: 4px; }
.reset-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.settings .reset-line p { margin: 0; max-width: 480px; }
.reset-line .button { flex-shrink: 0; }
.invite-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.invite-form .form-error { grid-column: 1 / -1; }
.invite-list { margin-top: 20px; border-top: 1px solid var(--line); }
.invite-empty { padding: 14px 0 0; }
.invite-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.invite-row:last-child { border-bottom: 0; }
.invite-row .person-info { flex: 1; min-width: 0; }
.invite-row strong { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.invite-row code { font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.settings .invite-row p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; }
.invite-row.inactive code { color: var(--muted); }
.row-toggle small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.5; }

@media (max-width: 760px) {
  .invite-form { grid-template-columns: 1fr; }
  .invite-form .button { justify-self: start; }
  .reset-line { flex-direction: column; align-items: flex-start; gap: 10px; }
  .invite-row { flex-wrap: wrap; }
  .invite-row .stack { width: 100%; }
  .tab .count { margin-left: 4px; }
}

/* ---------- Social: reactions, friends, polls, albums, Recommended ---------- */
/* Reaction colours come from tokens so they keep AA contrast in light and dark mode. */
.r-like { --r: var(--react-like); }
.r-love { --r: var(--react-love); }
.r-laugh { --r: var(--react-laugh); }
.r-support { --r: var(--react-support); }

.reaction-summary { display: flex; align-items: center; gap: 6px; }
.post-stats .reaction-summary svg { color: var(--subtle); }
.reaction-stack { display: inline-flex; }
.reaction-dot {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: -5px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 0 0 2px var(--surface);
}
.reaction-dot:first-child { margin-left: 0; }
.post-stats .reaction-dot svg, .comment-reactions .reaction-dot svg { width: 12px; height: 12px; color: var(--r); }

.react-wrap { position: relative; flex: 1; display: flex; }
.post-actions .react-wrap > button { flex: 1; }
.post-actions .selected[class*="r-"] { color: var(--r); }
.post-actions .selected[class*="r-"] svg { fill: currentColor; fill-opacity: .2; animation: react-pop var(--slow) var(--spring); }
@keyframes react-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.3) rotate(-8deg); } }
.react-picker {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20;
  display: flex; gap: 2px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); box-shadow: var(--shadow-md);
  animation: pop var(--base) var(--spring);
  transform-origin: bottom left;
}
.react-picker:not([hidden]) .react-choice svg { animation: react-pop var(--slow) var(--spring) backwards; }
.react-picker .react-choice:nth-child(2) svg { animation-delay: 40ms; }
.react-picker .react-choice:nth-child(3) svg { animation-delay: 80ms; }
.react-picker .react-choice:nth-child(4) svg { animation-delay: 120ms; }
.react-picker[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.9); } }
.post-actions .react-choice, .react-choice {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 56px; padding: 6px 8px; border-radius: var(--r-lg);
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.post-actions .react-choice svg, .react-choice svg { width: 24px; height: 24px; color: var(--r); transition: transform var(--fast) var(--spring); }
.react-choice:hover { background: var(--surface-3); color: var(--text); }
.react-choice:hover svg { transform: translateY(-4px) scale(1.25); }
.react-choice:active svg { transform: scale(.85); }
.react-choice.chosen { background: var(--primary-soft); color: var(--text); font-weight: 700; }

.comment-reactions { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.comment-reactions .reaction-summary > svg { display: none; }
.react-wrap.small { flex: none; }
.react-wrap.small .react-picker { left: -6px; }
.text-action { font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0; border-radius: var(--r-xs); }
.text-action:hover { color: var(--text); }
.text-action.selected { color: var(--r); }

/* Friends */
.section-help { display: flex; gap: 6px; align-items: flex-start; margin: -4px 0 16px; }
.section-help svg { width: 15px; height: 15px; margin-top: 2px; color: var(--primary); }
.request-group + .request-group { margin-top: 28px; }
.group-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.person .author-name { font-weight: 600; }

/* Recommended Discover */
.discover-bar { display: flex; align-items: center; gap: 14px; margin: -6px 0 18px; }
.discover-bar p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.segmented { display: inline-flex; flex: none; padding: 3px; gap: 2px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-pill); }
.segmented button { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--text-2); transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.segmented button:hover { color: var(--text); }
.segmented button svg { width: 14px; height: 14px; }
.segmented button.on { background: var(--primary); color: var(--on-primary); font-weight: 700; box-shadow: var(--shadow-pop); animation: tab-in var(--base) var(--spring); }
.segmented button.on svg { color: currentColor; }

.why { margin: -2px 18px 10px; font-size: 12.5px; color: var(--muted); }
.why summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 700; color: var(--primary-strong); list-style: none; border-radius: var(--r-xs); }
.why summary::-webkit-details-marker { display: none; }
.why summary svg { width: 14px; height: 14px; }
.why ul, .points-list { list-style: none; margin: 8px 0 0; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.why li, .points-list li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--text-2); }
.why li.total { margin-top: 4px; padding-top: 7px; border-top: 1px solid var(--line); font-weight: 600; color: var(--text); }
.points { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); white-space: nowrap; }

.choice-group { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice-group legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-lg); cursor: pointer; transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.choice:hover { border-color: var(--primary-line); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.choice input { margin: 3px 0 0; accent-color: var(--primary); }
.choice strong { display: block; font-size: 14px; font-weight: 700; }
.choice small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.how { font-size: 12.5px; color: var(--text-2); }
.how summary { cursor: pointer; font-weight: 600; color: var(--primary-strong); }
.how p { margin-top: 8px; line-height: 1.55; color: var(--muted); }
.points-list { font-size: 12.5px; }

/* Interests, topics, and Show less (Recommended) */
.why li.minus .points { color: var(--danger-strong); }
.why li.variety-note { display: block; margin-top: 4px; padding-top: 7px; border-top: 1px dashed var(--line); color: var(--muted); font-style: italic; }
.new-tag { display: inline-flex; align-items: center; gap: 5px; margin: 0 18px 8px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--coral-soft); color: var(--coral-ink); font-size: 12px; font-weight: 700; }
.new-tag svg { width: 13px; height: 13px; }
.loop-info .new-tag { margin: 8px 0 0; }
.topic-picker { border: 0; margin: 0; padding: 0; }
.topic-picker legend, .compass-section h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-chip { position: relative; display: inline-flex; cursor: pointer; }
.topic-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.topic-chip span { padding: 6px 12px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--text-2); transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.topic-chip:hover span { border-color: var(--primary-line); }
.topic-chip input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.topic-chip:has(input:focus-visible) span { box-shadow: var(--ring); border-color: var(--primary); }
.topic-chip:has(input:focus-visible) { border-radius: var(--r-pill); outline: 2px solid var(--primary); outline-offset: 2px; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 18px 12px; }
.topic-tag { padding: 3px 9px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.loop-info .topic-tags { margin: 6px 0 0; }
.loop-info .topic-tag { background: rgba(255, 255, 255, .16); color: #fff; }
.interest-prompt { padding: 18px; margin-bottom: 16px; }
.interest-prompt h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.interest-prompt h3 svg { width: 18px; height: 18px; color: var(--primary); }
.interest-prompt p { margin: 6px 0 12px; color: var(--muted); font-size: 13.5px; }
.compass-interests { display: grid; gap: 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.compass-section { display: grid; gap: 10px; }
.compass-section h3 { font-size: 15px; }
.compass-section h4 { margin: 4px 0 0; }
.learned-list, .mute-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.learned-list li, .mute-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; }
.learned-list li > span:not(.avatar):not(.points), .mute-list li > span { flex: 1; min-width: 0; }
.learned-list small, .mute-list small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mute-list li > span { overflow-wrap: anywhere; }
.learned-list li.learned-subject { flex-wrap: wrap; }
.learned-sources { flex-basis: 100%; min-width: 0; }
.source-list { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; }
.source-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.source-list li > span { flex: 1 1 180px; min-width: 0; }
.source-list .source-text { color: var(--text-2); }
.inline-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 180px; }
.menu-group { display: grid; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Plan polls */
.polls { display: grid; gap: 10px; margin: 2px 0 14px; }
.poll { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.poll-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.poll-head svg { width: 16px; height: 16px; color: var(--primary); }
.poll-head strong { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-options { display: grid; gap: 6px; }
.poll-option {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 38px; padding: 8px 12px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-pill);
  font-size: 13.5px; transition: border-color var(--fast) var(--ease), transform var(--fast) var(--spring);
}
.poll-option:not(:disabled):active { transform: scale(.98); }
.poll-option:not(:disabled):hover { border-color: var(--primary); }
.poll-option:disabled { cursor: default; opacity: 1; }
.poll-option.chosen { border-color: var(--primary); }
.poll-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--tint-coral); transition: width var(--slow) var(--spring); }
.poll-option.chosen .poll-bar { background: var(--primary-soft); }
.poll-label, .poll-count { position: relative; display: flex; align-items: center; gap: 6px; }
.poll-label { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.poll-label svg { width: 15px; height: 15px; color: var(--primary); }
.poll-count { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.poll-foot .stack { gap: 2px; flex-wrap: nowrap; }
.poll-foot .icon-button { width: 30px; height: 30px; }
.poll.closed .poll-head strong { color: var(--text-2); }
.poll-add { justify-self: start; }
.poll-bar.w-5 { width: 5%; }
.poll-bar.w-10 { width: 10%; }
.poll-bar.w-15 { width: 15%; }
.poll-bar.w-20 { width: 20%; }
.poll-bar.w-25 { width: 25%; }
.poll-bar.w-30 { width: 30%; }
.poll-bar.w-35 { width: 35%; }
.poll-bar.w-40 { width: 40%; }
.poll-bar.w-45 { width: 45%; }
.poll-bar.w-50 { width: 50%; }
.poll-bar.w-55 { width: 55%; }
.poll-bar.w-60 { width: 60%; }
.poll-bar.w-65 { width: 65%; }
.poll-bar.w-70 { width: 70%; }
.poll-bar.w-75 { width: 75%; }
.poll-bar.w-80 { width: 80%; }
.poll-bar.w-85 { width: 85%; }
.poll-bar.w-90 { width: 90%; }
.poll-bar.w-95 { width: 95%; }
.poll-bar.w-100 { width: 100%; }

/* Circle albums */
.grid.albums { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.albums .album-card { overflow: hidden; display: flex; flex-direction: column; transition: transform var(--base) var(--spring), box-shadow var(--base) var(--ease); }
.albums .album-card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-md); }
.album-cover { display: block; flex: none; width: 100%; height: 170px; overflow: hidden; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-placeholder { display: grid; place-items: center; height: 100%; color: var(--primary); background: linear-gradient(135deg, var(--tint-violet), var(--tint-coral)); }
.album-placeholder svg { width: 34px; height: 34px; stroke-width: 1.4; }
.album-card .card-content { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.album-card .card-content p { color: var(--muted); font-size: 13.5px; }
.album-card .card-bottom { margin-top: auto; padding-top: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.photo-tile { margin: 0; min-width: 0; }
.photo-open { display: block; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-md); background: var(--surface-3); }
.photo-open img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--base) var(--ease); }
.photo-open:hover img { transform: scale(1.06); }
.photo-tile figcaption { margin-top: 5px; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-grid.mini { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.photo-grid.mini:empty { display: none; }
.photo-grid.mini img { aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); }
.photo-large { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--r-md); background: var(--surface-3); }
.photo-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.photo-meta .button { margin-left: auto; }

@media (max-width: 760px) {
  .discover-bar { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: -4px; }
  .react-picker { left: -4px; }
  .post-actions .react-choice, .react-choice { min-width: 50px; padding: 6px 4px; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .photo-open { border-radius: var(--r-xs); }
  .photo-tile figcaption { display: none; }
  .poll-foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .react-picker { animation: none; }
  .poll-bar, .photo-open img, .react-choice svg { transition: none; }
}

/* ---------- Moments (24-hour updates) ---------- */
.moments-tray { margin: -4px 0 18px; }
.moments-tray[hidden] { display: none; }
.tray-scroll { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.tray-scroll::-webkit-scrollbar { display: none; }
.moment-ring { flex: none; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-2); }
.moment-ring .ring { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: var(--line-strong); transition: transform var(--fast) var(--spring); }
.moment-ring.unseen .ring { background: conic-gradient(from 210deg, var(--violet), var(--pink), var(--coral), var(--sun), var(--violet)); }
.moment-ring.add .ring { background: transparent; border: 2px dashed var(--primary-line); padding: 2px; }
.moment-ring .avatar { width: 100%; height: 100%; font-size: 17px; box-shadow: 0 0 0 2.5px var(--bg); }
.moment-ring:hover .ring { transform: scale(1.08) rotate(-4deg); }
.moment-ring:active .ring { transform: scale(.94); }
.moment-ring:focus-visible { outline: none; }
.moment-ring:focus-visible .ring { box-shadow: var(--ring); }
.ring-name { max-width: 100%; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moment-ring.unseen .ring-name { color: var(--text); font-weight: 800; }
.ring-plus { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--coral); color: var(--ink); box-shadow: 0 0 0 2.5px var(--bg); }
.ring-plus svg { width: 13px; height: 13px; stroke-width: 2.6; }
.tray-hint { align-self: center; max-width: 300px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

.moment-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: radial-gradient(80% 60% at 50% 0%, rgba(124, 92, 255, .35), transparent 70%), var(--media-bg); color: #fff; animation: fade-in var(--base) var(--ease); }
.moment-viewer::backdrop { background: var(--media-bg); }
html:has(.moment-viewer[open]) { overflow: hidden; }
.mv-stage { position: relative; height: 100%; max-width: min(100vw, max(360px, calc((100dvh - 190px) * 9 / 16))); margin: 0 auto; display: flex; flex-direction: column; padding: 10px 10px 12px; gap: 10px; }
.mv-bars { display: flex; gap: 4px; }
.mv-bar { flex: 1; height: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .28); overflow: hidden; }
.mv-bar span { display: block; height: 100%; background: linear-gradient(90deg, #fff, #ffd9cf); transform-origin: left; transform: scaleX(0); }
.mv-bar.done span { transform: scaleX(1); }
.mv-head { display: flex; align-items: center; gap: 10px; }
.mv-head .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.mv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mv-who strong { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-who span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: rgba(255, 255, 255, .72); }
.mv-who svg { width: 12px; height: 12px; }
.mv-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; color: #fff; transition: background var(--fast) var(--ease); }
.mv-icon:hover { background: rgba(255, 255, 255, .14); }
.mv-icon:active { transform: scale(.9); }
.mv-icon svg { width: 20px; height: 20px; }
.mv-frame { position: relative; flex: 1; min-height: 0; border-radius: var(--r-xl); overflow: hidden; background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.mv-media { width: 100%; height: 100%; object-fit: contain; display: block; }
.mv-tap { position: absolute; top: 0; bottom: 0; width: 34%; }
.mv-tap.prev { left: 0; }
.mv-tap.next { right: 0; width: 66%; }
.mv-tap:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: -6px; border-radius: var(--r-lg); }
.mv-caption { font-size: 15px; line-height: 1.45; text-align: center; padding: 0 8px; overflow-wrap: anywhere; }
.mv-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mv-reply { flex: 1 1 220px; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 16px; background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(255, 255, 255, .35); border-radius: var(--r-pill); }
.mv-reply input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; font-size: 14px; padding: 6px 0; }
.mv-reply input::placeholder { color: rgba(255, 255, 255, .65); }
.mv-reply input:focus { outline: none; }
.mv-reply:focus-within { border-color: #fff; box-shadow: 0 0 0 4px rgba(164, 141, 255, .45); }
.mv-reactions { display: flex; gap: 2px; }
.mv-react { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; transition: background var(--fast) var(--ease), transform var(--fast) var(--spring); }
.mv-react svg { width: 21px; height: 21px; }
.mv-react:hover { background: rgba(255, 255, 255, .14); transform: translateY(-3px) scale(1.12); }
.mv-react:active { transform: scale(.88); }
.mv-react.chosen { background: #fff; color: var(--r); animation: react-pop var(--slow) var(--spring); }
.mv-react.r-like.chosen { --r: #6847f5; }
.mv-react.r-love.chosen { --r: #d6336c; }
.mv-react.r-laugh.chosen { --r: #9a6400; }
.mv-react.r-support.chosen { --r: #0b7a62; }
.mv-owner { display: flex; align-items: center; gap: 8px; width: 100%; }
.mv-pill { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .14); color: #fff; font-size: 13.5px; font-weight: 700; }
.mv-pill:hover { background: rgba(255, 255, 255, .22); }
.mv-pill svg { width: 17px; height: 17px; }
.mv-owner .mv-icon { margin-left: auto; }
.mv-sheet { position: absolute; left: 10px; right: 10px; bottom: 10px; max-height: 60%; overflow: auto; padding: 16px 18px 18px; border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); animation: dialog-in var(--base) var(--spring); }
.mv-sheet[hidden] { display: none; }
.mv-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mv-sheet-head h3 { font-size: 16px; font-weight: 800; }
.mv-viewers { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.mv-viewers li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.mv-viewers li:first-child { border-top: 0; }
.mv-viewers li > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.mv-viewers strong { font-size: 13.5px; font-weight: 700; }
.mv-viewers small { font-size: 12px; color: var(--muted); }
.mv-viewers .reaction-dot { margin: 0; }

/* ---------- Video uploads ---------- */
.media-preview:empty { display: none; }
.media-preview { display: flex; flex-direction: column; gap: 6px; }
.video-preview { width: 100%; max-height: 300px; border-radius: var(--r-md); background: var(--media-bg); }
/* The frame takes the shape of the video as it will be shared (--ratio is width/height after any
   turn); the video inside is turned by --turn and, when sideways, swaps its width and height. */
.video-frame { position: relative; container-type: size; aspect-ratio: var(--ratio, 0.5625); width: min(100%, calc(300px * var(--ratio, 0.5625))); margin-inline: auto; overflow: hidden; border-radius: var(--r-md); background: var(--media-bg); }
.video-frame .video-preview { position: absolute; top: 50%; left: 50%; width: 100cqw; height: 100cqh; max-height: none; border-radius: 0; object-fit: contain; transform: translate(-50%, -50%) rotate(var(--turn, 0deg)); }
.video-frame.sideways .video-preview { width: 100cqh; height: 100cqw; }
.video-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.upload-progress[hidden] { display: none; }
.upload-bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; margin-bottom: 6px; }
.upload-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--coral)); transform-origin: left; transform: scaleX(0); transition: transform var(--fast) linear; }
.upload-progress.working .upload-bar span { animation: upload-pulse 1.2s ease-in-out infinite; }
@keyframes upload-pulse { 50% { opacity: .45; } }

/* ---------- Loops (short vertical videos) ---------- */
.post-video-wrap { position: relative; margin: 0 20px 12px; display: flex; justify-content: center; border-radius: var(--r-lg); background: var(--media-bg); overflow: hidden; }
.post-video { display: block; width: 100%; max-height: 560px; aspect-ratio: 9 / 16; object-fit: contain; background: var(--media-bg); }
.loop-chip { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--r-pill); background: rgba(27, 20, 64, .78); color: #fff; font-size: 12px; font-weight: 700; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.loop-chip svg { width: 14px; height: 14px; }
.loop-chip:hover { background: #6847f5; }
.made-with-buddy { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(27, 20, 64, .72); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1.4; }
.made-with-buddy svg { width: 12px; height: 12px; }
.post-video-wrap .made-with-buddy { position: absolute; top: 10px; left: 10px; pointer-events: none; }
.loop-info .made-with-buddy { margin-bottom: 8px; }
.mv-caption .made-with-buddy { margin-bottom: 6px; }
.mv-caption p { margin: 0; }

.loops-page { max-width: 760px; margin: 0 auto; }
.loops-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.loops-head h1 { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.loops-head h1 svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--violet), var(--pink)); box-shadow: var(--shadow-pop); }
.loops-head p { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.loops-page .discover-bar { margin: 0 0 14px; }
.loops-filter { margin-bottom: 14px; }
.loops-feed { height: calc(100dvh - var(--topbar-h) - 210px); min-height: 420px; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; display: flex; flex-direction: column; gap: 16px; }
.loops-feed::-webkit-scrollbar { display: none; }
.loop { flex: none; height: 100%; display: flex; justify-content: center; align-items: flex-end; gap: 14px; scroll-snap-align: start; scroll-snap-stop: always; }
.loop-frame { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; border-radius: var(--r-xl); overflow: hidden; background: var(--media-bg); box-shadow: var(--shadow-md); }
.loop-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.loop-tap { position: absolute; inset: 0; display: grid; place-items: center; }
.loop-tap:focus-visible { outline: 3px solid rgba(255, 255, 255, .8); outline-offset: -6px; border-radius: var(--r-xl); }
.loop-paused { display: none; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(104, 71, 245, .8); color: #fff; animation: count-in var(--base) var(--spring); }
.loop-paused svg { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.loop.paused .loop-paused { display: grid; }
.loop-sound { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(27, 20, 64, .6); color: #fff; transition: background-color var(--fast) var(--ease); }
.loop-sound:hover { background: #6847f5; }
.loop-sound svg { width: 19px; height: 19px; }
.loop-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 16px 16px; color: #fff; background: linear-gradient(to top, rgba(18, 13, 43, .88), rgba(18, 13, 43, 0)); pointer-events: none; }
.loop-info button, .loop-info details { pointer-events: auto; }
.loop-author { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: rgba(255, 255, 255, .78); }
.loop-author .author-name { color: #fff; font-size: 14px; }
.loop-author > span:last-child { display: inline-flex; align-items: center; gap: 4px; width: 100%; }
.loop-author svg { width: 12px; height: 12px; }
.loop-caption { margin-top: 8px; font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.loop-info .why { margin: 8px 0 0; padding: 6px 10px; border-radius: var(--r-md); background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.loop-info .why summary, .loop-info .why .points { color: #fff; }
.loop-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 8px; }
.loop-act { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 46px; padding: 9px 4px; border-radius: var(--r-pill); color: var(--text-2); font-size: 12px; font-weight: 700; transition: background var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--spring); }
.loop-act svg { width: 24px; height: 24px; transition: transform var(--base) var(--spring); }
.loop-act:hover { background: var(--primary-soft); color: var(--primary-strong); }
.loop-act:hover svg { transform: scale(1.15); }
.loop-act:active { transform: scale(.9); }
.loop-act.selected { color: var(--r, var(--primary)); }
.loop-act.selected svg { fill: currentColor; fill-opacity: .2; animation: react-pop var(--slow) var(--spring); }
.loop-rail .react-wrap { position: relative; }
.loop-picker { position: absolute; right: calc(100% + 6px); bottom: 0; left: auto; }
.loops-footer { flex: none; scroll-snap-align: end; }
.loops-footer .load-more { width: 100%; }

.profile-extras[hidden] { display: none; }
.profile-moments { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.profile-loops { padding: 18px 20px; margin-bottom: 16px; }
.profile-loops h3 { display: flex; align-items: center; gap: 8px; }
.profile-loops h3 svg { width: 18px; height: 18px; color: var(--c-pink); }
.loop-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.loop-thumb { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-lg); overflow: hidden; background: var(--media-bg); transition: transform var(--base) var(--spring); }
.loop-thumb:hover { transform: translateY(-3px) rotate(-1deg); }
.loop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--base) var(--ease); }
.loop-thumb:hover img { transform: scale(1.04); }
.loop-thumb > span { position: absolute; left: 8px; bottom: 7px; display: inline-flex; align-items: center; gap: 4px; color: #fff; font-size: 12px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.loop-thumb > span svg { width: 12px; height: 12px; fill: currentColor; }
.loop-comments .post { margin: 0; box-shadow: none; border: 0; }
.loop-comments .post-video-wrap { display: none; }

@media (max-width: 760px) {
  .mobile-nav button { width: auto; flex: 1; }
  .composer-bottom button:nth-child(3) { display: none; }
  .composer-bottom button { white-space: nowrap; }
  .loops-head h1 { font-size: 22px; }
  .loops-head p { display: none; }
  .loops-page .discover-bar p { display: none; }
  .loops-feed { height: calc(100dvh - var(--topbar-h) - 60px - 150px); gap: 12px; }
  .loop { position: relative; }
  .loop-frame { width: 100%; aspect-ratio: auto; }
  .loop-rail { position: absolute; right: 6px; bottom: 96px; gap: 4px; padding: 0; }
  .loop-act { color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
  .loop-act:hover { background: rgba(255, 255, 255, .14); color: #fff; }
  .loop-info { padding-right: 70px; }
  .post-video-wrap { margin: 0 16px 12px; }
  .mv-stage { padding: 8px 8px 10px; max-width: none; }
  .mv-frame { border-radius: var(--r-md); }
}
@media (max-width: 560px) {
  .composer-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 4px; }
}
.mv-viewers .reaction-dot { width: 28px; height: 28px; color: var(--r); }
.mv-viewers .reaction-dot svg { width: 16px; height: 16px; fill: currentColor; fill-opacity: .18; }
/* ---------- Circle rules ---------- */
.circle-rules { padding: 18px 20px; margin-bottom: 20px; }
.circle-rules-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.circle-rules-head h3 { font-size: 16px; font-weight: 800; }
.rules-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.rules-list li::marker { color: var(--coral-ink); font-weight: 800; }
.rules-empty { align-items: center; margin-bottom: 20px; }
.rules-empty > span { flex: 1; }
.join-rules { padding: 14px 16px; border: 1.5px dashed var(--primary-line); border-radius: var(--r-lg); background: var(--surface-2); }
.join-rules h3 { font-size: 14px; font-weight: 800; }
.join-rules .help { margin: 2px 0 10px; }
.invite-preview { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 6px; }
.invite-preview img { width: 88px; height: 66px; flex: none; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); }
.invite-preview p { margin: 6px 0 2px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.invite-preview small { font-size: 12.5px; color: var(--muted); }
.notif-text .notif-rule { display: block; margin-top: 3px; font-style: normal; font-size: 12.5px; color: var(--text-2); padding-left: 8px; border-left: 2px solid var(--primary-line); }

/* ---------- Welcome page (signed-out visitors) ---------- */
.welcome {
  min-height: 100vh; display: grid; place-items: center; gap: 0;
  padding: 48px 20px; position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(50% 45% at 8% 10%, rgba(124, 92, 255, .22), transparent 70%),
    radial-gradient(45% 40% at 95% 90%, rgba(255, 122, 89, .22), transparent 70%),
    var(--bg);
}
.welcome-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.welcome-deco .blob { position: absolute; border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%; animation: wobble 9s ease-in-out infinite; }
.welcome-deco .b1 { width: 260px; height: 260px; top: 7%; left: calc(50% - 470px); background: linear-gradient(135deg, var(--violet), #a07bff); opacity: .9; }
.welcome-deco .b2 { width: 190px; height: 190px; bottom: 9%; right: calc(50% - 450px); background: linear-gradient(135deg, var(--sun), var(--coral)); animation-delay: -3s; }
.welcome-deco .b3 { width: 90px; height: 90px; top: 12%; right: calc(50% - 400px); background: var(--mint); animation-delay: -6s; }
.welcome-deco .spark { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--coral); animation: float 5s ease-in-out infinite; }
.welcome-deco .s1 { top: 30%; left: calc(50% - 330px); }
.welcome-deco .s2 { bottom: 22%; left: calc(50% - 420px); width: 22px; height: 8px; border-radius: 4px; background: var(--pink); transform: rotate(-30deg); animation-delay: -2s; }
.welcome-deco .s3 { top: 42%; right: calc(50% - 360px); width: 10px; height: 10px; background: var(--violet); animation-delay: -4s; }
@keyframes float { 50% { translate: 0 -10px; } }

.welcome-card {
  position: relative; z-index: 1; width: min(580px, 100%);
  display: grid; gap: 24px; padding: 34px 38px 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 32px;
  box-shadow: var(--shadow-md), 0 0 0 8px rgba(255, 255, 255, .35);
  animation: dialog-in var(--slow) var(--spring);
}
.welcome-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.welcome-card .brand { color: var(--text); }
.welcome-sticker {
  flex: none; padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--coral); color: var(--ink);
  font-size: 12.5px; font-weight: 800; letter-spacing: .01em;
  transform: rotate(4deg); box-shadow: 0 8px 18px -8px rgba(255, 122, 89, .9);
}
.welcome-copy h1 { font-size: 50px; line-height: 1.02; letter-spacing: -.045em; font-weight: 850; }
.welcome-hl {
  background: linear-gradient(transparent 62%, rgba(255, 122, 89, .45) 62%, rgba(255, 122, 89, .45) 92%, transparent 92%);
  padding: 0 4px; margin: 0 -4px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  color: var(--primary);
}
.welcome-lede { margin-top: 14px; font-size: 16.5px; line-height: 1.6; color: var(--text-2); }
.welcome-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.welcome-points li { display: flex; gap: 12px; align-items: center; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.welcome-points li svg { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 50%; color: var(--c-violet); background: var(--tint-violet); }
.welcome-points li:nth-child(2) svg { color: var(--c-coral); background: var(--tint-coral); }
.welcome-points li:nth-child(3) svg { color: var(--c-mint); background: var(--tint-mint); }
.welcome-points strong { color: var(--text); font-weight: 750; }
.welcome-invite { display: grid; gap: 12px; padding: 18px; border: 1.5px dashed var(--primary-line); border-radius: var(--r-lg); background: var(--primary-soft); }
.welcome-invite h2 { font-size: 18px; font-weight: 800; }
.welcome-invite .badge { justify-self: start; background: var(--surface); }
.welcome-invite .invite-preview { margin: 0; }
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-actions .button { flex: 1 1 180px; min-height: 52px; font-size: 15.5px; }
.welcome-note { font-size: 13px; text-align: center; }
.welcome-art {
  position: absolute; inset: auto 0 0 0; z-index: -1; width: 100%; height: 34vh; object-fit: cover;
  opacity: .18; pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .welcome-hl { background: linear-gradient(transparent 62%, rgba(255, 122, 89, .3) 62%, rgba(255, 122, 89, .3) 92%, transparent 92%); }
  .welcome-card { box-shadow: var(--shadow-md), 0 0 0 8px rgba(124, 92, 255, .12); }
  .welcome-art { opacity: .1; }
}
@media (max-width: 1000px) {
  .welcome-deco .b1 { left: -90px; top: -60px; }
  .welcome-deco .b2 { right: -70px; bottom: -50px; }
  .welcome-deco .b3 { right: -30px; top: 30%; width: 60px; height: 60px; }
  .welcome-deco .spark { display: none; }
}
@media (max-width: 760px) {
  .welcome { padding: 24px 14px; place-items: start center; }
  .welcome-card { padding: 24px 20px 22px; gap: 20px; border-radius: var(--r-xl); }
  .welcome-copy h1 { font-size: 36px; }
  .welcome-lede { font-size: 15px; }
  .welcome-sticker { font-size: 11.5px; padding: 6px 11px; }
}

/* ---------- Installable app: Download button, install guides, update prompt, offline page ---------- */
[data-install-ui][hidden], [data-installed-ui][hidden] { display: none !important; }

.sidebar-install {
  margin: auto 2px 12px; min-height: 42px; padding: 9px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--coral), var(--sun)); color: var(--ink);
  font-size: 13.5px; font-weight: 800;
  box-shadow: 0 10px 24px -12px rgba(255, 122, 89, .9);
  transition: transform var(--fast) var(--spring), box-shadow var(--fast) var(--ease);
}
.sidebar-install svg { width: 17px; height: 17px; stroke-width: 2.2; }
.sidebar-install:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px rgba(255, 122, 89, 1); }
.sidebar-install:active { transform: scale(.96); }
.sidebar-install:not([hidden]) + .sidebar-foot { margin-top: 0; }

.welcome-install { display: flex; justify-content: center; margin-top: -10px; }
.welcome-install:has(> [hidden]) { display: none; }

.install-done { display: flex; align-items: center; gap: 10px; }
.settings .install-done { color: var(--text-2); }
.install-done svg { flex: none; width: 30px; height: 30px; padding: 6px; border-radius: 50%; color: var(--c-mint); background: var(--tint-mint); stroke-width: 2.4; }

.alerts-state { display: grid; gap: 12px; }
.alerts-note { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); }
.alerts-note svg { flex: none; width: 30px; height: 30px; padding: 6px; border-radius: 50%; color: var(--warn-ink); background: var(--tint-sun); stroke-width: 2.2; }

.install-guide { display: grid; gap: 16px; }
.install-guide > p { font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.install-guide .help { font-size: 13px; }
.install-tile { justify-self: center; display: grid; justify-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.install-tile img { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow-md); }
.install-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; }
.install-steps li {
  counter-increment: step; position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 40px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.5; color: var(--text-2);
}
.install-steps li::before {
  content: counter(step); position: absolute; left: 12px; top: 50%; translate: 0 -50%;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--coral); color: var(--ink); font-size: 11.5px; font-weight: 800;
}
.install-steps strong { color: var(--text); font-weight: 750; }
.install-step-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--c-violet); background: var(--tint-violet); }
.install-step-icon svg { width: 19px; height: 19px; }

.update-bar {
  position: fixed; z-index: 101; left: 50%; top: calc(var(--topbar-h) + var(--safe-top) + 12px); translate: -50% 0;
  width: max-content; max-width: calc(100vw - 24px);
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px; border-radius: var(--r-pill);
  background: var(--inverse-bg); color: var(--inverse-text); box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 650;
  animation: dialog-in var(--slow) var(--spring);
}
.update-bar > svg { width: 18px; height: 18px; color: var(--coral); }
.update-bar .icon-button { width: 34px; height: 34px; color: inherit; }
.update-bar .icon-button:hover { background: rgba(127, 127, 127, .2); color: inherit; }
.update-bar :focus-visible { outline-color: var(--coral); }

.offline-art { justify-self: stretch; height: 120px; border-radius: var(--r-lg); overflow: hidden; background: var(--tint-violet); }
.offline-art img { width: 100%; height: 100%; object-fit: cover; }
.offline .welcome-actions .button { text-decoration: none; }

/* ---------- Installed app and notched phones: keep content clear of the status bar, notch and home indicator ---------- */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
.topbar { height: calc(var(--topbar-h) + var(--safe-top)); padding-top: var(--safe-top); padding-right: max(36px, var(--safe-right)); }
.sidebar { padding-top: calc(22px + var(--safe-top)); padding-left: max(14px, var(--safe-left)); padding-bottom: calc(18px + var(--safe-bottom)); }
.welcome { padding-top: calc(48px + var(--safe-top)); padding-bottom: calc(48px + var(--safe-bottom)); }
#toast { bottom: calc(24px + var(--safe-bottom)); }
.notif-panel { max-height: min(620px, calc(100vh - var(--topbar-h) - var(--safe-top) - 24px)); }
/* The installed app has no browser bar to pull or bounce. */
.installed-app body { overscroll-behavior-y: none; }
@media (max-width: 760px) {
  .topbar { padding-left: max(8px, var(--safe-left)); padding-right: max(12px, var(--safe-right)); }
  .sidebar { top: calc(var(--topbar-h) + var(--safe-top)); bottom: calc(60px + var(--safe-bottom)); padding-top: 12px; padding-bottom: 18px; }
  .content-wrap { padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right)); padding-bottom: calc(88px + var(--safe-bottom)); }
  .notif-panel { top: calc(var(--topbar-h) + var(--safe-top) + 6px); max-height: calc(100vh - var(--topbar-h) - var(--safe-top) - 90px - var(--safe-bottom)); }
  #toast { bottom: calc(76px + var(--safe-bottom)); }
  .welcome { padding-top: calc(24px + var(--safe-top)); padding-bottom: calc(24px + var(--safe-bottom)); padding-left: max(14px, var(--safe-left)); padding-right: max(14px, var(--safe-right)); }
}
@media (prefers-reduced-motion: reduce) {
  .update-bar { animation: none; }
}

/* Invite friends to Atlas: the invite sheet, entry points and the personal-invite welcome page */
.profile-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-actions .button { margin-left: 0; }
.empty .button + .button { margin-left: 8px; }
.invite-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -4px 0 16px; }
.invite-strip .help { flex: 1 1 260px; margin: 0; }
.invite-sheet { display: grid; gap: 14px; }
.invite-sheet > p { color: var(--text-2); line-height: 1.55; }
.invite-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-buttons .button { flex: 1 1 140px; }
.invite-sheet input[readonly] { font-size: 13.5px; color: var(--text-2); }
.invite-qr { display: grid; justify-items: center; gap: 8px; margin: 0; padding: 16px; border-radius: var(--r-lg); background: var(--surface-3); text-align: center; }
.invite-qr img { width: 176px; height: 176px; border-radius: 12px; background: #fff; padding: 6px; }
.invite-qr figcaption { font-size: 13px; color: var(--muted); }
.invite-stat { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--text); font-size: 14px; line-height: 1.5; }
.invite-stat svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--primary); }
.invite-reset { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.invite-person { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.invite-person strong { display: block; font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.invite-person span:not(.avatar) { color: var(--muted); font-size: 14px; }
.invite-befriend { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--primary-line); border-radius: var(--r-md); background: var(--primary-soft); font-size: 14.5px; line-height: 1.45; color: var(--text); cursor: pointer; }
.invite-befriend input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.invite-befriend strong { overflow-wrap: anywhere; }
.invite-befriend small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.invite-befriend:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.personal-invite .invite-from { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.personal-invite h1 { overflow-wrap: anywhere; }
.notif-type.type-invite_joined { background: #0b7a62; }
@media (max-width: 760px) {
  .profile-actions { margin-left: 0; }
  .invite-qr img { width: 156px; height: 156px; }
}
