/* ==========================================================================
   Kinky Zone — design system
   ========================================================================== */

:root {
  /* Dark Theme Default */
  --bg-main: #111111;
  --bg-surface: #2A2A35;
  --bg-card: #20202B;
  --primary: #C8102E;
  --accent-messaging: #E57373;
  --accent-notifications: #8E44AD;
  --tertiary-graphs: #F39C12;
  --text-main: #EEEEEE;
  --text-muted: #A0A0B0;
  --border-color: #3A3A48;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-card: 16px;
  --radius-button: 9999px;
  --radius-avatar: 50%;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.25);

  --max-width-desktop: 1200px;
  --feed-width: 600px;
  --sidebar-width: 260px;
  --header-height: 56px;
  --nav-bottom-height: 64px;
  --golden: #F1C40F;
}

[data-theme="light"] {
  --bg-main: #F4F5F8;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-main: #111111;
  --text-muted: #666666;
  --border-color: #E2E4EB;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.45;
  min-height: 100vh;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 50%, transparent) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 45%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-muted) 70%, transparent);
  background-clip: padding-box;
  border: 2px solid transparent;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-surface);
}

.btn-gasm {
  width: 100%;
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  font-size: 1rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-avatar);
  background: transparent;
  border: none;
  color: var(--text-muted);
}

.btn-icon:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.logo-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--primary), #8B0A1E);
  box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.25);
  position: relative;
}

.logo-dot::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.guest-gate-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  object-fit: contain;
  display: block;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  max-width: var(--max-width-desktop);
  margin: 0 auto;
}

.app-sidebar {
  display: none;
}

/* Icon safety — never let SVGs blow up to viewport size (FOUC / bfcache) */
.app-shell svg,
.bottom-nav svg,
.auth-layout svg,
.gasm-actions svg,
.btn-icon svg {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
}

.gasm-action svg {
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
}

.badge-icon svg {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 9999px;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.05rem;
}

.nav-link:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.nav-link.is-active {
  color: var(--primary);
}

.nav-link svg {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  flex-shrink: 0;
}

.app-main {
  min-width: 0;
  border-left: none;
  border-right: none;
  padding-bottom: calc(var(--nav-bottom-height) + env(safe-area-inset-bottom, 0px));
}

.app-aside {
  display: none;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg-main) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.top-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.feed-column {
  max-width: var(--feed-width);
  margin: 0 auto;
  width: 100%;
}

.page-pad {
  padding: 16px;
}

/* --------------------------------------------------------------------------
   Desktop sidebar
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .app-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 16px;
    gap: 8px;
  }

  .app-main {
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding-bottom: 0;
  }

  .bottom-nav {
    display: none !important;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 24px;
    flex: 1;
  }

  .sidebar-cta {
    margin-top: auto;
    padding-top: 16px;
  }
}

@media (min-width: 1100px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, var(--feed-width)) 1fr;
  }

  .app-aside {
    display: block;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 16px;
    overflow: auto;
  }

  .aside-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow-card);
  }

  .aside-card h2 {
    margin: 0 0 8px;
    font-size: 1rem;
  }

  .aside-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
  }

  body.layout-messages .app-shell {
    max-width: 1400px;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }
}

/* Messages uses full main column — no trends rail */
body.layout-messages .feed-column {
  max-width: none;
}
body.layout-messages .page-pad {
  padding: 12px 16px 16px;
}
@media (min-width: 900px) {
  body.layout-messages .page-pad {
    padding: 12px 20px 20px;
  }
  body.layout-messages .app-main {
    border-right: none;
  }
}

/* --------------------------------------------------------------------------
   Mobile bottom navigation
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-bottom-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.bottom-nav a svg {
  width: 24px;
  height: 24px;
}

.bottom-nav a.is-active {
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   Gasm card (shell styles for Phase 2)
   -------------------------------------------------------------------------- */
.gasm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}

.gasm-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-avatar);
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.avatar--lg {
  width: 72px;
  height: 72px;
}

.gasm-meta {
  flex: 1;
  min-width: 0;
}

.gasm-meta .name {
  font-weight: 700;
}

.gasm-meta .handle,
.gasm-meta .time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.gasm-body {
  margin: 12px 0 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.gasm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 420px;
  margin-top: 4px;
}

.gasm-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 9999px;
  font-size: 0.85rem;
}

.gasm-action:hover {
  background: var(--bg-surface);
  color: var(--text-main);
}

.gasm-action.is-liked {
  color: var(--primary);
}

.gasm-action.is-golden {
  color: var(--golden);
}

.gasm-action svg {
  width: 18px;
  height: 18px;
}

