:root {
  --bg: #e6e8eb;
  --elev: #ffffff;
  --ink: #050505;
  --muted: #65676b;
  --fox: #ff6a00;
  --fox-rgb: 255, 106, 0;
  --fox-light: #ff8a3d;
  --line: rgba(0, 0, 0, 0.1);
  --font: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* display:* auf Klassen überschreibt sonst das HTML-Attribut hidden */
[hidden] { display: none !important; }
/* Session hint from inline script: hide login flash while auth/me loads */
html.has-session #auth-screen { display: none !important; }
html.has-session #app[hidden] { display: grid !important; }
html.has-session body {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  touch-action: pan-x pan-y;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
  overscroll-behavior-y: none;
}
/* iOS: kein Auto-Zoom bei Fokus auf Inputs */
input, textarea, select { font-size: 16px; }
body:has(#app:not([hidden])) {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}
button, input, textarea, select { font: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: .7rem 1.1rem;
  background: var(--fox); color: #fff; font-weight: 700; cursor: pointer;
}
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.muted { color: var(--muted); }
.error { color: #f87171; }
.hint { color: var(--muted); font-size: .85rem; }

.auth-screen {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
}
.auth-logo { width: 120px; height: auto; margin: 0 auto 1rem; display: block; }
.auth-card h1 { margin: 0 0 .35rem; font-size: 1.4rem; text-align: center; }
.auth-card > .muted { text-align: center; margin: 0 0 1rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.tab {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: .55rem; cursor: pointer; font-weight: 600;
}
.tab.is-active { color: var(--fox); border-color: var(--fox); background: rgba(var(--fox-rgb),.12); }
.auth-form { display: grid; gap: .75rem; }
.auth-hint { margin: 0; font-size: .88rem; }
.auth-verify-box {
  display: grid;
  gap: .75rem;
  margin-top: .25rem;
}
.auth-verify-box[hidden] { display: none !important; }
.auth-verify-msg {
  margin: 0;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: rgba(var(--fox-rgb),.08);
  border: 1px solid rgba(var(--fox-rgb),.28);
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.45;
}
.auth-success {
  margin: .75rem 0 0;
  color: #2e7d32;
  font-weight: 600;
  font-size: .92rem;
}
.auth-success[hidden] { display: none !important; }
.check-label {
  display: flex !important; align-items: center; gap: .55rem;
  flex-direction: row !important; font-weight: 500;
}
.check-label input[type="checkbox"] {
  width: 1.1rem; height: 1.1rem; accent-color: var(--fox); flex-shrink: 0;
}
.profile-danger {
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid; gap: .55rem;
}
.profile-danger h4 { margin: 0; font-size: .95rem; }
.profile-danger[hidden] { display: none !important; }
.btn-danger {
  background: #c0392b; border-color: #c0392b; color: #fff;
  justify-self: start;
}
.btn-danger:hover { filter: brightness(1.05); }
.auth-form label, .form-grid label, #redeem-form label, #profile-form label {
  display: grid; gap: .35rem; font-size: .9rem; color: var(--muted);
}
input, textarea, select {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); padding: .7rem .8rem;
}
/* Dictation / paste / extension inserts — never block text selection in fields */
.composer-input-wrap textarea,
#composer-text,
#profile-composer-text,
.chat-form #chat-input,
.search input,
.comment-form .comment-field,
.comment-edit-box .comment-field,
.bubble-edit-input,
#profile-form input:not([type="color"]):not([type="checkbox"]):not([type="file"]),
#profile-form textarea,
.auth-form input:not([type="checkbox"]) {
  user-select: text;
  -webkit-user-select: text;
}
.back { display: inline-block; margin-top: 1rem; color: var(--fox); font-weight: 600; text-decoration: none; }

.app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}
.nav {
  position: relative;
  border-bottom: 1px solid var(--line);
  padding: calc(.4rem + env(safe-area-inset-top, 0px)) .75rem .45rem;
  display: flex; align-items: center;
  /* No backdrop-filter on .nav itself — it would trap position:fixed menus inside the header */
  background: rgba(255, 255, 255, 0.96);
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}
.nav-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; width: 100%;
  position: relative;
  z-index: 2;
}
.header-actions {
  display: flex; align-items: center; gap: .3rem; flex-shrink: 0;
}
.lang-switch {
  display: inline-flex; flex-direction: column; align-items: center; gap: .12rem; flex-shrink: 0;
}
.lang-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,.85); color: var(--muted);
  border-radius: 8px; padding: .22rem .38rem; font-size: .68rem; font-weight: 700;
  cursor: pointer; line-height: 1.1; opacity: .55; transition: opacity .15s, border-color .15s, background .15s;
}
.lang-btn:hover { opacity: .85; }
.lang-btn.is-active {
  opacity: 1; color: var(--fox); border-color: rgba(var(--fox-rgb),.45);
  background: rgba(var(--fox-rgb),.1);
}
.auth-lang-row {
  display: flex; justify-content: flex-end; margin-bottom: .35rem;
}
.header-actions-desktop { display: none; }
.header-ico {
  border: 0; background: #f3f4f6; color: var(--ink);
  width: 2.4rem; height: 2.4rem; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.header-ico:active { transform: scale(.96); }
.header-ico.is-active {
  background: rgba(var(--fox-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--fox-rgb), 0.25);
}
.header-ico .nav-ico,
.header-ico .nav-ico img {
  width: 1.4rem; height: 1.4rem;
}
.header-ico.header-profile {
  background: transparent;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
}
.header-ico.header-profile.is-online {
  outline: 2.5px solid #22c55e;
  outline-offset: 0;
}
.header-ico.header-profile.is-offline {
  outline: 2.5px solid #dc2626;
  outline-offset: 0;
}
.header-ico.header-profile.is-active {
  box-shadow: inset 0 0 0 2px var(--fox);
  background: transparent;
}
.header-ico.header-profile.is-active.is-online {
  outline: 2.5px solid #22c55e;
  box-shadow: none;
}
.header-ico.header-profile.is-active.is-offline {
  outline: 2.5px solid #dc2626;
  box-shadow: none;
}
.header-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--fox-light), var(--fox));
  background-size: cover; background-position: center;
}
.header-avatar.has-img { color: transparent; }
.composer-avatar-btn {
  flex-shrink: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.composer-avatar-btn:hover { filter: brightness(0.97); }
.composer-avatar-btn:focus-visible {
  outline: 2px solid var(--fox);
  outline-offset: 2px;
}
.points-chip {
  border: 1px solid rgba(var(--fox-rgb), 0.35);
  background: rgba(var(--fox-rgb), 0.1);
  color: var(--fox);
  border-radius: 999px;
  padding: .35rem .65rem;
  display: inline-flex; align-items: baseline; gap: .25rem;
  cursor: pointer; font: inherit; line-height: 1;
}
.points-chip strong { font-size: .95rem; font-weight: 800; }
.points-chip span { font-size: .68rem; font-weight: 700; opacity: .9; }
.points-chip:active { transform: scale(.97); }
.topbar-right {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end;
}
.pic-switch {
  display: none;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
  max-width: 100%;
}
.pic-switch.is-visible { display: inline-flex; }
.pic-switch-label {
  font-size: .78rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
}
.pic-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.pic-switch-ui {
  position: relative;
  width: 2.55rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #d1d5db;
  border: 1px solid rgba(0, 0, 0, .08);
  flex-shrink: 0;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.pic-switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.4rem - 6px);
  height: calc(1.4rem - 6px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .2s ease;
}
.pic-switch:hover .pic-switch-label { color: var(--ink); }
.pic-switch input:checked + .pic-switch-ui {
  background: var(--fox);
  border-color: rgba(var(--fox-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--fox-rgb), .16);
}
.pic-switch input:checked + .pic-switch-ui::after {
  transform: translateX(1.15rem);
}
.pic-switch input:focus-visible + .pic-switch-ui {
  outline: 2px solid rgba(var(--fox-rgb), .55);
  outline-offset: 2px;
}
/* Community: Posts / Slideshow / Composer / Kommentare stark unscharf */
html.hide-pictures .post-image,
html.hide-pictures .composer-preview img,
html.hide-pictures .feed-slide-img,
html.hide-pictures .feed-slide-media,
html.hide-pictures .comment img:not(.fp-emoji),
html.hide-pictures .lightbox-img {
  filter: blur(22px);
  transform: scale(1.08);
}
html.hide-pictures .post-image-btn,
html.hide-pictures .composer-preview,
html.hide-pictures .feed-slideshow-viewport,
html.hide-pictures .feed-slide,
html.hide-pictures .feed-ad-slide {
  overflow: hidden;
}
@media (max-width: 768px) {
  .composer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    align-items: stretch;
    padding-right: 0;
  }
  .composer-actions .post-scope-destination,
  .composer-actions .post-audience {
    display: none !important;
  }
  .post-scope {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
  }
  .post-scope-legend {
    font-size: .875rem;
    margin-bottom: .25rem;
    color: var(--ink);
  }
  .post-scope-opt {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    min-height: 2.75rem;
    padding: .35rem .45rem;
    white-space: normal;
    border-radius: 10px;
    font-size: .9375rem;
    color: var(--ink);
  }
  .post-scope-opt:active {
    background: rgba(var(--fox-rgb), .07);
  }
  .post-scope-opt input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    box-shadow: none;
  }
  .post-scope-opt input[type="radio"]:checked {
    box-shadow: inset 0 0 0 3px #fff;
  }
  .post-scope-opt span {
    line-height: 1.35;
    flex: 1;
    min-width: 0;
  }
  .composer-actions .btn-file,
  .composer-actions .btn[type="submit"] {
    min-height: 2.75rem;
    font-size: .9375rem;
    justify-content: center;
    width: 100%;
  }
  .composer-actions .btn[type="submit"] {
    grid-column: 2;
  }
  .composer-actions .btn-file {
    grid-column: 1;
  }
  .composer-head {
    gap: .55rem;
  }
  .profile-form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-form-actions .btn {
    width: 100%;
    min-height: 2.75rem;
    justify-content: center;
  }
  .profile-fold-toggle {
    min-height: 2.75rem;
    font-size: .9375rem;
  }
  .profile-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
  }
  .profile-info-row dt {
    min-width: 0;
  }
  .profile-preview-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .profile-preview-banner .btn {
    width: 100%;
    min-height: 2.75rem;
  }
  .accent-picker {
    flex-direction: column;
    align-items: flex-start;
  }
  .accent-presets {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .pic-switch-label {
    font-size: .7rem;
    max-width: 5.8rem;
    white-space: normal;
    text-align: right;
  }
}
.brand {
  position: relative;
  display: inline-flex; align-items: center; gap: .5rem;
  color: inherit; text-decoration: none; font-weight: 800; letter-spacing: .06em;
  padding: .1rem 0; min-width: 0; overflow: hidden;
}
.brand img { width: 32px; height: 32px; object-fit: contain; border-radius: 9px; flex-shrink: 0; }
.brand span { white-space: nowrap; font-size: 1.02rem; }
.nav-menu-btn {
  border: 0; background: #f3f4f6; color: var(--ink);
  width: 2.4rem; height: 2.4rem; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.nav-menu-btn:active { transform: scale(.96); }
.nav-menu-btn.is-open {
  background: rgba(var(--fox-rgb), 0.14);
  color: var(--fox);
}

.nav-stack { display: contents; }
/* Handy: keine Bottom-Bar — Navigation oben + More-Menu */
.nav-primary { display: none; }
.nav-secondary { display: grid; gap: .15rem; }
.nav-more-tab { display: none; }

.nav-item {
  border: 0; background: transparent; color: var(--muted); padding: .4rem .2rem;
  border-radius: 14px; cursor: pointer; font-weight: 600; text-decoration: none;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; font: inherit; flex: 1; min-width: 0; text-align: center;
}
.nav-item.is-active {
  font-weight: 700;
  background: transparent;
  color: var(--fox);
}
.nav-item:active { background: rgba(0, 0, 0, 0.04); }
.nav-ico {
  position: relative; width: 1.55rem; height: 1.55rem; flex-shrink: 0;
  display: grid; place-items: center;
}
.nav-ico img {
  width: 1.55rem; height: 1.55rem; object-fit: contain; display: block;
  border-radius: 6px;
}
/* Nav-PNGs: persönliche Accent color via CSS-Maske */
.nav-ico.nav-ico-tint img {
  opacity: 0;
  pointer-events: none;
}
.nav-ico.nav-ico-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--fox);
  mask: var(--nav-mask) center / contain no-repeat;
  -webkit-mask: var(--nav-mask) center / contain no-repeat;
  mask-mode: alpha;
  -webkit-mask-mode: alpha;
}
.nav-ico-svg { color: var(--fox); }
.nav-item.is-active .nav-ico-svg { color: var(--fox); }
.nav-label {
  font-size: .62rem; line-height: 1.15; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  letter-spacing: .01em;
}
.nav-label-lg { display: none; }
.nav-badge {
  position: absolute; top: -3px; right: -3px;
  width: .55rem; height: .55rem; border-radius: 50%;
  background: #ed4956; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
}
.nav-badge[hidden] { display: none !important; }
.nav-item.nav-danger { color: #c2410c; }
.nav-more-tab .nav-ico-svg { color: var(--muted); }
.nav-more-tab.is-open,
.nav-more-tab.is-active {
  color: var(--fox);
  background: rgba(var(--fox-rgb), 0.12);
}

/* Mobile more-sheet (mounted on body while open) */
.nav-sheet[hidden] { display: none !important; }
.nav-sheet:not([hidden]) {
  position: fixed; inset: 0; z-index: 200;
  display: block;
}
.nav-sheet-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(17, 17, 17, 0.42);
  cursor: pointer;
}
.nav-sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: .55rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  max-height: min(85vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.18);
  animation: navSheetIn .22s ease;
  z-index: 1;
}
.nav-sheet-handle {
  width: 40px; height: 4px; border-radius: 999px;
  background: #d1d5db; margin: .2rem auto .85rem;
}
.nav-sheet-panel h2 {
  margin: 0 0 .75rem; font-size: 1.1rem; letter-spacing: -.01em;
}
.nav-secondary {
  display: grid;
  gap: .1rem;
}
.nav-secondary .nav-item {
  flex-direction: row; justify-content: flex-start; text-align: left;
  gap: .85rem; padding: .85rem .9rem; width: 100%; flex: none;
  border-radius: 14px;
  display: inline-flex !important;
  color: var(--ink);
  background: transparent;
}
.nav-secondary .nav-item.nav-danger {
  color: #c2410c;
  margin-top: .35rem;
  border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  padding-top: 1rem;
}
.nav-secondary .nav-label {
  font-size: .98rem; max-width: none; font-weight: 600;
  overflow: visible; text-overflow: unset; white-space: nowrap;
}
.nav-secondary .nav-ico,
.nav-secondary .nav-ico img {
  width: 1.7rem; height: 1.7rem;
}

