: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;
}