/* --------------------------------------------------------------------------
   Empty / placeholder states
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state h2 {
  color: var(--text-main);
  margin: 0 0 8px;
}

.composer-shell {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 16px;
}

.composer-shell textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-main);
  font: inherit;
  line-height: 1.45;
}

.composer-shell--pro {
  padding: 14px 16px 12px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.06);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-card) 92%, var(--bg-surface)) 0%, var(--bg-card) 100%);
}
.composer-shell--pro textarea {
  min-height: 72px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.composer-shell--pro:focus-within {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border-color));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.08);
}
.composer-shell--reply {
  margin-top: 12px;
}
.composer-shell--guest {
  color: var(--text-muted);
}
.composer-shell--guest p { margin: 0; }
.composer-shell--guest a { color: var(--primary); font-weight: 600; }

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  min-width: 0;
}

.composer-tool {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}
.composer-tool:hover,
.composer-tool[aria-pressed="true"],
.composer-tool[aria-expanded="true"],
.composer-tool.is-active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
label.composer-tool { margin: 0; }

.composer-tool-wrap { position: relative; }

.composer-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  min-width: 240px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: composer-pop 0.14s ease-out;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@keyframes composer-pop {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.composer-popover[hidden] { display: none !important; }
.composer-popover-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.composer-select,
.composer-datetime {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border-color) 85%, transparent);
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.3;
}
.composer-datetime:focus,
.composer-select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-color));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.composer-popover--schedule {
  min-width: 260px;
  max-width: min(300px, calc(100vw - 40px));
}
.composer-popover-cta {
  width: 100%;
  margin: 0;
  justify-content: center;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 650;
}
.composer-popover--emoji {
  min-width: 280px;
  max-width: min(320px, calc(100vw - 48px));
  padding-right: 8px;
  gap: 8px;
}
.composer-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 55%, transparent) transparent;
}
.composer-emoji-grid::-webkit-scrollbar {
  width: 6px;
  height: 0;
}
.composer-emoji-grid::-webkit-scrollbar-track {
  background: transparent;
}
.composer-emoji-grid::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 55%, transparent);
  border-radius: 999px;
}
.composer-emoji-grid::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-muted) 80%, transparent);
}
.composer-emoji-btn {
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  padding: 6px 2px;
  cursor: pointer;
  min-width: 0;
}
.composer-emoji-btn:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.composer-place-input {
  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
}
.composer-place-input[hidden] { display: none !important; }

.composer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.composer-chips[hidden] { display: none !important; }
.composer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 550;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--text-main);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border-color));
}
.composer-chip button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}
.composer-chip button:hover { color: var(--text-main); }

.composer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
}
.composer-btn-quiet {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.composer-btn-quiet:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}
.composer-actions .btn-primary {
  min-width: 88px;
  justify-content: center;
  border-radius: 9999px;
  padding: 8px 18px;
  font-weight: 700;
}

.char-count {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  min-width: 3.5rem;
  text-align: right;
}

.char-count.is-warn {
  color: var(--tertiary-graphs);
}

.char-count.is-over {
  color: var(--accent-messaging);
}

@media (max-width: 560px) {
  .composer-footer {
    align-items: flex-start;
  }
  .composer-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .composer-popover,
  .composer-popover--schedule {
    left: auto;
    right: 0;
    min-width: min(260px, calc(100vw - 48px));
  }
}

/* --------------------------------------------------------------------------
   Auth layout
   -------------------------------------------------------------------------- */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(200, 16, 46, 0.18), transparent 45%),
    radial-gradient(ellipse at 80% 90%, rgba(142, 68, 173, 0.12), transparent 40%),
    var(--bg-main);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
}

.auth-card h1 {
  margin: 16px 0 8px;
  font-size: 1.5rem;
}

.auth-card .muted {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Public invite landing */
.invite-landing {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  z-index: 1;
}
.invite-landing-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(200, 16, 46, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(142, 68, 173, 0.16), transparent 50%),
    radial-gradient(ellipse 40% 35% at 10% 70%, rgba(243, 156, 18, 0.08), transparent 45%);
  z-index: 0;
}
.invite-landing-brand {
  text-align: center;
  margin-bottom: 28px;
}
.invite-landing-brand .brand-mark {
  display: inline-flex;
  justify-content: center;
}
.invite-landing-card {
  position: relative;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border-color));
  border-radius: 22px;
  padding: 32px 28px 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  text-align: center;
}
.invite-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.invite-title {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 5vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.invite-lede {
  margin: 0 auto 24px;
  max-width: 28rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
}
.invite-meter { margin-bottom: 22px; }
.invite-meter-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-surface);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.invite-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #e57373);
  transition: width 0.35s ease;
}
.invite-meter-label {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.invite-meter-label strong {
  color: var(--text-main);
  font-size: 1.05rem;
}
.invite-claim-btn {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 1.02rem;
  font-weight: 700;
}
.invite-hint {
  margin: 12px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.invite-result {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: left;
}
.invite-result-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.invite-result-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.invite-result-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
}
.invite-result .btn-primary {
  width: 100%;
  justify-content: center;
}
.invite-footer {
  margin: 22px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.invite-footer a { color: var(--primary); font-weight: 600; }

.theme-mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  gap: 2px;
}
.theme-mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.theme-mode-btn.is-active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.theme-mode-btn:hover:not(.is-active) {
  color: var(--text-main);
}

.guest-gate {
  max-width: 28rem;
  margin: 12px auto 32px;
  padding: 28px 8px 8px;
  text-align: center;
}
.guest-gate-brand {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 650;
}
.guest-gate-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.guest-gate-lede {
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.5;
}
.guest-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
}
.guest-gate-actions .btn {
  min-width: 120px;
  justify-content: center;
}
.guest-gate-points {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  display: grid;
  gap: 10px;
}
.guest-gate-points li {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --------------------------------------------------------------------------
   Forms, auth, profile, settings, admin, feed extras
   -------------------------------------------------------------------------- */
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--text-muted); }
.stack-form input, .stack-form textarea, .stack-form select, .search-box input, .select-mini {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-color);
  background: var(--bg-surface); color: var(--text-main); font: inherit;
}
.stack-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.check-row { flex-direction: row !important; align-items: flex-start; gap: 10px !important; color: var(--text-main) !important; }
.hint { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }
.form-error { background: rgba(229,115,115,0.15); color: var(--accent-messaging); border: 1px solid rgba(229,115,115,0.35); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.form-ok { background: rgba(46,204,113,0.12); color: #2ecc71; border: 1px solid rgba(46,204,113,0.35); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.signup-success {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  color: var(--text-main);
}
.signup-success strong {
  color: #2ecc71;
  font-size: 1.05rem;
}
.signup-success p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.handle-input {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 12px;
  min-height: 44px;
}
.handle-input:focus-within {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border-color));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.handle-input > span {
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}
.handle-input input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 12px 0 !important;
  border-radius: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}