@keyframes navSheetIn {
  from { transform: translateY(18px); opacity: .7; }
  to { transform: translateY(0); opacity: 1; }
}

body.nav-sheet-open { overflow: hidden; }
/* Keep top bar (☰) above the dimmed sheet so tapping the icon again closes it */
body.nav-sheet-open .nav {
  z-index: 210;
}

.main {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: .7rem .75rem calc(1rem + env(safe-area-inset-bottom, 0px));
}
.topbar {
  display: flex; flex-wrap: nowrap; justify-content: space-between; gap: .75rem;
  margin: 0 0 .85rem; align-items: center;
  position: sticky; top: 0; z-index: 20;
  padding: .35rem 0 .55rem;
  background: linear-gradient(to bottom, var(--bg) 78%, transparent);
  /* Transparent gradient must not steal taps from content scrolling underneath */
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar h1 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.topbar .sub { display: none; }
.topbar-right .points { display: none; }
.sub { margin: .2rem 0 0; color: var(--muted); }
.sub:empty { display: none !important; margin: 0; }
.points {
  display: grid; justify-items: end; gap: .1rem;
  padding: .7rem 1rem; border-radius: 14px; border: 1px solid rgba(var(--fox-rgb),.3);
  background: rgba(var(--fox-rgb),.08);
}
.points span { color: var(--muted); font-size: .8rem; }
.points strong { font-size: 1.2rem; color: var(--fox); }

/* App-like feed cards on phones */
.composer, .post, .card {
  border-radius: 16px;
}
.chat-pane {
  min-height: min(70dvh, 560px);
  border-radius: 18px;
}

.composer, .card, .rail-card {
  background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 1rem;
}
.composer { margin-bottom: 1rem; }
.composer-head { display: flex; gap: .75rem; align-items: flex-start; }
.composer-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: .35rem;
}
.composer-input-wrap {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .4rem;
  align-items: start;
}
.composer-input-wrap textarea,
.composer-input-wrap .rich-compose-field {
  width: 100%;
  resize: vertical;
  min-height: 42px;
  grid-column: 1;
  border-radius: 18px;
  border: 1px solid #d5d8de;
  padding: .55rem .8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -2px 5px rgba(0, 0, 0, .055),
    0 2px 5px rgba(0, 0, 0, .06);
}
.composer-input-wrap .rich-compose-field {
  resize: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  outline: none;
  cursor: text;
  line-height: 1.45;
}
.composer-input-wrap .rich-compose-field:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.composer-input-wrap .rich-compose-field .fp-emoji {
  vertical-align: -.25em;
  display: inline;
  width: 1.35em;
  height: 1.35em;
  margin: 0 1px;
}
.composer-input-wrap textarea:focus,
.composer-input-wrap .rich-compose-field:focus {
  outline: none;
  border-color: rgba(var(--fox-rgb), .45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -2px 5px rgba(0, 0, 0, .04),
    0 0 0 3px rgba(var(--fox-rgb), .12),
    0 2px 6px rgba(0, 0, 0, .07);
}
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0 2.75rem 0 0;
  position: relative;
  z-index: 2;
}
.composer-emoji-btn {
  grid-column: 2;
  grid-row: 1;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
}
.composer-emoji-btn:hover,
.composer-emoji-btn[aria-expanded="true"] {
  border-color: rgba(var(--fox-rgb), .45);
  background: rgba(var(--fox-rgb), .08);
}
.composer-emoji-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: .25rem;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
  max-height: 9.5rem;
  overflow: auto;
}
.composer-emoji-panel[hidden] { display: none !important; }
.composer-emoji-panel button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
  padding: .25rem 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.composer-emoji-panel button:hover {
  background: rgba(var(--fox-rgb), .12);
}
.composer-emoji-panel .fp-emoji {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
}
.fp-emoji {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.2em;
  display: inline-block;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 0;
}
.bubble-text .fp-emoji {
  background: transparent;
}
.fp-emoji-btn { width: 1.35rem; height: 1.35rem; }
.react-emoji .fp-emoji,
.react-chip .fp-emoji {
  width: 1.2rem;
  height: 1.2rem;
  vertical-align: middle;
}
.bubble-actions .react-chip .fp-emoji {
  width: 1.25rem;
  height: 1.25rem;
}
.composer-preview { margin-top: .55rem; position: relative; }
.composer-preview img {
  width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; display: block;
}
.composer-preview .remove-preview {
  position: absolute; top: .5rem; right: .5rem;
}
.composer-actions .btn-file,
.composer-actions .btn {
  padding: .35rem .85rem;
  font-size: .92rem;
}
.btn-file {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem;
  cursor: pointer; font-weight: 600; color: var(--ink); background: transparent;
}
.btn-file:hover { border-color: var(--fox); color: var(--fox); }

