:root {
  color-scheme: light;
  --bg: #fcf9f2;
  --bg-warm: #fff8ee;
  --ink: #1a1a1a;
  --muted: #8a847c;
  --coral: #f5645f;
  --pink: #fde8e6;
  --pink-text: #e45a55;
  --white: #ffffff;
  --line: #eee6dc;
  --shadow: 0 8px 24px rgba(26, 26, 26, 0.06);
  --radius: 22px;
  --pill: 999px;
  --nav-h: calc(76px + env(safe-area-inset-bottom, 0px));
  --phone-w: 390px;
  --stage-bg: #e8e2d8;
  --nav-ink: #3a3a3a;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171410;
  --bg-warm: #221e19;
  --ink: #f3eee6;
  --muted: #a79e92;
  --coral: #ff7a74;
  --pink: #3a2c2a;
  --pink-text: #ff9b96;
  --white: #241f1b;
  --line: #3b342c;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --stage-bg: #0f0d0b;
  --nav-ink: #d2c8bc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--stage-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

.hidden {
  display: none !important;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

.phone {
  width: min(100%, var(--phone-w));
  height: min(860px, calc(100vh - 32px));
  background: var(--bg);
  border-radius: 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.screen.is-off {
  display: none;
}

.onboard {
  padding: 36px 22px 28px;
  overflow: auto;
}

.wordmark {
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.onboard h1 {
  font-size: 32px;
  line-height: 1.15;
  margin: 28px 0 10px;
  letter-spacing: -0.03em;
}

.lede {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  margin-bottom: 22px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.pick-chip {
  border: 1.5px solid #eadfd3;
  background: var(--white);
  border-radius: var(--pill);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
}

.pick-chip.is-on {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
}

.create-box,
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.create-box h3,
.form-card h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--bg-warm);
  outline: none;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.toggle-row {
  display: flex;
  gap: 8px;
}

.toggle-row button {
  flex: 1;
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: var(--pill);
  padding: 10px;
  font-weight: 700;
  font-size: 13px;
}

.toggle-row button.is-on {
  background: var(--pink);
  border-color: var(--coral);
  color: var(--coral);
}

.btn-primary {
  width: 100%;
  background: var(--coral);
  color: var(--white);
  border-radius: var(--pill);
  padding: 14px 18px;
  font-weight: 800;
  font-size: 16px;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  width: 100%;
  color: var(--muted);
  font-weight: 700;
  padding: 12px;
}

.oauth-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-oauth {
  display: block;
  text-align: center;
  text-decoration: none;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  padding: 12px 18px;
  font-weight: 800;
  color: var(--ink);
  background: var(--white);
}

#auth-apple {
  background: #111;
  color: #fff;
  border-color: #111;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 4px 0 10px;
}

.check-row input {
  margin-top: 2px;
}

.legal-links a {
  color: var(--coral);
  font-weight: 800;
  text-decoration: none;
}

.feed-more {
  margin: 8px 0 20px;
}

.app-header {
  padding: 18px 18px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.members {
  border: 0;
  background: var(--pink);
  color: var(--pink-text);
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--pill);
  white-space: nowrap;
  cursor: pointer;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 18px 12px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--pill);
  padding: 9px 14px;
  font-weight: 800;
  font-size: 14px;
  background: var(--white);
  border: 1.5px solid #f0c8c5;
  color: var(--ink);
}

.chip.is-active {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
}

.chip.add {
  border-style: dashed;
  border-color: #cfc6ba;
  color: var(--muted);
}

.name-link {
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  color: inherit;
  text-align: left;
}

.reel-copy .name-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.person-bio {
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

#screen-person .profile-avatar {
  margin-top: 4px;
  pointer-events: none;
}

.lock {
  font-size: 11px;
  opacity: 0.85;
}

.content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 18px var(--nav-h);
}

#screen-app.is-reels {
  background: #000;
}

#screen-app.is-reels .app-header,
#screen-app.is-reels .chips {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
}

#screen-app.is-reels .app-header {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
  padding-bottom: 4px;
}

#screen-app.is-reels .btn-text {
  color: #fff;
}

#screen-app.is-reels .leave-btn {
  color: #ffc4bf;
}

#screen-app.is-reels .chips {
  top: 58px;
  background: transparent;
  padding-bottom: 8px;
}

#screen-app.is-reels .wordmark,
#screen-app.is-reels .btn-text {
  color: #fff;
}

#screen-app.is-reels .content {
  padding: 0 0 var(--nav-h);
  overflow: hidden;
}

#screen-app.is-reels #owner-requests {
  display: none !important;
}

#screen-app.is-reels .nav {
  background: var(--bg);
  border-top-color: var(--line);
}

#screen-app.is-reels .nav button {
  color: var(--nav-ink);
}

#screen-app.is-reels .nav button.is-active {
  color: var(--coral);
}

#feed-reels {
  position: relative;
  height: 100%;
}

#reel-list {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

#reel-list::-webkit-scrollbar {
  display: none;
}

.reel {
  position: relative;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  color: var(--white);
  background: #111;
}

.reel-empty {
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #bbb;
  font-weight: 700;
}

.reel-fab {
  position: absolute;
  right: 14px;
  top: 128px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.reel-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + 12px);
  z-index: 8;
  background: var(--white);
  color: var(--ink);
  border-radius: 24px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.reel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: rgba(0, 0, 0, 0.45);
}

.sheet-close {
  background: var(--coral);
  color: #fff !important;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--pill);
}

.reel-sheet .composer-row {
  justify-content: space-between;
}

.reel-sheet .btn-ghost {
  width: auto;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sheet-head h3 {
  font-size: 16px;
}

.sheet-list {
  max-height: 280px;
  overflow: auto;
}

.comment-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  text-align: left;
}

.comment-row p {
  font-size: 14px;
  line-height: 1.35;
}

.comment-replies {
  margin-left: 28px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.c-act {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.c-act.is-on {
  color: var(--coral);
}

.c-act.danger {
  color: var(--pink-text);
}

.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--coral);
}

.reply-bar button {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.reel-share-bubble,
.share-bubble {
  font-weight: 700;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 260px);
}

.share-bubble .share-text {
  font-weight: 700;
}

.share-bubble .share-media {
  width: calc(100% + 28px);
  max-height: 220px;
  margin: -10px -14px 2px;
  object-fit: cover;
  border-radius: 14px 14px 6px 6px;
  background: #111;
  display: block;
  cursor: pointer;
}

.share-bubble .share-quote,
.share-bubble .share-event {
  display: block;
  text-align: left;
  font-weight: 700;
  line-height: 1.35;
}

.share-bubble .share-event small {
  display: block;
  margin-top: 4px;
  font-weight: 700;
  opacity: 0.8;
}

.share-bubble .share-link {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.share-bubble.is-gone .share-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.reel.is-shared-focus,
.thread-card.is-shared-focus {
  outline: 3px solid var(--coral);
  outline-offset: -3px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 14px;
}

.section-head h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.btn-add {
  flex: 0 0 auto;
  background: var(--coral);
  color: var(--white);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--pill);
}

.map-wrap {
  position: relative;
  margin-bottom: 16px;
}

.map-frame {
  position: relative;
  height: 210px;
  border-radius: 28px;
  overflow: hidden;
  margin-bottom: 0;
  background: #c5e4f5;
  border: 3px solid #9ec9ee;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.55),
    0 10px 24px rgba(77, 163, 255, 0.18);
}

.map-frame.poke-map::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 48px rgba(20, 50, 90, 0.22);
  z-index: 450;
}

.map-locate {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid #b5d6f5;
  background: #f3f8ff;
  color: #2f7fd6;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(47, 127, 214, 0.12);
  cursor: pointer;
}

.you-tip.leaflet-tooltip {
  background: #2f7fd6;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  box-shadow: 0 4px 10px rgba(47, 127, 214, 0.25);
}

.you-tip.leaflet-tooltip::before {
  display: none;
}

.map-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--coral);
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: var(--pill);
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 14px rgba(245, 100, 95, 0.45);
}

.pin::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: var(--coral);
  transform: rotate(45deg);
  border-radius: 2px;
}

.event-card,
.thread-card,
.person-row,
.discover-row {
  background: var(--white);
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.feed-post.event-card,
.feed-post.thread-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 14px 0 12px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.feed-post .post-author .avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.feed-post .post-title {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
  font-weight: 800;
}

.feed-post .post-body {
  font-size: 15px;
  line-height: 1.45;
  margin: 8px 0 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-post .meta {
  margin-bottom: 8px;
}

.feed-post .badge {
  margin-top: 8px;
  margin-bottom: 0;
}

.feed-post .event-actions {
  margin-top: 10px;
}

.feed-post .btn-going {
  border-radius: 12px;
  padding: 10px;
}

.feed-post .engage-row {
  margin-top: 6px;
  margin-left: -4px;
}

#feed-threads .composer {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 0 14px;
  margin-bottom: 0;
}

.badge {
  display: inline-block;
  background: var(--pink);
  color: var(--pink-text);
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--pill);
  margin-bottom: 8px;
}