.handle-input input:focus,
.handle-input input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.handle-input input:-webkit-autofill,
.handle-input input:-webkit-autofill:hover,
.handle-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-main);
  caret-color: var(--text-main);
  transition: background-color 99999s ease-in-out 0s;
  box-shadow: 0 0 0 1000px var(--bg-surface) inset !important;
}
.auth-card--wide { max-width: 480px; }
.avatar-upload { display: flex; align-items: center; gap: 16px; }
.onboard-avatar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 8px;
}
.onboard-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}
.onboard-avatar-img {
  width: 88px !important;
  height: 88px !important;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  background: var(--bg-surface);
}
.onboard-avatar-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.onboard-avatar-btn:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border-color));
}
.onboard-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.onboard-avatar-meta strong {
  color: var(--text-main);
  font-size: 0.95rem;
}
.avatar-fallback { background: linear-gradient(135deg, var(--primary), var(--accent-notifications)); display: inline-block; }
.avatar--xl { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--bg-main); object-fit: cover; }

.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: rgba(142,68,173,0.15); border: 1px solid rgba(142,68,173,0.35); color: var(--text-main); font-size: 0.9rem; }

.feed-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.feed-tabs-track {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.feed-tabs-track::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.feed-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.feed-tab.is-active {
  color: var(--text-main);
  border-bottom-color: var(--primary);
}

.gasm-meta-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.gasm-more { margin-left: auto; }
.gasm-media {
  display: grid;
  gap: 2px;
  margin: 12px 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--border-color);
  max-height: min(510px, 70vh);
}
.gasm-media--1 {
  display: block;
  max-height: none;
  background: transparent;
}
.gasm-media--1 .gasm-media-btn,
.gasm-media--1 .gasm-video {
  display: block;
  width: 100%;
  height: auto;
}
.gasm-media--1 img {
  width: 100%;
  height: auto;
  max-height: min(510px, 70vh);
  object-fit: cover;
  display: block;
  background: var(--bg-surface);
}
.gasm-media--1 .gasm-video {
  max-height: min(510px, 70vh);
  width: 100%;
  background: #000;
}
.gasm-media--2 {
  grid-template-columns: 1fr 1fr;
  aspect-ratio: 2 / 1;
}
.gasm-media--3 {
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1.55 / 1;
}
.gasm-media--3 > :first-child {
  grid-row: 1 / -1;
}
.gasm-media--4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1.45 / 1;
}
.gasm-media .gasm-media-btn,
.gasm-media .gasm-video {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.gasm-media:not(.gasm-media--1) img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: none;
  background: var(--bg-surface);
}
.gasm-media:not(.gasm-media--1) .gasm-video {
  object-fit: cover;
  background: #000;
}
.gasm-media-btn {
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  cursor: zoom-in;
  display: block;
}
.gasm-media-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  z-index: 1;
}
.golden-badge { background: var(--golden); color: #111; font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 9999px; }
.composer-media-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}
.composer-media-preview[data-count="1"] { grid-template-columns: 1fr; }
.composer-media-preview[data-count="2"] { grid-template-columns: 1fr 1fr; }
.composer-media-preview[data-count="3"] { grid-template-columns: 1fr 1fr 1fr; }
.composer-media-preview[data-count="4"] { grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) {
  .composer-media-preview[data-count="3"] { grid-template-columns: 1fr 1fr; }
  .composer-media-preview[data-count="3"] .media-preview-item:first-child { grid-column: 1 / -1; }
}
.composer-media-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; display: block; }
.composer-alt-fields { display: none !important; }

.profile-cover { aspect-ratio: 3 / 1; background: linear-gradient(120deg, var(--bg-surface), var(--primary)); background-size: cover; background-position: center; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.profile-body { padding: 0 12px 16px; }
.profile-avatar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: -48px;
}
.profile-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 4px;
  min-width: 0;
}
.profile-actions .btn {
  padding: 7px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
  line-height: 1.2;
}
.profile-actions .profile-more-wrap {
  margin-left: 0;
  flex-shrink: 0;
}
.profile-actions .profile-more-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.profile-name { margin: 12px 0 0; font-size: 1.4rem; }
.profile-handle { margin: 2px 0 8px; color: var(--text-muted); }
.profile-bio { margin: 0 0 8px; }
.profile-meta-line { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }
.profile-link { color: var(--primary); }
.profile-counts { display: flex; gap: 16px; margin: 12px 0; }
.count-btn { background: none; border: none; color: var(--text-main); cursor: pointer; padding: 0; font: inherit; }
.profile-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: var(--header-height);
  background: var(--bg-main);
  z-index: 20;
}
.profile-tabs a {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.profile-tabs a.is-active {
  color: var(--text-main);
  border-bottom-color: var(--primary);
}
.badge-stack { display: flex; margin: 8px 0; }
.badge-icon { width: 28px; height: 28px; margin-left: -6px; background: var(--bg-card); border-radius: 50%; border: 2px solid var(--bg-main); display: inline-flex; align-items: center; justify-content: center; color: var(--tertiary-graphs); }
.badge-icon svg { width: 16px; height: 16px; }
.badge-icon:first-child { margin-left: 0; }

.settings-shell { display: flex; flex-direction: column; gap: 20px; }
.settings-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 4px 2px 8px;
}
.settings-title { margin: 0; font-size: 1.55rem; letter-spacing: -0.02em; }
.settings-lede { margin: 6px 0 0; color: var(--text-muted); font-size: 0.95rem; max-width: 36rem; }
.settings-hero-avatar { flex-shrink: 0; }

.settings-layout {
  display: block;
  max-width: 40rem;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  overflow: visible;
}
.settings-shell[data-settings-view="detail"] .settings-nav,
.settings-shell[data-settings-view="detail"] [data-settings-hero] {
  display: none;
}
.settings-shell[data-settings-view="menu"] .settings-main {
  display: none !important;
}

.settings-nav-btn {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-radius: 14px;
  padding: 14px 16px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.settings-nav-btn:hover {
  background: var(--bg-surface);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border-color));
}
.settings-nav-btn:active {
  transform: scale(0.995);
}
.settings-nav-btn.is-active {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border-color));
}
.settings-nav-btn--danger {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border-color));
}
.settings-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.settings-nav-label {
  display: block;
  font-weight: 650;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.settings-nav-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 450;
  white-space: normal;
}
.settings-nav-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  flex-shrink: 0;
  opacity: 0.7;
}