.form-grid { display: grid; gap: .75rem; margin-top: .75rem; }
.form-grid .full { grid-column: 1 / -1; }
.feed { display: grid; gap: .85rem; }
.post-scope {
  border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem;
  font-size: .78rem; color: var(--muted); min-width: 0;
}
.composer-actions .post-scope {
  flex: 1 1 100%;
  width: 100%;
}
.post-scope-legend {
  flex: 0 0 100%;
  font-size: .72rem; font-weight: 600; margin: 0 0 .15rem; padding: 0;
}
.post-scope-opt {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; white-space: nowrap;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.post-scope-opt input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid #b8bcc4;
  border-radius: 50%;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.post-scope-opt input[type="radio"]:checked {
  border-color: var(--fox);
  background: var(--fox);
  box-shadow: inset 0 0 0 2.5px #fff;
}
.post-scope-opt input[type="radio"]:focus-visible {
  outline: 2px solid rgba(var(--fox-rgb), .45);
  outline-offset: 2px;
}
.post-audience { margin-bottom: .35rem; }
.post-audience[hidden] { display: none !important; margin: 0; padding: 0; border: 0; }
.post-visibility {
  font-size: .75rem; color: var(--post-muted, var(--muted)); margin-bottom: .45rem; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .35rem;
}
.post-visibility-label { font-weight: 600; color: var(--post-muted, var(--muted)); }
.post-visibility-link {
  border: 0; background: none; padding: 0; color: var(--post-link, var(--fox)); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline;
}
.post-visibility-link:hover { filter: brightness(1.08); }
.post-visibility-sep { opacity: .55; }
.post.post-highlight { animation: post-highlight 2s ease-out; }
@keyframes post-highlight {
  0%, 15% { box-shadow: 0 0 0 2px rgba(var(--fox-rgb), .55); }
  100% { box-shadow: none; }
}
.post {
  --post-muted: var(--muted);
  --post-link: var(--fox);
  --post-link-rgb: var(--fox-rgb);
  background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 1rem;
}
.post .hint {
  color: var(--post-muted, var(--muted));
}
time.post-time {
  display: block;
  margin-top: .12rem;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--post-muted, var(--muted));
}
.post-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .55rem; position: relative; }
button.linkish {
  border: 0; background: none; color: inherit; padding: 0; cursor: pointer; font-weight: 700; text-align: left;
  font: inherit;
}
button.linkish:hover { color: var(--fox); }
.avatar {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center;
  background: rgba(var(--fox-rgb),.2); color: var(--fox); font-weight: 700; font-size: .8rem;
  overflow: hidden; flex-shrink: 0; background-size: cover; background-position: center;
  box-shadow: 0 0 0 2.5px #9ca3af;
}
.avatar.is-online { box-shadow: 0 0 0 2.5px #22c55e; }
.avatar.is-offline { box-shadow: 0 0 0 2.5px #dc2626; }
button.avatar {
  border: 0; padding: 0; cursor: pointer; font: inherit;
}
button.avatar:hover { filter: brightness(0.97); }
.avatar.has-img { color: transparent; }
.post-body { margin: .5rem 0; white-space: pre-wrap; word-break: break-word; }
.post-image-btn {
  margin: .65rem -1rem; width: calc(100% + 2rem);
}
.post-image-wrap {
  position: relative;
  margin: .65rem -1rem;
  width: calc(100% + 2rem);
}
.post-image-media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.post-image-wrap .post-image-btn,
.post-image-media .post-image-btn {
  margin: 0;
  width: 100%;
}
.post-image-fx-btn {
  position: absolute;
  left: auto;
  right: .55rem;
  bottom: .55rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
  color: #fff;
  background: rgba(10, 12, 16, .52);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, background .15s ease, transform .12s ease;
}
.post-image-wrap:hover .post-image-fx-btn,
.post-image-fx-btn:focus-visible,
.post-image-fx-btn.is-active {
  opacity: 1;
  pointer-events: auto;
}
.post-image-fx-btn:hover,
.post-image-fx-btn:active {
  background: rgba(var(--fox-rgb), .88);
  transform: scale(1.06);
}
.post-image-fx-btn.is-active {
  color: #ffe08a;
  background: rgba(10, 12, 16, .72);
}
@media (hover: none) {
  .post-image-wrap .post-image-fx-btn {
    opacity: .62;
    pointer-events: auto;
  }
}
html.hide-pictures .post-image-fx-btn,
html.hide-pictures .post-image-fx-picker {
  display: none !important;
}
.post-image-fx-picker {
  position: fixed;
  z-index: 99999;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  max-width: min(92vw, 22rem);
  padding: .45rem .5rem;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.post-image-fx-picker[hidden] { display: none !important; }
.post-image-fx-opt {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .28rem .62rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.post-image-fx-opt:hover,
.post-image-fx-opt:active {
  border-color: rgba(var(--fox-rgb), .45);
  background: rgba(var(--fox-rgb), .08);
}
.post-image-fx-opt.is-active {
  border-color: rgba(var(--fox-rgb), .55);
  background: rgba(var(--fox-rgb), .12);
  color: var(--fox);
}
.post-image {
  width: 100%; max-height: 480px;
  object-fit: cover; display: block; background: #e4e6eb; border-radius: 0;
}
.post-actions {
  display: flex; gap: .55rem; margin-top: .75rem; flex-wrap: wrap; align-items: center;
}
.post-actions .action-ico {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 14px; padding: .4rem .65rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 2.4rem; transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.post-actions .action-ico img {
  width: 1.55rem; height: 1.55rem; object-fit: contain; display: block;
  border-radius: 5px;
}
.post-actions .action-ico .action-count {
  font-size: .88rem; font-weight: 700; color: var(--muted); min-width: .8rem;
}
.post-actions .action-ico:hover { background: #f7f7f8; border-color: rgba(var(--fox-rgb),.35); }
.post-actions .action-ico:active { transform: scale(.96); }
.post-actions .action-ico.is-liked {
  border-color: rgba(var(--fox-rgb),.5);
  background: rgba(var(--fox-rgb),.1);
}
.post-actions .action-ico.is-liked .action-count { color: var(--fox); }
.post-actions .action-react-wrap {
  position: relative;
  display: inline-flex;
}
.post-actions .react-add {
  width: auto; min-height: 2.4rem;
  padding: .4rem .65rem;
  opacity: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.post-actions .react-add-face {
  width: 1.45rem; height: 1.45rem; display: block; object-fit: contain;
}
.post-chat-panel {
  margin: .75rem -1rem -1rem;
  padding: .75rem 1rem 1rem;
  border-radius: 0 0 15px 15px;
  background: var(--post-chat-bg, #5f7d84);
  color: var(--post-chat-ink, var(--ink));
}
.post:not(:has(.post-image-wrap, .post-image-btn)) .post-chat-panel {
  margin-top: .75rem;
  border-radius: 12px;
}
.post-chat-panel .post-actions { margin-top: 0; }
.post-chat-panel .post-actions .action-ico,
.post-chat-panel .post-actions .react-add {
  background: var(--post-chat-input, #fff);
  border-color: var(--post-chat-line, var(--line));
  color: var(--post-chat-ink, var(--ink));
}
.post-chat-panel .post-actions .action-ico .action-count {
  color: var(--post-chat-muted, var(--muted));
}
.post-chat-panel .post-actions .action-ico:hover,
.post-chat-panel .post-actions .react-add:hover {
  background: var(--post-chat-bg, #5f7d84);
  filter: brightness(1.08);
  border-color: var(--post-chat-line, var(--line));
}
.post-chat-panel .comment { color: var(--post-chat-muted, var(--muted)); }
.post-chat-panel .comment strong { color: var(--post-chat-ink, var(--ink)); }
.post-chat-panel .comment-reply-btn { color: var(--post-chat-muted, var(--muted)); }
.post-chat-panel .comment-reply-chip {
  background: rgba(255, 255, 255, .1);
  color: var(--post-chat-muted, var(--muted));
}
.post-chat-panel .comment-reply-chip strong { color: var(--post-chat-ink, var(--ink)); }
.post-chat-panel .comment-form .comment-input-wrap .rich-compose-field,
.post-chat-panel .comment-edit-box .comment-field {
  background: var(--post-chat-input, #fff);
  color: var(--post-chat-ink, var(--ink));
  border-color: var(--post-chat-line, var(--line));
}
.post-chat-panel .comment-form .comment-input-wrap .rich-compose-field:empty::before {
  color: var(--post-chat-muted, var(--muted));
}
.post-chat-panel .comment-form > button[type="submit"] {
  background: var(--post-chat-input, #fff);
  color: var(--post-chat-ink, var(--ink));
  border-color: var(--post-chat-line, var(--line));
}
.post-chat-panel .comment-form > button[type="submit"]:hover {
  border-color: rgba(var(--fox-rgb), .45);
  color: var(--fox);
}
.comment-form > button[type="submit"] {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 999px; padding: .35rem .75rem; cursor: pointer;
}
.comments { margin-top: .75rem; display: grid; gap: .4rem; }
.comments-extra[hidden] { display: none !important; }
.comments-toggle {
  border: 0; background: transparent; color: var(--fox);
  font: inherit; font-weight: 700; font-size: .9rem;
  padding: .2rem 0; cursor: pointer; text-align: left; width: fit-content;
}
.comments-toggle:hover { text-decoration: underline; }
.comment { color: var(--muted); font-size: .92rem; display: flex; gap: .5rem; align-items: flex-start; }
.comment.is-reply {
  margin-left: 1.6rem;
  padding-left: .65rem;
  border-left: 2px solid rgba(var(--fox-rgb), .25);
}
.comment .avatar { width: 1.7rem; height: 1.7rem; font-size: .65rem; }
.comment strong { color: var(--ink); }
.comment-body { flex: 1; min-width: 0; }
.comment-text { display: inline; margin-left: .25rem; }
.comment-text[hidden] { display: none !important; }
.comment-reply-to {
  font-size: .78rem; color: var(--fox); font-weight: 700; margin-bottom: .15rem;
}
.comment-tools {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  margin-top: .3rem;
}
.comment-tools[hidden] { display: none !important; }
.comment-tools .react-bar {
  position: static; min-height: 0;
}
.comment-tools .react-add {
  width: 1.45rem; height: 1.45rem;
  box-shadow: none;
}
.comment-tools .react-add-face { width: 1.1rem; height: 1.1rem; }
.comment-tools .react-chip {
  padding: .1rem .35rem; font-size: .78rem;
  box-shadow: none;
}
.comment-reply-btn,
.comment-tools [data-edit-comment],
.comment-tools [data-delete-comment] {
  border: 0; background: transparent; color: var(--fox);
  font: inherit; font-size: .8rem; font-weight: 700; padding: 0; cursor: pointer;
}
.comment-reply-btn {
  font-size: 1rem; line-height: 1; padding: .1rem .2rem;
  color: var(--muted);
}
.comment-reply-btn:hover,
.comment-tools [data-edit-comment]:hover,
.comment-tools [data-delete-comment]:hover { text-decoration: underline; color: var(--fox); }
.comment-reply-chip {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin: .55rem 0 0; padding: .35rem .55rem;
  background: rgba(var(--fox-rgb), .08); border-radius: 10px;
  font-size: .85rem; color: var(--muted);
}
.comment-reply-chip strong { color: var(--ink); }
.comment-reply-chip .linkish {
  margin-left: auto; font-size: 1.1rem; line-height: 1; color: var(--muted);
}
.comment-edit-box { margin-top: .4rem; display: grid; gap: .4rem; }
.comment-edit-box .comment-field {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .65rem;
  resize: vertical;
  min-height: 2.5rem;
}
.comment-edit-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.comment-form {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
  align-items: flex-start;
}
.comment-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .35rem;
  align-items: start;
  overflow: visible;
}
.comment-form .comment-input-wrap .comment-field,
.comment-form .comment-input-wrap .rich-compose-field {
  width: 100%;
  min-width: 0;
  grid-column: 1;
  position: relative;
  z-index: 1;
  resize: vertical;
  min-height: 2.5rem;
}
.comment-form .comment-input-wrap .rich-compose-field {
  resize: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  outline: none;
  cursor: text;
  line-height: 1.45;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: .55rem .8rem;
  background: #fff;
}
.comment-form .comment-input-wrap .rich-compose-field:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.comment-form .comment-input-wrap .rich-compose-field .fp-emoji {
  vertical-align: -.25em;
  display: inline;
  width: 1.35em;
  height: 1.35em;
  margin: 0 1px;
}
.comment-form .comment-emoji-btn {
  grid-column: 2;
  grid-row: 1;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 11px;
}
.comment-form .comment-emoji-panel {
  grid-column: 1 / -1;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: .35rem;
  z-index: 5;
}
.comment-form .comment-emoji-panel[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.comment-form > button[type="submit"] {
  flex-shrink: 0;
  align-self: stretch;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: .45rem .9rem;
  cursor: pointer;
  font-weight: 700;
}
.comment-form > button[type="submit"]:hover {
  border-color: rgba(var(--fox-rgb), .45);
  color: var(--fox);
}

.community-layout {
  display: grid; gap: 1rem;
}
.feed-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.feed-slideshow {
  position: relative;
  margin: 0 0 1.1rem;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1c20;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .12);
}
.feed-slideshow[hidden] { display: none !important; }
.feed-slideshow-viewport {
  position: relative;
  height: clamp(120px, 22vh, 210px);
  overflow: hidden;
}
.feed-slideshow-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.feed-slide {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: #222;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity .55s ease, transform .7s ease;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  text-align: left;
  color: #fff;
  font: inherit;
  overflow: hidden;
}
.feed-slide-img,
.feed-slide-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  pointer-events: none;
}
.feed-ad-slide {
  text-decoration: none;
  color: inherit;
}
.feed-ad-slide[href] {
  cursor: pointer;
}
.feed-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}
.feed-slide-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.08) 30%, rgba(0,0,0,.72) 100%);
  pointer-events: none;
  z-index: 1;
}
.feed-slide-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: .65rem .85rem .75rem;
  display: grid;
  gap: .1rem;
}
.feed-slide-author {
  font-weight: 800;
  font-size: .95rem;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
}
.feed-slide-text {
  margin: 0;
  font-size: .82rem;
  line-height: 1.3;
  opacity: .95;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}
.feed-slideshow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: #111;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: .92;
  transition: opacity .2s ease, transform .2s ease;
}
.feed-slideshow-nav:hover { opacity: 1; transform: translateY(-50%) scale(1.04); }
.feed-slideshow-nav.prev { left: .65rem; }
.feed-slideshow-nav.next { right: .65rem; }
.feed-slideshow-nav[hidden],
.feed-slideshow-dots[hidden] { display: none !important; }
.feed-slideshow-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .4rem .65rem .5rem;
  background: rgba(255, 255, 255, .96);
}
.feed-slideshow-dot {
  width: .55rem;
  height: .55rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #c9ccd1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, width .2s ease;
}
.feed-slideshow-dot.is-active {
  background: var(--fox);
  width: 1.15rem;
  transform: none;
}
.post.is-slideshow-target {
  outline: 2px solid rgba(var(--fox-rgb), .55);
  outline-offset: 3px;
  transition: outline-color .3s ease;
}
@media (min-width: 900px) {
  .feed-slideshow-viewport { height: clamp(130px, 23vh, 230px); }
  .feed-col > .composer { margin-top: .15rem; }
}
.rail { display: none; }
.rail-card h3 { margin: 0 0 .75rem; font-size: .95rem; }
.person-row {
  display: flex; gap: .65rem; align-items: flex-start; margin-bottom: .75rem;
}
.person-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.person-row-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .15rem; }
.person-name-block { width: 100%; min-width: 0; }
.person-name-block strong { display: block; font-weight: 600; line-height: 1.25; }
.person-name-block .linkish {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
  text-overflow: ellipsis; word-break: break-word; text-decoration: none;
  -webkit-line-clamp: 2; line-clamp: 2; max-width: 100%;
}
.person-name-block-compact .linkish { -webkit-line-clamp: 1; line-clamp: 1; }
.person-name-underline {
  display: block; height: 2px; margin-top: .28rem; border-radius: 1px;
  background: var(--user-accent, var(--fox)); opacity: .88;
}
.person-preview-bio {
  margin: 0; line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
  -webkit-line-clamp: 3; line-clamp: 3;
}
.person-row .person-preview-bio { -webkit-line-clamp: 2; line-clamp: 2; }
.people-grid {
  display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: stretch;
}
.person-card {
  border: 1px solid var(--line); border-radius: 14px; padding: .85rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: .55rem;
  min-height: 0;
}
.person-card .avatar { width: 3rem; height: 3rem; flex-shrink: 0; }
.person-card-body {
  display: flex; flex-direction: column; flex: 1; width: 100%; min-width: 0; gap: .4rem;
}
.person-card .person-preview-bio {
  flex: 1; min-height: calc(1.35em * 3);
}
.person-card-actions {
  display: flex; gap: .35rem; flex-wrap: wrap; width: 100%; margin-top: auto; padding-top: .25rem;
}

.split { display: grid; gap: 1rem; }
.messenger-side { min-width: 0; }
.chat-list { display: grid; gap: .4rem; margin-top: .5rem; }
/* Bei geöffnetem Chat: nur ~4 Konversationen sichtbar, Rest scrollen */
#messenger-split.has-open-chat #chat-list {
  max-height: calc(4 * 3.85rem + 3 * .4rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: .15rem;
  scrollbar-gutter: stable;
}
#messenger-split.has-open-chat #chat-list::-webkit-scrollbar {
  width: 6px;
}
#messenger-split.has-open-chat #chat-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .2);
  border-radius: 999px;
}
.chat-item, .search-item {
  text-align: left; border: 1px solid var(--line); background: var(--elev);
  border-radius: 12px; padding: .55rem .7rem; color: var(--ink);
  display: flex; gap: .5rem; align-items: center;
  min-height: 3.85rem;
}
.chat-item.is-active { border-color: var(--fox); }
.chat-open, .search-item {
  flex: 1; border: 0; background: transparent; color: inherit; cursor: pointer;
  text-align: left; padding: .2rem; font: inherit;
}
.chat-open {
  display: flex; align-items: center; gap: .65rem; min-width: 0;
}
.chat-open-text { min-width: 0; display: grid; gap: .1rem; }
.chat-open-text .hint {
  margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-profile-link { font-size: .8rem; white-space: nowrap; }
.search-item-row { display: flex; gap: .4rem; align-items: stretch; }
.search-item-row .search-item {
  display: block; border: 1px solid var(--line); border-radius: 12px;
  background: var(--elev); padding: .7rem .8rem;
}
.chat-pane {
  border: 1px solid var(--line); border-radius: 16px; background: var(--elev);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 420px;
  max-height: min(70vh, 640px);
  overflow: hidden;
  position: relative;
}
.chat-head { grid-row: 1; }
.chat-compose {
  grid-row: 3;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: min-content;
  z-index: 2;
  background: var(--elev);
  border-top: 1px solid var(--line);
  overflow: visible;
}
.chat-pane.has-chat-chrome .chat-head,
.chat-pane.has-chat-chrome .chat-compose {
  background: var(--chat-chrome-bg, #5f7d84);
  color: var(--chat-chrome-ink, var(--ink));
  border-color: var(--chat-chrome-line, var(--line));
}
.chat-pane.has-chat-chrome .chat-form #chat-input,
.chat-pane.has-chat-chrome .chat-form .rich-compose-field#chat-input {
  background: var(--chat-chrome-input, #fff);
  color: var(--chat-chrome-ink, var(--ink));
  border-color: var(--chat-chrome-line, var(--line));
}
.chat-pane.has-chat-chrome .chat-form .rich-compose-field#chat-input:empty::before {
  color: var(--chat-chrome-muted, var(--muted));
}
.chat-pane.has-chat-chrome .chat-bg-btn,
.chat-pane.has-chat-chrome .chat-emoji-btn,
.chat-pane.has-chat-chrome .chat-photo,
.chat-pane.has-chat-chrome .chat-mic,
.chat-pane.has-chat-chrome .chat-mic-cancel,
.chat-pane.has-chat-chrome .chat-form > button[type="submit"] {
  background: var(--chat-chrome-input, #fff);
  color: var(--chat-chrome-ink, var(--ink));
  border-color: var(--chat-chrome-line, var(--line));
}
.chat-pane.has-chat-chrome .chat-typing-indicator {
  color: var(--chat-chrome-muted, var(--muted));
}
.chat-pane.has-chat-chrome .chat-head .hint {
  color: var(--chat-chrome-muted, var(--muted));
}
.chat-compose .chat-form {
  flex-shrink: 0;
  min-height: 3.25rem;
}
.chat-pane.is-empty .chat-thread {
  display: grid;
  place-items: center;
}
.chat-pane.is-empty .chat-messages {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .95rem;
  overflow: hidden;
}
.chat-pane.is-empty .chat-messages::before {
  content: "Select a chat on the left";
}
.chat-pane.is-empty .chat-bg {
  display: none;
}
.chat-pane.is-empty .chat-compose {
  display: none !important;
}
.chat-typing-indicator {
  padding: 0 .75rem .35rem;
  font-size: .82rem;
  color: var(--muted);
  min-height: 1.1rem;
  line-height: 1.2;
}
.chat-typing-indicator[hidden] { display: none !important; }
.chat-typing-dots {
  display: inline-block;
  min-width: 1.1em;
}
.chat-pane header, .chat-head {
  padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-weight: 700;
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.chat-close-btn {
  margin-left: auto;
  width: 2.1rem; height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
}
.chat-close-btn:hover {
  border-color: rgba(229, 57, 53, .45);
  color: #e53935;
  background: rgba(229, 57, 53, .06);
}
.chat-open-text .hint,
.chat-menu-meta .hint {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.chat-head-avatar { width: 2rem; height: 2rem; font-size: .7rem; }
.chat-head-name { font-size: 1.05rem; }
.chat-head-name:hover { text-decoration: underline; }
.chat-presence {
  display: block;
  font-size: .75rem;
  margin-top: .05rem;
}
.chat-presence.is-online,
.profile-presence.is-online,
.chat-head .hint.is-online {
  color: #16a34a;
  font-weight: 600;
}
.chat-presence.is-offline,
.profile-presence.is-offline,
.chat-head .hint.is-offline {
  color: #dc2626;
  font-weight: 600;
}
.chat-head .hint { max-width: min(100%, 28rem); }
.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  margin-top: .28rem;
  line-height: 1;
}
.bubble-wrap:not(.me) .bubble-meta { justify-content: flex-start; }
.bubble-time {
  font-size: .7rem;
  line-height: 1;
  color: rgba(70, 76, 86, .55);
  white-space: nowrap;
  user-select: none;
}
.msg-receipt {
  font-size: .78rem; font-weight: 700; letter-spacing: -0.08em;
  user-select: none;
}
.msg-receipt.receipt-sent,
.msg-receipt.receipt-delivered { color: #8b9199; }
.msg-receipt.receipt-read { color: #34b7f1; }
.profile-actions .hint { align-self: center; }
.chat-thread {
  grid-row: 2;
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.chat-bg.has-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, .2);
}
.chat-messages {
  flex: 1;
  min-height: 0;
  padding: 1rem;
  display: grid;
  gap: .7rem;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
  background: transparent;
}
.chat-bg-btn {
  flex-shrink: 0;
  width: 2.35rem; height: 2.35rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
}
.chat-bg-btn svg { display: block; }
.chat-bg-btn:hover,
.chat-bg-btn[aria-expanded="true"] {
  border-color: rgba(var(--fox-rgb), .35);
  color: var(--fox);
  background: rgba(var(--fox-rgb), .08);
}
.chat-bg-panel {
  position: absolute;
  top: 3.35rem;
  right: .75rem;
  z-index: 30;
  width: min(17.5rem, calc(100% - 1.5rem));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--elev);
  box-shadow: 0 10px 28px rgba(20, 24, 32, .14);
  padding: .75rem;
}
.chat-bg-panel[hidden] { display: none !important; }
.chat-bg-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .65rem;
  font-weight: 700;
  font-size: .92rem;
}
.chat-bg-close {
  width: 1.75rem; height: 1.75rem;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.chat-bg-close:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
.chat-bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .45rem;
  margin-bottom: .65rem;
}
.chat-bg-swatch {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.chat-bg-swatch.is-active {
  border-color: var(--fox);
  box-shadow: 0 0 0 1px var(--fox);
}
.chat-bg-swatch-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: .18rem .25rem;
  font-size: .62rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .45));
  pointer-events: none;
}
.chat-bg-swatch.is-default {
  background: linear-gradient(145deg, #f4f5f7, #e8eaee);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
}
.chat-bg-swatch.is-custom {
  background: linear-gradient(145deg, rgba(var(--fox-rgb), .12), rgba(var(--fox-rgb), .04));
  display: grid;
  place-items: center;
  color: var(--fox);
  font-size: .68rem;
  font-weight: 600;
}
.chat-bg-actions {
  display: flex;
  gap: .45rem;
  justify-content: flex-end;
}
.bubble-wrap {
  display: grid; gap: .3rem; max-width: 78%;
  justify-items: start;
}
.bubble-wrap.me { justify-self: end; justify-items: end; }
.bubble-sender {
  font-size: .72rem;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.15;
  padding: 0 .2rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.user-accent-name {
  color: var(--user-accent, var(--fox));
}
button.linkish.user-accent-name:hover,
button.linkish.user-accent-name:focus-visible {
  color: var(--user-accent, var(--fox));
  filter: brightness(.88);
}
.bubble-sender.user-accent-name {
  color: var(--user-accent, var(--fox));
}
#call-peer.user-accent-name,
.notify-row .user-accent-name,
.notif-row .user-accent-name,
.chat-head-name.user-accent-name {
  color: var(--user-accent, var(--fox));
}
.bubble-wrap.me .bubble-sender { text-align: right; }
.bubble {
  position: relative;
  max-width: 100%;
  min-width: 0;
  padding: .62rem .88rem .5rem;
  border-radius: 18px;
  color: var(--ink);
  border: 1px solid rgba(55, 60, 70, .12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 42%),
    linear-gradient(165deg, #f6f7fa 0%, #e3e5eb 55%, #d2d5dd 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -3px 6px rgba(0, 0, 0, .07),
    0 3px 10px rgba(30, 34, 42, .12),
    0 1px 2px rgba(30, 34, 42, .08);
  transform: translateZ(0);
}
.bubble.me {
  border-color: rgba(var(--fox-rgb), .28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(
      165deg,
      rgba(var(--fox-rgb), .42) 0%,
      rgba(var(--fox-rgb), .24) 52%,
      rgba(var(--fox-rgb), .16) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -3px 6px rgba(var(--fox-rgb), .14),
    0 3px 12px rgba(var(--fox-rgb), .22),
    0 1px 2px rgba(40, 30, 20, .08);
}
.bubble.is-deleted {
  opacity: .85;
  background: linear-gradient(165deg, #f0f1f3 0%, #e8eaee 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .65),
    0 2px 6px rgba(30, 34, 42, .08);
}
.react-bar {
  position: relative;
  display: flex; align-items: center; gap: .25rem; flex-wrap: nowrap;
  min-height: 0;
}
.bubble-actions {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem;
  margin-top: .35rem;
  pointer-events: none;
}
.bubble-actions .react-bar,
.bubble-actions .react-chip,
.bubble-actions .react-add {
  pointer-events: auto;
}
.bubble-wrap.me .bubble-actions { justify-content: flex-end; }
.bubble-wrap:not(.me) .bubble-actions { justify-content: flex-start; }
.bubble-wrap.me .react-bar { flex-direction: row; }
/* Gewählte Reaktionen: nur Emoji, ohne Rahmen */
.bubble-actions .react-chip {
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0 .1rem;
  font-size: 1.15rem;
  gap: .1rem;
  line-height: 1;
}
.bubble-actions .react-chip.is-mine {
  border: 0;
  background: transparent;
}
.bubble-actions .react-chip .react-count {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  margin-left: .05rem;
}
.bubble-actions .react-chip .react-count[data-count="1"] { display: none; }
.bubble-actions .react-add {
  width: 1.45rem;
  height: 1.45rem;
  box-shadow: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.bubble-actions .react-add-face {
  width: 1.15rem;
  height: 1.15rem;
  background: transparent;
}
.bubble-poke { margin-top: .15rem; }
.poke-back-btn {
  border-radius: 999px !important;
  padding: .2rem .65rem !important;
  font-size: .8rem !important;
  font-weight: 700;
  background: rgba(var(--fox-rgb), .12);
  border-color: rgba(var(--fox-rgb), .4);
  color: var(--fox);
}
.react-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.react-chip, .react-add, .react-emoji {
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  border-radius: 999px; font: inherit; line-height: 1;
}
.react-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .15rem .45rem; font-size: .85rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.react-chip.is-mine {
  border-color: rgba(var(--fox-rgb),.45);
  background: rgba(var(--fox-rgb),.12);
}
.react-count { font-size: .72rem; color: var(--muted); font-weight: 700; }
.react-add {
  width: 1.7rem; height: 1.7rem; padding: 0;
  display: grid; place-items: center;
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.react-add-face {
  width: 1.35rem; height: 1.35rem; display: block; object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
  border-radius: 0;
}
.post-image-btn, .bubble-img-btn {
  display: block; padding: 0; border: 0; background: transparent;
  cursor: zoom-in; border-radius: 12px; max-width: 100%;
}
.post-image-btn:focus-visible, .bubble-img-btn:focus-visible {
  outline: 2px solid var(--fox); outline-offset: 2px;
}
.lightbox {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.lightbox[hidden] { display: none !important; }
.lightbox-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0;
  background: rgba(10, 12, 16, .82); cursor: pointer;
}
.lightbox-img {
  position: relative; z-index: 1;
  max-width: min(96vw, 1100px); max-height: 92vh;
  width: auto; height: auto; object-fit: contain;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45);
  background: #111;
}
.lightbox-close {
  position: absolute; z-index: 2; top: max(.75rem, env(safe-area-inset-top));
  right: max(.75rem, env(safe-area-inset-right));
  width: 2.5rem; height: 2.5rem; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.95); color: #111;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
body.lightbox-open { overflow: hidden; }
.react-add:hover {
  border-color: rgba(var(--fox-rgb),.4);
  background: rgba(var(--fox-rgb),.08);
}
.react-picker {
  position: fixed;
  z-index: 90;
  display: flex; gap: .15rem; padding: .35rem .4rem;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.react-picker.is-floating {
  position: fixed !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: flex !important;
  opacity: 1 !important;
}
.react-picker[hidden] { display: none !important; }
.react-emoji {
  width: 2rem; height: 2rem; border: 0; background: transparent;
  display: grid; place-items: center; font-size: 1.15rem; border-radius: 50%;
}
.react-emoji:hover, .react-emoji:active {
  background: rgba(var(--fox-rgb),.12);
}
.post .react-bar-chips { margin-top: .45rem; min-height: 0; }
.chat-form, .search { display: flex; gap: .5rem; padding: .75rem; align-items: center; }
.search { padding: 0; }
.chat-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.chat-form #chat-input,
.chat-form .rich-compose-field#chat-input {
  flex: 1;
  min-width: 0;
  border-radius: 18px;
  border: 1px solid #d5d8de;
  padding: .55rem .8rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -2px 5px rgba(0, 0, 0, .055),
    0 2px 5px rgba(0, 0, 0, .06);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
  outline: none;
  cursor: text;
  line-height: 1.45;
  min-height: 2.5rem;
  max-height: 6rem;
  overflow-y: auto;
}
.chat-form .rich-compose-field#chat-input:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.chat-form .rich-compose-field#chat-input .fp-emoji {
  vertical-align: -.25em;
  display: inline;
  width: 1.35em;
  height: 1.35em;
  margin: 0 1px;
}
.chat-form .rich-compose-field#chat-input:focus {
  border-color: rgba(var(--fox-rgb), .45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -2px 5px rgba(0, 0, 0, .04),
    0 0 0 3px rgba(var(--fox-rgb), .12),
    0 2px 6px rgba(0, 0, 0, .07);
}
.chat-emoji-btn {
  grid-column: auto;
  grid-row: auto;
  width: 2.4rem;
  height: 2.4rem;
  flex-shrink: 0;
}
.chat-emoji-panel.is-floating,
.comment-emoji-panel.is-floating {
  position: fixed !important;
  z-index: 99999 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  display: grid !important;
  opacity: 1 !important;
}
.chat-emoji-panel[hidden],
.composer-emoji-panel[hidden],
.comment-emoji-panel[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.chat-emoji-panel:not(.is-floating):not([hidden]),
.comment-emoji-panel:not(.is-floating):not([hidden]) {
  /* nur floating am body — nie im overflow:hidden Composer „halb offen“ */
  display: none !important;
}
.chat-attach-wrap {
  position: relative;
  flex-shrink: 0;
}
.chat-photo {
  flex-shrink: 0;
  width: 2.55rem;
  height: 2.55rem;
  color: #444;
}
.chat-photo-ico { display: block; }
.chat-attach-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + .4rem);
  z-index: 40;
  min-width: 10.5rem;
  display: grid;
  gap: .15rem;
  padding: .35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.chat-attach-menu[hidden] { display: none !important; }
.chat-attach-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: .55rem .65rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
}
.chat-attach-menu button:hover {
  background: rgba(var(--fox-rgb),.1);
  color: var(--fox);
}
.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: #0b0d10;
  display: grid;
  grid-template-rows: 1fr auto;
}
.camera-overlay[hidden] { display: none !important; }
.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.camera-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.2rem max(1rem, env(safe-area-inset-right))
    max(1.4rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}
.camera-btn,
.camera-shutter {
  pointer-events: auto;
  border: 0;
  cursor: pointer;
}
.camera-btn {
  position: absolute;
  top: max(.85rem, env(safe-area-inset-top));
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}
.camera-close { left: max(.85rem, env(safe-area-inset-left)); font-size: 1.6rem; line-height: 1; }
.camera-flip { right: max(.85rem, env(safe-area-inset-right)); }
.camera-shutter {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 8px 24px rgba(0,0,0,.35);
}
.camera-shutter:active { transform: scale(.96); }
body.camera-open { overflow: hidden; }
#camera-video.camera-mirror { transform: scaleX(-1); }
.btn-icon {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff;
  border-radius: 12px; width: 2.55rem; height: 2.55rem; padding: 0;
  display: grid; place-items: center; cursor: pointer; font: inherit;
}
.btn-icon:hover { border-color: rgba(var(--fox-rgb),.45); background: rgba(var(--fox-rgb),.08); }
.chat-mic[hidden],
.chat-mic-cancel[hidden] { display: none !important; }
.chat-mic.is-recording {
  background: #e53935; border-color: #c62828; color: #fff;
  width: auto; min-width: 2.55rem; padding: 0 .7rem; gap: .35rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.chat-mic.is-recording .chat-mic-icon { display: none; }
.chat-mic.is-recording .chat-mic-timer { display: inline; font-size: .85rem; font-weight: 700; }
.chat-mic.is-recording::before {
  content: "⏹";
  font-size: .95rem;
  line-height: 1;
}
.chat-mic-timer[hidden] { display: none !important; }
.chat-mic-cancel {
  background: #fff;
  border-color: #e0e0e0;
  color: #666;
  font-size: 1rem;
}
.chat-mic-cancel:hover { border-color: #c62828; color: #c62828; background: #fff5f5; }
.voice-draft {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .75rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
}
.voice-draft[hidden] { display: none !important; }
.voice-draft-play {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--fox-rgb), .35);
  background: rgba(var(--fox-rgb), .1);
  color: var(--fox);
  cursor: pointer;
  font: inherit;
  display: grid;
  place-items: center;
}
.voice-draft-play:hover { background: rgba(var(--fox-rgb), .18); }
.voice-draft-track {
  flex: 1;
  min-width: 3rem;
  height: .35rem;
  border-radius: 999px;
  background: #e4e6eb;
  overflow: hidden;
}
.voice-draft-progress {
  height: 100%;
  width: 0%;
  background: var(--fox);
  border-radius: inherit;
  transition: width .1s linear;
}
.voice-draft-time {
  flex-shrink: 0;
  font-size: .78rem;
  color: rgba(70, 76, 86, .65);
  min-width: 2.4rem;
  text-align: right;
}
.voice-draft #voice-draft-audio { display: none; }
.voice-draft #voice-draft-delete { flex-shrink: 0; }
.voice-draft #voice-draft-send { flex-shrink: 0; }
.chat-head .chat-bg-btn { margin-left: auto; }
.chat-call-btn {
  flex-shrink: 0;
  width: 2.35rem; height: 2.35rem; border-radius: 999px;
  border: 1px solid rgba(var(--fox-rgb), .35);
  background: rgba(var(--fox-rgb), .12);
  color: var(--fox);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  margin-left: .15rem;
}
.chat-call-btn svg { display: block; }
.chat-call-btn:hover {
  background: rgba(var(--fox-rgb), .22);
  border-color: rgba(var(--fox-rgb), .5);
}
.chat-head .chat-close-btn { margin-left: .15rem; }
.chat-head:not(:has(.chat-bg-btn)):not(:has(.chat-call-btn)) .chat-close-btn { margin-left: auto; }
.call-overlay {
  position: fixed;
  z-index: 2000;
  right: max(12px, env(safe-area-inset-right));
  top: max(72px, env(safe-area-inset-top));
  left: auto;
  bottom: auto;
  width: min(300px, calc(100vw - 24px));
  pointer-events: none;
}
.call-overlay.is-open { pointer-events: auto; }
.call-overlay[hidden] { display: none !important; }
.call-card {
  background: var(--elev, #fff);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  overflow: hidden;
}
.call-header {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem .85rem .2rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.call-header.is-dragging,
.call-header:active { cursor: grabbing; }
.call-drag-grip {
  color: var(--muted);
  font-size: .85rem;
  letter-spacing: -.05em;
  line-height: 1;
}
.call-kicker {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
}
.call-body {
  padding: .15rem .95rem 1rem;
  text-align: center;
}
.call-body strong {
  display: block;
  font-size: 1.15rem;
  margin: .2rem 0 .15rem;
}
.call-timer { margin: 0; font-size: .85rem; }
.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: center;
  margin-top: .85rem;
}
.call-mute-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin-top: .55rem;
}
.call-mute-row[hidden] { display: none !important; }
.call-mute-btn {
  min-width: 7.5rem;
  font-size: .82rem !important;
  padding: .45rem .7rem !important;
}
.call-mute-btn.is-muted {
  border-color: rgba(198, 40, 40, .45) !important;
  color: #c62828 !important;
  background: rgba(198, 40, 40, .08) !important;
}
.call-accept { background: #2e7d32 !important; border-color: #2e7d32 !important; color: #fff !important; }
#call-remote-audio {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  left: -9999px;
  bottom: 0;
}
.call-event-line {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: .35rem 0;
  pointer-events: none;
  user-select: none;
}
.call-event-msg {
  margin: 0;
  max-width: min(460px, 94%);
  text-align: center;
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.4;
}
.call-event-msg.is-missed,
.msg-call.is-missed,
.chat-messages .call-event-msg.is-missed {
  color: #c62828;
  font-weight: 600;
}
.call-event-msg.is-ok,
.msg-call.is-ok,
.chat-messages .call-event-msg.is-ok {
  color: #22c55e;
  font-weight: 600;
}
.chat-system-line {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: .35rem 0;
  pointer-events: none;
  user-select: none;
  text-align: center;
  font-size: .86rem;
}
.bubble-msg-tools {
  position: absolute;
  top: .2rem;
  display: flex;
  gap: .2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 5;
}
.bubble-wrap.me .bubble-msg-tools { right: auto; left: .25rem; }
.bubble-wrap:not(.me) .bubble-msg-tools { right: .25rem; left: auto; }
@media (hover: hover) {
  .bubble-wrap:hover .bubble-msg-tools,
  .bubble-wrap:focus-within .bubble-msg-tools {
    opacity: 1;
    pointer-events: auto;
  }
}
.bubble-wrap.msg-actions-open .bubble-msg-tools {
  opacity: 1;
  pointer-events: auto;
}
.bubble-tool {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #555;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.bubble-tool:hover { color: var(--fox); border-color: rgba(var(--fox-rgb),.45); }
.bubble-tool-del:hover { color: #e53935; border-color: rgba(229,57,53,.45); }
.bubble.has-voice,
.bubble:has(.bubble-text) { padding-top: .7rem; }
.bubble-deleted {
  font-style: italic;
  color: var(--muted);
  font-size: .92rem;
}
.bubble-edited {
  font-size: .68rem;
  color: var(--muted);
  margin-top: .15rem;
}
.bubble-edit-form {
  display: grid;
  gap: .4rem;
  margin-top: .2rem;
  min-width: min(240px, 70vw);
}
.bubble-edit-input {
  width: 100%;
  resize: vertical;
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .45rem .55rem;
  font: inherit;
  background: #fff;
}
.bubble-edit-actions {
  display: flex;
  gap: .35rem;
  justify-content: flex-end;
}
.msg-delete-dialog {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.msg-delete-dialog[hidden] { display: none !important; }
.msg-delete-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(12,14,18,.45);
  cursor: pointer;
}
.msg-delete-card {
  position: relative;
  z-index: 1;
  width: min(340px, 100%);
  background: var(--elev, #fff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem 1.1rem 1rem;
  display: grid;
  gap: .45rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
}
.msg-delete-card h3 {
  margin: 0;
  font-size: 1.1rem;
}
.msg-delete-card .muted { margin: 0 0 .25rem; font-size: .9rem; }
.msg-del-btn {
  justify-content: center;
  width: 100%;
}
.msg-del-btn[data-del-scope="all"] { color: #e53935; }
.msg-del-cancel { margin-top: .25rem; width: 100%; justify-content: center; }
.bubble-audio {
  display: none;
}
.bubble.has-voice { min-width: min(240px, 72vw); }
.voice-msg {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .4rem;
  width: min(260px, 70vw);
  max-width: 100%;
  position: relative;
  z-index: 2;
}
.voice-play {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--fox-rgb),.45);
  background: #fff;
  color: var(--fox);
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.voice-play:hover { background: rgba(var(--fox-rgb),.1); }
.voice-play.is-playing { background: rgba(var(--fox-rgb),.18); }
.voice-play:disabled { opacity: .5; cursor: not-allowed; }
.voice-track {
  flex: 1;
  min-width: 0;
  height: .35rem;
  border-radius: 999px;
  background: rgba(0,0,0,.12);
  overflow: hidden;
}
.voice-progress {
  height: 100%;
  width: 0%;
  background: var(--fox);
  border-radius: inherit;
  transition: width .12s linear;
}
.voice-time {
  flex: 0 0 auto;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
  text-align: right;
}
.bubble.me .voice-play {
  border-color: rgba(var(--fox-rgb),.55);
}
.chat-preview {
  padding: .5rem .75rem 0;
}
.chat-preview[hidden] { display: none !important; }
.chat-share-card {
  display: flex; gap: .65rem; align-items: center;
  padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 14px;
  background: #fafafa;
}
.chat-preview img,
.chat-share-card img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-share-meta { flex: 1; min-width: 0; }
.chat-share-meta strong { display: block; font-size: .9rem; }
.chat-share-meta p {
  margin: .2rem 0 0; color: var(--muted); font-size: .85rem;
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bubble-img {
  display: block; max-width: min(260px, 70vw); max-height: 240px;
  border-radius: 12px; margin-top: .4rem; object-fit: cover;
}
.dropzone { position: relative; transition: box-shadow .15s ease, border-color .15s ease; }
.dropzone.is-dragover {
  outline: 2px dashed var(--fox);
  outline-offset: -4px;
  box-shadow: inset 0 0 0 999px rgba(var(--fox-rgb), 0.06);
}
.composer.dropzone.is-dragover { border-color: var(--fox); }

.grid-2 { display: grid; gap: 1rem; margin-bottom: 1rem; }
.card-grid { display: grid; gap: .85rem; }
.card h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.big { font-size: 2rem; font-weight: 800; margin: .4rem 0; color: var(--fox); }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.history li { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.cb-rule { margin: .35rem 0 .15rem; font-weight: 700; color: var(--ink); }
.cb-status { font-weight: 700; }
.cb-status-pending { color: #b26a00; }
.cb-status-booked { color: #1b7a3d; }
.cb-status-cancelled { color: #a12828; }

.profile-page { display: grid; gap: 1rem; }
.profile-hero {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: visible;
}
.cover,
#profile-cover {
  position: relative;
  height: clamp(180px, 30vw, 300px);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, #2a180c 0%, var(--fox) 55%, #7a3a10 100%);
  background-size: cover;
  background-position: center;
}
.cover-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.cover-video-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  will-change: opacity, transform;
}
.cover-edit {
  position: absolute;
  top: 14px;
  left: 1rem;
  right: auto;
  bottom: auto;
  z-index: 2;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .45rem .85rem;
  font: inherit;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}
.cover-edit:hover { background: rgba(0,0,0,.68); }
.cover-menu {
  position: absolute;
  top: calc(14px + 2.1rem);
  left: 1rem;
  z-index: 40;
  min-width: 12rem;
  display: grid;
  gap: .15rem;
  padding: .35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.cover-menu[hidden] { display: none !important; }
.cover-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: .55rem .65rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
}
.cover-menu button:hover:not(:disabled) {
  background: rgba(var(--fox-rgb),.1);
  color: var(--fox);
}
.cover-menu button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.cover.is-repositioning {
  cursor: grab;
  touch-action: none;
  user-select: none;
  overscroll-behavior: contain;
}
.cover.is-repositioning:active { cursor: grabbing; }
.cover-reposition-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .75rem;
  padding: .55rem .75rem;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(8px);
  color: #fff;
}
.cover-reposition-bar[hidden] { display: none !important; }
.cover-reposition-hint {
  font-size: .85rem;
  font-weight: 600;
}
.cover-reposition-actions {
  display: flex;
  gap: .4rem;
  margin-left: auto;
}
.cover-reposition-bar .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,.35);
}
.cover-reposition-bar .btn-ghost:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.profile-identity {
  display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; align-items: center;
  margin: 0; padding: 1.1rem 1.25rem 1.25rem;
}
.avatar-xl-wrap {
  position: relative; width: 96px; height: 96px; flex-shrink: 0;
}
.avatar-xl {
  width: 96px; height: 96px; border-radius: 50%; border: 3px solid #9ca3af;
  background: rgba(var(--fox-rgb),.25); color: var(--fox); font-weight: 800; font-size: 1.7rem;
  display: grid; place-items: center; overflow: hidden;
  padding: 0; background-size: cover; background-position: center;
  box-shadow: 0 0 0 3px #9ca3af;
}
.avatar-xl.is-online { border-color: #22c55e; box-shadow: 0 0 0 3px #22c55e; }
.avatar-xl.is-offline { border-color: #dc2626; box-shadow: 0 0 0 3px #dc2626; }
.avatar-xl.has-img span { display: none; }
.avatar-gear {
  position: absolute; left: 0; bottom: 0;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 2px solid var(--elev); background: #9aa0a6; color: #fff;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.avatar-gear:hover { background: #7e848b; }
.avatar-gear svg { display: block; }
.avatar-menu {
  position: absolute;
  left: 0;
  top: calc(100% + .35rem);
  z-index: 40;
  min-width: 11.5rem;
  display: grid;
  gap: .15rem;
  padding: .35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.avatar-menu[hidden] { display: none !important; }
.avatar-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: .55rem .65rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
}
.avatar-menu button:hover {
  background: rgba(var(--fox-rgb),.1);
  color: var(--fox);
}
.avatar-menu button.avatar-menu-danger { color: #b42318; }
.avatar-menu button.avatar-menu-danger:hover {
  background: rgba(180,35,24,.08);
  color: #912018;
}
.avatar-menu button[hidden] { display: none !important; }
.profile-identity-text { flex: 1; min-width: min(100%, 220px); }
.profile-identity-text h2 {
  margin: 0; font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.25; word-break: break-word;
}
.profile-identity-text #profile-meta {
  margin: .35rem 0 0; line-height: 1.4;
}
.profile-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center;
  position: relative;
  z-index: 6;
  pointer-events: auto;
}
.profile-actions .btn {
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(var(--fox-rgb), .18);
  min-height: 2.5rem;
  pointer-events: auto;
}
.profile-actions .btn[aria-disabled="true"] {
  opacity: .55;
}
.profile-actions .profile-msg-hint {
  flex: 1 1 100%;
  margin: .15rem 0 0;
}
.profile-preview-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin: 0 0 .85rem;
  padding: .7rem .9rem;
  border-radius: 14px;
  border: 1px solid rgba(var(--fox-rgb), .35);
  background: rgba(var(--fox-rgb), .1);
  color: var(--ink);
  font-weight: 650;
  font-size: .95rem;
}
.profile-preview-banner[hidden] { display: none !important; }
.profile-preview-banner .btn { flex-shrink: 0; }
.profile-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}
.accent-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  margin-top: .35rem;
}
.accent-picker input[type="color"] {
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.accent-picker input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.accent-picker input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}
.accent-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.accent-swatch {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  background: var(--swatch, #ff6a00);
  cursor: pointer;
  padding: 0;
}
.accent-swatch.is-active,
.accent-swatch:hover {
  box-shadow: 0 0 0 2px var(--fox);
}
.surface-swatch.is-active,
.surface-swatch:hover {
  box-shadow: 0 0 0 2px var(--profile-ink, var(--ink));
}
.muted-text-swatch.is-active,
.muted-text-swatch:hover {
  box-shadow: 0 0 0 2px var(--profile-ink, var(--ink));
}
.link-swatch.is-active,
.link-swatch:hover {
  box-shadow: 0 0 0 2px var(--profile-ink, var(--ink));
}
.heading-swatch.is-active,
.heading-swatch:hover {
  box-shadow: 0 0 0 2px var(--profile-ink, var(--ink));
}
.chat-swatch.is-active,
.chat-swatch:hover {
  box-shadow: 0 0 0 2px var(--ink);
}
.color-templates {
  display: grid;
  gap: .45rem;
  margin: .35rem 0 .55rem;
  padding: .75rem .85rem;
  border: 1px solid var(--profile-line, var(--line));
  border-radius: 12px;
  background: var(--profile-surface-input, rgba(0,0,0,.03));
}
.color-templates-title {
  font-weight: 700;
  color: var(--profile-ink, inherit);
}
.color-template-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.color-template-save-row input[type="text"] {
  flex: 1 1 10rem;
  min-width: 0;
}
.color-template-list {
  display: grid;
  gap: .4rem;
  margin-top: .15rem;
}
.color-template-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .55rem;
  padding: .4rem .5rem;
  border-radius: 10px;
  border: 1px solid var(--profile-line, var(--line));
  background: var(--profile-surface, var(--elev));
}
.color-template-swatches {
  display: flex;
  gap: .2rem;
  flex-shrink: 0;
}
.color-template-swatches span {
  width: .85rem;
  height: .85rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--swatch, #ccc);
}
.color-template-name {
  flex: 1 1 6rem;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--profile-ink, inherit);
}
.color-template-actions {
  display: flex;
  gap: .3rem;
  margin-left: auto;
}

/* Profile surface color — scoped via CSS variables set in JS on #view-profile */
#view-profile {
  --profile-surface: #ffffff;
  --profile-surface-input: #ffffff;
  --profile-heading: #111827;
  --profile-ink: var(--ink);
  --profile-muted: var(--muted);
  --profile-link: #2563eb;
  --profile-link-rgb: 37, 99, 235;
  --profile-line: var(--line);
}
#view-profile .card,
#view-profile .composer,
#view-profile .post {
  background: var(--profile-surface);
  border-color: var(--profile-line);
  color: var(--profile-ink);
}
#view-profile .about-card h3,
#view-profile .section-title,
#view-profile .profile-section-title,
#view-profile .profile-fold-toggle {
  color: var(--profile-heading, var(--profile-ink));
}
#view-profile .profile-bio,
#view-profile .profile-info-list dt,
#view-profile .profile-info-list dd,
#view-profile button.linkish {
  color: var(--profile-ink);
}
#view-profile .post {
  --post-muted: var(--profile-muted);
}
#view-profile .composer-input-wrap .rich-compose-field:empty::before,
#view-profile #profile-composer .rich-compose-field:empty::before {
  color: var(--profile-muted);
}
#view-profile .post-scope-legend,
#view-profile .post-scope-opt span {
  color: var(--profile-muted);
}
#view-profile .comment-field:empty::before,
#view-profile .comment-form .comment-input-wrap .rich-compose-field:empty::before {
  color: var(--profile-muted);
}
#view-profile .muted,
#view-profile .hint,
#view-profile #profile-form label {
  color: var(--profile-muted);
}
#view-profile.profile-surface-dark time.post-time {
  color: rgba(242, 242, 242, 0.85);
}
#view-profile input:not([type="color"]):not([type="checkbox"]):not([type="file"]):not([type="radio"]),
#view-profile textarea,
#view-profile select,
#view-profile .rich-compose-field {
  background: var(--profile-surface-input);
  color: var(--profile-ink);
  border-color: var(--profile-line);
}
#view-profile .composer-input-wrap textarea,
#view-profile .composer-input-wrap .rich-compose-field {
  background: var(--profile-surface-input);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -1px 3px rgba(0, 0, 0, .06);
}
#view-profile.profile-surface-dark .composer-input-wrap textarea,
#view-profile.profile-surface-dark .composer-input-wrap .rich-compose-field {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -1px 3px rgba(0, 0, 0, .2);
}
#view-profile .profile-fold {
  border-top-color: var(--profile-line);
}
#view-profile .profile-section-title {
  border-top-color: var(--profile-line);
}
#view-profile .post-actions .action-ico:hover {
  background: var(--profile-surface-input);
  border-color: var(--profile-line);
}
#view-profile .post-edit-box textarea {
  background: var(--profile-surface-input);
  color: var(--profile-ink);
  border-color: var(--profile-line);
}
#view-profile .profile-web-link,
#view-profile .post-visibility-link,
#view-profile button.linkish.mention {
  color: var(--post-link, var(--profile-link));
}
#view-profile .post .mention.linkish {
  color: var(--post-link, var(--profile-link));
  background: rgba(var(--post-link-rgb, var(--profile-link-rgb)), .1);
}
#view-profile .comment-field,
#view-profile .comment-edit-box .comment-field {
  background: var(--profile-surface-input);
  color: var(--profile-ink);
  border-color: var(--profile-line);
}