.event-card h3,
.thread-card h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.btn-going {
  width: 100%;
  background: var(--coral);
  color: var(--white);
  font-weight: 800;
  border-radius: var(--pill);
  padding: 12px;
}

.btn-going.is-on {
  background: #2e2e2e;
}

.event-actions {
  display: flex;
  gap: 8px;
}

.event-actions .btn-going {
  flex: 1;
}

.btn-msg {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  padding: 12px 14px;
  font-weight: 800;
  font-size: 13px;
}

.reel-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.55)),
    radial-gradient(circle at 30% 20%, #ffb199, transparent 45%),
    linear-gradient(135deg, #3d8b8a, #f5645f);
}

.reel:nth-child(even) .reel-bg {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.55)),
    radial-gradient(circle at 70% 30%, #ffd29a, transparent 40%),
    linear-gradient(135deg, #2b6e78, #c44d4a);
}

.play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.85;
}

.reel-copy {
  position: absolute;
  left: 16px;
  right: 72px;
  bottom: 28px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.reel-copy p {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.25;
}

.reel-copy span {
  display: block;
  margin-top: 6px;
  opacity: 0.85;
  font-size: 13px;
  font-weight: 600;
}

.reel-side {
  position: absolute;
  right: 12px;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-weight: 800;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.icon-btn small {
  display: block;
  font-size: 11px;
}

.icon-btn.is-on {
  background: var(--coral);
}

.icon-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.off-topic-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--coral);
}

.reel-copy .off-topic-tag {
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 3px 8px;
}

.composer {
  background: var(--white);
  border-radius: 24px;
  padding: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.composer textarea {
  width: 100%;
  border: 0;
  resize: none;
  min-height: 64px;
  font-size: 15px;
  outline: none;
  background: transparent;
}

.composer-row {
  display: flex;
  justify-content: flex-end;
}

.composer-row button {
  background: var(--coral);
  color: var(--white);
  border-radius: var(--pill);
  padding: 8px 16px;
  font-weight: 800;
}

.thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.author {
  font-weight: 800;
  font-size: 14px;
}

.time {
  color: var(--muted);
  font-size: 12px;
}

.thread-card p {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.engage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.engage-row .icon-btn {
  width: auto;
  height: auto;
  padding: 4px 8px;
  border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  gap: 2px;
}

.engage-row .icon-btn svg {
  width: 16px;
  height: 16px;
}

.engage-row .icon-btn small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.engage-row .icon-btn.is-liked,
.engage-row .icon-btn.is-on {
  background: transparent;
  color: var(--coral);
}

.engage-row .icon-btn.is-liked small,
.engage-row .icon-btn.is-on small {
  color: var(--coral);
}

.engage-row .btn-msg {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: var(--pill);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.engage-row .btn-msg:disabled {
  opacity: 0.55;
}

.engage-row .icon-btn.danger,
.reel-side .icon-btn.danger {
  color: var(--coral);
}

.event-balloon .engage-row .icon-btn {
  background: transparent;
  color: var(--muted);
}

.person-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
}

.person-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
  min-width: 0;
}

.discover-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  width: 100%;
}

.discover-row .avatar {
  margin-top: 2px;
}

.comm-desc {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin: 2px 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.discover-row.is-link,
.profile-comm[data-open-comm] {
  cursor: pointer;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pink);
  display: grid;
  place-items: center;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}

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

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  vertical-align: middle;
}

.user-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-on-media {
  color: #fff;
  margin-bottom: 6px;
}

.user-chip-on-media .avatar-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.comment-row .author.name-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: inherit;
  cursor: pointer;
}

.person-row .grow,
.discover-row .grow {
  flex: 1;
  min-width: 0;
}

.preview {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.sub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 8px;
}

.back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  font-size: 18px;
}

.sub-head h2 {
  font-size: 20px;
}

.sub-body {
  padding: 8px 18px 24px;
  overflow: auto;
  flex: 1;
}

.search {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  padding: 12px 16px;
  margin-bottom: 14px;
  background: var(--white);
  font-size: 15px;
  outline: none;
}

.chat-log {
  flex: 1;
  overflow: auto;
  padding: 8px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.35;
}

.bubble.them {
  background: var(--white);
  align-self: flex-start;
}

.bubble.me {
  background: var(--coral);
  color: var(--white);
  align-self: flex-end;
}

.bubble.me.share-bubble .share-link {
  color: #fff;
}

button.share-bubble {
  font: inherit;
  color: inherit;
}

.chat-compose {
  display: flex;
  gap: 8px;
  padding: 10px 18px 18px;
}

.chat-compose input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: var(--pill);
  padding: 12px 14px;
  background: var(--white);
  outline: none;
}

.chat-compose button {
  background: var(--coral);
  color: var(--white);
  border-radius: var(--pill);
  padding: 0 16px;
  font-weight: 800;
}

.nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px calc(14px + env(safe-area-inset-bottom, 0px));
}

.nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--nav-ink);
  font-weight: 700;
  font-size: 11px;
}

.nav button svg {
  width: 22px;
  height: 22px;
}

.nav button.is-active {
  color: var(--coral);
}

.err {
  color: var(--coral);
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0;
  min-height: 1em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-text {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.leave-btn {
  color: var(--coral);
}

#map-el {
  height: 220px;
  width: 100%;
}

.leaflet-pokeBase-pane {
  filter: saturate(0.85) brightness(1.02);
}

.poke-map .leaflet-control-zoom {
  border: 0 !important;
  margin: 10px !important;
}

.poke-map .leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 32px !important;
  margin-bottom: 6px;
  border-radius: 12px !important;
  border: 2px solid #b5d6f5 !important;
  background: #f3f8ff !important;
  color: #2f7fd6 !important;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(47, 127, 214, 0.12);
}

[data-theme="dark"] .leaflet-pokeBase-pane {
  filter: brightness(0.42) contrast(1.28) saturate(0.85) hue-rotate(48deg);
}

[data-theme="dark"] .poke-map .leaflet-control-zoom a {
  border-color: #3d5368 !important;
  background: #241f1b !important;
  color: #8ec8ff !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.poke-map .leaflet-control-attribution {
  background: rgba(243, 248, 255, 0.9) !important;
  color: #6a849c;
  font-size: 9px;
  border-radius: 8px 0 0 0;
}

.map-pin-wrap,
.map-you-wrap {
  background: none !important;
  border: 0 !important;
}

.map-pin {
  width: 44px;
  height: 54px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  filter: drop-shadow(0 6px 8px rgba(245, 100, 95, 0.35));
}

.map-pin-orb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: radial-gradient(circle at 32% 28%, #fff6, #ff8a7a 42%, #f5645f 100%);
  border: 3px solid #fff;
  box-shadow: inset 0 -6px 0 rgba(180, 40, 40, 0.18);
}

.map-pin {
  position: relative;
}

.map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 12px;
  height: 12px;
  background: #f5645f;
  border: 2px solid #fff;
  border-top: 0;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 3px 0;
  z-index: -1;
}

.map-pin.is-draft .map-pin-orb {
  background: radial-gradient(circle at 32% 28%, #fff8, #8ec8ff 40%, #4da3ff 100%);
}

.map-pin.is-draft::after {
  background: #4da3ff;
}

.map-you {
  width: 28px;
  height: 28px;
  position: relative;
}

.map-you i {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #4da3ff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #4da3ff;
}

.map-you::before,
.map-you::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(77, 163, 255, 0.45);
  animation: you-pulse 2s ease-out infinite;
}

.map-you::after {
  animation-delay: 0.7s;
}

@keyframes you-pulse {
  from {
    transform: scale(0.5);
    opacity: 0.8;
  }
  to {
    transform: scale(2.1);
    opacity: 0;
  }
}

.map-missing {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.reel video,
.reel img.media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.pending-box {
  background: var(--pink);
  color: var(--pink-text);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}

.pending-box h3 {
  font-size: 13px;
  margin-bottom: 8px;
}

.pending-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.leaflet-container {
  font-family: inherit;
  cursor: pointer;
}

.buds-popup .leaflet-popup-content-wrapper {
  background: var(--bg);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0;
}

.buds-popup .leaflet-popup-content {
  margin: 12px 12px 10px;
  min-width: 200px;
}

.buds-popup .leaflet-popup-tip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-top: 0;
  border-left: 0;
}

