/* MyFri design system.
   Brand identity: a youthful violet-to-pink gradient on a clean light-gray
   chrome, with a familiar social layout (top bar, feed, side rails).
   Re-theme centrally: edit the --myfri-* tokens and every surface follows. */

:root {
  /* --- MyFri brand tokens (the single place to change the identity) ---
     Step 7 identity: warm and editorial - paper surfaces, ink text, a
     terracotta accent. Distinct from the blue/violet social-app palette. */
  --myfri-brand: #c2410c;          /* terracotta */
  --myfri-brand-dark: #9a3412;
  --myfri-brand-soft: #f8e9de;     /* soft warm tint */
  --myfri-brand-grad: linear-gradient(135deg, #cf4a17 0%, #b91c1c 100%);
  --cover-grad: linear-gradient(135deg, #e8dfd2 0%, #d8cdbb 100%);
  /* MyFri signature signals: Love (affection, rose) and Touch (presence, amber).
     Deliberately different hues so they never read as the same mechanic. */
  --love: #c2145b;
  --love-soft: #fde7ee;
  --touch: #b45309;
  --touch-soft: #fdf0d9;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Semantic tokens map onto the MyFri brand tokens. */
  --brand: var(--myfri-brand);
  --brand-dark: var(--myfri-brand-dark);
  --brand-soft: var(--myfri-brand-soft);
  --brand-grad: var(--myfri-brand-grad);

  --bg: #f7f4ef;
  --card: #fffdf9;
  --text: #221f1b;
  --text-soft: #6e675e;
  --line: #e7dfd4;
  --hover: #f2ece2;

  --like: #e0245e;
  --green: #16a34a;
  --danger: #dc2626;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(60, 42, 20, 0.06), 0 1px 3px rgba(60, 42, 20, 0.05);
  --shadow-lg: 0 10px 30px rgba(60, 42, 20, 0.18);
  --topbar-h: 56px;
}

/* Dark theme: override the same variables, so every surface adapts. Toggled by
   setting data-theme="dark" on <html> (persisted in localStorage). */
html[data-theme="dark"] {
  --myfri-brand: #e56f1f;
  --myfri-brand-dark: #f0853c;
  --myfri-brand-soft: #3c2c1f;

  --love: #f06292;
  --love-soft: #3a1f2a;
  --touch: #e0a33c;
  --touch-soft: #3a2f1a;

  --bg: #1b1816;
  --card: #26221f;
  --text: #ece7e0;
  --text-soft: #b3aa9f;
  --line: #3b352f;
  --hover: #322c27;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
}

/* Keyboard users get a clear, brand-colored focus ring everywhere. */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Brand wordmark ---------- */
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.brand-mark svg { width: 23px; height: auto; display: block; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  background: var(--hover);
  color: var(--text);
  transition: filter 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.btn:hover { filter: brightness(0.96); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); filter: none; }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: #fde8e8; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Inputs ---------- */
.input, textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea.input { resize: vertical; min-height: 60px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 5px; font-weight: 600; }

/* ---------- Avatars ---------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
  flex: none;
  max-width: none; /* override the global img max-width so a fixed-size avatar never shrinks into an oval */
  aspect-ratio: 1 / 1;
}
.avatar-fallback {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex: none;
  text-transform: uppercase;
}

/* ---------- Landing / auth ---------- */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 70% -10%, #f5e7d8 0%, var(--bg) 60%);
}
.landing-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
.landing-pitch h1 { font-family: var(--font-display); font-size: 56px; margin: 0 0 4px; line-height: 1; }
.landing-pitch p { font-size: 22px; color: var(--text-soft); max-width: 420px; }
.landing-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.landing-logo .name { font-size: 34px; }

/* Manifesto / promises checklist (left pitch column, visible during login + signup) */
.promises { margin-top: 30px; max-width: 460px; }
.landing-pitch .promises-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  max-width: none;
  margin: 0 0 16px;
}
.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.promise {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  text-align: left;
}
.promise-check {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
  margin-top: 1px;
}
.promise-check svg { width: 15px; height: 15px; display: block; }
.promise-text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-soft);
}
.promise-text strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 1px;
}
/* Supporting line sits muted and a touch smaller under each bold claim, so the
   five headlines are the primary scan layer. */
.promise-sub {
  display: block;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.4;
}
.promise-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.promise-link:hover { color: var(--brand-dark); }
/* Defense in depth: the entrance animation is JS-only (no opacity:0 default in
   CSS), but if motion is reduced we also force rows visible so nothing can be
   left hidden. */