.profile-body {
  display: grid; gap: 1rem;
}
.profile-side-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  align-self: start;
}
.profile-posts-col {
  min-width: 0;
  width: 100%;
}
.profile-ads-rail {
  min-width: 0;
  width: 100%;
}
.profile-ads-rail .rail-card {
  width: 100%;
}
.profile-ads-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  width: 100%;
}
.profile-ads-list--fill {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.profile-ads-list--fill .profile-ad-card,
.profile-ads-list--fill .profile-ad-placeholder {
  flex: 1 1 0;
  min-height: 64px;
  max-height: none;
  aspect-ratio: auto;
  height: auto;
  padding: .35rem;
}
.profile-ads-list--fill .profile-ad-placeholder {
  display: grid;
  place-content: center;
}
.profile-ads-list--fill .profile-ad-placeholder-dim {
  min-height: 0;
}
.profile-ad-card--rail {
  aspect-ratio: auto;
}
.profile-ads-left {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  width: 100%;
  overflow: hidden;
  min-height: 0;
}
.profile-ads-left[hidden] { display: none !important; }
.profile-ads-left .profile-ad-card,
.profile-ads-left .profile-ad-placeholder {
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 5 / 3;
  max-height: 92px;
  border-radius: 12px;
  padding: .45rem;
}
.profile-ads-left--fill .profile-ad-card,
.profile-ads-left--fill .profile-ad-placeholder {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  height: auto;
}
.profile-ads-left .profile-ad-placeholder {
  min-height: 0;
  display: grid;
  place-content: center;
}
.profile-ads-left .profile-ad-placeholder-label {
  font-size: .68rem;
}
.profile-ad-card {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1c20;
  aspect-ratio: 16 / 10;
  position: relative;
}
.profile-ad-card-link {
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.profile-ad-card-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.profile-ad-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-ad-placeholder {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
  background: rgba(0, 0, 0, .02);
}
.profile-ad-placeholder-dim {
  opacity: .55;
  min-height: 5rem;
  display: grid;
  place-items: center;
}
.profile-ad-placeholder-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
#view-profile .post-image {
  max-height: 360px;
}
#view-profile .post-image-wrap,
#view-profile .post-image-media {
  max-height: 360px;
  overflow: hidden;
}
.section-title { margin: 0 0 .75rem; font-size: 1.05rem; }
.about-card h3 { margin: 0; }
.profile-section-title {
  margin: .85rem 0 0;
  font-size: .92rem;
  font-weight: 800;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: .85rem;
}
.profile-fold {
  margin: .35rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: .15rem;
}
.profile-fold-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border: 0;
  background: transparent;
  padding: .7rem .1rem;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: .95rem;
  font-weight: 800;
  color: var(--ink);
  text-align: left;
  border-radius: 10px;
  transition: background .2s ease, color .2s ease;
}
.profile-fold-toggle:hover {
  background: rgba(var(--fox-rgb), .06);
  color: var(--fox);
}
.profile-fold-chevron {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .04);
  color: var(--muted);
  transition: transform .35s cubic-bezier(.22, .61, .36, 1), background .2s ease, color .2s ease;
}
.profile-fold-chevron::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(-1px, -1px);
}
.profile-fold.is-open .profile-fold-chevron {
  transform: rotate(90deg);
  background: rgba(var(--fox-rgb), .12);
  color: var(--fox);
}
.profile-fold-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s cubic-bezier(.22, .61, .36, 1);
}
.profile-fold.is-open .profile-fold-panel {
  grid-template-rows: 1fr;
}
.profile-fold-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity .28s ease,
    transform .35s cubic-bezier(.22, .61, .36, 1),
    padding .35s ease;
  padding: 0 .05rem;
}
.profile-fold.is-open .profile-fold-inner {
  opacity: 1;
  transform: translateY(0);
  padding: .15rem .05rem .55rem;
}
.profile-fold-inner.form-grid {
  margin-top: 0;
  gap: .7rem;
}
.profile-danger .profile-fold {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.profile-danger .profile-fold-toggle {
  color: #b42318;
}
.profile-danger .profile-fold-toggle:hover {
  background: rgba(180, 35, 24, .06);
  color: #912018;
}
.profile-danger .profile-fold.is-open .profile-fold-chevron {
  background: rgba(180, 35, 24, .1);
  color: #b42318;
}
.profile-danger .profile-fold-inner .muted {
  margin: 0 0 .65rem;
}
.profile-bio {
  margin: .65rem 0 0;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-info-list {
  margin: .85rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.profile-info-row {
  display: grid;
  gap: .2rem;
  padding: .72rem 0;
  border-bottom: 1px solid var(--line);
}
.profile-info-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.profile-info-row dt {
  margin: 0;
  font-size: .78rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: .01em;
}
.profile-info-row dd {
  margin: 0;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.profile-info-row dd .profile-presence.is-online,
.profile-info-row dd .profile-presence.is-offline {
  font-weight: 600;
}
.profile-web-link {
  color: var(--profile-link, var(--fox));
  font-weight: 700;
  text-decoration: none;
}
.profile-web-link:hover { text-decoration: underline; }
.bullets { color: var(--muted); margin: .75rem 0 1rem; padding-left: 1.2rem; }
.bullets li { margin: .35rem 0; }

.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--elev); border: 1px solid var(--line); padding: .7rem 1rem;
  border-radius: 999px; z-index: 50;
  box-shadow: 0 10px 30px rgba(80,40,10,.12);
}

.user-menu {
  position: fixed; z-index: 80; min-width: 200px;
  background: var(--elev); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(40, 24, 8, 0.16);
  padding: .35rem; display: grid; gap: .15rem;
}
.user-menu[hidden] { display: none !important; }
.user-menu-title {
  padding: .45rem .7rem .25rem; font-size: .78rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-menu button {
  border: 0; background: transparent; text-align: left; width: 100%;
  padding: .55rem .7rem; border-radius: 8px; cursor: pointer;
  color: var(--ink); font: inherit; font-weight: 600;
}
.user-menu button:hover { background: rgba(var(--fox-rgb),.1); color: var(--fox); }
.user-menu-sep { height: 1px; background: var(--line); margin: .2rem .35rem; }
.user-menu button.admin-mod { color: #b45309; }
.user-menu button.admin-mod:hover { background: rgba(180, 83, 9, .12); color: #92400e; }
button.admin-mod, .post-own button.admin-mod {
  border-color: rgba(180, 83, 9, .35); color: #b45309;
}
.profile-admin-actions {
  display: flex; flex-wrap: wrap; gap: .45rem; width: 100%; margin-top: .5rem;
  padding-top: .5rem; border-top: 1px dashed var(--line);
}

.post-own {
  margin-left: auto; display: flex; gap: .35rem; align-self: flex-start;
}
.post-own button {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: .25rem .65rem; cursor: pointer; font-size: .82rem;
}
.post-own button:hover { color: var(--fox); border-color: rgba(var(--fox-rgb),.4); }
.post-edit-box { margin: .5rem 0; display: grid; gap: .5rem; }
.post-edit-box textarea {
  width: 100%; min-height: 80px; resize: vertical; font: inherit;
  border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem;
  background: var(--bg); color: var(--ink);
}
.post-edit-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.post-edit-scope { margin: 0; border: 0; padding: 0; }
.post-edit-scope .post-scope-opt { font-size: .875rem; }

.chat-menu {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 4.2rem);
  right: max(.75rem, env(safe-area-inset-right, 0px));
  z-index: 85;
  width: min(340px, calc(100vw - 1.25rem));
  max-width: calc(100vw - 1.25rem);
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(40, 24, 8, 0.16);
  overflow-x: hidden;
  overflow-y: hidden;
  transform-origin: top right;
  animation: chat-menu-in .28s cubic-bezier(.22, 1, .36, 1);
}
.chat-menu[hidden] { display: none !important; }
.chat-menu.is-leaving {
  animation: chat-menu-out .22s cubic-bezier(.4, 0, .2, 1) forwards;
  pointer-events: none;
}
.chat-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .85rem 1rem .55rem;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.chat-menu-head strong { font-size: .95rem; min-width: 0; }
.chat-menu-list {
  max-height: calc(5 * 4.15rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: .35rem;
  display: grid;
  gap: .2rem;
  min-width: 0;
}
.chat-menu-item {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; max-width: 100%; min-width: 0;
  text-align: left;
  border: 0; background: transparent; color: inherit;
  border-radius: 12px; padding: .55rem .65rem;
  cursor: pointer; font: inherit;
  box-sizing: border-box;
}
.chat-menu-item:hover,
.chat-menu-item:focus-visible {
  background: rgba(var(--fox-rgb), 0.08);
  outline: none;
}
.chat-menu-item.is-unread {
  background: rgba(var(--fox-rgb), 0.06);
}
.chat-menu-item.is-unread strong::after {
  content: "";
  display: inline-block;
  width: .45rem; height: .45rem; border-radius: 50%;
  background: var(--fox); margin-left: .4rem; vertical-align: middle;
}
.chat-menu-item .avatar {
  width: 2.35rem; height: 2.35rem; font-size: .75rem; flex-shrink: 0;
}
.chat-menu-meta { min-width: 0; flex: 1; }
.chat-menu-meta strong {
  display: block; font-size: .92rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-menu-meta .hint {
  margin: .15rem 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-menu-empty {
  margin: 0; padding: 1.1rem .85rem 1.25rem;
  color: var(--muted); font-size: .9rem; text-align: center;
}
@keyframes chat-menu-in {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chat-menu-out {
  to { opacity: 0; transform: translateY(-6px) scale(.97); }
}
@media (max-width: 959px) {
  .chat-menu {
    top: calc(env(safe-area-inset-top, 0px) + 3.7rem);
    right: .5rem;
    left: .5rem;
    width: auto;
  }
}

.notify-stack {
  position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 70;
  display: flex; flex-direction: column; gap: .65rem;
  width: min(340px, calc(100vw - 1.5rem));
  pointer-events: none;
}
.notify-card {
  pointer-events: auto;
  position: relative;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .85rem 1rem;
  box-shadow: 0 12px 36px rgba(40, 24, 8, 0.14);
  animation: notify-in .35s cubic-bezier(.22, 1, .36, 1);
  cursor: pointer;
  transform-origin: right bottom;
  will-change: transform, opacity;
}
.notify-card.is-leaving {
  pointer-events: none;
  animation: notify-out .45s cubic-bezier(.4, 0, .2, 1) forwards;
}
.notify-close {
  position: absolute; top: .35rem; right: .45rem;
  border: 0; background: transparent; color: var(--muted);
  font-size: 1.15rem; line-height: 1; cursor: pointer; padding: .2rem .35rem;
}
.notify-row { display: flex; gap: .7rem; align-items: center; padding-right: 1.2rem; }
.notify-ico {
  display: none;
  width: 1.35rem; height: 1.35rem;
  place-items: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.notify-actions { display: flex; gap: .4rem; margin-top: .65rem; flex-wrap: wrap; }

/* Handy: winzige Popups nur mit Symbol + Name */
@media (max-width: 720px) {
  .notify-stack {
    bottom: calc(.45rem + env(safe-area-inset-bottom, 0px));
    right: .45rem;
    left: auto;
    width: auto;
    max-width: min(200px, calc(100vw - .9rem));
    gap: .35rem;
  }
  .notify-card {
    padding: .28rem .55rem .28rem .4rem;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(40, 24, 8, 0.16);
  }
  .notify-close,
  .notify-actions,
  .notify-row .hint,
  .notify-row .avatar {
    display: none !important;
  }
  .notify-row {
    gap: .3rem;
    padding-right: 0;
  }
  .notify-ico { display: grid; }
  .notify-row strong {
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 9.5rem;
  }
}
@keyframes notify-in {
  from { opacity: 0; transform: translate3d(18px, 10px, 0) scale(.96); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes notify-out {
  0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(28px, 6px, 0) scale(.94); }
}

.notifications-list { display: grid; gap: .65rem; margin-top: 1rem; }
.notif-row {
  display: flex; gap: .75rem; align-items: center;
  padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: #fafafa;
}
.notif-row .actions { margin-left: auto; display: flex; gap: .35rem; flex-wrap: wrap; }
.notif-row .hint { margin: .15rem 0 0; }

@media (min-width: 960px) {
  body:has(#app:not([hidden])),
  html.has-session body {
    overflow: auto;
    height: auto;
  }

  /* Instagram-Style: schmal (nur Icons), bei Hover/Focus mit Labels */
  .app {
    display: grid;
    grid-template-rows: none;
    grid-template-columns: 72px 1fr;
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
    transition: grid-template-columns .22s ease;
  }
  .app:has(.nav:hover),
  .app:has(.nav:focus-within) {
    grid-template-columns: 244px 1fr;
  }

  .main {
    overflow: visible;
    padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
  }

  .nav {
    flex-direction: column; align-items: stretch; border-bottom: 0;
    border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
    padding: 1rem .55rem .85rem;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    backdrop-filter: none;
    box-shadow: none;
    transition: padding .22s ease, box-shadow .22s ease;
  }
  .nav:hover,
  .nav:focus-within {
    padding: 1.1rem .85rem 1rem;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.04);
  }

  .nav-top { width: auto; margin-bottom: .65rem; }
  .header-actions-mobile { display: none !important; }
  .header-actions-desktop { display: flex; }
  .topbar {
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 1.25rem;
    padding: .65rem 0 .85rem;
    background: linear-gradient(to bottom, var(--bg) 75%, transparent);
  }
  .topbar h1 { font-size: 1.5rem; }
  .topbar .sub { display: block; }
  .topbar-right .points { display: grid; }
  .nav-menu-btn,
  .nav-more-tab,
  .nav-sheet-backdrop,
  .nav-sheet-handle,
  .nav-sheet-panel > h2 { display: none !important; }
  /* Higher specificity than .nav-secondary .nav-item { display:inline-flex !important } */
  .nav-secondary .nav-item.nav-sheet-extra { display: none !important; }

  .nav-stack,
  .nav-primary,
  .nav-secondary,
  .nav-sheet,
  .nav-sheet[hidden],
  .nav-sheet-panel {
    display: contents !important;
  }

  .nav-primary .nav-item {
    display: inline-flex !important;
  }

  .brand { margin: 0; padding: .45rem; justify-content: center; width: 100%; }
  .nav:hover .brand,
  .nav:focus-within .brand {
    justify-content: flex-start; padding: .35rem .5rem; gap: .55rem;
  }
  .brand span {
    max-width: 0; opacity: 0;
    transition: max-width .2s ease, opacity .15s ease;
  }
  .nav:hover .brand span,
  .nav:focus-within .brand span {
    max-width: 140px; opacity: 1;
  }

  .nav-item {
    flex-direction: row;
    justify-content: center;
    padding: .65rem;
    gap: 0;
    width: 100%;
    flex: none;
    text-align: left;
    border-radius: 12px;
    color: var(--ink);
  }
  .nav:hover .nav-item,
  .nav:focus-within .nav-item {
    justify-content: flex-start;
    padding: .6rem .85rem;
    gap: .85rem;
  }
  .nav-item:hover { background: #f2f2f2; }

  .nav-label {
    font-size: .98rem;
    max-width: 0; opacity: 0;
    transition: max-width .2s ease, opacity .15s ease, margin .2s ease;
  }
  .nav:hover .nav-label,
  .nav:focus-within .nav-label {
    max-width: 180px; opacity: 1;
  }
  .nav-label-sm { display: none; }
  .nav-label-lg { display: inline; }

  .nav-ico,
  .nav-ico img {
    width: 1.7rem; height: 1.7rem;
  }

  .nav-item.is-active {
    background: #f2f2f2;
    color: var(--ink);
  }
  .nav-item.nav-danger { margin-top: auto; }

  .split { grid-template-columns: 280px 1fr; }
  .grid-2, .card-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .profile-body {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
  }
  .profile-posts-col {
    max-width: 560px;
    margin-inline: auto;
  }
  .profile-ads-rail {
    grid-column: 2;
    grid-row: 2;
    max-width: 560px;
    margin-inline: auto;
    width: 100%;
  }
  .profile-ads-left { display: flex; }
}

@media (min-width: 1180px) {
  .profile-body {
    /* Side | centered posts | right ads fill remaining width */
    grid-template-columns: 240px minmax(0, 560px) minmax(280px, 1fr);
    gap: 1.1rem 1.25rem;
    justify-content: stretch;
  }
  .profile-posts-col {
    max-width: 560px;
    width: 100%;
    margin-inline: 0;
    justify-self: stretch;
  }
  .profile-ads-rail {
    grid-column: 3;
    grid-row: 1;
    max-width: none;
    width: 100%;
    margin-inline: 0;
    justify-self: stretch;
    align-self: start;
  }
  .profile-ads-rail .rail-card {
    max-width: none;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }
  .profile-ads-rail .profile-ads-list {
    flex: 1;
    min-height: 0;
    width: 100%;
  }
  .profile-ads-rail .profile-ad-card,
  .profile-ads-rail .profile-ad-placeholder {
    width: 100%;
    box-sizing: border-box;
  }
}

.profile-top-ad {
  display: none;
  width: 100%;
  margin: 0;
}
.profile-top-ad[hidden] { display: none !important; }
.profile-top-ad-card {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  aspect-ratio: 6 / 1;
  min-height: 48px;
  max-height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1c20;
  place-content: center;
  padding: 0;
}
.profile-top-ad-card.profile-ad-placeholder {
  border-style: dashed;
  background: rgba(0, 0, 0, .02);
}
.profile-top-ad .profile-ad-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-billboard {
  width: 100%;
  margin: 0 0 .15rem;
}
.profile-billboard[hidden] { display: none !important; }
.profile-billboard-card,
.profile-billboard-placeholder {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 5 / 1;
  min-height: 88px;
  max-height: 160px;
}
.profile-billboard-card {
  display: block;
  border: 1px solid var(--line);
  background: #1a1c20;
}
.profile-billboard-placeholder {
  display: grid;
  place-content: center;
  gap: .25rem;
  text-align: center;
  padding: .85rem 1rem;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, .02);
}
.profile-billboard .profile-ad-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-mobile-ads {
  display: none;
}
.profile-mobile-ad-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 2.4 / 1;
  max-height: 72px;
  min-height: 48px;
  border: 1px solid var(--line);
  background: #1a1c20;
  padding: 0;
}
.profile-mobile-ad-btn.profile-ad-placeholder {
  display: grid;
  place-content: center;
  border-style: dashed;
  background: rgba(0, 0, 0, .02);
}
.profile-mobile-ad-btn .profile-ad-placeholder-label {
  font-size: .65rem;
}

/* Community + profile (desktop): slim banner strip between posts */
#feed .infeed-ad-slot,
#profile-feed .infeed-ad-slot {
  display: block;
  width: 100%;
  margin: .1rem 0 .55rem;
}
#feed .infeed-ad-card,
#feed .infeed-ad-placeholder,
#profile-feed .infeed-ad-card,
#profile-feed .infeed-ad-placeholder {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  aspect-ratio: 6 / 1;
  min-height: 56px;
  max-height: 96px;
  border-radius: 12px;
  place-content: center;
  gap: .25rem;
}
#feed .infeed-ad-card,
#profile-feed .infeed-ad-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1c20;
}
#feed .infeed-ad-media,
#profile-feed .infeed-ad-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* mobile profile keeps slim in-feed strips (see max-width: 899px block) */

/* Mobile master toggle for profile info (desktop: hidden) */
.profile-info-mobile-toggle {
  display: none;
}
.profile-info-mobile-body {
  display: contents;
}

/* Phone / narrow tablet: collapsible profile info, centered posts, no bottom ads */
@media (max-width: 899px) {
  .profile-page { gap: .65rem; }
  .profile-top-ad:not([hidden]) {
    display: block;
  }
  .cover,
  #profile-cover {
    height: clamp(96px, 22vw, 148px);
  }
  .profile-identity {
    padding: .65rem .75rem .75rem;
    gap: .65rem;
    position: relative;
    z-index: 5;
  }
  .profile-identity-text {
    position: relative;
    z-index: 5;
    min-width: 0;
    width: 100%;
  }
  .profile-identity-text h2 {
    font-size: 1.15rem;
  }
  .profile-actions {
    width: 100%;
    gap: .45rem;
  }
  .profile-actions .btn {
    min-height: 2.75rem;
    padding: .65rem 1rem;
  }
  /* Avatar menus must never cover Message / Follow taps */
  .avatar-xl-wrap {
    z-index: 1;
  }
  .avatar-menu[hidden],
  .cover-menu[hidden] {
    display: none !important;
    pointer-events: none !important;
  }
  .profile-billboard--mobile .profile-mobile-ads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
  }
  .profile-billboard--mobile .profile-billboard-card,
  .profile-billboard--mobile .profile-billboard-placeholder {
    display: none;
  }
  .profile-body {
    grid-template-columns: 1fr;
    gap: .7rem;
    align-items: stretch;
    padding-inline: .15rem;
  }
  .profile-side-col {
    position: static;
    width: 100%;
    max-width: 36rem;
    margin-inline: auto;
    z-index: 2;
  }
  .profile-posts-col {
    width: 100%;
    max-width: 36rem;
    margin-inline: auto;
    padding-inline: .45rem;
    box-sizing: border-box;
    overflow: visible;
  }
  #profile-feed {
    overflow: visible;
  }
  #profile-feed .post {
    overflow: visible;
  }
  #profile-feed .post-head {
    padding-left: 2px; /* room for avatar online ring */
  }
  #profile-feed .avatar {
    margin: 2px;
  }
  .profile-ads-rail {
    display: none !important;
  }
  .profile-ads-left {
    display: none !important;
  }

  #view-profile .about-card {
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
  }
  .profile-info-mobile-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    border: 0;
    background: transparent;
    padding: .85rem 1rem;
    margin: 0;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    text-align: left;
  }
  .profile-info-mobile-toggle:hover {
    background: rgba(var(--fox-rgb), .06);
    color: var(--fox);
  }
  .profile-info-mobile-chevron {
    width: 1.45rem;
    height: 1.45rem;
    flex-shrink: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .05);
    color: var(--muted);
    transition: background .2s ease, color .2s ease, transform .25s ease;
  }
  .profile-info-mobile-chevron::before {
    content: "";
    width: .48rem;
    height: .48rem;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px); /* down */
  }
  .profile-side-col.is-mobile-open .profile-info-mobile-chevron {
    background: rgba(var(--fox-rgb), .12);
    color: var(--fox);
    transform: rotate(180deg); /* up */
  }
  .profile-info-mobile-body {
    display: none;
    padding: 0 .85rem .85rem;
  }
  .profile-side-col.is-mobile-open .profile-info-mobile-body {
    display: block;
  }
  .profile-side-col.is-mobile-open .profile-info-mobile-toggle {
    border-bottom: 1px solid var(--line);
  }

  #view-profile .profile-fold {
    margin-top: .15rem;
    padding-top: .05rem;
  }
  #view-profile .profile-fold-toggle {
    font-size: .9rem;
    font-weight: 700;
    padding: .55rem .1rem;
  }
  #feed .infeed-ad-card,
  #feed .infeed-ad-placeholder,
  #profile-feed .infeed-ad-card,
  #profile-feed .infeed-ad-placeholder {
    aspect-ratio: 5 / 1;
    max-height: 64px;
    min-height: 44px;
    border-radius: 10px;
  }
  #profile-feed .infeed-ad-slot {
    display: block;
    margin: .1rem 0 .45rem;
  }
}