.event-balloon {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-balloon .post-author .avatar-sm {
  width: 28px;
  height: 28px;
}

.event-balloon .post-title {
  font-size: 15px;
  margin: 6px 0 2px;
}

.event-balloon .meta {
  margin-bottom: 6px;
  font-size: 12px;
}

.event-balloon .btn-going,
.event-balloon .btn-msg {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

#screen-app.is-you .chips,
#screen-app.is-you #owner-requests,
#screen-app.is-you .members,
#screen-app.is-you #open-create {
  display: none !important;
}

.public-profile {
  position: relative;
  text-align: center;
  padding: 8px 4px 24px;
}

.profile-tools {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.gear-btn {
  position: relative;
  top: auto;
  right: auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.lang-btn {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.lang-wrap {
  position: relative;
}

.lang-menu {
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 148px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 6px;
  text-align: left;
}

.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
}

.lang-menu button.is-on {
  background: var(--pink);
  color: var(--coral);
}

.gear-btn svg {
  width: 22px;
  height: 22px;
}

#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
  width: 22px;
  height: 22px;
}

.profile-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  margin: 8px auto 14px;
  background: var(--pink);
  color: var(--pink-text);
  font-weight: 800;
  font-size: 36px;
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-profile h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
}

.profile-handle {
  color: var(--muted);
  font-weight: 700;
  margin: 2px 0 4px;
}

.bud-count {
  display: inline-block;
  border: 0;
  background: none;
  padding: 0;
  color: var(--coral);
  font: inherit;
  font-weight: 800;
  margin: 0 0 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.person-bud-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 0 12px;
}

.person-safety-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 12px;
}

.person-safety-actions .btn-ghost {
  font-size: 13px;
  padding: 8px 12px;
  width: auto;
}

.safety-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.safety-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.safety-sheet {
  position: relative;
  z-index: 1;
  width: calc(100% - 24px);
  max-height: 85%;
  overflow: auto;
  margin-bottom: 16px;
}

.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 12px;
}

.report-reason {
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-warm);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  border: 2px solid transparent;
}

.report-reason.is-on {
  border-color: var(--coral);
  background: var(--pink);
}

.mod-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.mod-card .meta {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 8px;
}

.mod-card .mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mod-tabs {
  margin-bottom: 12px;
}

#public-bio {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 72px;
  resize: vertical;
  background: var(--white);
  font-size: 15px;
  outline: none;
}

.public-profile .btn-ghost {
  width: auto;
  margin-top: 6px;
  color: var(--coral);
}

.profile-section-title {
  text-align: left;
  margin: 22px 0 10px;
  font-size: 16px;
}

.profile-comm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-comm-chips .chip {
  background: var(--white);
}

.profile-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 0 14px;
  box-shadow: var(--shadow);
}

.profile-block h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.profile-lede {
  margin-bottom: 14px;
  font-size: 14px;
}

.profile-block .btn-primary {
  width: 100%;
  margin-top: 8px;
}

.ok {
  color: #2f8a5a;
  font-size: 13px;
  font-weight: 700;
  margin: 8px 0;
  min-height: 1em;
}

.activity-row,
.profile-comm {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.activity-row.is-link {
  cursor: pointer;
}

.activity-row.is-link:hover .activity-kind {
  text-decoration: underline;
}

.activity-row .grow,
.profile-comm .grow {
  flex: 1;
  min-width: 0;
}

.activity-kind {
  font-size: 11px;
  font-weight: 800;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-row p,
.profile-comm .preview {
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.btn-danger,
.btn-tiny-danger {
  background: var(--pink);
  color: var(--pink-text);
  font-weight: 800;
  border-radius: var(--pill);
  padding: 10px 14px;
}

.btn-tiny-danger {
  padding: 8px 12px;
  font-size: 12px;
  flex-shrink: 0;
}

.locked-note {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 4px;
}

.profile-block.danger {
  border: 1.5px solid var(--pink);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discover-row .profile-actions {
  flex-direction: row;
}

@media (max-width: 480px) {
  .stage {
    padding: 0;
  }

  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

.icon-header {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: inherit;
  display: grid;
  place-items: center;
}

.icon-header svg {
  width: 20px;
  height: 20px;
}

.nav-ico-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

#open-activity .nav-badge {
  top: 2px;
  right: 2px;
}

.chip.has-new {
  box-shadow: 0 0 0 2px var(--coral);
}

.chip.has-new::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  margin-left: 4px;
  flex-shrink: 0;
}

.create-sheet .create-actions {
  display: grid;
  gap: 10px;
  padding: 8px 4px 20px;
}

.create-action {
  padding: 16px;
  border-radius: 16px;
  background: var(--bg-warm);
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  text-align: left;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 12px 0 20px;
}

.profile-grid-item {
  aspect-ratio: 1;
  background: var(--line);
  overflow: hidden;
  position: relative;
  border: 0;
  padding: 0;
}

.profile-grid-item img,
.profile-grid-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-grid-item.is-note {
  display: grid;
  place-items: center;
  padding: 8px;
  background: var(--bg-warm);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  line-height: 1.3;
}

.skeleton {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--line), var(--bg-warm), var(--line));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.1s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-card {
  height: 92px;
  margin: 10px 0;
}

.pull-indicator {
  position: sticky;
  top: 0;
  z-index: 6;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  padding: 8px;
  pointer-events: none;
}

.pull-indicator.is-ready {
  color: var(--coral);
}

.icon-btn.is-liked {
  color: var(--coral);
}

.icon-btn svg {
  width: 26px;
  height: 26px;
  display: block;
  margin: 0 auto;
}

.reel-side .icon-btn svg {
  width: 24px;
  height: 24px;
}

.bubble .seen-mark {
  display: block;
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  font-weight: 700;
}

.reel-mute {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
}

.reel-mute svg {
  width: 18px;
  height: 18px;
}

.reel-heart-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  font-size: 72px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.reel-heart-burst.is-on {
  animation: heart-burst 0.7s ease forwards;
}

@keyframes heart-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

.activity-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  width: 100%;
  color: inherit;
}

.activity-row .grow {
  min-width: 0;
}

.activity-row .preview {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

#screen-app.is-reels .icon-header {
  color: #fff;
}

.explore-view-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  background: var(--bg-warm);
  border-radius: 14px;
}

.explore-view-btn {
  padding: 10px 8px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}

.explore-view-btn.is-on {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.explore-collection[data-view="icons"] {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.explore-collection[data-view="grid"] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.explore-card {
  background: var(--white);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
  text-align: left;
  color: inherit;
}

.explore-card.is-link {
  cursor: pointer;
}

.explore-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.explore-emoji {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--bg-warm);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
}

.explore-card-icons .explore-emoji {
  width: 56px;
  height: 56px;
  font-size: 30px;
  border-radius: 18px;
}

.explore-card-grid .explore-card-head {
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.explore-card-grid .explore-emoji {
  width: 40px;
  height: 40px;
  font-size: 22px;
}

.explore-card-grid .profile-actions {
  width: 100%;
  display: flex;
  gap: 6px;
}

.explore-card-grid .profile-actions .btn-add,
.explore-card-grid .profile-actions .btn-tiny-danger {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
}

.explore-card .comm-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.explore-card-grid .comm-desc {
  -webkit-line-clamp: 1;
}

.explore-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  min-height: 72px;
}

.explore-card-icons .explore-preview {
  min-height: 88px;
}

.explore-card-grid .explore-preview {
  min-height: 96px;
  gap: 3px;
}

.explore-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-warm);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  padding: 6px;
  display: grid;
  place-items: center;
  text-align: left;
}

.explore-thumb img,
.explore-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.explore-thumb.is-note {
  align-content: start;
}

.explore-thumb.is-video {
  padding: 0;
  position: relative;
}

.explore-thumb.is-video::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 0;
  height: 0;
  border-left: 8px solid #fff;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.explore-preview.is-empty,
.explore-preview.is-locked {
  display: grid;
  place-items: center;
  background: var(--bg-warm);
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
  gap: 4px;
  min-height: 72px;
  grid-template-columns: 1fr;
}

.explore-card .profile-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}


/* presence, typing, emoji + GIF picker */
.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 2px var(--card, #fff);
  flex: none;
}

.chat-typing {
  color: var(--muted);
  font-size: 12px;
  padding: 2px 18px 4px;
}

.chat-compose .picker-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  flex: none;
  background: transparent;
  color: inherit;
  padding: 0;
}

.chat-picker {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 12px;
  max-height: 240px;
  overflow: auto;
}

.picker-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.emoji-item {
  font-size: 24px;
  width: 40px;
  height: 40px;
}

.gif-search {
  width: 100%;
  margin-bottom: 8px;
}

.gif-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.gif-item {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
}

.gif-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble.gif-bubble {
  padding: 4px;
  background: transparent;
}

.bubble.gif-bubble img {
  display: block;
  max-width: 220px;
  width: 100%;
  border-radius: 12px;
}

/* message time, quotes, reactions, actions */
.bubble .msg-time {
  display: block;
  font-size: 10px;
  opacity: 0.6;
  text-align: right;
  margin-top: 2px;
}

.bubble[data-msg-id] {
  cursor: pointer;
}

.msg-quote {
  border-left: 3px solid currentColor;
  padding: 2px 8px;
  margin-bottom: 6px;
  font-size: 12px;
  opacity: 0.8;
  display: flex;
  flex-direction: column;
}

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.msg-react {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.msg-react.is-mine {
  background: rgba(0, 0, 0, 0.18);
}

.msg-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}

.act-emoji {
  font-size: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
}