.settings-back {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 4px 0 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.settings-back:hover { color: var(--primary); }

.settings-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.settings-pane[hidden] { display: none !important; }
.settings-pane { display: flex; flex-direction: column; gap: 14px; }
.settings-pane-head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.settings-pane-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-card);
}
.settings-card--flush { padding: 0; overflow: hidden; }
.settings-card-intro {
  margin: 0 0 16px;
  padding: 0;
}
.settings-card--flush .settings-card-intro {
  padding: 18px 18px 16px;
  margin-bottom: 0;
}
.settings-card h3,
.settings-card-intro h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 650;
}
.settings-card-intro .muted {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.settings-card > .muted { margin-top: 0; }

.totp-setup .hint { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.totp-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  width: 252px;
  max-width: 100%;
  box-sizing: border-box;
}
.totp-qr svg,
.totp-qr img {
  display: block !important;
  width: 220px !important;
  height: 220px !important;
  max-width: none !important;
  border-radius: 4px;
}
.totp-secret {
  display: block;
  word-break: break-all;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.profile-media-studio { margin-top: 4px; }
.profile-media-cover {
  position: relative;
  aspect-ratio: 3 / 1;
  width: 100%;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--bg-surface) 55%, #1a1a22), color-mix(in srgb, var(--primary) 55%, #2a0a12));
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-color);
}
.profile-media-cover-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  appearance: none;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.profile-media-cover-btn:hover { background: rgba(0, 0, 0, 0.72); }

.profile-media-body {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "avatar meta"
    "avatar actions";
  gap: 10px 14px;
  align-items: end;
  padding: 0 16px 16px;
  margin-top: -36px;
}
.profile-media-avatar-wrap {
  grid-area: avatar;
  position: relative;
  width: 88px;
  height: 88px;
}
.profile-media-avatar {
  width: 88px !important;
  height: 88px !important;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  background: var(--bg-surface);
}
.profile-media-avatar-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.profile-media-avatar-btn:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border-color));
}
.profile-media-meta {
  grid-area: meta;
  min-width: 0;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-media-meta strong {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-media-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-media-actions .btn {
  padding: 7px 12px;
  font-size: 0.82rem;
  margin: 0;
  cursor: pointer;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .settings-form-grid { grid-template-columns: 1fr 1fr; }
  .settings-span-2 { grid-column: 1 / -1; }
}
.settings-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.settings-country-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-country-field > label:first-child {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.settings-country-show {
  margin: 0;
  padding-left: 2px;
  font-size: 0.85rem;
  color: var(--text-main) !important;
}

.settings-card--privacy {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border-color));
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--primary) 10%, transparent),
      transparent 55%
    ),
    var(--bg-card);
}
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.settings-toggle-copy {
  min-width: 0;
  flex: 1;
}
.settings-toggle-copy h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}
.settings-toggle-copy .muted {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.settings-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}
.settings-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.settings-switch-ui {
  display: block;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 35%, var(--bg-surface));
  border: 1px solid var(--border-color);
  transition: background 0.18s ease, border-color 0.18s ease;
  position: relative;
}
.settings-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease;
}
.settings-switch input:checked + .settings-switch-ui {
  background: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 70%, #000);
}
.settings-switch input:checked + .settings-switch-ui .settings-switch-thumb {
  transform: translateX(22px);
}
.settings-switch input:focus-visible + .settings-switch-ui {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
@media (max-width: 520px) {
  .settings-toggle-row {
    align-items: flex-start;
  }
}

.appearance-mode-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.appearance-mode-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.appearance-mode-copy strong { font-size: 0.92rem; }
.appearance-mode-copy .muted { margin: 0; font-size: 0.82rem; }

.settings-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  vertical-align: middle;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.settings-pill.is-ok {
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.1);
}
.settings-flash {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
}
.settings-flash.is-ok {
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.1);
}
.settings-btn-danger {
  background: #8B0000 !important;
  border-color: #8B0000 !important;
}

/* Legacy aliases used by other pages */
.settings-page { display: flex; flex-direction: column; gap: 16px; }
.settings-panel { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-card); padding: 20px; box-shadow: var(--shadow-card); }
.settings-panel h2 { margin: 0 0 8px; font-size: 1.1rem; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-color); margin-bottom: 12px; gap: 12px; }

.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  line-height: 1.4;
}
.notif-item > div:last-child { min-width: 0; flex: 1; }
.notif-item .avatar,
.notif-item .avatar-fallback {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-item.is-unread {
  background: color-mix(in srgb, var(--accent-notifications) 8%, transparent);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 10px;
}
.notif-item--broadcast {
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border-color));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 6%, var(--bg-card));
  box-shadow: none;
}
.notif-item--broadcast.is-unread {
  margin: 6px 0;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
}
.notif-broadcast-mark {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  box-shadow: none;
}
.notif-broadcast-mark svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}
.notif-broadcast { min-width: 0; flex: 1; }
.notif-broadcast-label {
  margin: 0 0 2px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}
.notif-broadcast-body,
.notif-snippet {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-main);
  word-break: break-word;
}
.notif-snippet { margin-top: 4px; }
.notif-broadcast-body a,
.notif-snippet a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.notif-broadcast-body a:hover,
.notif-snippet a:hover {
  text-decoration: underline;
}
.notif-broadcast-body.is-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.86rem;
}
.notif-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-main);
}
.notif-line a { color: inherit; text-decoration: none; }
.notif-line a:hover { color: var(--primary); }
.notif-verb { color: var(--text-muted); font-weight: 450; }
.notif-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.notif-foot .time { color: inherit; }
.notif-foot a {
  color: var(--text-muted);
  font-weight: 550;
  text-decoration: none;
}
.notif-foot a:hover { color: var(--primary); }
.notif-foot .hint { font-size: inherit; }
.search-box { display: flex; gap: 8px; margin-bottom: 16px; }
.search-box input { flex: 1; }
.search-h { font-size: 1rem; margin: 16px 0 8px; }
.search-row { display: block; padding: 12px 0; border-bottom: 1px solid var(--border-color); color: inherit; text-decoration: none; }
.search-row .handle { margin-right: 6px; }
.search-gasms { margin-top: 4px; }
.search-gasms .gasm-card:last-child { border-bottom: none; }
.wtf-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }

.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 700px) { .admin-stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; }
.stat strong { display: block; font-size: 1.5rem; }
.stat span { color: var(--text-muted); font-size: 0.85rem; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; margin: 4px 0; }
.bar { height: 8px; background: var(--primary); border-radius: 9999px; }
.report-row, .audit-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.inline-form input { flex: 1; min-width: 120px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); }

/* DMs */
.dm-layout {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100dvh - var(--header-height) - var(--nav-bottom-height) - 40px);
  min-height: 420px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
@media (min-width: 700px) {
  .dm-layout {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    height: calc(100dvh - var(--header-height) - 48px);
    min-height: 520px;
  }
}
@media (min-width: 900px) {
  .dm-layout {
    height: calc(100dvh - var(--header-height) - 44px);
  }
}

.dm-inbox {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  min-height: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-card) 92%, var(--bg-surface));
}
.dm-inbox-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.dm-inbox-empty {
  padding: 28px 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.dm-new {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.dm-new input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.92rem;
}
.dm-new input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-color));
}
.dm-new .btn {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.dm-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
  color: inherit;
  position: relative;
  transition: background 0.12s ease;
}
.dm-row:hover { background: var(--bg-surface); }
.dm-row.is-active {
  background: color-mix(in srgb, var(--primary) 12%, var(--bg-surface));
}
.dm-row.is-unread { box-shadow: inset 3px 0 0 var(--accent-messaging); }
.dm-row .avatar,
.dm-row .avatar-fallback {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.dm-row-body { flex: 1; min-width: 0; }
.dm-row-body p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 0.95rem;
}
.dm-row-top strong { font-weight: 650; }
.dm-row-top time { color: var(--text-muted); font-size: 0.75rem; flex-shrink: 0; }
.dm-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.dm-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--bg-card);
}
.dm-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-surface));
}
.dm-thread-head > a:last-of-type {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.dm-thread-head .avatar,
.dm-thread-head .avatar-fallback {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.dm-thread-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dm-thread-meta strong {
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.2;
}
.dm-thread-meta .handle {
  color: var(--text-muted);
  font-size: 0.86rem;
}
.dm-back {
  font-size: 1.25rem;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text-muted);
  line-height: 1;
}
.dm-back:hover { background: var(--bg-surface); color: var(--text-main); }
@media (min-width: 700px) { .dm-back { display: none; } }

.dm-messages {
  flex: 1;
  overflow: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 60%);
}
.dm-bubble {
  max-width: min(72%, 520px);
  padding: 11px 14px;
  border-radius: 16px;
  background: var(--bg-surface);
  align-self: flex-start;
  border: 1px solid color-mix(in srgb, var(--border-color) 65%, transparent);
}
.dm-bubble.is-mine {
  background: color-mix(in srgb, var(--primary) 28%, var(--bg-surface));
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border-color));
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}
.dm-bubble:not(.is-mine) { border-bottom-left-radius: 6px; }
.dm-bubble p { margin: 0; line-height: 1.45; word-break: break-word; }
.dm-bubble time { display: block; margin-top: 4px; font-size: 0.7rem; color: var(--text-muted); }

.dm-empty {
  margin: auto;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  max-width: 28rem;
}
.dm-empty h2 {
  margin: 0 0 8px;
  color: var(--text-main);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.dm-empty p { margin: 0; line-height: 1.5; font-size: 0.95rem; }

.dm-compose {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg-card) 90%, var(--bg-surface));
}
.dm-compose .dm-media-preview {
  grid-column: 1 / -1;
}
.dm-attach {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.dm-attach:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}
.dm-compose textarea {
  width: 100%;
  min-height: 42px;
  max-height: 140px;
  resize: none;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 11px 14px;
  line-height: 1.4;
  font: inherit;
  field-sizing: content;
}
.dm-compose textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border-color));
}
.dm-compose .btn-primary {
  min-width: 72px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 650;
}

@media (max-width: 699px) {
  .dm-layout--open .dm-inbox { display: none; }
  .dm-layout--open .dm-thread {
    min-height: calc(100dvh - var(--nav-bottom-height, 56px) - 72px);
  }
  .dm-layout:not(.dm-layout--open) .dm-thread { display: none; }
  .dm-layout:not(.dm-layout--open) {
    height: calc(100dvh - var(--header-height) - var(--nav-bottom-height) - 40px);
  }
}
.gasm-menu-wrap { margin-left: auto; position: relative; }
.gasm-menu { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 160px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-card); padding: 6px; display: flex; flex-direction: column; }
.gasm-menu[hidden] { display: none !important; }
.gasm-menu button { background: none; border: none; text-align: left; padding: 10px 12px; color: var(--text-main); border-radius: 8px; cursor: pointer; font: inherit; }
.gasm-menu button:hover { background: var(--bg-surface); }
.undo-toast { position: fixed; bottom: calc(var(--nav-bottom-height) + 16px); left: 50%; transform: translateX(-50%); z-index: 80; background: var(--bg-surface); border: 1px solid var(--border-color); color: var(--text-main); padding: 12px 16px; border-radius: 9999px; box-shadow: var(--shadow-card); }
.undo-toast button { margin-left: 10px; background: none; border: none; color: var(--primary); font-weight: 700; cursor: pointer; }
@media (min-width: 900px) { .undo-toast { bottom: 24px; } }
.app-toast { position: fixed; bottom: calc(var(--nav-bottom-height) + 16px); left: 50%; transform: translateX(-50%) translateY(12px); z-index: 90; background: var(--bg-elevated, var(--bg-surface)); border: 1px solid var(--border-color); color: var(--text-main); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-card); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: min(90vw, 360px); text-align: center; font-size: 0.92rem; }
.app-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .app-toast { bottom: 28px; } }
.modal-sheet { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; justify-content: center; }
.modal-sheet[hidden] { display: none !important; }
.modal-card { width: 100%; max-width: 420px; background: var(--bg-card); border-radius: 16px 16px 0 0; padding: 20px; border: 1px solid var(--border-color); }
.modal-card textarea { width: 100%; box-sizing: border-box; padding: 10px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); }
@media (min-width: 600px) { .modal-sheet { align-items: center; } .modal-card { border-radius: 16px; } }