@media (prefers-reduced-motion: reduce) {
  .promise { opacity: 1 !important; }
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.auth-card h2 { margin: 0 0 4px; }
.auth-card .sub { color: var(--text-soft); margin: 0 0 18px; }
.auth-switch { text-align: center; margin-top: 14px; color: var(--text-soft); }
.auth-switch button { background: none; border: none; color: var(--brand); font-weight: 600; cursor: pointer; }
/* Sign in with Google */
.google-auth { margin-top: 12px; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 12.5px; margin: 4px 0 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #ffffff; color: #3c4043; border: 1px solid #dadce0; font-weight: 600; }
.btn-google:hover { background: #f6f7f9; border-color: #cfd2d6; }
.btn-google .g-ic { flex: none; }
/* Alternative sign-in (passkey + Google) under the login form */
.alt-auth { margin-top: 12px; }
.alt-auth .btn-google, .alt-auth .btn-passkey { margin-bottom: 10px; }
.alt-auth .btn-google:last-child, .alt-auth .btn-passkey:last-child { margin-bottom: 0; }
/* Sign in with a passkey (biometric) */
.btn-passkey { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--card); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn-passkey:hover { border-color: var(--brand); color: var(--brand); }
.btn-passkey .pk-ic { flex: none; }
/* Passkey manager (Settings) */
/* Blocked / muted accounts list (Settings). */
.rel-list { display: flex; flex-direction: column; gap: 6px; }
.rel-row { display: flex; align-items: center; gap: 10px; }
.rel-row .rel-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passkey-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.passkey-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.passkey-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.passkey-name { font-weight: 600; font-size: 13.5px; }
.passkey-del { flex: none; color: #e5484d; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

.alert {
  background: #fde8e8;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 12px;
}
.alert-ok { background: #e7f6ec; color: var(--green); }
.hidden { display: none !important; }

/* ---------- Supporter verified tick + badges + tiers ---------- */
/* Blue verified tick shown next to supporter names. Cosmetic only. */
.vtick {
  width: 1em; height: 1em;
  vertical-align: -0.14em;
  margin-left: 2px;
  fill: var(--brand);
  flex: none;
}
.vtick-check { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .vtick-check { stroke: #18191a; }

/* Colored supporter badge chip. */
.badge-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #3a2a00;
  vertical-align: middle;
}
.badge-bronze { background: linear-gradient(135deg, #e8b27a, #cd7f32); color: #3a2400; }
.badge-silver { background: linear-gradient(135deg, #e4e7eb, #9aa4ad); color: #2a2f34; }
.badge-gold   { background: linear-gradient(135deg, #ffe08a, #e3b341); color: #3a2c00; }

.pill-ok { background: var(--brand-soft); color: var(--brand); font-weight: 700; }

/* Tier cards on the Support / upgrade page. */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.tier-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tier-card.tier-current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.tier-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tier-price { font-size: 22px; font-weight: 800; color: var(--text); }
.tier-price span { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.tier-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tier-perks li { font-size: 13px; color: var(--text-soft); padding-left: 18px; position: relative; line-height: 1.35; }
.tier-perks li::before { content: "\2713"; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.tier-card .btn { width: 100%; }

@media (max-width: 860px) {
  .tier-grid { grid-template-columns: 1fr; }
}

/* ---------- Invite / referrals ---------- */
.invite-link-row { display: flex; gap: 8px; align-items: center; }
.invite-link-row .input { flex: 1; min-width: 0; }
.prog-wrap { height: 10px; background: var(--hover); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.prog-bar { height: 100%; background: var(--brand-grad); border-radius: 999px; transition: width 0.4s ease; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 22px; text-align: center; font-weight: 800; color: var(--text-soft); flex: none; }
.lb-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { font-weight: 800; color: var(--brand); flex: none; }

/* ---------- Owner analytics bar lists ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.bar-label { flex: 0 0 38%; min-width: 0; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 10px; background: var(--hover); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }
.bar-val { flex: none; font-weight: 700; color: var(--text-soft); font-size: 13px; min-width: 32px; text-align: right; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar .logo { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.topbar .logo .name { font-size: 22px; }
.topbar .search {
  width: 300px;
  position: relative;
}
.topbar .search .search-ic {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-soft);
  pointer-events: none;
}
.topbar .search input {
  width: 100%;
  border: none;
  background: var(--hover);
  border-radius: 20px;
  padding: 9px 16px 9px 37px;
  font-size: 14px;
  outline: none;
}

/* Primary navigation: left rail on desktop, bottom bar on mobile. The old
   social-clone center top tabs were removed in Step 7. */
.nav-tab {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 92px;
  padding: 0 16px;
  height: 100%;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-size: 12px;
  font-weight: 600;
}
.nav-tab .ti { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.nav-tab .ti svg { width: 22px; height: 22px; display: block; }
.nav-tab:hover { background: var(--hover); }
.nav-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }

/* Right: utility cluster (messages, notifications, your avatar). flex:1 mirrors
   the left zone so the center tabs stay centered; content is pushed right. */
.topbar-right { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; justify-content: flex-end; }

/* Mobile bottom navigation: the primary tabs move here on small screens so they
   are always visible and tappable (the top bar can't fit them on a phone). */
.bottom-nav { display: none; }
.topbar .nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-btn svg { width: 20px; height: 20px; display: block; }
.nav-btn:hover { background: var(--hover); color: var(--text); }
.nav-btn.active { color: var(--brand); background: var(--brand-soft); }
/* Top-bar dark-mode toggle: a pill with an icon + short label (moon "Dark" in light mode,
   sun "Light mode" in dark mode). On phones the label hides so the top bar stays uncluttered. */
.nav-btn.theme-btn { width: auto; border-radius: 19px; padding: 0 12px; gap: 6px; font-size: 14px; font-weight: 600; }
.nav-btn.theme-btn .ti { display: inline-flex; line-height: 1; }
.nav-btn.theme-btn .ti svg { width: 17px; height: 17px; }
.nav-btn.theme-btn .tl { line-height: 1; }
@media (max-width: 640px) {
  .nav-btn.theme-btn { width: 38px; padding: 0; }
  .nav-btn.theme-btn .tl { display: none; }
}
.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--like);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card);
}
/* Brief attention pulse on the messages icon when a new DM lands. */
@keyframes navPing {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.28); }
  50% { transform: scale(0.94); }
  75% { transform: scale(1.14); }
}
.nav-btn.nav-ping { animation: navPing 0.55s ease 0s 2; }
.nav-btn.nav-ping .badge { box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.25); }

/* ---------- App layout ---------- */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.rail { position: sticky; top: calc(var(--topbar-h) + 16px); }
.center { min-width: 0; }

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.side-link:hover { background: var(--hover); }
.side-link.active { background: var(--brand-soft); color: var(--brand-dark); }
.side-link .ic { display: inline-flex; align-items: center; justify-content: center; width: 24px; flex: none; }
.side-link .ic svg { width: 20px; height: 20px; display: block; }
.side-link .side-badge { position: static; margin-left: auto; border: none; }

/* Step 7: the rail is the desktop's primary navigation. The first group carries
   the five MyFri destinations at a confident size; the second keeps every other
   existing destination. */
.rail-card { padding: 8px; }
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-primary .side-link { font-size: 15.5px; padding: 11px 12px; }
.rail-primary .side-link.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.rail-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.rail-secondary .side-link { color: var(--text-soft); }

/* ---------- Email verification banner ---------- */
.verify-banner {
  max-width: 1280px;
  margin: 12px auto 0;
  padding: 10px 16px;
  background: #fff7e6;
  border: 1px solid #f0c36d;
  color: #6b4e00;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.verify-banner span { flex: 1; }
/* Yellow "install this as an app" (PWA) banner */
/* Compact install prompt: a slim one-line strip inside the Home feed column.
   Kept quiet on purpose - one short line, small action, hairline border. */
.install-banner {
  margin: 0 0 10px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  font-size: 12.5px;
  font-weight: 600;
}
.install-banner .ib-text { flex: 1; min-width: 0; line-height: 1.35; }
.install-banner .ib-btn { background: var(--brand); color: #fff; border: none; border-radius: 7px; padding: 5px 11px; font-weight: 700; font-size: 12px; cursor: pointer; white-space: nowrap; }
.install-banner .ib-btn:hover { background: var(--brand-dark); }
.install-banner .ib-x { background: transparent; border: none; color: var(--text-soft); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: 0.6; }
.install-banner .ib-x:hover { opacity: 1; }

/* New-user welcome banner: shown on the home feed to accounts under 30 days old,
   dismissible. Brand-tinted and theme-aware so it stays readable in dark mode. */
.welcome-banner { position: relative; background: var(--brand-soft); border: 1px solid var(--brand); }
.welcome-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-right: 22px; }
.welcome-text { flex: 1; min-width: 200px; font-size: 14px; line-height: 1.5; color: var(--text); padding-right: 18px; }
.welcome-emoji { font-size: 16px; }
.welcome-cta { flex: none; white-space: nowrap; }
.welcome-x { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--text-soft); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 7px; border-radius: 6px; }
.welcome-x:hover { background: var(--hover); color: var(--text); }

/* Profile visibility chooser (public / friends / private) inside the modal. */
.vis-opts { display: flex; flex-direction: column; gap: 8px; }
.vis-opt { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.vis-opt:hover { border-color: var(--brand); }
.vis-opt.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.vis-opt .vis-ic { font-size: 22px; flex: none; line-height: 1.2; }
.vis-opt .vis-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vis-opt .vis-label { font-weight: 700; font-size: 15px; color: var(--text); }
.vis-opt .vis-desc { font-size: 12.5px; color: var(--text-soft); line-height: 1.45; }
.vis-opt .vis-check { flex: none; color: var(--brand); font-weight: 800; opacity: 0; align-self: center; }
.vis-opt.sel .vis-check { opacity: 1; }

/* ---------- Moderation ---------- */
.modbanner {
  background: #fdecea;
  border: 1px solid #f5b5ae;
  color: #8a1c10;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 8px 0;
}
.modbanner-soft { background: var(--hover); border-color: #ddd; color: var(--text-soft); }
.cbubble.cremoved { opacity: 0.6; font-style: italic; }

/* ---------- Password show/hide ---------- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 8px;
}
.pw-toggle:hover { text-decoration: underline; }

/* ---------- Dashboard ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stat .sval { font-size: 28px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat .slabel { font-weight: 700; margin-top: 4px; }
.stat .shint { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.analytics-table { width: 100%; border-collapse: collapse; }
.analytics-table th, .analytics-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.analytics-table th { color: var(--text-soft); font-weight: 600; }
.analytics-table td:not(:first-child), .analytics-table th:not(:first-child) { text-align: right; width: 70px; }
.analytics-table tr.link:hover td { background: var(--hover); }

/* ---------- Reels (vertical video) ---------- */
.reels-viewer {
  height: calc(100vh - var(--topbar-h) - 96px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}
.reel-stage {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  background: #000;
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-video { width: 100%; height: 100%; object-fit: contain; background: #000; cursor: pointer; }
.reel-overlay { position: absolute; inset: 0; pointer-events: none; }
.reel-overlay > * { pointer-events: auto; }
.reel-actions { position: absolute; right: 12px; bottom: 96px; display: flex; flex-direction: column; gap: 14px; }
.reel-act {
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  gap: 1px;
}
.reel-act .ra-ic { font-size: 22px; line-height: 1; }
.reel-meta {
  position: absolute;
  left: 14px;
  right: 76px;
  bottom: 16px;
  color: #fff;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.reel-meta .rname { font-weight: 700; cursor: pointer; }
.reel-meta .rcap { font-size: 14px; margin-top: 2px; }
.reel-meta .rcap a { color: #cfe1ff; }
.reel-meta .rviews { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.reel-mute {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 16px;
}
/* Step 7 correction: inside the app columns, hierarchy comes from whitespace,
   typography, and hairline dividers, not boxed dashboard cards. Cards keep
   their markup (so behavior is untouched) but render as flat sections. */
.layout .card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 16px 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}
.layout .card.card-pad-0 { padding: 0; }
.layout .rail-card { padding: 0; }
.card-pad-0 { padding: 0; overflow: hidden; }
.section-title { font-family: var(--font-body); font-size: 15px; font-weight: 700; margin: 0 0 10px; }

/* ---------- Composer ---------- */
.composer .row { display: flex; gap: 10px; align-items: center; }
.composer textarea {
  border: none;
  background: var(--hover);
  border-radius: 20px;
  padding: 11px 16px;
  width: 100%;
  resize: none;
  font-size: 15px;
  outline: none;
  min-height: 42px;
}
.composer .preview { margin-top: 10px; position: relative; }
.composer .preview img { border-radius: 10px; max-height: 320px; width: 100%; object-fit: cover; }
.composer .preview .remove {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  width: 30px; height: 30px; border-radius: 50%; font-size: 16px;
}
.composer .actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.composer .actions .spacer { flex: 1; }
.icon-action { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; background: transparent; border: none; color: var(--text-soft); font-weight: 600; }
.icon-action:hover { background: var(--hover); }
/* Composer: compact "Add" menu (mobile) vs spread-out icons (desktop) */
.composer-add-wrap { display: none; position: relative; }
.composer-add-menu { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 40; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; min-width: 150px; }
.composer-add-menu button { background: transparent; border: none; text-align: left; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--text); font-size: 14px; }
.composer-add-menu button:hover { background: var(--hover); }
@media (max-width: 600px) {
  .composer-spread { display: none; }
  .composer-add-wrap { display: inline-block; }
  .composer .actions { gap: 6px; }
  .composer-audience { max-width: 130px; }
}

/* ---------- Stories ---------- */
.stories { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.story {
  flex: none;
  width: 74px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--brand-soft);
}
.story img { width: 100%; height: 100%; object-fit: cover; }
.story .who {
  position: absolute; bottom: 4px; left: 4px; right: 4px;
  color: #fff; font-size: 10px; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.story .ring {
  position: absolute; top: 6px; left: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--brand);
}
.story.add { background: var(--card); display: flex; flex-direction: column; }
.story.add .plus {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); font-size: 20px;
}
.story.add .label { padding: 4px; font-size: 10px; font-weight: 700; text-align: center; }

/* ---------- Posts ---------- */
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head .meta { flex: 1; min-width: 0; }
.post-head .name { font-weight: 700; cursor: pointer; }
.post-head .name:hover { text-decoration: underline; }
.post-head .time { font-size: 12px; color: var(--text-soft); }
/* A clickable avatar that opens the author's profile (feed posts, comments, people cards). */
.avatar-link { display: inline-flex; flex: none; cursor: pointer; line-height: 0; border-radius: 50%; }
/* The "N comments" count is a real button that opens the comments. */
.stat-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--text-soft); cursor: pointer; }
.stat-link:hover { text-decoration: underline; }
.post-body { margin: 10px 0; white-space: pre-wrap; word-wrap: break-word; }
/* @mention of a person: a clickable link to their profile. */
.mention { color: var(--brand); font-weight: 600; text-decoration: none; cursor: pointer; }
.mention:hover { text-decoration: underline; }
/* @everyone / @friends: a broadcast highlight, not a profile link. */
.mention-all { color: var(--brand); font-weight: 700; }
.post-image { margin: 0 -14px; }
.post-image img { width: 100%; max-height: 560px; object-fit: cover; }
.post-stats { display: flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 13px; padding: 8px 0; }
.post-stats .heart { color: var(--like); }
.post-actions { display: flex; align-items: center; border-top: 1px solid var(--line); padding-top: 4px; }
/* Step 7 card anatomy: the MyFri signature row (Love, Touch, Reply, Share) sits
   above a quiet utility row (vote, react, save, report). */
.post-actions-main { border-top: 1px solid var(--line); padding-top: 6px; }
.post-actions-util { border-top: none; padding-top: 2px; }
.post-actions-util .post-action { color: var(--text-soft); font-size: 13px; }
.post-action svg { display: block; }
.post-action.sig-love-btn.loved { color: var(--love); font-weight: 700; }
.post-action.sig-touch-btn.touched { color: var(--touch); font-weight: 700; }
.post-action.sig-love-btn, .post-action.sig-touch-btn { transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease; }
.post-action.sig-love-btn:active, .post-action.sig-touch-btn:active { transform: scale(0.97); }
.post-action {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; border: none; color: var(--text-soft);
  font-weight: 600; padding: 8px; border-radius: 8px; white-space: nowrap; min-width: 0;
}
.post-action:hover { background: var(--hover); }
.post-action.liked { color: var(--like); }
/* On phones the action row's text labels crowd the icons together, so hide the labels
   and keep just the icons (each button keeps a title tooltip, and the Share count stays).
   Like / comment / share / save / report icons + the vote arrows are self-explanatory. */
@media (max-width: 640px) {
  .post-actions .al { display: none; }
  .votebox.inline .vlabel { display: none; }
  .post-actions .post-action { gap: 0; padding-left: 4px; padding-right: 4px; font-size: 17px; }
}
.menu-btn { background: transparent; border: none; color: var(--text-soft); font-size: 20px; width: 34px; height: 34px; border-radius: 50%; }
.menu-btn:hover { background: var(--hover); }

/* comments */
.comments { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment { display: flex; gap: 8px; margin-bottom: 10px; }
.comment .bubble { background: var(--hover); border-radius: 16px; padding: 8px 12px; }
/* The name is an inline link (only the name text navigates, not the whole bubble). */
.comment .bubble .name { font-weight: 700; font-size: 13px; cursor: pointer; }
.comment .bubble .name:hover { text-decoration: underline; }
.comment .bubble .ctext, .cbubble .ctext { white-space: pre-wrap; word-wrap: break-word; }
/* Inline comment editor (Edit button). */
.cedit { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cedit-area { width: 100%; resize: vertical; min-height: 40px; font: inherit; }
.cedit-actions { display: flex; gap: 6px; }
.cedited { color: var(--text-soft); }
.comment-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.comment-form input {
  flex: 1; border: none; background: var(--hover); border-radius: 18px;
  padding: 9px 14px; outline: none; font-size: 14px;
}

/* ---------- Profile ---------- */
/* Premium theme skin: a gradient that frames the whole profile background.
   The vibrant gradient paints the top identity area (background-size height);
   below that, the inline background-color (a soft accent tint) washes behind the
   posts. Cards float on top as solid surfaces, so text stays readable. Untheme
   leaves .profile-skin as a plain transparent wrapper. */
.profile-skin.themed {
  padding: 14px;
  border-radius: var(--radius);
  background-repeat: no-repeat;
  background-size: 100% 300px;
}
.profile-skin.themed > :last-child { margin-bottom: 0; }
.profile-skin.themed .profile-cover { border-radius: var(--radius); }

.profile-cover {
  height: 190px;
  background: var(--cover-grad);
  border-radius: 0 0 var(--radius) var(--radius);
  position: relative;
  background-size: cover;
  background-position: center;
}
.profile-cover .edit-cover {
  position: absolute; right: 14px; bottom: 14px;
  background: rgba(255,255,255,0.9); color: var(--text);
}
.profile-head {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px 18px;
  margin: 0; padding: 0 24px 16px;
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 1; /* paint above the positioned cover */
}
/* Lift ONLY the avatar up over the cover. The name column then stays in the white
   area below the cover, so the cover (which is position:relative and would
   otherwise paint over the non-positioned name) can never cover the name. */
.profile-head .av-wrap { position: relative; margin-top: -46px; flex: none; }
.profile-head .av-wrap .cam {
  position: absolute; right: 4px; bottom: 4px;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--hover); border: 2px solid var(--card);
  display: flex; align-items: center; justify-content: center;
}
.profile-head .pname { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--name-accent, var(--text)); }
/* In dark mode the name is always bright for readability: a custom name color
   (var(--name-accent), often a dark shade picked in light mode) would otherwise
   render near-black on the dark card and disappear. The accent still shows in
   light mode. */
html[data-theme="dark"] .profile-head .pname { color: var(--text); }
.profile-head .pmeta { color: var(--text-soft); }
/* Name + actions sit on one row; the bio flows full-width below it (so action
   buttons never squeeze the bio). */
.profile-head .phead-row { display: flex; align-items: flex-start; gap: 12px; }
.profile-head .phead-id { flex: 1 1 auto; min-width: 0; }
/* Actions sit in a compact 2-up grid (two buttons per row, wrapping) with a capped
   width, so a long action set (Message / Friends / Follow / Share / More) never eats
   the space the name + stats need. Grid items stretch to equal-width columns. */
.profile-head .pactions {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  width: 220px;
  max-width: 46%;
}
.profile-head .pactions .btn { white-space: nowrap; }
.profile-head .pactions .btn-icon { justify-self: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon { padding: 8px 11px; font-size: 16px; line-height: 1; }
.btn-icon svg { display: block; }
.menu-btn svg, .btn svg { vertical-align: -3px; }
.icon-action svg, .file-chip svg, .ccw-ic svg, .msg-menu svg { vertical-align: -3px; }

/* The MyFri signature strip: Love | Touch | Friends. */
.psig { display: flex; border-bottom: 1px solid var(--line); }
.psig-cell {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 8px; background: none; border: none; border-right: 1px solid var(--line);
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.psig-cell:last-child { border-right: none; }
.psig-cell:not(.static):hover { background: var(--hover); }
.psig-cell.static { cursor: default; }
.psig-cell.love-btn.loved { background: var(--love-soft); color: var(--love); font-weight: 700; }
.psig-cell.touch-btn.touched { background: var(--touch-soft); color: var(--touch); font-weight: 700; }
.psig-cell .psig-tx b { font-weight: 800; }
.psig-cell svg { display: block; }
.psig-cell .psig-ic { display: inline-flex; align-items: center; }

/* My Space: the personal content area under the signature strip. */
.ms-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 18px 2px 10px; }
.ms-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.ms-stats { margin-left: auto; font-size: 13px; color: var(--text-soft); }

/* ---------- Lists / people ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.person {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; text-align: center; padding-bottom: 12px;
}
.person .ph { height: 120px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; }
.person .pn { font-weight: 700; margin: 10px 8px 2px; cursor: pointer; }
.person .phandle { color: var(--text-soft); font-size: 12.5px; margin: 0 8px 8px; }
.person .pb { padding: 0 10px; display: flex; flex-direction: column; gap: 6px; }
/* "Follow OpenBook" discovery card in the right rail. */
.ob-follow .ob-follow-row { display: flex; align-items: center; gap: 10px; }
.ob-follow .ob-follow-id { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.ob-follow .ob-follow-meta { display: flex; flex-direction: column; min-width: 0; }
.ob-follow .ob-follow-meta .nm { font-weight: 700; }
.ob-follow #obFollowBtn { flex: none; }
.contact { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer; }
.contact:hover { background: var(--hover); }
.contact .nm { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot-online { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.dot-online.off { background: #9aa3ad; }
/* Cosmetic Founder badge next to a name (distinct from supporter badges). */
.founder-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 800; line-height: 1;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle;
  color: #4a3200; background: linear-gradient(135deg, #ffd34d, #f7a823);
  border: 1px solid rgba(0,0,0,0.08); white-space: nowrap;
}
/* Golden ring around the founder's avatar (cosmetic). */
.av-gold { box-shadow: 0 0 0 2px var(--card, #fff), 0 0 0 4px #f5b301, 0 0 0 6px rgba(245,179,1,0.28); }
/* The official OpenBook account: brand "O" mark + an Official badge. */
.avatar-official { display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--brand); color: #fff; border-radius: 30%; font-weight: 800; line-height: 1; }
.official-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; line-height: 1; padding: 2px 7px; border-radius: 999px; vertical-align: middle; color: #fff; background: var(--brand); white-space: nowrap; }

/* Blue Pioneer badge for the first 5,000 members (cosmetic, never reputation). */
.pioneer-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700; line-height: 1;
  padding: 2px 7px; border-radius: 999px; vertical-align: middle;
  color: var(--brand-dark); background: var(--brand-soft);
  border: 1px solid var(--brand); white-space: nowrap;
}
/* A Pioneer who supports: the Pioneer badge takes their tier color (matching the
   supporter badge colors), reverting to the default blue when support lapses. */
.pioneer-badge.pio-bronze { background: rgba(205,127,50,.14); color: #8a5a24; border: 1px solid rgba(205,127,50,.28); }
.pioneer-badge.pio-silver { background: rgba(122,132,142,.12); color: #55606a; border: 1px solid rgba(122,132,142,.26); }
.pioneer-badge.pio-gold   { background: rgba(196,148,22,.12); color: #7d621a; border: 1px solid rgba(196,148,22,.28); }
/* Growth-phase ladder on the Support page (done / current / upcoming). Scrolls
   horizontally on narrow screens so the four phases never crush together. */
.phase-ladder { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.phase-step { flex: 1 1 0; min-width: 78px; border-radius: 10px; padding: 8px 10px; text-align: center; border: 1px solid var(--line); background: var(--hover); }
.phase-step .ps-n { font-size: 12.5px; font-weight: 800; }
.phase-step .ps-to { font-size: 11px; color: var(--text-soft); margin-top: 1px; }
.phase-step.phase-done { background: var(--brand-soft); border-color: var(--brand); }
.phase-step.phase-done .ps-n { color: var(--brand-dark); }
.phase-step.phase-cur { background: linear-gradient(135deg, #4f8cff, #2563eb); border-color: transparent; }
.phase-step.phase-cur .ps-n, .phase-step.phase-cur .ps-to { color: #fff; }
.phase-step.phase-next { opacity: 0.85; }
/* Premium profile theme swatches in the Edit profile dialog. */
.theme-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.theme-sw { width: 56px; height: 34px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.theme-sw.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.theme-sw.theme-none { background: var(--hover); color: var(--text-soft); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* Pinned, clearly-labeled site announcement at the top of the feed (transparent
   pin, never a hidden feed boost). */
.ann-wrap { margin-bottom: 14px; border: 1.5px solid #2563eb; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 16px rgba(37,99,235,0.12); }
.ann-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .02em; color: #fff; background: linear-gradient(135deg, #4f8cff, #2563eb); padding: 7px 14px; }
.ann-wrap > .card { margin: 0; border: none; border-radius: 0; box-shadow: none; }
/* Profile header name column: take the remaining width and let long names wrap
   cleanly instead of being clipped under the avatar / cover overlap. */
/* The name column claims at least ~240px and grows; if the row is too tight for
   the avatar + name + actions, the actions wrap to their own line below (so the
   name is never squeezed into a 1-letter-per-line column). */
.profile-head .phead-main { flex: 1 1 240px; min-width: 0; }
.profile-head .pname { overflow-wrap: break-word; word-break: normal; line-height: 1.2; }
/* Composer audience (Public / Friends) selector. */
.composer-audience {
  font: inherit; font-size: 13px; padding: 6px 8px; margin-right: 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); cursor: pointer;
}

/* ---------- Rich posts: colored text backgrounds, polls, file chips ---------- */
/* Background gradients, shared by post backgrounds, the composer textarea, and swatches. */
/* !important so the gradient wins over the base textarea/button backgrounds when
   applied to the composer textarea and the swatches. */
.cbg-1 { background: linear-gradient(135deg, #667eea, #764ba2) !important; }
.cbg-2 { background: linear-gradient(135deg, #f093fb, #f5576c) !important; }
.cbg-3 { background: linear-gradient(135deg, #11998e, #38ef7d) !important; }
.cbg-4 { background: linear-gradient(135deg, #ff8008, #ffc837) !important; }
.cbg-5 { background: linear-gradient(135deg, #2193b0, #6dd5ed) !important; }
.cbg-6 { background: linear-gradient(135deg, #3a3d5c, #4286f4) !important; }

.post-bg {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 200px; padding: 26px; margin: 8px 0; border-radius: 12px;
  color: #fff; font-size: 26px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere;
}
/* When a background is picked the composer textarea BECOMES a live preview of the
   final post: big, bold, centered white text with a shadow so it reads clearly on
   any gradient (it was thin/faint before). */
.composer-bg {
  color: #fff !important; font-weight: 800; text-align: center;
  font-size: 24px !important; line-height: 1.35;
  min-height: 150px; border: none !important; border-radius: 12px;
  padding: 30px 20px !important; margin-top: 6px; resize: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.composer-bg::placeholder { color: rgba(255, 255, 255, 0.92); font-weight: 700; }

.cbg-strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.cbg-swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line);
  color: #fff; font-weight: 700; font-size: 12px; line-height: 1;
}
.cbg-swatch.cbg-none { background: var(--hover); color: var(--text); }
.cbg-swatch.on { outline: 2px solid var(--brand); outline-offset: 1px; }

.cpoll { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.cpoll-opt { width: 100%; }
.cpoll-add { align-self: flex-start; }
.cfile-chip { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.cfile-chip .remove { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-soft); }

.poll { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.poll-opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 10px 12px; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden;
}
.poll-opt:hover { border-color: var(--brand); }
.poll-opt.mine { border-color: var(--brand); font-weight: 700; }
.poll-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--brand-soft); z-index: 0; transition: width .4s; }
.poll-text, .poll-pct { position: relative; z-index: 1; }
.poll-pct { color: var(--text-soft); font-weight: 700; }
.poll-total { font-size: 12px; color: var(--text-soft); }

.file-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 8px 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--hover); color: var(--text); text-decoration: none;
}
.file-chip:hover { border-color: var(--brand); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Suggestion board ---------- */
.sug-row { display: flex; gap: 12px; align-items: flex-start; }
.sug-main { flex: 1; min-width: 0; }
.sug-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.sug-body { color: var(--text-soft); font-size: 14px; margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sug-meta { font-size: 12px; color: var(--text-soft); margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sug-cat, .sug-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: capitalize; }
.sug-cat { background: var(--hover); color: var(--text); }
.sug-status-open { background: var(--hover); color: var(--text-soft); }
.sug-status-planned { background: #fde68a; color: #92400e; }
.sug-status-in_progress { background: #dbeafe; color: #1e40af; }
.sug-status-shipped { background: #bbf7d0; color: #166534; }
.sug-status-declined { background: #fecaca; color: #991b1b; }
.sug-note { font-size: 12.5px; color: var(--text-soft); font-style: italic; line-height: 1.45; margin-top: 8px; overflow-wrap: anywhere; }
.sug-admin { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sug-admin:empty { display: none; }
/* Owner dashboard: suggestions inbox summary chips */
.adm-sug-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.adm-sug-chip { font-size: 12.5px; color: var(--text-soft); background: var(--hover); border-radius: 999px; padding: 4px 11px; }
.adm-sug-chip b { color: var(--text); }

/* ---------- Photo repositioning ---------- */
.profile-cover .cover-tools { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* The cover buttons always sit on a near-white pill (same in both themes), so the
   label must be a fixed dark color. Using var(--text) made it light-on-white and
   invisible in dark mode. */
.cover-tools .cover-btn { background: rgba(255, 255, 255, 0.92); color: #1c1e21; }
.profile-head .av-wrap .cam.cam-repos { right: auto; left: 4px; }
.repos-frame { position: relative; overflow: hidden; background: #000; width: 100%; touch-action: none; cursor: grab; user-select: none; }
.repos-frame:active { cursor: grabbing; }
.repos-frame img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; }
.rf-cover { aspect-ratio: 5 / 2; min-height: 150px; border-radius: 10px; }
.rf-avatar { width: 260px; max-width: 80vw; aspect-ratio: 1 / 1; border-radius: 50%; margin: 0 auto; }

/* ---------- Notifications dropdown ---------- */
.dropdown {
  position: absolute; right: 16px; top: calc(var(--topbar-h) - 4px);
  width: 360px; max-width: calc(100vw - 24px);
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 60; overflow: hidden;
}
.dropdown .dhead { display: flex; align-items: center; padding: 12px 14px; }
.dropdown .dhead h3 { margin: 0; flex: 1; }
.notif {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px; cursor: pointer;
}
.notif:hover { background: var(--hover); }
.notif.unread { background: var(--brand-soft); }
.notif .nt { flex: 1; min-width: 0; }
.notif .nt .tm { font-size: 12px; color: var(--text-soft); }

/* Dedicated Notifications page (Step 11): a compact social activity stream.
   Centered column, thin separators, avatar identity first, no cards. */
.notif-page { max-width: 620px; margin: 0 auto; }
.notif-page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 20px 8px 12px; }
.notif-page-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.notif-readall { background: none; border: none; padding: 4px 2px; font: inherit; font-size: 13px; color: var(--text-soft); cursor: pointer; }
.notif-readall:hover { color: var(--text); text-decoration: underline; }
.notif-stream { border-top: 1px solid var(--line); }
.notif-page .notif { display: flex; gap: 12px; align-items: center; padding: 11px 8px; border-radius: 0; }
.notif-page .notif + .notif { border-top: 1px solid var(--line); }
.notif-page .notif:hover { background: var(--hover); }
/* Unread is quiet: a barely-there neutral wash + a small dot, never a loud tint. */
.notif-page .notif.unread { background: rgba(128, 128, 128, 0.07); }
.notif-page .notif.unread:hover { background: var(--hover); }
.notif-av { position: relative; flex: none; }
.notif-ic { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-soft); }
.notif-page .notif .nx { font-size: 14.5px; line-height: 1.35; }
.notif-page .notif .nt .tm { font-size: 12px; color: var(--text-soft); margin-top: 1px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text); opacity: 0.85; flex: none; margin-left: auto; }
.notif-page .empty { padding: 56px 16px; text-align: center; color: var(--text-soft); font-size: 14px; }
@media (max-width: 720px) {
  .notif-page { max-width: none; }
  .notif-page-head { padding: 16px 14px 10px; }
  .notif-page .notif { padding: 11px 14px; }
}

/* On Notifications, the page is the destination: no promotional rail links
   (Get started / Discover / MyShot / footer), no legacy right sidebar.
   Scoped to this view only; the rails are untouched everywhere else. */
.view-notifications #leftRail .rail-secondary,
.view-notifications #leftRail .rail-foot,
.view-notifications #rightRail { display: none; }
.notif-page .empty-t { font-size: 15px; font-weight: 600; color: var(--text); }
.notif-page .empty-s { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.empty { text-align: center; color: var(--text-soft); padding: 28px 14px; }

/* ---------- Messages ---------- */
.messenger { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 32px); }
/* min-height:0 lets these grid/flex children shrink to the row height so their inner
   lists actually scroll instead of overflowing the messenger box (the thread-scroll bug). */
.mlist { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.msearch { padding: 8px; border-bottom: 1px solid var(--line); flex: none; }
.msearch input { width: 100%; border: none; background: var(--hover); border-radius: 20px; padding: 9px 14px; outline: none; color: var(--text); font: inherit; }
.mlist-items { flex: 1; min-height: 0; overflow-y: auto; }
.mlist .convo { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.mlist .convo:hover, .mlist .convo.active { background: var(--hover); }
.mlist .convo .cm { flex: 1; min-width: 0; }
.mlist .convo .cm .nm { font-weight: 600; }
.mlist .convo .cm .lm { font-size: 13px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mlist .convo.unread .cm .nm { font-weight: 800; }
.mlist .convo.unread .cm .lm { color: var(--text); font-weight: 600; }
.mlist .convo .cmeta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.mlist .convo .cmeta .ct { font-size: 11px; color: var(--text-soft); }
.mlist .convo .cmeta .unread { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--text); }
.mlist .convo .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }
.mthread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mthread .thead { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex: none; background: var(--card); }
.mbody { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.bubble-msg { position: relative; align-self: flex-start; max-width: 78%; padding: 2px 0 2px 12px; border-left: 2px solid var(--line); background: none; box-shadow: none; border-radius: 0; color: var(--text); word-wrap: break-word; }
.bubble-msg.mine { align-self: flex-end; border-left: none; border-right: 2px solid var(--brand); padding: 2px 12px 2px 0; text-align: right; }
.bubble-msg.g-first { margin-top: 16px; }
.bubble-msg .bt { display: none; font-size: 11px; color: var(--text-soft); margin-top: 3px; }
.bubble-msg.g-last .bt { display: block; }
/* Message edit / delete (Telegram-style) */
.bubble-msg { position: relative; }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-edited { font-style: italic; opacity: 0.85; margin-left: 4px; }
.msg-menu-btn { position: absolute; top: 2px; right: 16px; border: none; background: transparent; color: inherit; opacity: 0; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 5px; border-radius: 6px; }
.bubble-msg:hover .msg-menu-btn, .msg-menu-btn:focus { opacity: 0.6; }
.msg-menu-btn:hover { opacity: 1; background: rgba(0, 0, 0, 0.14); }
.msg-menu { position: absolute; top: 22px; right: 16px; z-index: 30; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; min-width: 124px; }
.msg-menu button { background: transparent; border: none; text-align: left; padding: 7px 10px; border-radius: 7px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.msg-menu button:hover { background: var(--hover); }
.msg-menu button.danger { color: var(--like); }
.msg-editor { display: flex; flex-direction: column; gap: 6px; min-width: 230px; }
.msg-edit-input { width: 100%; resize: vertical; border-radius: 10px; border: 1px solid var(--line); padding: 7px 9px; font: inherit; background: var(--bg); color: var(--text); }
.msg-edit-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* Onboarding checklist card in the official OpenBook conversation */
.onboard-card { align-self: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.onboard-h { font-weight: 800; font-size: 15px; margin: 2px 2px 10px; }
.onboard-steps { display: flex; flex-direction: column; gap: 7px; }
.onboard-step { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; color: var(--text); font: inherit; transition: background .12s, border-color .12s; }
.onboard-step:hover { background: var(--hover); border-color: var(--brand); }
.onboard-step .oi { font-size: 20px; width: 26px; text-align: center; flex: none; }
.onboard-step .ot { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.onboard-step .o1 { font-weight: 700; font-size: 14px; }
.onboard-step .o2 { font-size: 12.5px; color: var(--text-soft); line-height: 1.35; }
.onboard-step .oc { font-size: 20px; color: var(--text-soft); flex: none; }
/* Get started guide (modal): a tappable tour of each section */
.gs-list { display: flex; flex-direction: column; gap: 7px; }
.gs-row { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; color: var(--text); font: inherit; transition: background .12s, border-color .12s; }
.gs-row:hover { background: var(--hover); border-color: var(--brand); }
.gs-ic { font-size: 20px; width: 26px; text-align: center; flex: none; }
.gs-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gs-name { font-weight: 700; font-size: 14px; }
.gs-desc { font-size: 12.5px; color: var(--text-soft); line-height: 1.35; }
.gs-go { font-size: 20px; color: var(--text-soft); flex: none; }
.official-pill { background: var(--brand); color: #fff; }
.mfoot-note { padding: 13px 16px; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; border-top: 1px solid var(--line); background: var(--card); }
.mfoot { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--card); }
.mfoot input { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 22px; padding: 11px 16px; outline: none; color: var(--text); font: inherit; }
.mfoot input:focus { border-color: var(--brand); }
.send-btn { flex: none; width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.send-btn:hover { background: var(--brand); color: #fff; }
.send-btn svg { display: block; }
.chat-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-soft); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: var(--card); border-radius: var(--radius-lg);
  width: 100%; max-width: 500px; box-shadow: var(--shadow-lg);
  max-height: 90vh; overflow-y: auto; position: relative;
}
/* Always-present close button at the top-left, so a full-screen modal on mobile is
   easy to dismiss even when there is no backdrop to tap. */
.modal-x {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: var(--hover); color: var(--text); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.modal-x:hover { background: var(--line); }
.modal .mh { display: flex; align-items: center; padding: 14px 44px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { margin: 0; flex: 1; text-align: center; font-size: 18px; }
.modal .mc { padding: 18px; }

/* story viewer */
.story-view-back { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 110; display: flex; align-items: center; justify-content: center; }
.story-view { width: min(420px, 92vw); height: min(86vh, 760px); border-radius: 14px; overflow: hidden; position: relative; background: #000; }
.story-view img { width: 100%; height: 100%; object-fit: contain; }
.story-view .sv-head { position: absolute; top: 0; left: 0; right: 0; padding: 14px; display: flex; gap: 10px; align-items: center; background: linear-gradient(rgba(0,0,0,0.6), transparent); color: #fff; }
.story-view .sv-cap { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.7)); }
.story-view .sv-close { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(0,0,0,0.5); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1c1e21; color: #fff; padding: 11px 18px; border-radius: 10px;
  box-shadow: var(--shadow-lg); z-index: 200; font-size: 14px;
}

/* ---------- Shared bits ---------- */
.mk-head { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 8px; vertical-align: middle; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text-soft); border-radius: 16px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Marketplace ---------- */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.mk-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform 0.08s ease; }
.mk-card:hover { transform: translateY(-2px); }
.mk-photo { position: relative; aspect-ratio: 1 / 1; background: var(--hover); }
.mk-photo img { width: 100%; height: 100%; object-fit: cover; }
.mk-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 34px; opacity: 0.5; }
.mk-sold { position: absolute; top: 8px; left: 8px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.mk-info { padding: 8px 10px 12px; }
.mk-price { font-weight: 800; }
.mk-title { font-size: 14px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-loc { font-size: 12px; color: var(--text-soft); }

/* ---------- Groups ---------- */
.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.grp-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.grp-cover { height: 90px; background: var(--cover-grad); background-size: cover; background-position: center; cursor: pointer; }
.grp-body { padding: 10px; }
.grp-name { font-weight: 700; cursor: pointer; }
.grp-name:hover { text-decoration: underline; }
.grp-act { margin-top: 8px; }
.grp-hero { height: 160px; background: var(--cover-grad); background-size: cover; background-position: center; border-radius: 0 0 var(--radius) var(--radius); }
.grp-hd { display: flex; align-items: flex-end; gap: 12px; padding: 14px 18px; }
.grp-hd-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Albums ---------- */
.alb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.alb-card { cursor: pointer; }
.alb-cover { aspect-ratio: 4 / 3; border-radius: 10px; background: var(--brand-soft) center/cover no-repeat; box-shadow: var(--shadow); }
.alb-info { padding: 6px 2px; }
.alb-title { font-weight: 700; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ph-item { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.ph-item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.ph-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.7)); }

/* ---------- Communities + voting ---------- */
.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }

.votebox { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 34px; flex: none; }
.votebox .vrow { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.votebox.inline { min-width: 0; padding: 0 4px; }
.votebox.inline .vrow { flex-direction: row; gap: 4px; }
/* Small caption UNDER the arrows so the control reads clearly as a vote, without
   taking horizontal space on the action line. */
.vlabel { font-size: 9.5px; line-height: 1; color: var(--text-soft); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.vote { background: none; border: none; color: var(--text-soft); font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.vote:hover { background: var(--hover); }
.vote.up.on { color: var(--brand); }
.vote.down.on { color: var(--like); }
.vscore { font-weight: 700; font-size: 13px; }
.vscore.pos { color: var(--brand); }
.vscore.neg { color: var(--like); }

.cpost { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.cpost-full { cursor: default; }
.cpost-body { flex: 1; min-width: 0; }
.cpost-title { font-weight: 700; font-size: 16px; cursor: pointer; }
.cpost-link { font-size: 13px; word-break: break-all; }
.cpost-snippet { color: var(--text-soft); font-size: 14px; margin-top: 4px; white-space: pre-wrap; }
.cpost-thumb { margin-top: 8px; }
.cpost-thumb img { max-height: 340px; width: 100%; object-fit: cover; border-radius: 10px; }
.cpost-meta { color: var(--text-soft); font-size: 12px; margin-top: 8px; }

.comm-hero { height: 90px; background: var(--cover-grad); border-radius: 0 0 var(--radius) var(--radius); }
.comm-hd { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.comm-hd .avatar, .comm-hd .avatar-fallback { margin-top: -44px; border: 4px solid var(--card); }
.comm-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.comm-row { display: flex; gap: 10px; align-items: center; cursor: pointer; }

.tabs { display: flex; gap: 4px; }
.tab { background: none; border: none; padding: 6px 14px; border-radius: 18px; font-weight: 600; color: var(--text-soft); }
.tab.active { background: var(--brand-soft); color: var(--brand-dark); }

.ctree { margin-top: 10px; }
.crow { display: flex; gap: 8px; align-items: flex-start; }
.cmain { flex: 1; min-width: 0; }
.cbubble { background: var(--hover); border-radius: 12px; padding: 8px 12px; }
.cname { font-weight: 700; font-size: 13px; }
.ctime { font-size: 11px; color: var(--text-soft); margin-left: 6px; }
.cactions { display: flex; gap: 10px; padding: 4px 0 0 12px; }
.clink { background: none; border: none; color: var(--text-soft); font-weight: 600; font-size: 12px; cursor: pointer; }
.clink:hover { color: var(--text); }
.cchildren { margin-left: 22px; border-left: 2px solid var(--line); padding-left: 10px; }

/* ---------- Reactions + edit history ---------- */
.post-actions { position: relative; }
.rx-ctl { position: relative; display: inline-flex; }
.post-actions > [data-react] { flex: 1; display: flex; }
.post-actions > [data-react] > .rx-ctl { flex: 1; }
.post-actions .post-action.react { flex: 1; }
.rx-mine { color: var(--brand); font-weight: 700; }
.rx-picker {
  position: absolute; bottom: 115%; left: 0; z-index: 40;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-lg);
  display: flex; gap: 2px; padding: 5px 8px;
}
.rx-opt { background: none; border: none; font-size: 24px; line-height: 1; padding: 4px; border-radius: 50%; transition: transform 0.1s ease; }
.rx-opt:hover { transform: scale(1.3); }
.rx-opt.on { background: var(--brand-soft); }
.rx-sum { color: var(--text-soft); font-size: 13px; }
.rx-emoji { font-size: 14px; }
.rxbtn-sm { background: none; border: none; color: var(--text-soft); font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; }
.cmeta { display: flex; align-items: center; gap: 8px; margin-left: 12px; margin-top: 3px; font-size: 12px; color: var(--text-soft); flex-wrap: wrap; }
.edited-link { color: var(--text-soft); cursor: pointer; }
.edited-link:hover { text-decoration: underline; }
.hist-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; white-space: pre-wrap; word-wrap: break-word; }
.hist-current { border-color: var(--brand); background: var(--brand-soft); }
.hist-when { font-size: 12px; color: var(--text-soft); margin-bottom: 4px; font-weight: 600; }
.hist-title { font-weight: 700; margin-bottom: 2px; }

/* ---------- Page descriptions (explain Groups vs Communities, etc.) ---------- */
.page-desc { color: var(--text-soft); font-size: 13.5px; line-height: 1.55; padding: 6px 6px 2px; }
.page-desc a { color: var(--brand); cursor: pointer; text-decoration: none; }
.page-desc a:hover { text-decoration: underline; }

/* ---------- Profile bio + clickable bio links (Plus tier / trusted accounts) ---------- */
.profile-bio { white-space: pre-wrap; word-break: break-word; }
/* Keep a link (e.g. a domain) intact: it wraps to the next line as a whole unit
   instead of being split mid-word. word-break:normal overrides the parent
   .profile-bio break-word, which was slicing the domain across two lines. */
.bio-link { color: var(--brand); text-decoration: underline; word-break: normal; overflow-wrap: normal; white-space: nowrap; }

/* ---------- Shared site footer (landing page + "Our Mission") ---------- */
.site-footer { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 26px 16px 34px; color: var(--text-soft); font-size: 13px; }
.site-footer a { color: var(--brand); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer-tag { color: var(--text-soft); }

/* Facebook-style text links at the bottom of the left rail */
.rail-foot { padding: 12px 10px 4px; line-height: 1.7; }
.rail-foot a { color: var(--text-soft); font-size: 12px; text-decoration: none; }
.rail-foot a:hover { color: var(--brand); text-decoration: underline; }
.rail-foot a:not(:last-of-type)::after { content: "\00B7"; display: inline-block; margin: 0 6px; color: var(--text-soft); text-decoration: none; }
.rail-foot-copy { margin-top: 7px; font-size: 11px; color: var(--text-soft); opacity: .75; }

/* ---------- Repost header (Share / repost) ---------- */
.repost-hdr { font-size: 12.5px; color: var(--text-soft); font-weight: 600; margin: -2px 0 8px; }
.repost-hdr .avatar-link { cursor: pointer; }
.repost-hdr b { color: var(--text, inherit); }
.repost-comment { white-space: pre-wrap; word-break: break-word; margin: 0 0 10px; }

/* Saved action active state */
.post-action.on { color: var(--brand); font-weight: 600; }

/* ---------- Content warning cover (sensitive content blur) ---------- */
.cw-cover { border: 1px dashed var(--line); border-radius: 12px; padding: 26px 16px; margin: 4px 0 10px; text-align: center; background: var(--brand-soft); cursor: pointer; }
.cw-cover .cw-ic { font-size: 26px; }
.cw-cover .cw-label { font-weight: 700; margin-top: 6px; }
.cw-cover .cw-sub { font-size: 12px; color: var(--text-soft); margin: 4px 0 12px; }

/* Composer content-warning row + active toggle */
.ccw { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.ccw-ic { font-size: 16px; }
.ccw-input { flex: 1; }
.icon-action.on, .composer-spread.on, .composer-add-btn.on { color: var(--brand); }

/* ---------- Link preview card (text only) ---------- */
.link-preview { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 4px 0 10px; text-decoration: none; color: inherit; transition: background .15s; }
.link-preview:hover { background: var(--brand-soft); }
.link-preview .lp-site { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.link-preview .lp-title { font-weight: 700; margin: 2px 0; }
.link-preview .lp-desc { font-size: 13px; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Search: community results ---------- */
.search-comm-list { display: flex; flex-direction: column; gap: 6px; }
.search-comm { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.search-comm:hover { background: var(--brand-soft); }
.search-comm .sc-name { font-weight: 700; }
.search-comm .sc-desc { font-size: 12.5px; color: var(--text-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  /* The mobile viewport shows the page itself immediately; the rail of extra
     destinations follows underneath instead of pushing content down. */
  .layout .center { order: 1; }
  #leftRail { order: 2; }
  /* Hide the suggestions (right) rail, but keep the destination menu reachable
     by turning the left rail into a horizontal scroller above the content. */
  #rightRail { display: none; }
  #leftRail { position: static; }
  #leftRail .card { display: flex; flex-direction: row; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 8px 0; border-bottom: none; }
  #leftRail .rail-group { display: flex; flex-direction: row; gap: 2px; }
  #leftRail .side-link { flex: 0 0 auto; white-space: nowrap; padding: 8px 10px; font-size: 13px; color: var(--text-soft); }
  #leftRail .rail-foot { padding: 8px 4px 24px; }
  /* Primary destinations live in the bottom bar on mobile; the rail scroller
     keeps every other destination reachable. */
  #leftRail .rail-primary { display: none; }
  #leftRail .rail-sep { display: none; }
  /* Primary tabs move to the bottom bar on mobile, so hide them in the top bar
     and let the search flex to fill the space next to the utility cluster. */
  .topbar .search { width: auto; flex: 1; min-width: 0; }
  .topbar { gap: 8px; padding: 0 10px; }
  /* Bottom navigation bar: the four primary destinations, always tappable. */
  .toast { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card);
    border-top: 1px solid var(--line);
    box-shadow: none;
  }
  .bottom-nav .nav-tab { flex: 1; min-width: 0; padding: 0; height: 100%; border-bottom: none; border-top: none; color: var(--text-soft); }
  .bottom-nav .nav-tab .tl { display: block; font-size: 10px; }
  .bottom-nav .nav-tab .ti svg { width: 21px; height: 21px; }
  .bottom-nav .nav-tab.active { color: var(--brand); border-top-color: transparent; border-bottom-color: transparent; }
  /* The Create tab is a raised action button, visually distinct from the four
     destinations (and from any social app's plain center icon). */
  .bottom-nav .nav-create .ti {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-top: -16px;
    border-radius: 50%; background: var(--brand); color: #fff;
    font-size: 22px; box-shadow: var(--shadow-lg);
  }
  /* Leave room above the fixed bottom bar so content is never hidden behind it. */
  .layout { padding-bottom: 76px; }
  .landing-grid { grid-template-columns: 1fr; gap: 24px; }
  .landing-pitch { text-align: center; }
  .landing-pitch h1 { font-size: 40px; }
  /* Center the manifesto block and left-align the eyebrow + each row inside it
     for legibility (the column itself is centered on mobile). */
  .promises { margin-left: auto; margin-right: auto; }
  .promises-eyebrow, .promise { text-align: left; }
  .messenger { grid-template-columns: minmax(0, 1fr); }
  .messenger.show-thread .mlist { display: none; }
  .messenger:not(.show-thread) .mthread { display: none; }
  /* Keep the thread composer fully above the fixed bottom navigation. The
     desktop height only clears the page padding (32px); on mobile the fixed
     bottom nav (56px + safe-area inset) covers that zone, so subtract it too.
     100dvh tracks the on-screen keyboard shrinking the visual viewport, so
     the composer also stays visible while typing; 100vh is the fallback. */
  .messenger { height: calc(100vh - var(--topbar-h) - 56px - env(safe-area-inset-bottom, 0px)); }
  .messenger { height: calc(100dvh - var(--topbar-h) - 56px - env(safe-area-inset-bottom, 0px)); }

  /* Stack the profile header so the avatar never overlaps the name. */
  .profile-cover { height: 180px; }
  .profile-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    margin-top: -64px;
  }
  .profile-head .phead-main { flex: 0 0 auto; width: 100%; }
  /* On mobile the whole (column) header lifts over the cover, so the avatar must
     not also lift on its own, or it would ride too far up. */
  .profile-head .av-wrap { margin-top: 0; }
  .profile-head .phead-row { flex-direction: column; align-items: center; width: 100%; }
  /* On mobile the name is centered above; the 2-up action grid sits centered below it
     at a comfortable width (the desktop 46% cap does not apply here). */
  .profile-head .pactions { width: 100%; max-width: 320px; justify-self: center; }
}
@media (max-width: 520px) {
  .topbar .search { max-width: none; }
  .topbar .logo .name { display: none; }
}

/* Logged-out / public read-only view (a shared /p or /u link seen without an account). */
.public-shell { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 8px 0 40px; }
.public-mode .layout { justify-content: center; }
.public-mode .rail { display: none; }
.pub-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(120deg, var(--brand, #4f46e5), #8b5cf6); color: #fff;
  padding: 12px 16px; border-radius: 12px; font-size: 14px; flex-wrap: wrap; }
.pub-cta .btn { flex: none; }
.pub-cta a.btn-primary { background: #fff; color: var(--brand, #4f46e5); }
.pp-title { font-size: 22px; font-weight: 800; margin: 0 0 8px; line-height: 1.25; }
.pp-stats { color: var(--text-soft); font-weight: 600; margin-top: 10px; }
.pp-comment { padding: 8px 0; border-top: 1px solid var(--line, #e4e6eb); font-size: 15px; }
.pp-comments .section-title { margin-bottom: 4px; }
.pub-foot { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.pp-crumb a, .pp-post .name a { color: var(--brand, #4f46e5); text-decoration: none; }
.pp-linkcard { display: block; text-decoration: none; color: inherit; }
.pp-linkcard:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.explore-list { list-style: none; margin: 8px 0 0; padding: 0; }
.explore-list li { padding: 7px 0; border-top: 1px solid var(--line, #e4e6eb); }
.explore-list li:first-child { border-top: none; }
.explore-list a { color: var(--brand, #4f46e5); text-decoration: none; font-weight: 600; }
.explore-list .muted { color: var(--text-soft); font-weight: 400; }
.upd-item .post-body { color: var(--text-soft); }

/* New-member "fill your feed" starter card. */
.starter-card .starter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.starter-card .pmeta { margin-top: 4px; }

/* Founding-member scarcity nudge on the signup card. */

/* The little "how to turn on notifications" guide inside Settings, Notifications. A
   soft brand-tinted callout that adapts to light / dark via the theme variables. */
.push-guide { background: var(--brand-soft, #eef0ff); border: 1px solid var(--line, #e4e6eb);
  border-radius: 10px; padding: 10px 12px; }
.push-guide-title { font-size: 12px; font-weight: 700; color: var(--brand, #4f46e5);
  text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.push-guide-steps { margin: 0 0 8px; padding-left: 18px; }
.push-guide-steps li { font-size: 12.5px; line-height: 1.5; color: var(--text-soft, #65676b);
  margin-bottom: 5px; }
.push-guide-steps li strong { color: var(--text, #1c1e21); font-weight: 600; }
.push-guide-note { font-size: 11.5px; line-height: 1.45; color: var(--text-soft, #65676b);
  border-top: 1px solid var(--line, #e4e6eb); padding-top: 7px; }

/* ---------- Step 3: Discover "Coming soon" card + MyShot placeholder ---------- */
.soon-card { display: block; }
.soon-card .mk-head { margin-bottom: 6px; }
.soon-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.soon-item:first-of-type { border-top: none; }
.soon-ic { width: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-soft); }
.soon-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.soon-txt { font-size: 13px; margin-top: 2px; }
.pill-soon {
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
}

.myshot-card { text-align: center; padding: 48px 24px; }
.myshot-mark {
  width: 88px; height: 88px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.myshot-card .section-title { margin-bottom: 4px; }
.myshot-sub { font-size: 15px; font-weight: 600; color: var(--text-soft); margin-bottom: 12px; }
.myshot-txt { max-width: 460px; margin: 0 auto; line-height: 1.5; }

/* Bottom-nav badge sits over the tab icon, not the tab's far corner. */
.bottom-nav .nav-tab .badge { top: 4px; right: calc(50% - 26px); }

@media (max-width: 980px) {
  /* The bottom bar's Me tab covers your profile, so the duplicated avatar button
     hides. Messages stays in the top bar (with its badge) on small screens. */
  .topbar-right #meBtn { display: none; }
}

/* ---------- Step 4: Touch ---------- */
/* Touch = connection/presence: warm amber. Distinct from Love's rose. */
.touch-btn { transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease; }
.touch-btn:active { transform: scale(0.97); }
.touch-btn.touched {
  background: var(--touch-soft);
  color: var(--touch);
  border-color: transparent;
  font-weight: 700;
}

/* ---------- Step 5: Love ---------- */
/* Love = affection: rose. */
.love-btn { transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease; }
.love-btn:active { transform: scale(0.97); }
.love-btn.loved {
  background: var(--love-soft);
  color: var(--love);
  border-color: transparent;
  font-weight: 700;
}

/* Step 7: Touch destination mark in the signature amber. */
.touch-mark { background: var(--touch-soft); color: var(--touch); }

/* ---------- Step 7 final polish: compact launch notice ---------- */
.layout .welcome-banner { padding: 10px 14px; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); }
.welcome-body { gap: 10px; padding-right: 20px; }
.welcome-text { font-size: 13px; }
.welcome-x { top: 6px; right: 8px; }

/* --- MyShot + Creator (Step 8) --- */
.csheet-backdrop { position: fixed; inset: 0; z-index: 60; background: transparent; }
.create-sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; width: min(320px, calc(100vw - 32px)); padding: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
@media (min-width: 900px) { .create-sheet { bottom: auto; top: 84px; } }
.create-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 10px 8px; border-radius: 10px; cursor: pointer; color: var(--text); font: inherit; }
.create-opt:hover { background: var(--hover); }
.shots-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 2px; }
.shot-cell { border: 0; background: none; padding: 0; cursor: pointer; flex: 0 0 auto; text-align: left; color: inherit; font: inherit; }
.shot-thumb { width: 96px; height: 128px; border-radius: 10px; overflow: hidden; background: var(--hover); border: 1px solid var(--line); }
.shot-thumb img, .shot-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--text-soft); }
.shot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .shot-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .shot-grid .shot-thumb { width: 100%; height: auto; aspect-ratio: 3 / 4; } }
.shot-grid .shot-cell-meta { display: block; padding: 4px 2px 0; font-size: 12px; }
.shot-cell-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-cell-counts { color: var(--text-soft); display: inline-flex; align-items: center; gap: 3px; }
.shot-cell-counts svg { vertical-align: -2px; }
.shot-media { background: #111; border-radius: 12px 12px 0 0; overflow: hidden; display: flex; justify-content: center; }
.shot-media img, .shot-media video { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.shot-seq { overflow-x: auto; }
.shot-seq img { width: auto; max-width: 100%; flex: 0 0 auto; }
.shot-body { padding: 14px; }
.shot-by { display: flex; align-items: center; gap: 10px; }
.shot-author-name { font-weight: 700; }
.shot-author-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.shot-topic { font-size: 12px; color: var(--text-soft); }
.shot-caption { margin-top: 10px; font-size: 14.5px; white-space: pre-wrap; }
.shot-actions { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.shot-act { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--text-soft); font: inherit; font-size: 13.5px; }
.shot-act:hover { background: var(--hover); }
.shot-act.on { color: var(--brand); font-weight: 600; }
.shot-replies { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.shot-reply { font-size: 13.5px; }
.shot-reply-name { font-weight: 600; }
.shot-replybox { display: flex; gap: 8px; margin-top: 10px; }
.shot-replybox .input { flex: 1; }
.shot-create-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px; border: 1px dashed var(--line); border-radius: 12px; color: var(--text-soft); cursor: pointer; }
.shot-create-drop:hover { background: var(--hover); }
.sc-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.sc-cell { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.sc-cell img, .sc-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.creator-block { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.creator-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid var(--brand); border-radius: 999px; padding: 3px 10px; }
.creator-chip-sm { font-size: 11.5px; padding: 2px 8px; }
.creator-verified { color: var(--text); background: var(--card); border-color: var(--line); }
.creator-conns { font-size: 12.5px; }
.creator-bio { margin-top: 6px; font-size: 13.5px; color: var(--text); }
.creator-links { margin-top: 4px; font-size: 13px; }
.creator-links a { color: var(--brand-dark); }

/* ---------- Shared MyShot reference card (Step 8 correction) ---------- */
.shot-ref { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 4px 0 10px; cursor: pointer; transition: background .15s; }
.shot-ref:hover { background: var(--brand-soft); }
.shot-ref-thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; background: var(--hover); }
.shot-ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-ref-meta { min-width: 0; }
.shot-ref-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.shot-ref-cap { font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-ref-by { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ---------- MyShot no-preview placeholder (Step 8 micro polish) ---------- */
.shot-thumb-empty { flex-direction: column; gap: 4px; }
.shot-noph-label { font-size: 9.5px; line-height: 1.2; text-align: center; color: var(--text-soft); padding: 0 4px; }

/* ---------- MyShot viewer More button (Step 9) ---------- */
.shot-by { position: relative; }
.shot-more { position: absolute; right: 0; top: 0; }

/* Step 12B: poster-first MyShot video with a visible sound control. The
   container reserves the video's space so the poster -> playback transition
   never jumps the layout. */
.shot-video-wrap { position: relative; background: #0d0d0c; }
.shot-video-wrap video.shot-video { display: block; width: 100%; max-height: 78vh; background: #0d0d0c; }
.shot-sound {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(20, 20, 18, 0.65); color: #f5f2ea;
}
.shot-sound:hover { background: rgba(20, 20, 18, 0.85); }

/* Step 13A: subtle E2EE state - a quiet lock badge, not a security dashboard. */
.e2ee-badge { display:inline-flex; align-items:center; gap:4px; flex:none; padding:0; font-size:11px; font-weight:400; color:var(--text-soft); opacity:0.85; }
.e2ee-badge svg { display:block; }
.msg-locked { display:flex; align-items:center; gap:6px; font-style:italic; opacity:.75; }
.msg-locked svg { flex:none; }

/* ---------- Full-screen mobile MyTalk chat (Step 13B) ---------- */
/* Date separators are rendered by shared code, so they are styled globally;
   they appear on desktop too, which keeps the two layouts consistent. */
.date-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-soft); }
.date-sep::before, .date-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.chat-menu { position: absolute; top: 100%; right: 8px; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 210px; padding: 4px; display: flex; flex-direction: column; }
.chat-menu button { background: transparent; border: none; text-align: left; padding: 10px 12px; border-radius: 7px; cursor: pointer; color: var(--text); font-size: 14px; }
.chat-menu button:hover { background: var(--hover); }
.chat-menu button.danger { color: #e5484d; }
.mthread .thead { position: relative; }

/* The chat-only header extras (status line, in-conversation search) belong
   to the mobile full-screen chat; desktop stays unchanged. Step 14B: the
   overflow button is shown on desktop too, since Chat settings (read
   receipts) lives behind it and must be reachable on both form factors. */
@media (min-width: 981px) {
  .mthread .thead .ts, .chat-search { display: none !important; }
  .mthread .ov-btn { min-width: 36px; min-height: 36px; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 980px) {
  /* While a thread is open, the conversation takes over the whole screen:
     global header, search, dark toggle, bell and bottom navigation go away. */
  body.chat-open .topbar, body.chat-open .bottom-nav { display: none; }
  body.chat-open .layout { padding: 0; max-width: none; }
  body.chat-open .layout .card.card-pad-0 { border: none; border-radius: 0; }
  body.chat-open .messenger { height: 100vh; height: 100dvh; }

  /* Chat header: comfortable back target, 40px avatar, name + status. */
  body.chat-open .mthread .thead { padding: 6px 10px; gap: 10px; }
  body.chat-open .mthread .thead #backToList { min-width: 44px; min-height: 44px; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
  body.chat-open .mthread .thead .tname { line-height: 1.25; }
  body.chat-open .mthread .thead .ts { font-size: 12px; font-weight: 400; color: var(--text-soft); margin-top: 1px; }
  body.chat-open .mthread .thead .ov-btn { min-width: 44px; min-height: 44px; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }

  /* In-conversation search row under the header. */
  body.chat-open .chat-search { padding: 8px 12px; border-bottom: 1px solid var(--line); }
  body.chat-open .chat-search input { width: 100%; border: none; background: var(--hover); border-radius: 18px; padding: 9px 14px; outline: none; font-size: 14px; }
  body.chat-open .chat-search.hidden { display: none; }

  /* Composer: slightly taller, pinned at the bottom of the chat area, always
     clear of the Android safe area and (via 100dvh) the on-screen keyboard. */
  body.chat-open .mthread .mfoot { padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px)); }
  body.chat-open .mthread .mfoot input { padding: 13px 16px; font-size: 15px; min-height: 46px; }
  body.chat-open .mthread .mfoot .send-btn { width: 44px; height: 44px; }
}

/* ---------- STEP 13C: MyTalk visual language ---------- */
/* Inbox identity */
.mlist-brand { font-family: var(--font-body); font-size: 25px; font-weight: 500; letter-spacing: normal; color: var(--text); padding: 16px 16px 8px; }
.mlist-brand .b2 { font-weight: 600; }
.mlist-brand::after { content: ''; display: block; width: 22px; height: 2.5px; border-radius: 2px; background: var(--brand); margin-top: 5px; }
/* Chat header name/status stack */
.mthread .thead .tname { display: flex; flex-direction: column; min-width: 0; flex: 1; font-weight: 700; line-height: 1.25; color: var(--text); }
.mthread .thead .tname .ts { display: block; font-size: 12px; font-weight: 400; color: var(--text-soft); margin-top: 1px; }
.mthread .thead .tback { font-size: 20px; }
/* Locked (undecryptable) rows stay quiet in the timeline */
.bubble-msg .msg-locked { opacity: 0.7; }
/* Onboarding card spans the timeline */
.mbody .onboard-card { align-self: stretch; margin-top: 4px; }
@media (max-width: 980px) {
  body.chat-open .mthread .e2ee-badge span { display: none; }
  body.chat-open .mbody { padding: 16px 16px; }
  body.chat-open .bubble-msg { max-width: 84%; }
}

/* STEP 13C: long previews must never push the row meta off screen */
.mlist, .mlist-items, .mthread { min-width: 0; }
.mlist .convo .cm { min-width: 0; }

/* Step 14B: chat settings panel (per-conversation read receipts) + Read state */
.chat-menu.chat-settings { min-width: 270px; padding: 10px 12px 12px; }
.cs-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-soft); padding: 2px 2px 8px; }
.cs-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 2px 2px; cursor: pointer; }
.cs-label { font-size: 14px; color: var(--text); display: flex; flex-direction: column; gap: 3px; }
.cs-hint { font-size: 12px; color: var(--text-soft); font-weight: 400; line-height: 1.4; max-width: 195px; }
.cs-toggle { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); border: none; position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s ease; }
.cs-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); transition: left .15s ease; }
.cs-toggle:checked { background: var(--brand); }
.cs-toggle:checked::after { left: 18px; }
.msg-read { color: var(--text-soft); }

/* ---- Step 14C: disappearing messages ---- */
/* Quiet ghost left where an expired message was. */
.msg-expired { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); font-style: italic; font-size: 13px; opacity: .8; }
/* Timer tag on the message meta line. */
.msg-ttl { display: inline-flex; align-items: center; gap: 3px; color: var(--text-soft); font-size: 11px; }
.msg-ttl svg { opacity: .8; }
/* Composer timer chip next to the send button. */
.timer-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--text-soft); padding: 4px 9px; cursor: pointer; font-size: 12px; line-height: 1; }
.timer-btn:hover { color: var(--text); border-color: var(--text-soft); }
.timer-btn.on { color: var(--brand); border-color: var(--brand); }
.timer-btn .tlbl { font-weight: 500; }
/* Chat settings: disappearing row + value + radio options. */
.cs-value { color: var(--text-soft); font-size: 13px; white-space: nowrap; }
.cs-link { cursor: pointer; }
.cs-opt { cursor: pointer; padding-top: 8px; padding-bottom: 8px; }
.cs-note { display: block; padding: 0 14px 8px; }
.cs-titlerow { display: inline-flex; align-items: center; gap: 6px; }

/* 14C polish: one-time override chip (dashed ring) + picker title. */
.timer-btn.once { border-style: dashed; }
.msg-menu-title { padding: 6px 14px 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); }

/* ---- Step 14D-A: scheduled messages ---- */
.sched-btn { padding: 4px 7px; }
.sched-strip { border-top: 1px solid var(--line); padding: 8px 14px 4px; }
.sched-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 4px; }
.sched-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.sched-when { color: var(--text-soft); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.sched-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.sched-failed { color: var(--like); font-style: italic; }
.sched-cancel { background: none; border: none; color: var(--text-soft); cursor: pointer; font-size: 12.5px; padding: 2px 6px; border-radius: 6px; }
.sched-cancel:hover { color: var(--like); background: var(--hover); }
.sched-custom { display: flex; gap: 6px; padding: 7px 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.sched-custom input { flex: 1; font-size: 13px; }
.sched-custom button { background: var(--brand); color: #fff; border: none; border-radius: 7px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.sched-menu { min-width: 220px; }

/* ---- Step 14D-B: scheduled message edit/reschedule ---- */
.sched-actions { display: inline-flex; gap: 2px; white-space: nowrap; }
.sched-act { background: none; border: none; color: var(--text-soft); cursor: pointer; font-size: 12.5px; padding: 2px 6px; border-radius: 6px; }
.sched-act:hover { color: var(--brand); background: var(--hover); }
.sched-editing { align-items: center; }
.sched-edit-input { flex: 1; min-width: 0; font-size: 13.5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.sched-edit-input:focus { outline: none; border-color: var(--brand); }
.sched-resched { flex: 1; border-top: none; padding: 0; margin-top: 0; }
.sched-resched button { background: var(--brand); color: #fff; border: none; border-radius: 7px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.sched-resched .sched-cancel { background: none; color: var(--text-soft); }

/* 14D-B mobile scheduled rows: keep the message and failure reason readable. */
@media (max-width: 600px) {
  .sched-row:not(.sched-editing) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 8px; }
  .sched-row:not(.sched-editing) .sched-when { grid-column: 1 / -1; }
  .sched-row:not(.sched-editing) .sched-preview { grid-column: 1; overflow: hidden; overflow-wrap: anywhere; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .sched-row:not(.sched-editing) .sched-actions { grid-column: 2; }
  .sched-resched input { min-width: 0; }
}

/* 14G-A: visible preferences and a best-effort overlay, never a storage boundary. */
.mytalk-privacy-settings { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.privacy-control { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.privacy-control input { margin-top: 3px; flex: none; accent-color: var(--brand); }
.privacy-control strong { display: block; font-size: 13px; line-height: 1.4; }
.privacy-control small { display: block; color: var(--text-soft); font-size: 12px; line-height: 1.5; margin-top: 3px; }
.mytalk-privacy-cover:not([hidden]) { position: fixed; inset: 0; z-index: 2147483647; display: grid; place-items: center; background: var(--bg); color: var(--text); text-align: center; padding: 24px; }
.mytalk-privacy-cover strong { display: block; font-size: 22px; margin-bottom: 8px; }
.mytalk-privacy-cover span { font-size: 13px; color: var(--text-soft); }