@media (max-width: 639px) {
  .profile-posts-col {
    padding-inline: .55rem;
  }
  .profile-mobile-ad-btn {
    max-height: 58px;
    min-height: 44px;
    border-radius: 10px;
  }
}

.messenger-chat-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.messenger-ads-slot {
  margin: 0;
  width: 100%;
  flex: 0 0 auto;
}
.messenger-chat-col .chat-pane {
  flex: 1 1 auto;
  min-height: 0;
}
.messenger-ads-slot .profile-ad-card,
.messenger-ads-slot .profile-ad-placeholder {
  width: 100%;
  max-height: 140px;
  aspect-ratio: 16 / 5;
}
.messenger-ad-card .profile-ad-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-ads-rail {
  min-width: 0;
  width: 100%;
}
.community-ads-rail[hidden] { display: none !important; }
.community-ads-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.community-ads-card > h3 {
  margin: 0 0 .55rem;
  flex: 0 0 auto;
}
.community-ads-card .profile-ads-list {
  flex: 1 1 auto;
  min-height: 0;
}
.rail.rail-right {
  flex-direction: column;
  gap: 1rem;
  align-self: start;
}

@media (min-width: 1180px) {
  .community-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    align-items: start;
  }
  .rail { display: block; position: sticky; top: 1rem; }
  .rail.rail-right {
    display: flex;
    position: sticky;
    top: 1rem;
  }
}