/* Explore + analytics + crop */
.explore-h { font-size: 1.05rem; margin: 20px 0 10px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tag-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 9999px; background: var(--bg-card); border: 1px solid var(--border-color); font-size: 0.9rem; font-weight: 600; }
.tag-pill em { font-style: normal; color: var(--text-muted); font-weight: 500; font-size: 0.8rem; }
.media-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }
.media-gallery-item { aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--bg-surface); display: block; border: none; padding: 0; cursor: zoom-in; width: 100%; }
.media-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.premium-claim { margin: 12px 0; padding: 14px; border-radius: 12px; border: 1px solid rgba(243,156,18,0.45); background: rgba(243,156,18,0.08); }
.analytics-modal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.analytics-modal-grid .stat { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; }
.analytics-modal-grid .stat strong { display: block; font-size: 1.25rem; }
.analytics-modal-grid .stat span { color: var(--text-muted); font-size: 0.8rem; }
.people-grid { display: grid; gap: 10px; margin-bottom: 8px; }
@media (min-width: 600px) { .people-grid { grid-template-columns: 1fr 1fr; } }
.person-card { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-card); border: 1px solid var(--border-color); background: var(--bg-card); color: inherit; }
.person-card p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.85rem; }
.analytics-panel { margin: 12px 0 20px; padding: 16px; border-radius: var(--radius-card); border: 1px solid var(--border-color); background: var(--bg-card); }
.analytics-panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.analytics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.gasm-menu a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text-main); text-decoration: none; }
.gasm-menu a:hover { background: var(--bg-surface); }
.crop-card .crop-stage { display: flex; justify-content: center; margin: 12px 0; }
.crop-card .crop-hint { margin: 0 0 4px; font-size: 0.85rem; }
.crop-card .crop-zoom-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.crop-card .crop-zoom-label input { flex: 1; }
.crop-card canvas {
  width: 280px;
  height: 280px;
  max-width: 100%;
  border-radius: 12px;
  touch-action: none;
  cursor: grab;
  background: #111;
}
.crop-card--wide { max-width: min(560px, 96vw); }
.crop-card--wide canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
}
.crop-actions { display: flex; gap: 8px; margin-top: 12px; }
.crop-actions .btn { flex: 1; }