.act-emoji.is-on {
  background: rgba(0, 0, 0, 0.1);
}

.act-reply {
  margin-left: auto;
  font-weight: 800;
  padding: 0 12px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
}

.reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  font-size: 13px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.reply-bar span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.8;
}

.bubble.is-deleted {
  opacity: 0.6;
  font-size: 13px;
}

.msg-edited {
  font-size: 10px;
  opacity: 0.6;
}

.act-small {
  font-weight: 700;
  padding: 0 10px;
  height: 36px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  flex: none;
}

.act-reply {
  flex: none;
}

/* Chat header avatar, search and forward */
.chat-avatar .avatar { width: 32px; height: 32px; font-size: 0.8rem; }
.chat-search-btn { margin-left: auto; background: none; border: 0; font-size: 1.1rem; cursor: pointer; padding: 6px; }
.chat-search { display: flex; gap: 6px; padding: 6px 12px; }
.chat-search.hidden { display: none; }
.chat-search input { flex: 1; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, #ddd); background: var(--card, #fff); color: inherit; }
.chat-search button { background: none; border: 0; cursor: pointer; font-size: 1rem; color: inherit; }
.forward-list { max-height: 45vh; overflow-y: auto; margin: 0 12px 8px; padding: 8px; border-radius: 12px; border: 1px solid var(--line, #ddd); background: var(--card, #fff); }
.forward-list.hidden { display: none; }
.forward-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 8px; }
.forward-head button { background: none; border: 0; cursor: pointer; color: inherit; }
.forward-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; background: none; border: 0; cursor: pointer; color: inherit; text-align: left; border-radius: 8px; }
.forward-row:hover { background: rgba(127, 127, 127, 0.12); }
.forward-row .avatar { width: 32px; height: 32px; font-size: 0.8rem; }
.msg-forwarded { font-size: 0.75rem; opacity: 0.7; font-style: italic; margin-bottom: 2px; }

/* Voice messages */
.voice-bubble { min-width: 210px; }
.voice-row { display: flex; align-items: center; gap: 10px; }
.voice-play { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; cursor: pointer; font-size: 0.9rem; background: rgba(255, 255, 255, 0.85); color: #333; }
.bubble.them .voice-play { background: var(--accent, #f4675f); color: #fff; }
.voice-track { flex: 1; height: 4px; border-radius: 2px; background: rgba(127, 127, 127, 0.35); overflow: hidden; }
.voice-fill { height: 100%; width: 0; background: currentColor; transition: width 0.2s linear; }
.voice-dur { font-size: 0.75rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.voice-rec { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.voice-rec.hidden, .chat-compose.hidden { display: none; }
.voice-rec .grow { flex: 1; }
.voice-cancel { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: inherit; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e53935; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: 0.25; } }
#voice-send { background: var(--coral); color: var(--white); border-radius: var(--pill); padding: 12px 16px; font-weight: 800; border: 0; cursor: pointer; }
.voice-rec { padding: 10px 18px 18px; }
.bubble.them .voice-play { background: var(--coral); }
.chat-compose { align-items: center; }
.chat-compose input { min-width: 0; }
.chat-compose button { flex: none; }
.chat-compose.has-text #chat-mic, .chat-compose:not(.has-text) #chat-send { display: none; }
#chat-send { padding: 12px 16px; }

/* Quote jump, photo viewer, invite */
.msg-quote[data-jump] { cursor: pointer; }
.bubble.is-flash { animation: msg-flash 1.2s ease; }
@keyframes msg-flash { 0%, 60% { box-shadow: 0 0 0 3px rgba(255, 200, 0, 0.9); } 100% { box-shadow: 0 0 0 0 rgba(255, 200, 0, 0); } }
.bubble.gif-bubble img[data-full] { cursor: zoom-in; }
.photo-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.92); display: flex; align-items: center; justify-content: center; }
.photo-viewer.hidden { display: none; }
.photo-viewer img { width: 100%; height: 100%; object-fit: contain; }
.photo-viewer-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.2rem; cursor: pointer; }
.people-invite { margin-left: auto; }

/* Full-screen map with a pull-up event list */
#screen-app.is-map .content { padding: 0 0 var(--nav-h); overflow: hidden; position: relative; }
#screen-app.is-map #feed-map { position: absolute; inset: 0 0 var(--nav-h) 0; overflow: hidden; }
#screen-app.is-map .map-wrap { height: 100%; margin: 0; }
#screen-app.is-map .map-frame { height: 100%; border-radius: 0; border: 0; box-shadow: none; }
#screen-app.is-map #map-el { height: 100%; }
#screen-app.is-map .map-frame.poke-map::after { display: none; }
.map-top { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-top h2 { font-size: 15px; font-weight: 800; background: rgba(255, 255, 255, 0.94); color: var(--ink, #1d1b1a); padding: 8px 14px; border-radius: var(--pill); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.map-top .btn-add { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); flex: none; }
#screen-app.is-map .map-locate { bottom: 156px; right: 10px; }
#screen-app.is-map .leaflet-bottomright .leaflet-control-zoom { margin-bottom: 66px !important; margin-right: 10px !important; }
.event-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1001; max-height: 72%; height: 72%; display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15); transform: translateY(calc(100% - 54px)); transition: transform 0.28s ease; }
.event-sheet.is-open { transform: translateY(0); }
.sheet-handle { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; flex: none; width: 100%; background: none; border: 0; font-weight: 800; font-size: 15px; color: inherit; cursor: pointer; }
.sheet-handle .grabber { position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(127, 127, 127, 0.35); }
.sheet-arrow { font-size: 11px; opacity: 0.6; transition: transform 0.28s ease; }
.event-sheet.is-open .sheet-arrow { transform: rotate(180deg); }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.sheet-body .hint { margin: 0 0 10px; }

/* Optional onboarding + no-community state */
.onboard-skip { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; align-items: stretch; }
.onboard-skip .btn-text { align-self: center; color: var(--muted); }
.feed-empty { text-align: center; padding: 48px 12px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.feed-empty.hidden { display: none; }
.feed-empty-emoji { font-size: 52px; }
.feed-empty h2 { font-size: 22px; }
.members:empty { display: none; }

.share-copy {
  width: 100%;
  margin: 4px 0 8px;
  padding: 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line, #eadfd6);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* Photo editor: crop, zoom and rotate before upload */
.photo-editor { position: fixed; inset: 0; z-index: 2000; background: #111; color: #fff; display: flex; flex-direction: column; touch-action: none; }
.photo-editor.hidden { display: none; }
.pe-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.pe-title { font-weight: 800; }
.pe-btn { border: 0; background: transparent; color: #fff; font: inherit; font-weight: 700; padding: 8px 10px; cursor: pointer; }
.pe-done { background: var(--coral, #f4675f); border-radius: 999px; padding: 8px 16px; }
.pe-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 8px 16px; }
.pe-stage canvas { display: block; max-width: 100%; max-height: 100%; cursor: grab; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); outline: 2px solid rgba(255, 255, 255, 0.85); }
.photo-editor.is-round .pe-stage canvas { border-radius: 50%; }
.pe-tools { padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.pe-aspects { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pe-aspects button { border: 1.5px solid rgba(255, 255, 255, 0.35); background: transparent; color: #fff; font: inherit; font-weight: 700; font-size: 14px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.pe-aspects button.is-on { background: #fff; color: #111; border-color: #fff; }
.pe-row { display: flex; align-items: center; gap: 10px; }
.pe-row input { flex: 1; accent-color: var(--coral, #f4675f); }
.pe-rotate { border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.pe-hint { text-align: center; font-size: 13px; opacity: 0.7; margin: 0; }
.reel-preview { display: block; max-width: 100%; max-height: 220px; border-radius: 14px; margin: 8px 0; object-fit: contain; }
.pe-top, .pe-tools { position: relative; z-index: 2; background: #111; }
.pe-stage { position: relative; z-index: 1; overflow: hidden; }

.explore-tabs { display: flex; gap: 6px; background: var(--chip-bg, rgba(0, 0, 0, 0.05)); padding: 4px; border-radius: 999px; margin-bottom: 12px; }
.explore-tab { flex: 1; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; padding: 10px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.explore-tab.is-on { background: var(--coral, #f4675f); color: #fff; }

/* General feed: which community a post came from */
.comm-tag { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--coral-soft, #fdecea); color: var(--coral-ink, #c9473f); font: inherit; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; margin-bottom: 8px; cursor: pointer; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-copy .comm-tag { background: rgba(255, 255, 255, 0.92); color: #1d1b1a; }
.chip.chip-all { font-weight: 800; }

@keyframes swipeInLeft { from { transform: translateX(28px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes swipeInRight { from { transform: translateX(-28px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.content.swipe-in-left { animation: swipeInLeft 0.22s ease-out; }
.content.swipe-in-right { animation: swipeInRight 0.22s ease-out; }

/* ===== Two layouts: phone (default) and computer (wide screens) ===== */
.side { display: contents; }
.side-brand,
.side-label,
.panel,
.header-title { display: none; }

@media (min-width: 1000px) {
  :root {
    --nav-h: 0px;
    --side-w: 264px;
    --list-w: 380px;
  }

  .stage { padding: 0; display: block; min-height: 100vh; }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  /* Sign-in and welcome screens: a centred card */
  #screen-auth .onboard,
  #screen-onboarding .onboard { width: 100%; max-width: 480px; margin: 0 auto; }

  /* Main app: sidebar | feed | info panel */
  #screen-app:not(.is-off) {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "side header"
      "side content";
  }
  .app-header { grid-area: header; align-items: center; padding: 16px 28px 12px; border-bottom: 1px solid var(--line); }
  .app-header .wordmark { display: none; }
  .header-title { display: block; font-size: 20px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .content { grid-area: content; padding: 16px 28px 40px; }
  .content > * { max-width: 680px; margin-left: auto; margin-right: auto; }
  .content > #pull-indicator { display: none !important; }

  .side {
    grid-area: side;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: var(--bg-warm);
    padding: 18px 12px 12px;
    gap: 4px;
  }
  .side-brand { display: block; font-size: 30px; font-weight: 900; letter-spacing: -0.04em; color: var(--coral); padding: 2px 12px 14px; }
  .side .nav {
    position: static;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    background: transparent;
    border: 0;
  }
  .side .nav button {
    flex-direction: row;
    gap: 14px;
    font-size: 16px;
    padding: 11px 12px;
    border-radius: 14px;
    text-align: left;
    position: relative;
  }
  .side .nav button:hover { background: var(--pink); }
  .side .nav button.is-active { background: var(--pink); color: var(--pink-text); }
  .side .nav button svg { width: 22px; height: 22px; flex: none; }
  .side-label { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 18px 12px 6px; }
  .side .chips {
    flex: 1;
    min-height: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 8px;
    gap: 2px;
    scrollbar-width: thin;
  }
  .side .chip {
    width: 100%;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    font-size: 15px;
    padding: 9px 12px;
    border-radius: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .side .chip:hover { background: var(--pink); }
  .side .chip.is-active { background: var(--coral); color: #fff; }
  .side .chip.add { border: 1.5px dashed #cfc6ba; justify-content: center; margin-bottom: 4px; }
  .side .chip.has-new { box-shadow: none; }
  .side .chip.has-new::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); margin-left: auto; flex: none; }

  /* Clips: a vertical video column in the middle instead of the whole screen */
  #screen-app.is-reels { background: var(--bg); }
  #screen-app.is-reels .app-header,
  #screen-app.is-reels .chips { position: static; background: none; }
  #screen-app.is-reels .app-header { color: var(--ink); background: var(--bg); }
  #screen-app.is-reels .wordmark,
  #screen-app.is-reels .btn-text,
  #screen-app.is-reels .icon-header { color: var(--ink); }
  #screen-app.is-reels .leave-btn { color: var(--coral); }
  #screen-app.is-reels .content { padding: 16px 28px; background: var(--bg); }
  #screen-app.is-reels #feed-reels { max-width: min(100%, calc((100dvh - 110px) * 9 / 16)); height: 100%; border-radius: 24px; overflow: hidden; background: #000; }
  #screen-app.is-reels .reel-fab { right: 16px; top: 16px; }
  #screen-app .side .nav { background: transparent; border: 0; }
  .side .nav button.is-active .nav-ico-wrap,
  .side .nav button .nav-ico-wrap { display: inline-grid; }

  /* Map: fills the middle column */
  #screen-app.is-map .content > * { max-width: none; }

  /* Pop-up sheets become centred dialogs */
  .reel-sheet {
    position: fixed;
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 48px));
    max-height: 80vh;
    overflow: auto;
    z-index: 60;
    padding: 18px;
  }
  .reel-sheet .sheet-list { max-height: 50vh; }
  .reel-backdrop { position: fixed; z-index: 59; }

  /* Other screens open beside the sidebar instead of replacing the whole app */
  .screen.is-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: var(--side-w);
    right: 0;
    z-index: 40;
    background: var(--bg);
  }
  .screen.is-overlay .sub-head,
  .screen.is-overlay .sub-body { width: 100%; max-width: 760px; margin: 0 auto; }
  .screen.is-overlay .sub-head { padding-top: 22px; }

  /* Chat: conversation list on the left, open conversation on the right (like WhatsApp Web) */
  .phone.chat-open #screen-app:not(.is-off) { grid-template-columns: var(--side-w) var(--list-w) 0; }
  .phone.chat-open #screen-app .content { padding: 12px 14px; }
  .phone.chat-open .panel { display: none !important; }
  .phone.chat-open #screen-chat.is-overlay { left: calc(var(--side-w) + var(--list-w)); border-left: 1px solid var(--line); }
  .phone.chat-open #screen-chat .sub-head,
  .phone.chat-open #screen-chat .sub-body { max-width: none; }
  .phone.chat-open #screen-chat .sub-head .back { display: none; }
  .phone.chat-open .person-row.is-current { background: var(--pink); }
}

/* Info panel on the right, only when there is room */
@media (min-width: 1280px) {
  #screen-app:not(.is-off) {
    grid-template-columns: var(--side-w) minmax(0, 1fr) 320px;
    grid-template-areas:
      "side header panel"
      "side content panel";
  }
  #screen-app.is-map:not(.is-off) {
    grid-template-columns: var(--side-w) minmax(0, 1fr) 0;
  }
  #screen-app.is-map .panel { display: none; }
  .panel {
    grid-area: panel;
    display: block;
    border-left: 1px solid var(--line);
    padding: 22px 20px;
    overflow-y: auto;
    min-height: 0;
  }
  .panel-card { background: var(--white); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
  .panel-emoji { font-size: 40px; line-height: 1; margin-bottom: 8px; }
  .panel-name { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
  .panel-desc { color: var(--muted); line-height: 1.45; margin-bottom: 12px; white-space: pre-wrap; }
  .panel-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .panel-meta .members { font-size: 13px; }
  .panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .panel-actions button { flex: 1; min-width: 120px; }
  .panel-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 6px 4px 10px; }
  .panel-event { display: block; width: 100%; text-align: left; background: var(--white); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; color: inherit; font: inherit; box-shadow: var(--shadow); }
  .panel-event b { display: block; font-weight: 800; margin-bottom: 2px; }
  .panel-event small { color: var(--muted); }
  .panel-empty { color: var(--muted); font-size: 14px; padding: 0 4px; }
  .panel-foot { color: var(--muted); font-size: 12px; padding: 12px 4px; }
  .panel-foot a { color: inherit; }
}

/* Emoji/GIF picker inside the comments sheet */
.chat-picker.is-in-sheet { border-top: 0; padding: 4px 0 8px; max-height: 220px; }
.comment-gif { display: block; max-width: 200px; max-height: 180px; border-radius: 12px; margin: 4px 0; }
#comment-compose .picker-btn { flex: none; }

/* Compact note box: one line until you tap it */
#feed-threads .composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 26px; }
#feed-threads .composer textarea { flex: 1; min-height: 0; height: 36px; padding: 8px 0; line-height: 1.35; transition: height 0.15s ease; }
#feed-threads .composer.is-open textarea { height: 110px; }
#feed-threads .composer .composer-row { flex: none; }
#feed-threads .composer .composer-row button { padding: 9px 18px; }

/* Phone browsers: no zoom-in when typing (iPhone zooms on text under 16px), no sideways wobble */
@media (max-width: 999px) {
  input,
  textarea,
  select { font-size: 16px !important; }
}
html,
body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }

/* Bottom tabs stay on top of the feed (the map used to cover them after a few seconds) */
.nav { z-index: 30; }
#screen-app.is-map .content { z-index: 0; }

/* Clip video still being converted */
.reel-processing {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

/* ---------- Social basics ---------- */
.reel-carousel {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.reel-carousel::-webkit-scrollbar { display: none; }
.reel-carousel img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: center;
}
.reel-count {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: var(--pill);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.edited-tag { opacity: 0.75; font-weight: 600; }

.post-photos {
  display: grid;
  gap: 4px;
  margin: 10px 0 4px;
  border-radius: 16px;
  overflow: hidden;
}
.post-photos.n2, .post-photos.n4 { grid-template-columns: 1fr 1fr; }
.post-photos.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-photos.n3 .post-photo:first-child { grid-row: span 2; }
.post-photo { display: block; padding: 0; border: 0; background: var(--line); cursor: zoom-in; }
.post-photo img { display: block; width: 100%; height: 100%; max-height: 420px; object-fit: cover; }
.post-photos.n2 .post-photo img, .post-photos.n3 .post-photo img, .post-photos.n4 .post-photo img { aspect-ratio: 1; max-height: none; }
.post-photos.n3 .post-photo:first-child img { aspect-ratio: auto; }

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.92);
}
.photo-viewer img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.photo-viewer-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
}

.mention {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--coral);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.reel-copy .mention { color: #fff; text-decoration: underline; }

.mention-suggest {
  position: fixed;
  z-index: 260;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.mention-suggest button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
}
.mention-suggest button:hover { background: var(--bg-warm); }

.pinned-card {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.pinned-label { display: block; margin-bottom: 4px; color: var(--coral); font-size: 12px; font-weight: 800; }
.pinned-body { display: flex; gap: 10px; align-items: center; font-size: 14px; line-height: 1.35; }
.pinned-body img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px);
  z-index: 320;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  animation: toast-in 0.2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.action-sheet {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}
.action-sheet-box {
  width: 100%;
  max-width: 480px;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--white);
  animation: sheet-up 0.18s ease;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.action-sheet-box > button {
  display: block;
  width: 100%;
  padding: 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
}
.action-sheet-box > button.danger { color: var(--coral); }
.action-sheet-box > button.action-cancel { border-bottom: 0; color: var(--muted); }
.form-sheet h3 { margin: 6px 4px 12px; }
.form-sheet label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.form-sheet input, .form-sheet textarea,
.cs-body input, .cs-body textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.form-sheet textarea { min-height: 120px; resize: vertical; }
.cs-body textarea { min-height: 90px; resize: vertical; }
.cs-body label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.cs-body input:disabled, .cs-body textarea:disabled { opacity: 0.55; }
.cs-hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.cs-body #cs-save { width: 100%; }
#cs-cover-box { margin-bottom: 14px; }
#cs-cover-box .composer-row { justify-content: flex-end; gap: 8px; margin-top: 8px; }

.comm-cover {
  width: 100%;
  aspect-ratio: 3;
  border-radius: 16px;
  background: var(--line) center / cover no-repeat;
  margin-bottom: 10px;
}
.comm-cover.is-empty { background-image: linear-gradient(135deg, var(--pink), var(--bg-warm)); }
.panel-cover { margin: -4px 0 10px; }
.comm-rules { margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); text-align: left; }
.comm-rules summary { font-weight: 800; cursor: pointer; }
.comm-rules p { margin-top: 8px; white-space: pre-line; color: var(--ink); font-size: 14px; line-height: 1.4; }
.people-settings { margin-left: 6px; }
.btn-tiny {
  flex: none;
  margin-left: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.thumb-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; }
.thumb-chip { position: relative; flex: none; }
.thumb-chip img { display: block; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.thumb-chip button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
}
.note-photo-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 !important;
  border: 0;
  border-radius: 50%;
  background: none !important;
  color: var(--muted) !important;
}
.note-photo-btn svg { width: 22px; height: 22px; }
#feed-threads .composer { flex-wrap: wrap; }
#feed-threads .composer .composer-row { display: flex; align-items: center; gap: 4px; }
#feed-threads .composer #note-photos { order: 3; flex-basis: 100%; }

.saved-btn { margin: 10px auto 0; display: inline-flex; gap: 6px; }

.result-post {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.result-thumb { flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--line); }
.result-thumb img, .result-thumb video { width: 100%; height: 100%; object-fit: cover; }
.result-meta { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.result-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.result-emoji { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 26px; }
#search-results .person-row { width: 100%; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; }
#cs-cover-box .composer-row button { padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--pill); background: none; color: var(--ink); font-weight: 700; font-size: 14px; }
.cs-body #cs-save { padding: 14px; border: 0; border-radius: var(--pill); background: var(--coral); color: #fff; font: inherit; font-weight: 800; font-size: 16px; }

/* ---------- Group 2: polls, rooms ---------- */
.poll { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 4px; }
.poll-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  overflow: hidden;
}
.poll-opt:not(.is-voted) { border-color: var(--coral); color: var(--coral); }
.poll-opt.is-mine { border-color: var(--coral); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--pink); transition: width 0.3s ease; }
.poll-label, .poll-pct { position: relative; }
.poll-pct { color: var(--muted); font-size: 13px; }
.poll-total { color: var(--muted); font-size: 12px; font-weight: 700; }
.poll-editor { order: 3; flex-basis: 100%; padding: 6px 0; }
.poll-opt-row { display: flex; gap: 6px; margin-bottom: 6px; }
.poll-input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.poll-del { width: 36px; border: 0; border-radius: 12px; background: none; color: var(--muted); }
#poll-add { padding: 4px 2px; border: 0; background: none; color: var(--coral); font: inherit; font-weight: 800; }
.note-photo-btn.is-on { color: var(--coral) !important; }
.hashtag { color: var(--coral); }

#screen-room { display: flex; flex-direction: column; }
#screen-room.is-off { display: none; }
.room-emoji { display: grid; place-items: center; font-size: 24px; }
.room-line { display: flex; align-items: flex-end; gap: 6px; }
.room-line.me { justify-content: flex-end; }
.room-col { display: flex; flex-direction: column; max-width: 78%; }
.room-line.me .room-col { align-items: flex-end; }
.room-col .bubble { max-width: 100%; }
.room-who { padding: 0 0 2px 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 800; text-align: left; }
.room-av, .room-av-space { flex: none; width: 30px; }
.room-av .avatar { width: 30px; height: 30px; font-size: 11px; }
.room-avatar { display: grid; place-items: center; font-size: 22px; background: var(--pink); }
.room-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }
.room-chips .chip { padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--pill); background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; }
.room-chips .chip::before { content: "💬 "; }
.room-open-btn { display: block; width: 100%; margin: 4px 0 12px; padding: 12px; border: 0; border-radius: var(--pill); background: var(--coral); color: #fff; font: inherit; font-weight: 800; }
#feed-inbox .section-head { display: flex; align-items: center; justify-content: space-between; }
.pick-list { max-height: 50vh; overflow-y: auto; margin-bottom: 8px; }
.pick-row { display: flex !important; align-items: center; gap: 10px; padding: 8px 4px; color: var(--ink) !important; font-size: 15px !important; }
.pick-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--coral); }

@media (min-width: 1000px) {
  .phone.chat-open #screen-room.is-overlay { left: calc(var(--side-w) + var(--list-w)); border-left: 1px solid var(--line); }
  .phone.chat-open #screen-room .sub-head { max-width: none; }
  .phone.chat-open #screen-room .sub-head .back { display: none; }
}
#room-compose { align-items: center; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
#room-send { align-self: stretch; min-height: 44px; }
.bubble.me .mention { color: #fff; text-decoration: underline; }

/* ---------- Group 3: links, calls ---------- */
.text-link { color: inherit; text-decoration: underline; word-break: break-all; }
.thread-card .text-link { color: var(--coral); }
.link-card {
  display: flex;
  flex-direction: column;
  margin: 10px 0 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  max-width: 520px;
}
.link-card.is-loading { min-height: 0; border: 0; margin: 0; }
.link-card img { width: 100%; max-height: 220px; object-fit: cover; background: var(--line); }
.link-card-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.link-card-text small { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: lowercase; }
.link-card-text b { font-size: 14px; line-height: 1.3; }
.link-card-text span { color: var(--muted); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bubble .link-card { margin: 8px 0 2px; min-width: 200px; }

.chat-call-btn svg { width: 20px; height: 20px; }
.chat-call-btn { display: grid; place-items: center; }

.call-layer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(48px + env(safe-area-inset-top, 0px)) 20px calc(36px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 50% 30%, #3b2b28, #121010);
  color: #fff;
}
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.call-layer:not(.is-video) .call-remote { opacity: 0; pointer-events: none; }
.call-local {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  width: 104px;
  height: 148px;
  border-radius: 14px;
  object-fit: cover;
  background: #000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transform: scaleX(-1);
  z-index: 2;
}
.call-layer:not(.is-video) .call-local, .call-layer.is-incoming .call-local { display: none; }
.call-info { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.call-avatar-img { width: 96px !important; height: 96px !important; font-size: 32px !important; }
.call-layer.is-video:not(.is-incoming) .call-avatar-img { display: none; }
.call-info h2 { font-size: 24px; }
.call-info p { opacity: 0.85; font-weight: 700; }
.call-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; max-width: 420px; }
.call-layer.is-incoming .call-actions-live, .call-layer:not(.is-incoming) .call-actions-incoming { display: none; }
.call-opt { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 64px; }
.call-opt.hidden { display: none; }
.call-opt span { font-size: 12px; font-weight: 700; opacity: 0.9; text-align: center; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); white-space: nowrap; }
.call-actions-incoming { gap: 18px 56px; }
.call-btn {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.12s ease, background 0.15s ease;
}
.call-btn:active { transform: scale(0.92); }
.call-btn svg { width: 26px; height: 26px; }
.call-btn .slash { display: none; }
.call-btn.is-muted { background: #fff; color: #111; }
.call-btn.is-muted .slash { display: inline; }
.call-btn.is-red { background: #e5484d; }
.call-btn.is-green { background: #30a46c; }
.call-btn.is-hangup svg { transform: rotate(135deg); }
.call-layer.is-incoming #call-accept { animation: call-bounce 1.2s ease-in-out infinite; }
@keyframes call-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.call-top { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; z-index: 3; display: flex; align-items: center; justify-content: space-between; }
.call-icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.call-icon-btn svg { width: 22px; height: 22px; }
.call-top-space { visibility: hidden; }
.call-kind { font-size: 13px; font-weight: 700; opacity: 0.8; }
.call-layer.is-video:not(.is-incoming) .call-kind { opacity: 0; }
.call-layer.is-video .call-local { top: calc(64px + env(safe-area-inset-top, 0px)); }
.call-local.is-back { transform: none; }
.call-layer.is-min { display: none; }
.call-pill { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 401; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); border: 0; border-radius: 999px; padding: 10px 16px; background: #30a46c; color: #fff; font: inherit; font-weight: 800; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); cursor: pointer; }
.call-pill.hidden { display: none; }
.call-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: rec-blink 1s infinite; flex: none; }
.call-pill-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-pill-back { opacity: 0.85; font-weight: 700; white-space: nowrap; }

/* Logo goes home; Chat split into Chats and Groups */
.go-home { cursor: pointer; user-select: none; }
.inbox-tabs .explore-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.inbox-tabs .nav-badge { position: static; transform: none; }
.inbox-tabs .explore-tab.is-on .nav-badge { background: #fff; color: var(--coral, #f4675f); }
.btn-message { display: inline-flex; align-items: center; gap: 6px; }
.btn-message svg { width: 16px; height: 16px; }

/* Moderation panel */
.mod-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin-bottom: 12px; border-radius: 999px; background: var(--chip-bg, rgba(0, 0, 0, 0.05)); scrollbar-width: none; }
.mod-tabs::-webkit-scrollbar { display: none; }
.mod-tabs .explore-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; }
.mod-tabs .nav-badge { position: static; transform: none; }
.mod-tabs .explore-tab.is-on .nav-badge { background: #fff; color: var(--coral, #f4675f); }
.mod-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.mod-kind { font-weight: 800; background: var(--pink, #ffe3e1); color: var(--coral, #f4675f); padding: 2px 10px; border-radius: 999px; }
.mod-reasons { font-weight: 800; }
.mod-count { color: var(--muted); margin-left: auto; }
.mod-target { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.mod-target .grow { min-width: 0; }
.mod-target .name-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: inherit; cursor: pointer; text-align: left; }
.mod-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: none; background: var(--line); }
.mod-text { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.mod-quote { font-size: 14px; margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--line); }
.mod-pill { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.mod-search { width: 100%; border: 1.5px solid var(--line); border-radius: 999px; padding: 10px 14px; margin: 8px 0; background: var(--white); color: inherit; font: inherit; font-size: 16px; outline: none; }
.mod-user .name-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: inherit; cursor: pointer; text-align: left; }
.mod-user-filter { margin-bottom: 0; }
.mod-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mod-stat { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.mod-stat b { font-size: 24px; font-weight: 900; }
.mod-stat span { color: var(--muted); font-size: 13px; }
.mod-actions .btn-ghost, .mod-user .btn-ghost, .mod-user .btn-tiny-danger { width: auto; flex: none; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.mod-user .mod-pill { flex: none; }
.nav button .nav-me { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1.5px var(--line); }
.nav button.is-active .nav-me { box-shadow: 0 0 0 2px var(--coral); }

/* Phone notifications banner */
.push-banner { display: flex; align-items: center; gap: 10px; background: var(--pink, #ffe3e1); border-radius: 18px; padding: 12px 12px 12px 14px; margin-bottom: 12px; }
.push-banner.hidden { display: none; }
.push-banner .grow { flex: 1; min-width: 0; }
.push-banner .hint { margin: 2px 0 0; font-size: 13px; }
.push-banner .btn-add { flex: none; }
.push-bell { font-size: 22px; }
.push-x { flex: none; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px; }

/* Online now: budds with a green ring, like close friends */
.side-online { display: none; }
.online-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; }
.online-row::-webkit-scrollbar { display: none; }
.online-person { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.online-ring { display: block; padding: 2px; border-radius: 50%; border: 3px solid #22c55e; line-height: 0; }
.online-ring .avatar { width: 46px; height: 46px; min-width: 0; margin: 0; font-size: 15px; line-height: 1; border: 0; box-shadow: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; }
.online-ring .avatar img { width: 100%; height: 100%; object-fit: cover; }
.online-name { font-size: 12px; font-weight: 700; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-empty { color: var(--muted); font-size: 13px; margin: 2px 12px 4px; }
.online-dot-label { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 6px; vertical-align: 1px; }
.inbox-online { margin-bottom: 8px; }
@media (min-width: 1000px) {
  .side-online { display: block; }
  .side-online .online-row { padding-left: 10px; padding-right: 10px; }
}

/* Call history line in the chat */
.call-bubble { padding: 6px 8px; }
.call-log {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit;
  font: inherit; text-align: left; cursor: pointer; padding: 4px 4px 2px;
}
.call-log-icon {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: rgba(127, 127, 127, 0.18); font-size: 17px;
}
.call-log-text { display: flex; flex-direction: column; line-height: 1.25; }
.call-log-text small { opacity: 0.7; font-size: 12px; }
.call-bubble.is-missed .call-log-icon { background: rgba(229, 72, 77, 0.18); }
.call-bubble.them.is-missed strong { color: #e5484d; }

/* Chat list: green ring around the photo of whoever is online */
.chat-ring { display: inline-flex; flex: none; padding: 2px; border-radius: 50%; border: 2.5px solid transparent; line-height: 0; }
.chat-ring .avatar { margin: 0; }
.person-row.is-online .chat-ring { border-color: #22c55e; }

/* + sheet: which community to post in (from Geral) */
.create-where { padding: 0 16px 8px; }
.create-where-label { margin: 0 0 8px; font-size: 14px; opacity: 0.75; }
.create-where-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.create-where-chip {
  border: 1.5px solid rgba(127, 127, 127, 0.3); background: transparent; color: inherit; font: inherit;
  font-size: 14px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.create-where-chip.is-on { border-color: var(--accent, #f0625d); background: var(--accent, #f0625d); color: #fff; }

/* Geral: which community the note goes to */
.note-where {
  margin-right: auto; max-width: 55%; font: inherit; font-size: 13px; font-weight: 600; color: inherit;
  background: rgba(127, 127, 127, 0.12); border: 0; border-radius: 999px; padding: 7px 10px; cursor: pointer;
}

/* ---------- Feed: caught up / end ---------- */
.caught-up {
  display: flex; align-items: center; gap: 12px; margin: 18px 0; padding: 14px 16px;
  border-radius: 18px; background: var(--pink); color: var(--ink); text-align: left;
}
.caught-up-icon {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--coral); color: #fff; font-weight: 800;
}
.caught-up strong, .feed-end strong { display: block; font-size: 15px; }
.caught-up small, .feed-end small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.feed-end { text-align: center; padding: 28px 16px 36px; color: var(--ink); }
.feed-end > span { font-size: 26px; display: block; margin-bottom: 6px; }
.reel-end { display: grid; place-items: center; }
.reel-end .feed-end { color: #fff; }
.reel-end .feed-end small { color: rgba(255, 255, 255, 0.7); }

/* ---------- Profile look ---------- */
.public-profile { --pc: var(--coral); --pc2: #ffb199; }
.public-profile[data-pcolor="sky"] { --pc: #3b82f6; --pc2: #7dd3fc; }
.public-profile[data-pcolor="mint"] { --pc: #10b981; --pc2: #a7f3d0; }
.public-profile[data-pcolor="grape"] { --pc: #8b5cf6; --pc2: #f0abfc; }
.public-profile[data-pcolor="sun"] { --pc: #f59e0b; --pc2: #fde68a; }
.public-profile[data-pcolor="rose"] { --pc: #ec4899; --pc2: #fbcfe8; }
.public-profile[data-pcolor="night"] { --pc: #334155; --pc2: #64748b; }
.pf-swatch { --pc: var(--coral); --pc2: #ffb199; }
.pf-swatch[data-pcolor="sky"] { --pc: #3b82f6; --pc2: #7dd3fc; }
.pf-swatch[data-pcolor="mint"] { --pc: #10b981; --pc2: #a7f3d0; }
.pf-swatch[data-pcolor="grape"] { --pc: #8b5cf6; --pc2: #f0abfc; }
.pf-swatch[data-pcolor="sun"] { --pc: #f59e0b; --pc2: #fde68a; }
.pf-swatch[data-pcolor="rose"] { --pc: #ec4899; --pc2: #fbcfe8; }
.pf-swatch[data-pcolor="night"] { --pc: #334155; --pc2: #64748b; }

.profile-cover {
  height: 128px; margin: -8px -4px 0; border-radius: 0 0 26px 26px;
  background: linear-gradient(135deg, var(--pc), var(--pc2)); background-size: cover; background-position: center;
}
#screen-person .profile-cover, #feed-you .profile-cover { border-radius: 24px; margin: 0 0 0; }
.profile-cover + .profile-avatar { margin-top: -58px; position: relative; border: 4px solid var(--bg); }
.public-profile .bud-count { color: var(--pc); }

.now-bubble {
  display: inline-block; max-width: 92%; margin: 4px auto 10px; padding: 8px 14px; border-radius: 18px;
  background: var(--white); border: 1.5px solid var(--line); color: var(--ink); font: inherit; font-size: 14px;
  box-shadow: var(--shadow); position: relative;
}
.now-bubble small { color: var(--muted); }
.now-bubble.is-mine { cursor: pointer; }
.now-add { color: var(--muted); }
.public-profile > .now-bubble { display: table; }
.public-profile > .now-bubble.hidden { display: none; }

.profile-extras { text-align: left; }
.profile-song {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; padding: 10px 14px; border-radius: 16px;
  background: linear-gradient(135deg, var(--pc), var(--pc2)); color: #fff; font-weight: 700; font-size: 14px;
}
.profile-song-icon { font-size: 18px; }
.profile-interests { display: flex; flex-wrap: wrap; gap: 8px; }
.interest-chip {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--pc) 14%, transparent); color: var(--pc);
}

.testimonials .profile-section-title { display: flex; align-items: center; gap: 8px; }
.tm-count { background: var(--pc); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.testimonial {
  position: relative; margin: 10px 0; padding: 14px 14px 12px; border-radius: 18px; background: var(--white);
  box-shadow: var(--shadow); border-left: 4px solid var(--pc);
}
.testimonial.is-pending { border-left-style: dashed; opacity: 0.95; }
.testimonial.is-featured { background: color-mix(in srgb, var(--pc) 8%, var(--white)); }
.testimonial p { margin: 8px 0 0; white-space: pre-wrap; line-height: 1.45; font-size: 15px; }
.tm-author { display: flex; align-items: center; gap: 8px; font: inherit; font-weight: 800; color: var(--ink); padding: 0; }
.tm-author .avatar { width: 30px; height: 30px; min-width: 30px; font-size: 11px; margin: 0; }
.tm-badge { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 800; color: var(--muted); }
.tm-badge.is-star { color: var(--pc); }
.tm-actions { display: flex; gap: 8px; margin-top: 10px; }
.tm-pending-title { font-size: 13px; font-weight: 800; color: var(--pc); margin: 6px 0 0; }
.tm-write { background: var(--white); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); margin-bottom: 6px; }
.tm-write textarea {
  width: 100%; min-height: 72px; border: 0; resize: vertical; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; outline: none;
}
.tm-write-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn-mini {
  font: inherit; font-size: 13px; font-weight: 800; padding: 7px 12px; border-radius: 999px;
  background: var(--bg-warm); color: var(--ink); border: 1px solid var(--line); cursor: pointer;
}
.btn-mini.is-primary { background: var(--pc, var(--coral)); border-color: transparent; color: #fff; }

/* Customize sheet */
.profile-sheet { max-height: 80%; overflow-y: auto; }
.pf-body { padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.pf-label { margin: 8px 0 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.pf-body input[type="text"], .pf-body input:not([type]) {
  width: 100%; padding: 11px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.pf-row { display: flex; align-items: center; gap: 10px; }
.pf-row .btn-ghost { width: auto; }
.pf-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer;
  background: linear-gradient(135deg, var(--pc), var(--pc2)); box-shadow: 0 0 0 1px var(--line);
}
.pf-swatch.is-on { border-color: var(--ink); }
.pf-toggle { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 700; font-size: 14px; }
.pf-toggle input { width: 20px; height: 20px; accent-color: var(--coral); }
.pf-hint { margin: 0; font-size: 12px; color: var(--muted); }

/* "Agora" bubble in the chat list */
.chat-ring { position: relative; }
.row-now {
  position: absolute; left: 50%; top: -12px; transform: translateX(-30%); max-width: 120px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2;
  background: var(--white); color: var(--ink); font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); z-index: 1;
}
.person-row:has(.row-now) { padding-top: 18px; }
@media (max-width: 700px) {
  .composer:not(.is-open) .note-where { display: none; }
}

/* ---------- Clip studio ---------- */
.clip-studio { position: fixed; inset: 0; z-index: 300; background: #000; color: #fff; }
.clip-studio.hidden { display: none; }
.st-step { position: absolute; inset: 0; display: flex; flex-direction: column; background: #000; overflow: hidden; }
.st-step.hidden { display: none; }
.st-top {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px;
}
.st-capture .st-top { position: absolute; top: 0; left: 0; right: 0; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.st-icon {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, 0.16); color: #fff; font: inherit; font-size: 18px; font-weight: 800; cursor: pointer;
  backdrop-filter: blur(8px);
}
.st-icon svg { width: 24px; height: 24px; }
.st-space { visibility: hidden; }
.is-gone { visibility: hidden; pointer-events: none; }
.st-pill {
  border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 800; font-size: 15px;
  background: var(--coral); color: #fff; cursor: pointer;
}
.st-pill.st-ghost { background: rgba(255, 255, 255, 0.16); }
.st-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111; }
.st-video.is-mirror { transform: scaleX(-1); }
.st-capture::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.18s; }
.st-capture.is-flash::after { opacity: 0.8; transition: none; }
.st-nocam {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px; text-align: center; background: radial-gradient(circle at 50% 35%, #3b2b28, #121010);
}
.st-nocam.hidden { display: none; }
.st-nocam-icon { font-size: 44px; }
.st-nocam p { margin: 0; opacity: 0.85; line-height: 1.4; max-width: 300px; }
.st-rec { background: #e5484d; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 14px; }
.st-rec.hidden { display: none; }
.st-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 18px 20px calc(26px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, rgba(0,0,0,.55));
}
.st-modes { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.35); border-radius: 999px; padding: 4px; }
.st-modes button {
  border: 0; background: transparent; color: rgba(255, 255, 255, 0.75); font: inherit; font-weight: 800; font-size: 13px;
  padding: 7px 16px; border-radius: 999px; cursor: pointer; letter-spacing: 0.04em; text-transform: uppercase;
}
.st-modes button.is-on { background: #fff; color: #111; }
.st-controls { width: 100%; max-width: 340px; display: flex; align-items: center; justify-content: space-between; }
.st-shutter {
  width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; cursor: pointer;
  display: grid; place-items: center;
}
.st-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: all 0.18s ease; }
.st-shutter:active span { transform: scale(0.9); }
.st-shutter.is-video span { background: #e5484d; }
.st-shutter.is-recording span { width: 52%; height: 52%; border-radius: 8px; }

.st-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 6px 12px; }
.st-stage canvas, .st-stage video { max-width: 100%; max-height: 100%; border-radius: 18px; object-fit: contain; background: #111; }
.st-pages { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px; }
.st-pages.hidden { display: none; }
.st-page { position: relative; flex: none; border: 2px solid transparent; border-radius: 10px; padding: 0; background: none; cursor: pointer; }
.st-page.is-on { border-color: #fff; }
.st-page canvas { display: block; width: 46px; height: 58px; object-fit: cover; border-radius: 8px; }
.st-page-del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #111; color: #fff;
  font-size: 11px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5);
}
.st-filters {
  display: flex; gap: 10px; overflow-x: auto; padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}
.st-filters.hidden { display: none; }
.st-filters::-webkit-scrollbar { display: none; }
.st-filter {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none;
  color: rgba(255, 255, 255, 0.7); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; padding: 0;
}
.st-filter-img { display: block; width: 64px; height: 80px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; }
.st-filter-img canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-filter.is-on { color: #fff; }
.st-filter.is-on .st-filter-img { border-color: #fff; }
.st-video-note { text-align: center; opacity: 0.7; font-size: 13px; margin: 0; padding: 12px 20px calc(22px + env(safe-area-inset-bottom, 0px)); }
.st-video-note.hidden { display: none; }

.st-details { background: var(--bg); color: var(--ink); }
.st-top-light .st-icon { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.st-title { font-weight: 800; font-size: 17px; }
.st-details-body { flex: 1; overflow-y: auto; padding: 8px 18px 18px; }
.st-summary { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); }
.st-thumb { position: relative; flex: none; width: 88px; height: 110px; border-radius: 12px; overflow: hidden; background: #111; }
.st-thumb canvas, .st-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-thumb-count { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 999px; }
.st-summary textarea {
  flex: 1; min-height: 110px; border: 0; resize: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; outline: none;
}
.st-label { margin: 20px 0 10px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.st-communities { display: flex; flex-wrap: wrap; gap: 8px; }
.st-community {
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
}
.st-community.is-on { background: var(--coral); border-color: var(--coral); color: #fff; }
.st-post {
  margin: 0 18px calc(18px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 999px; padding: 16px; font: inherit;
  font-weight: 800; font-size: 16px; background: var(--coral); color: #fff; cursor: pointer;
}
.st-post:disabled { opacity: 0.7; }

@media (min-width: 1000px) {
  .clip-studio { background: rgba(0, 0, 0, 0.7); }
  .st-step { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 440px; height: min(860px, 92vh); border-radius: 26px; }
}