/* Foxpal header / cover FX */
.post-image-media.fp-headerfx {
  isolation: isolate;
}
.post-image-media.fp-headerfx > .post-image-btn {
  position: relative;
  z-index: 1;
}
.post-image-media .fp-headerfx__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.cover.fp-headerfx,
#profile-cover.fp-headerfx {
  isolation: isolate;
}
.cover .fp-headerfx__canvas,
#profile-cover .fp-headerfx__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
#profile-avatar-btn.fp-headerfx {
  isolation: isolate;
}
#profile-avatar-btn.fp-headerfx .fp-headerfx__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
#profile-avatar-btn.fp-headerfx > #profile-avatar {
  position: relative;
  z-index: 1;
}

/* Avatar FX — all profile thumbnails (subdued intensity via JS) */
.avatar.fp-headerfx,
.composer-avatar-btn.fp-headerfx,
.header-avatar.fp-headerfx,
#profile-composer-avatar.fp-headerfx,
.avatar-xl.fp-headerfx {
  isolation: isolate;
}
.avatar.fp-headerfx .fp-headerfx__canvas,
.composer-avatar-btn.fp-headerfx .fp-headerfx__canvas,
.header-avatar.fp-headerfx .fp-headerfx__canvas,
#profile-composer-avatar.fp-headerfx .fp-headerfx__canvas,
.avatar-xl.fp-headerfx .fp-headerfx__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
.avatar.fp-headerfx > *:not(.fp-headerfx__canvas),
.composer-avatar-btn.fp-headerfx > *:not(.fp-headerfx__canvas),
.avatar-xl.fp-headerfx > *:not(.fp-headerfx__canvas) {
  position: relative;
  z-index: 1;
}