/* Stage extras: lightbox, media buttons, settings media, danger */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px 40px;
}
.lightbox[hidden] { display: none !important; }
.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}
.lightbox img {
  max-width: min(96vw, 1200px);
  max-height: calc(100vh - 120px);
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.16); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 20, 24, 0.72);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}
.lightbox-nav:hover { background: rgba(40, 40, 48, 0.9); }
.lightbox-nav[hidden] { display: none !important; }
.lightbox-nav svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-meta {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  z-index: 2;
}
.lightbox-count { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.lightbox-gasm {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}
.lightbox-gasm:hover { border-bottom-color: #fff; }
@media (max-width: 700px) {
  .lightbox { padding: 56px 12px 52px; }
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox img { max-height: calc(100vh - 140px); }
}
.composer-alt-fields { display: none !important; }
.media-settings { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cover-preview { aspect-ratio: 3 / 1; width: 100%; min-width: 200px; border-radius: 12px; background: linear-gradient(120deg, var(--bg-surface), var(--primary)); background-size: cover; background-position: center; border: 1px solid var(--border-color); }
.danger-zone { border-color: rgba(200,16,46,0.45) !important; }
.gasm-body a { color: var(--primary); }

/* Stage: connections, mentions, lists, reports */
.composer-input-wrap { position: relative; }
.mention-suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
  margin-top: 4px; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 12px; box-shadow: var(--shadow-card); max-height: 240px; overflow: auto;
  display: flex; flex-direction: column; padding: 4px;
}
.mention-suggest[hidden] { display: none !important; }
.mention-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; color: var(--text-main); padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font: inherit;
}
.mention-item:hover, .mention-item.is-active { background: var(--bg-surface); }
.mention-item .handle { color: var(--text-muted); font-size: 0.85rem; }
.avatar--sm { width: 32px; height: 32px; }
.request-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border-color);
}
.request-user { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.request-user .handle { color: var(--text-muted); font-size: 0.85rem; }
.request-actions { display: flex; gap: 8px; flex-shrink: 0; }
.modal-card--list { max-height: min(80vh, 560px); display: flex; flex-direction: column; }
.modal-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-list-head h3 { margin: 0; }
.user-list { overflow: auto; flex: 1; }
.user-list-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid var(--border-color); color: inherit; text-decoration: none;
}
.user-list-row .handle { color: var(--text-muted); font-size: 0.85rem; }
.report-reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.report-reasons label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.regasm-banner {
  display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: 6px;
}
.regasm-banner svg { width: 14px; height: 14px; }
.regasm-banner a { color: var(--text-muted); font-weight: 600; }
.regasm-quote {
  margin: 0 0 10px; padding: 10px 12px; border-left: 3px solid var(--primary);
  background: var(--bg-surface); border-radius: 0 10px 10px 0; color: var(--text-main);
}
.quote-embed {
  display: block; margin: 8px 0 10px; padding: 12px; border: 1px solid var(--border-color);
  border-radius: 14px; background: var(--bg-surface); color: inherit; text-decoration: none;
}
.quote-embed:hover { border-color: var(--primary); }
.quote-embed-head { display: block; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 4px; }
.quote-embed-body { display: block; font-size: 0.92rem; line-height: 1.4; color: var(--text-main); }
.quote-embed-media {
  display: grid; gap: 4px; margin-top: 8px; border-radius: 10px; overflow: hidden;
}
.quote-embed-media--1 { grid-template-columns: 1fr; }
.quote-embed-media--2 { grid-template-columns: 1fr 1fr; }
.quote-embed-media--3, .quote-embed-media--4 { grid-template-columns: 1fr 1fr; }
.quote-embed-thumb {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-muted, #eee);
}
.quote-embed-thumb--video {
  position: relative;
}
.quote-embed-thumb--video::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,.45) 0 18%, transparent 19%) ,
    linear-gradient(transparent, transparent);
  background-color: #1a1a1a;
}
.reply-banner svg { width: 14px; height: 14px; }
.edited-label { font-size: 0.75rem; color: var(--text-muted); margin-left: 4px; }
.pin-banner {
  font-size: 0.75rem; font-weight: 700; color: var(--tertiary-graphs);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.nav-icon-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge {
  position: absolute; top: -6px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9999px; background: var(--primary); color: #fff; font-size: 0.65rem;
  font-weight: 700; line-height: 16px; text-align: center;
}
.nav-badge[hidden] { display: none !important; }
.trend-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border-color); color: inherit; text-decoration: none;
  font-size: 0.9rem;
}
.trend-row:last-child { border-bottom: none; }
.online-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #2ecc71; margin-left: 4px; vertical-align: middle;
}
#composer-modal .composer-shell { margin: 0; border: none; box-shadow: none; padding: 0; }
#composer-modal .composer-shell textarea { min-height: 100px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Phase 11: a11y, notifs, DMs */
/* API docs */
.api-docs {
  max-width: 40rem;
  margin: 0 auto;
  padding: 8px 0 48px;
}
.api-docs-hero { margin-bottom: 28px; }
.api-docs-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}
.api-docs h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.02em;
}
.api-docs-lede {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 1.02rem;
}
.api-docs-section {
  margin: 0 0 28px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.api-docs-section h2 {
  margin: 16px 0 10px;
  font-size: 1.15rem;
}
.api-docs-section p { margin: 0 0 12px; line-height: 1.5; }
.api-docs-code {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.45;
}
.api-docs-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-main);
  white-space: pre;
}
.api-docs-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.api-docs-foot { margin-top: 8px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; padding: 10px 16px; background: var(--primary); color: #fff; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
.gasm-card.is-focus { outline: 2px solid var(--primary); outline-offset: 2px; }

.dm-bubble-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dm-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; opacity: 0.6; }
.dm-delete:hover { opacity: 1; color: var(--accent-messaging); }

/* Phase 12 */
.link-preview { display: flex; gap: 10px; margin-top: 10px; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; background: var(--bg-surface); color: inherit; text-decoration: none; }
.link-preview img { width: 96px; height: 96px; object-fit: cover; flex-shrink: 0; }
.link-preview-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; min-width: 0; }
.link-preview-body strong { font-size: 0.92rem; }
.link-preview-body em { font-style: normal; color: var(--text-muted); font-size: 0.82rem; }
.edited-label { background: none; border: none; color: var(--text-muted); font-size: 0.75rem; cursor: pointer; padding: 0; margin-top: 4px; display: inline-block; }
.bookmark-move { margin: -6px 0 14px; padding-left: 52px; }
.bookmark-move select { max-width: 200px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main); }
.draft-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.edit-hist-row { padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.edit-hist-row p { margin: 4px 0 0; white-space: pre-wrap; }
.bookmark-folders em { font-style: normal; color: var(--text-muted); font-size: 0.8rem; margin-left: 4px; }

/* Phase 13: lists, digests, new posts, a11y */
.lists-grid { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 640px) { .lists-grid { grid-template-columns: 1fr 1fr; } }
.list-card {
  display: block; padding: 16px; border: 1px solid var(--border-color); border-radius: 14px;
  background: var(--bg-surface); color: inherit; text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.list-card:hover { border-color: var(--primary); }
.list-card strong { display: block; margin-bottom: 4px; }
.list-card p { margin: 8px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.list-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.person-card {
  display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color);
}
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input {
  flex: 1; min-width: 140px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main);
}
.feed-tab-link {
  text-decoration: none;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  align-self: stretch;
}
.feed-tab-link:hover { color: var(--primary); }
.new-posts-banner {
  display: block; width: 100%; margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid var(--primary); border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, var(--bg-card));
  color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-align: center;
}
.new-posts-banner[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Phase 14: polls, keywords */
.composer-poll {
  display: flex; flex-direction: column; gap: 8px; margin-top: 10px;
  padding: 10px; border: 1px dashed var(--border-color); border-radius: 12px;
}
.composer-poll[hidden] { display: none !important; }
.composer-poll input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-color);
  background: var(--bg-surface); color: var(--text-main); font: inherit;
}
.composer-poll-days {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.composer-poll-days select {
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
}
.gasm-poll { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.poll-option {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-color); background: var(--bg-surface); color: var(--text-main);
  font: inherit; cursor: pointer; overflow: hidden;
}
button.poll-option:hover { border-color: var(--primary); }
.poll-option.is-result { cursor: default; }
.poll-option.is-voted { border-color: var(--primary); }
.poll-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: color-mix(in srgb, var(--primary) 18%, transparent); z-index: 0;
}
.poll-label, .poll-pct { position: relative; z-index: 1; }
.poll-pct { color: var(--text-muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.poll-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.kw-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.kw-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-surface);
  font-size: 0.88rem;
}
.kw-chip button {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 0;
}
.btn-icon[aria-pressed="true"] { color: var(--primary); }
.list-card-wrap { display: flex; flex-direction: column; }

/* Phase 17–18 */
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-preset {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-color);
  background: var(--swatch, var(--primary)); cursor: pointer; padding: 0;
}
.theme-preset:hover, .theme-preset:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.shortcuts-card { max-width: 420px; }
.shortcuts-list { margin: 0; display: grid; gap: 8px; }
.shortcuts-list > div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: baseline; }
.shortcuts-list dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem; background: var(--bg-surface); border: 1px solid var(--border-color);
  border-radius: 6px; padding: 2px 8px; text-align: center;
}
.shortcuts-list dd { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.privacy-badge {
  display: inline-block; margin: 4px 0 6px; padding: 2px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border-color); background: var(--bg-surface);
}
.search-row--people { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.search-row-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.search-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.modal-card--composer { max-width: 520px; }
.modal-card--composer .composer-shell { margin: 0; border: none; box-shadow: none; padding: 0; }
.modal-card--regasm {
  max-width: 520px;
  background: transparent;
  border: none;
  padding: 12px;
  box-shadow: none;
}
.modal-card--regasm .modal-list-head {
  margin-bottom: 10px;
  padding: 0 4px;
}
.modal-card--regasm .modal-list-head h3 {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
#regasm-sheet .composer-shell {
  margin: 0;
}
#regasm-sheet .composer-shell--reply {
  margin-top: 0;
}
#regasm-sheet .regasm-embed {
  margin-top: 10px;
  margin-bottom: 2px;
}
.regasm-quote-embed { margin-top: 12px; pointer-events: none; }
.regasm-embed {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-surface);
  min-width: 0;
}
.regasm-embed .avatar--sm {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.regasm-embed-main {
  flex: 1;
  min-width: 0;
}
.regasm-embed-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 0.88rem;
  line-height: 1.3;
  margin-bottom: 2px;
}
.regasm-embed-meta strong {
  font-weight: 650;
  color: var(--text-main);
}
.regasm-embed-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.regasm-embed-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-muted, #222);
}
.regasm-embed-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.regasm-embed-thumb--video {
  position: relative;
  background: #1a1a1a;
}
.regasm-embed-thumb--video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,.85) 0 6px, transparent 7px);
  opacity: 0.7;
}
.place-badge {
  display: inline-block; margin: 4px 0 6px; font-size: 0.8rem; color: var(--text-muted);
}
.gasm-video {
  width: 100%; max-height: 420px; border-radius: 12px; background: #000; display: block;
}
.account-switcher-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.account-switcher-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-surface);
  overflow: hidden;
}
.account-switcher-row.is-current {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border-color));
}
.account-switcher-pick {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.account-switcher-pick:hover { background: color-mix(in srgb, var(--bg-card) 70%, transparent); }
.account-switcher-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.account-switcher-meta strong { font-size: 0.95rem; }
.account-switcher-meta .muted { font-size: 0.8rem; }
.account-switcher-remove {
  appearance: none;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px 14px;
  font: inherit;
  line-height: 1;
}
.account-switcher-remove:hover { color: var(--accent-messaging); }
.list-card {
  display: block; padding: 14px; border: 1px solid var(--border-color); border-radius: 12px;
  margin-bottom: 10px; color: inherit; text-decoration: none; background: var(--bg-card);
}
.list-card:hover { border-color: var(--primary); }
.dm-media { display: block; margin-bottom: 6px; }
.dm-media img { max-width: 220px; max-height: 220px; border-radius: 10px; object-fit: cover; }
.dm-media-preview { display: flex; gap: 8px; align-items: center; padding: 0 0 6px; }
.dm-media-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }

.media-preview-item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
}
.media-preview-frame {
  position: relative;
  aspect-ratio: 1;
  background: #0a0a0a;
  overflow: hidden;
}
.composer-media-preview[data-count="1"] .media-preview-frame {
  aspect-ratio: 16 / 10;
  max-height: 280px;
}
.media-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-preview-kind {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
}
.media-preview-toolbar {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}
.media-preview-tool {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.media-preview-tool:hover { background: var(--bg-surface); }
.media-preview-tool.is-on { color: var(--primary); }
.media-preview-tool--danger { color: var(--text-muted); }
.media-preview-tool--danger:hover { color: var(--accent-messaging, #e74c3c); }
.media-preview-tool span { line-height: 1; }
.media-preview-tool svg { flex-shrink: 0; }
/* Narrow tiles (3–4 photos): icons only — avoids “Rem…” truncation */
.composer-media-preview[data-count="3"] .media-preview-tool span,
.composer-media-preview[data-count="4"] .media-preview-tool span {
  display: none;
}
@media (max-width: 520px) {
  .composer-media-preview[data-count="2"] .media-preview-tool span {
    display: none;
  }
}
.media-preview-alt {
  padding: 6px 8px 8px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}
.media-preview-alt input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
  font-size: 0.85rem;
}

.modal-card--media-edit { max-width: 440px; }
.media-edit-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  cursor: grab;
  touch-action: none;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
}
.media-edit-stage:active { cursor: grabbing; }
.media-edit-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}
.media-edit-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.media-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.media-edit-label {
  flex: 0 0 52px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.media-edit-btns,
.media-edit-zoom {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.media-edit-btns .btn,
.media-edit-zoom .btn {
  padding: 8px 10px;
  font-size: 0.82rem;
}
.media-edit-zoom input[type="range"] {
  flex: 1;
  min-width: 0;
}
.media-edit-actions {
  display: flex;
  gap: 8px;
}
.media-edit-actions .btn { flex: 1; }

.community-mod-bar { padding: 0 12px 10px; margin-top: -8px; }