/* Companies & Groups */
.nav-ico-svg{display:grid;place-items:center;width:100%;height:100%;color:var(--muted)}
.nav-item.is-active .nav-ico-svg{color:var(--fox)}
/* Lotto tip community */
.lotto-hero{display:grid;gap:1rem}
.lotto-hero-top{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start;flex-wrap:wrap}
.lotto-hero-top h2{margin:0}
.lotto-countdown{
  font-weight:700;font-size:.95rem;padding:.55rem .85rem;border-radius:12px;
  background:rgba(var(--fox-rgb),.1);color:var(--fox);white-space:nowrap;
}
.lotto-pot{display:grid;gap:.2rem}
.lotto-pot span{color:var(--muted);font-size:.9rem}
.lotto-pot strong{font-size:2rem;letter-spacing:-.02em;color:var(--ink)}
.lotto-stats-row{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;
}
@media (min-width:720px){
  .lotto-stats-row{grid-template-columns:repeat(4,minmax(0,1fr))}
}
.lotto-stats-row > div{display:grid;gap:.15rem;padding:.65rem .75rem;border-radius:12px;background:rgba(0,0,0,.03)}
.lotto-stats-row span{font-size:.78rem;color:var(--muted)}
.lotto-stats-row strong{font-size:1.05rem}
.lotto-progress-wrap{display:grid;gap:.35rem}
.lotto-progress-bar{height:.55rem;border-radius:999px;background:rgba(0,0,0,.08);overflow:hidden}
.lotto-progress-bar i{display:block;height:100%;background:var(--fox);border-radius:inherit;transition:width .25s ease}
.lotto-form{display:grid;gap:.65rem;max-width:420px}
.lotto-form label{display:grid;gap:.3rem;font-size:.9rem;color:var(--muted)}
.lotto-form input[type="number"]{
  border:1px solid var(--line);border-radius:12px;padding:.7rem .8rem;background:#fff;color:var(--ink);font:inherit;
}
.lotto-form .check{display:flex;align-items:flex-start;gap:.5rem;color:var(--ink)}
.lotto-rows{display:grid;gap:.65rem}
.lotto-row{
  display:grid;gap:.45rem;padding:.75rem .85rem;border:1px solid var(--line);border-radius:14px;background:var(--elev);
}
.lotto-row.is-pending{opacity:.55}
.lotto-row-head{display:flex;justify-content:space-between;gap:.5rem;align-items:center;font-size:.9rem}
.lotto-balls{display:flex;flex-wrap:wrap;gap:.35rem}
.lotto-ball{
  width:2.1rem;height:2.1rem;border-radius:50%;display:grid;place-items:center;
  font-weight:700;font-size:.85rem;background:linear-gradient(160deg,#fff 10%,#ffe3cc 100%);
  border:1px solid rgba(var(--fox-rgb),.35);color:var(--ink);box-shadow:0 2px 6px rgba(0,0,0,.06);
}
.lotto-ball.is-hit{background:var(--fox);color:#fff;border-color:var(--fox)}
.lotto-history{display:grid;gap:.45rem}
.lotto-history-row{
  display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap;
  padding:.65rem .75rem;border-radius:12px;border:1px solid var(--line);
}

.entity-list{display:grid;gap:.65rem;margin:.85rem 0}
.entity-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.75rem .9rem;border:1px solid var(--line);border-radius:12px;background:var(--elev)}
.entity-row-group{align-items:flex-start}
.entity-row-body{flex:1;min-width:0}
.entity-row strong{display:block}
.entity-row .muted{font-size:.85rem;margin:.15rem 0 0}
.entity-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.entity-avatar{
  width:2.6rem;height:2.6rem;border-radius:12px;flex-shrink:0;
  background:#f0f1f3 center/cover no-repeat;display:grid;place-items:center;
  font-weight:700;font-size:.85rem;color:var(--fox);
}
.entity-avatar-fallback{background:rgba(var(--fox-rgb),.12)}
.join-answers{display:grid;gap:.35rem;margin:.35rem 0 .45rem;width:100%}
.join-answer{display:grid;gap:.1rem;padding:.4rem .55rem;border-radius:10px;background:rgba(0,0,0,.04);font-size:.85rem}
.join-answer strong{font-weight:600}
.group-pending-label{display:inline-block;padding:.35rem .65rem;border-radius:999px;background:rgba(var(--fox-rgb),.1);color:var(--fox);font-weight:600;font-size:.85rem}
.group-pending-title,.group-members-title{margin:1rem 0 .55rem;font-size:.95rem}
.group-pending-title{color:var(--fox)}
.member-chip.is-pending-member{border:1px solid rgba(var(--fox-rgb),.28);background:rgba(var(--fox-rgb),.04);border-radius:12px;padding:.55rem .65rem;margin-bottom:.4rem;display:flex;flex-wrap:wrap;gap:.55rem;align-items:flex-start}
.entity-hr{border:0;border-top:1px solid var(--line);margin:1.25rem 0}
.company-page-card{overflow:hidden;padding-top:0}
.company-cover,.group-cover{height:140px;margin:0 -1.1rem 0;background:linear-gradient(135deg,rgba(var(--fox-rgb),.25),#e8eaed 55%,#f4f5f7);background-size:cover;background-position:center}
.company-identity{display:flex;gap:1rem;align-items:flex-end;margin-top:-36px;position:relative}
.company-logo{width:72px;height:72px;border-radius:16px;background:var(--fox);color:#fff;display:grid;place-items:center;font-weight:800;font-size:1.1rem;border:3px solid var(--elev);overflow:hidden;flex-shrink:0;background-size:cover;background-position:center}
.company-identity-text{min-width:0;padding-bottom:.15rem}
.company-identity-text h2{margin:0 0 .2rem;font-size:1.35rem}
.company-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.55rem}
.company-bio{white-space:pre-wrap;color:var(--ink);line-height:1.45}
.company-body{margin-top:1rem}
.group-manage-box,.group-invite-box,.group-wall-wrap{margin-top:1.1rem;padding-top:.85rem;border-top:1px solid var(--line)}
.group-media-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.group-invite-link-row{display:flex;flex-wrap:wrap;gap:.45rem;margin:.55rem 0 .75rem}
.group-invite-link-row input{flex:1 1 180px;min-width:0}
.group-composer{margin:.65rem 0 1rem}
.group-feed .post{margin-bottom:.75rem}
.group-chat-pane{margin-top:1.1rem;padding:.85rem;border:1px solid var(--line);border-radius:14px;background:var(--elev)}
.group-chat-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.55rem}
.group-chat-head h3{margin:0}
.group-chat-messages{max-height:280px;overflow:auto;display:grid;gap:.45rem;padding:.35rem 0 .65rem}
.group-chat-bubble{padding:.45rem .65rem;border-radius:12px;background:rgba(0,0,0,.04);max-width:92%}
.group-chat-bubble.is-mine{background:rgba(var(--fox-rgb),.14);justify-self:end}
.group-chat-bubble .hint{font-size:.78rem;margin-top:.15rem}
.group-chat-form{display:flex;gap:.45rem}
.group-chat-form input{flex:1;min-width:0}
.member-chip{display:flex;align-items:center;gap:.65rem}
.member-chip .member-role-actions{margin-left:auto;display:flex;gap:.35rem;flex-wrap:wrap}
.group-wall-head{display:flex;flex-wrap:wrap;gap:.65rem;align-items:center;justify-content:space-between;margin-bottom:.35rem}
.group-wall-head h3{margin:0;flex:1 1 auto}
.group-search-row{display:flex;gap:.35rem;flex:1 1 220px}
.group-search-row input{flex:1;min-width:0}
.group-notif-pref{display:flex;align-items:center;gap:.35rem;font-size:.9rem;color:var(--muted)}
.post.is-pinned{outline:1px solid rgba(var(--fox-rgb),.35);background:rgba(var(--fox-rgb),.04)}
.comment.is-reply{margin-left:1rem;opacity:.95}
.company-contact{margin:.5rem 0}
.company-insights{margin-top:.65rem;font-size:.9rem}
.embed-box{margin-top:1.25rem;padding:1rem;border:1px dashed rgba(var(--fox-rgb),.4);border-radius:12px;background:rgba(var(--fox-rgb),.04)}
.embed-snippet{width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.78rem;line-height:1.4;padding:.65rem .75rem;border-radius:10px;border:1px solid var(--line);resize:vertical;margin:.5rem 0}
.member-chip{display:flex;align-items:center;gap:.65rem;padding:.55rem .7rem;border:1px solid var(--line);border-radius:10px}
.member-chip .avatar{width:36px;height:36px;border-radius:50%;background:rgba(var(--fox-rgb),.15);display:grid;place-items:center;font-weight:700;font-size:.8rem;overflow:hidden;background-size:cover;background-position:center;flex-shrink:0}
.mention,.mention.linkish{color:var(--post-link,var(--fox));font-weight:600;background:rgba(var(--post-link-rgb,var(--fox-rgb)),.1);padding:.05em .28em;border-radius:6px}
button.mention.linkish{border:0;cursor:pointer;font:inherit}
.mention-compose-wrap{position:relative}
.mention-suggest{position:absolute;left:0;right:0;bottom:100%;margin-bottom:.35rem;z-index:20;display:grid;gap:.15rem;max-height:220px;overflow:auto;padding:.35rem;border:1px solid var(--line);border-radius:12px;background:var(--elev);box-shadow:0 8px 24px rgba(0,0,0,.12)}
.mention-suggest-item{display:flex;align-items:center;gap:.55rem;width:100%;text-align:left;border:0;background:transparent;padding:.4rem .5rem;border-radius:8px;cursor:pointer;font:inherit;color:inherit}
.mention-suggest-item:hover,.mention-suggest-item:focus-visible{background:rgba(var(--fox-rgb),.12)}
.mention-suggest-item .avatar{width:28px;height:28px;border-radius:50%;background:rgba(var(--fox-rgb),.15);display:grid;place-items:center;font-size:.72rem;font-weight:700;background-size:cover;background-position:center;flex-shrink:0}
