/* Custom scrollbar for dark UI */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 10px;
}

/* Prevent pull-to-refresh on mobile */
html, body {
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

/* Smooth transitions */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

.tap-feedback {
  transition: transform 0.1s ease-out, opacity 0.1s ease-out;
}
.tap-feedback:active {
  transform: scale(0.96);
  opacity: 0.8;
}

/* Subtle premium press feedback for tappable profile header */
.press-glow {
  position: relative;
  transition: transform 0.12s ease-out;
}
.press-glow::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 40%, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0) 60%);
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.14s ease-out, transform 0.14s ease-out;
  pointer-events: none;
}
.press-glow:active {
  transform: scale(0.97);
}
.press-glow:active::after {
  opacity: 1;
  transform: scale(1);
}

/* Header (top-right) premium system: status + icon control */
.vibes-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header: brand mark (VIBES) */
.vibes-brand-mark {
  font-size: 14px; /* slightly larger for presence */
  font-weight: 900;
  letter-spacing: 0.16em; /* slightly tighter than before */
  text-transform: uppercase;
  line-height: 1;

  /* Premium, intentional tone */
  color: rgba(244, 244, 245, 0.86);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 0 14px rgba(59, 130, 246, 0.18); /* subtle blue emphasis */

  /* Keep it crisp */
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Header: LIVE NOW label (de-emphasized so it doesn't overpower VIBES) */
.vibes-live-now {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  color: rgba(161, 161, 170, 0.72);
}

/* Header: compact mode badge (pill) */
.vibes-mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 9999px;

  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;

  /* Dark premium pill */
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.82);

  box-shadow:
    0 10px 26px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Header placement variant: keep it compact and centered in the middle gap */
.vibes-mode-badge--header {
  margin-left: 14px;
  flex: 0 0 auto;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.86);
  border-color: rgba(255,255,255,0.14);
  box-shadow:
    0 10px 26px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.05);

  /* Nudge the chip slightly DOWN while keeping it in the header row */
  transform: translateY(6px);
}

/* Live Energy card: make the bottom text match the premium badge typography */
.vibes-liveenergy-stat,
.vibes-liveenergy-sub,
.vibes-liveenergy-link {
  font-weight: 800;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

/* Live Energy card: micro-indicators (dots) 
   Slightly less intense + more premium (no layout change). */
.vibes-liveenergy-dot {
  opacity: 0.82;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 8px rgba(255,255,255,0.025);
}

/* LIVE ENERGY icon: subtle, premium "alive" motion (icon only) */
.vibes-liveenergy-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Soft breathing glow around the icon (low opacity, no flashing) */
.vibes-liveenergy-icon::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 9999px;
  background: radial-gradient(circle at 50% 50%, rgba(16,185,129,0.26), rgba(16,185,129,0) 64%);
  opacity: 0.16;
  filter: blur(9px);
  animation: vibes-liveenergy-glow 2.9s ease-in-out infinite;
  pointer-events: none;
}

@keyframes vibes-liveenergy-glow {
  0%, 100% { transform: scale(0.94); opacity: 0.12; }
  50% { transform: scale(1.06); opacity: 0.24; }
}

/* Inner bars: tiny, live-signal motion (no bounce/spin/flash) */
.vibes-liveenergy-bar {
  transform-box: fill-box;
  transform-origin: center;
  animation: vibes-liveenergy-bars 2.4s ease-in-out infinite;
  will-change: transform, opacity;
}

.vibes-liveenergy-bar--1 { animation-delay: 0s; }
.vibes-liveenergy-bar--2 { animation-delay: 0.22s; }
.vibes-liveenergy-bar--3 { animation-delay: 0.44s; }

@keyframes vibes-liveenergy-bars {
  0%, 100% { transform: translateY(0.35px) scaleY(0.94); opacity: 0.84; }
  50% { transform: translateY(-0.35px) scaleY(1.08); opacity: 0.98; }
}

@media (prefers-reduced-motion: reduce) {
  .vibes-liveenergy-icon::after,
  .vibes-liveenergy-bar {
    animation: none !important;
  }
}

/* Keep hierarchy: stat line slightly stronger than the sub line */
.vibes-liveenergy-stat {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.vibes-liveenergy-sub {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Keep "1 story" blue; just align typography */
.vibes-liveenergy-link {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.vibes-header-iconbtn {
  height: 34px;
  width: 34px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Premium dark glass */
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 10px 26px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.06);

  color: rgba(255,255,255,0.55);
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease-out, background 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}

.vibes-header-iconbtn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.78);
}

.vibes-header-iconbtn:active {
  transform: scale(0.96);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow:
    0 8px 22px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.vibes-header-iconbtn:focus-visible {
  outline: none;
  box-shadow:
    0 10px 26px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 4px rgba(59,130,246,0.18);
}

.vibes-header-icon {
  display: block;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.35));
}

.vibes-header-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  height: 10px;
  width: 10px;
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 30%, rgba(147,197,253,1), rgba(59,130,246,1) 55%, rgba(37,99,235,1));
  border: 2px solid rgba(0,0,0,0.9);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 14px rgba(59,130,246,0.55);
}

.vibes-header-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border-radius: 9999px;

  background: linear-gradient(180deg, rgba(16,185,129,0.10), rgba(16,185,129,0.05));
  border: 1px solid rgba(16,185,129,0.20);
  box-shadow:
    0 10px 26px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

.vibes-header-status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 30%, rgba(167,243,208,1), rgba(16,185,129,1) 55%, rgba(5,150,105,1));
  box-shadow:
    0 0 0 1px rgba(16,185,129,0.35),
    0 0 12px rgba(16,185,129,0.35);
}

.vibes-header-status-dot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(16,185,129,0.22), rgba(16,185,129,0) 60%);
  opacity: 0.55;
  animation: vibes-status-breathe 2.8s ease-in-out infinite;
}

@keyframes vibes-status-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.35; }
  50% { transform: scale(1.08); opacity: 0.65; }
}

.vibes-header-status-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(167,243,208,0.95);
  line-height: 1;
  transform: translateY(0.5px);
}

/* Name affordance: subtle underline/glow only on interaction */
.name-affordance {
  text-decoration: none;
}
button:active .name-affordance {
  opacity: 0.92;
}
@media (hover: hover) {
  button:hover .name-affordance {
    opacity: 0.95;
  }
}
button:active .name-affordance {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.18);
  text-underline-offset: 6px;
}
@media (hover: hover) {
  button:hover .name-affordance {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.14);
    text-underline-offset: 6px;
  }
}
button:active .name-affordance-icon {
  color: rgba(255, 255, 255, 0.38);
}
@media (hover: hover) {
  button:hover .name-affordance-icon {
    color: rgba(255, 255, 255, 0.32);
  }
}

/* Messages panel: empty inbox vertical centering
   Only applies when the inbox is empty (MessagesView adds .vibes-messages-empty).
   Do NOT move the sheet or change its height; just center the empty-state block
   within the available panel body space.
*/
.vibes-messages-panel-body:has(.vibes-messages-empty) {
  flex: 0 0 auto !important;
  max-height: 45vh;

  /* Keep the existing body padding (no artificial push down/up). */
  padding-top: 24px !important;
  padding-bottom: 24px !important;

  /* Center children vertically within the panel body. */
  display: flex;
  flex-direction: column;
}

/* Fallback for browsers without :has() support (still safe):
   MessagesView also adds .vibes-messages-empty to its root, so we can target it directly.
*/
.vibes-messages-panel-body .vibes-messages-empty {
  min-height: 0;
}

/* Empty inbox: vertically center the empty-state block within the existing sheet.
   (No typography/color/button changes.) */
.vibes-messages-panel-body .vibes-messages-empty > .flex-1 {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Empty inbox: ONLY adjust the empty-state content block (icon + text + button).
   Do not change sheet height/position or any other spacing. */
.vibes-messages-panel-body .vibes-messages-empty .vibes-messages-empty-content {
  margin-top: 0;
  transform: translateY(-48px);
}

/* Profile: premium info cards + social icons refinements (no layout changes) */
.vibes-profile-status-dot{
  position: relative;
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  flex: 0 0 auto;
}

.vibes-profile-status-dot.is-online{
  background: radial-gradient(circle at 30% 30%, rgba(167,243,208,1), rgba(16,185,129,1) 55%, rgba(5,150,105,1));
  box-shadow:
    0 0 0 1px rgba(16,185,129,0.22),
    0 0 8px rgba(16,185,129,0.20);
}

.vibes-profile-status-dot.is-online::after{
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(16,185,129,0.18), rgba(16,185,129,0) 62%);
  filter: blur(7px);
  opacity: 0.6;
}

.vibes-profile-status-dot.is-offline{
  background: rgba(255,255,255,0.18);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}

/* Social icons: crisp vector, integrated with dark cards */
.vibes-social-icon{
  display: block;
  shape-rendering: geometricPrecision;
  color: rgba(255,255,255,0.72);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.45));
}

.vibes-social-icon *{
  vector-effect: non-scaling-stroke;
  shape-rendering: geometricPrecision;
}


/* Safari/WebKit autofill: keep dark theme (prevent yellow background) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  -webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.25) inset;
  box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.25) inset;
  transition: background-color 999999s ease-out 0s;
}

/* Story ring: subtle glow when stories are active */
@keyframes story-ring {
  0%, 100% { opacity: 0.25; filter: blur(0px); }
  50% { opacity: 0.55; filter: blur(0.4px); }
}
.animate-story-ring {
  animation: story-ring 2.8s ease-in-out infinite;
}

@keyframes pulse-slow {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.25; }
}

.animate-pulse-slow {
  animation: pulse-slow 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes heat-glow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.15); }
}

.animate-heat-glow {
  animation: heat-glow 8s ease-in-out infinite;
}

/* Map: subtle activity glow behind clusters (soft energy field, minimal) */
@keyframes vibes-activity-glow {
  0%, 100% { opacity: 0.10; transform: scale(0.98); }
  50% { opacity: 0.16; transform: scale(1.04); }
}

.vibes-activity-glow {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(59,130,246,0.22), rgba(59,130,246,0.0) 62%),
    radial-gradient(circle at 35% 35%, rgba(147,197,253,0.10), rgba(147,197,253,0.0) 55%);
  filter: blur(34px);
  opacity: 0.12;
  animation: vibes-activity-glow 9.5s ease-in-out infinite;
  pointer-events: none;
}

.vibes-activity-glow--inner {
  inset: 18%;
  filter: blur(22px);
  opacity: 0.10;
  animation-duration: 12.5s;
  animation-delay: 1.8s;
}

@keyframes breathing {
  0%, 100% { transform: scale(0.85); opacity: 0.2; }
  50% { transform: scale(1.15); opacity: 0.5; }
}

.animate-breathing {
  animation: breathing 5s ease-in-out infinite;
}

@keyframes fade-in-vibe {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.animate-fade-in-vibe {
  animation: fade-in-vibe 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-slide-up {
  animation: slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Unified premium bottom-sheet close animation (matches Profile/Panel feel)
   - slides down
   - slightly fades while moving
   - feels like it returns to the bottom of the screen
*/
.vibes-sheet--closing {
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 700ms cubic-bezier(0.32, 0.72, 0, 1),
    opacity 700ms ease;
  will-change: transform, opacity;
}

/* Overlay fade-out for sheets that use the Profile/Panel dismissal feel */
.vibes-sheet-overlay--closing {
  opacity: 0;
  transition: opacity 700ms ease;
  will-change: opacity;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out forwards;
}

@keyframes fade-in-out {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

.animate-fade-in-out {
  animation: fade-in-out 3s ease-in-out forwards;
}

/* Energy Waves */
@keyframes energy-wave {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.animate-energy-wave {
  animation: energy-wave 3.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Story pulse: soft expanding wave (subtle, low opacity, no hard rings) */
@keyframes vibes-story-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.52);
    opacity: 0;
  }
  10% {
    /* Slightly stronger initial visibility so it's clearly noticeable */
    opacity: 0.52;
  }
  100% {
    /* Expand across a much larger area of the map */
    transform: translate(-50%, -50%) scale(16.2);
    opacity: 0;
  }
}

.vibes-story-pulse {
  /* Soft fill + very faint edge to avoid “radar ring” look */
  background: radial-gradient(circle, rgba(147,197,253,0.22), rgba(147,197,253,0.0) 64%);
  box-shadow: 0 0 0 3px rgba(147,197,253,0.14);
  filter: blur(0.25px);
  opacity: 0.34;
  animation: vibes-story-pulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Current-user story bubble (blue square) that coexists with the expanding story pulse */
.vibes-user-story-bubble {
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59,130,246,0.95), rgba(34,211,238,0.55));
  box-shadow:
    0 10px 26px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.10) inset,
    0 0 18px rgba(59,130,246,0.35);
  opacity: 0.95;
  pointer-events: none;
}

/* Place the current-user story square in the upper map area (balanced between Live Energy and Filters).
   NOTE: size/style unchanged; only position adjusted. */
.vibes-user-story-square {
  top: 0;
  left: 0;
  /* Shift rightward so it isn't glued to the Live Energy card, while staying in the upper map area
     and clear of the header. */
  transform: translate(18%, -80%);
}

@keyframes bounce-up {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  50% { transform: translateY(-40px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-80px) scale(1); opacity: 0; }
}

.animate-bounce-up {
  animation: bounce-up 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.bg-gradient-radial {
  background-image: radial-gradient(circle, var(--tw-gradient-from) 0%, var(--tw-gradient-to) 70%);
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Global Avatar Styles */
.avatar-container {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 9999px; /* Circular mask */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  transform: none !important; /* Prevent offset crops */
  display: block;
}

/* Leaflet map: keep dark fallback during fast pan/zoom (no white flashes) */
#vibes-map {
  background: #09090b; /* theme-matching dark fallback behind tiles */
}

#vibes-map .leaflet-container {
  background: #09090b !important;
}

#vibes-map .leaflet-tile-pane,
#vibes-map .leaflet-map-pane,
#vibes-map .leaflet-layer,
#vibes-map .leaflet-tile-container {
  background: transparent !important;
}

#vibes-map .leaflet-tile {
  background: transparent !important;
}

/* Map: top-right Filters button (must be reliably tappable above map layers) */
.vibes-map-filters-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;

  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 14px 40px rgba(0,0,0,0.45);

  color: rgba(255,255,255,0.75);

  /* Make it definitely tappable */
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: relative;
  z-index: 1000;
}

.vibes-map-filters-btn.is-open{
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.25);
}

.vibes-map-filters-btn__icon{
  color: rgba(255,255,255,0.55);
}

.vibes-map-filters-btn.is-open .vibes-map-filters-btn__icon{
  color: rgba(255,255,255,0.90);
}

.vibes-map-filters-btn__label{
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.75);
}

/* Map right-side floating action buttons (premium alignment) */
.vibes-map-fab {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Integrated luxury dark UI */
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.028));
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  /* Same shadow intensity for both buttons */
  box-shadow:
    0 10px 26px rgba(0,0,0,0.52),
    0 1px 0 rgba(255,255,255,0.055) inset;

  color: rgba(255,255,255,0.78);

  transition: transform 160ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.vibes-map-fab:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.085), rgba(255,255,255,0.035));
  border-color: rgba(255,255,255,0.16);
  box-shadow:
    0 12px 30px rgba(0,0,0,0.54),
    0 1px 0 rgba(255,255,255,0.06) inset;
}

.vibes-map-fab:active {
  transform: scale(0.93);
}

.vibes-map-fab__icon {
  display: block;
  color: rgba(255,255,255,0.82);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.45));
  shape-rendering: geometricPrecision;
}

/* Slightly lighter icon treatment for the recenter glyph */
.vibes-map-fab[aria-label="Recenter map"] .vibes-map-fab__icon {
  color: rgba(255,255,255,0.72);
}

/* Recent Stories (premium row) */
.vibes-stories-row {
  width: 100%;
  /* Tiny upward nudge so the current-user story bubble sits slightly closer to the Live Energy card. */
  margin-top: -2px;
}

.vibes-stories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.vibes-stories-scroll::-webkit-scrollbar {
  display: none;
}

.vibes-story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.vibes-story-thumb {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  transition: transform 120ms ease-out, box-shadow 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out;
}

.vibes-story-thumb.is-active {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(59, 130, 246, 0.25));
}

.vibes-story-thumb.is-active::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(34, 211, 238, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.9;
}

.vibes-story-thumb.is-active::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 40%, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0) 60%);
  opacity: 0.55;
  pointer-events: none;
}

.vibes-story-item:active .vibes-story-thumb {
  transform: scale(0.975);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(59, 130, 246, 0.12);
}

.vibes-story-media {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
  position: relative;
}

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

.vibes-story-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255,  255, 0.55);
  font-weight: 800;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
  z-index: -1;
}

.vibes-story-label {
  width: 76px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* StoryViewer: keep stage dark (iPhone-stable: no 3D transforms/backface hacks) */
.story-media-stage {
  background: #000;
}

/* StoryViewer: ensure gesture layer never blocks the bottom dock */
.vibes-story-gesture-layer {
  pointer-events: auto;
}

/* StoryViewer: lightweight image progress bar (CSS-only) */
@keyframes story-img-progress {
  from { width: 0%; }
  to { width: 100%; }
}

.story-img-progress {
  width: 0%;
  animation: story-img-progress 4s linear forwards;
}

/* StoryViewer: composer dock wrapper (non-interactive overlay) */
.vibes-story-composer-dock-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
  touch-action: auto;
}

/* StoryViewer: composer dock (topmost interactive layer) */
.vibes-story-composer-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: auto;
  touch-action: auto;
}

.vibes-story-composer-dock,
.vibes-story-composer-dock * {
  pointer-events: auto;
}

/* StoryViewer: fixed reply composer (touch-stable: no blur/backdrop-filter/transform/filter/animation) */
.vibes-story-composer-fixed {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 18, 29, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.vibes-story-composer-emoji {
  height: 42px;
  width: 42px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.vibes-story-composer-input-native {
  flex: 1;
  height: 42px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 16px;
  line-height: 22px;
  outline: none;
  resize: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vibes-story-composer-input-native::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.vibes-story-composer-input-native:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.vibes-story-composer-send-fixed {
  height: 42px;
  width: 42px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.vibes-story-composer-send-fixed.is-active {
  color: #fff;
  background: #2563eb;
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* StoryViewer: native reply bar (iPhone Safari stable) */
.vibes-story-replybar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 18, 29, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  touch-action: auto;
}

/* Live Energy card + Story avatar UI tweaks */
.live-energy-row{
  display:flex;
  align-items:center;

  /* Tighten label↔number spacing without moving dots/labels vertically */
  gap:4px;
}

/* LIVE ENERGY: keep a consistent numeric column, but bring it closer to the label.
   Only affects the stats row layout (Nearby/Stories). */
.live-energy-count{
  font-size:10px;
  font-weight:500;
  line-height:1;
  opacity:.92;

  /* Consistent alignment between rows */
  min-width: 14px;
  text-align: right;

  /* Small, consistent label→number gap */
  margin-left: 6px;
}

/* Story preview tile: remove any framed/outlined look so media feels embedded in the map */
.story-active,
.story-playing,
.story-preview,
.story-tile,
.vibes-story-thumb,
.vibes-story-item,
.vibes-story-media{
  border:none !important;
  outline:none !important;
  box-shadow:none !important;
  background:transparent !important;
}

.story-active::before,
.story-active::after,
.story-playing::before,
.story-playing::after,
.story-preview::before,
.story-preview::after,
.story-tile::before,
.story-tile::after,
.vibes-story-thumb::before,
.vibes-story-thumb::after{
  content:none !important;
  display:none !important;
}

.story-active img,
.story-playing img,
.story-preview img,
.story-tile img,
.story-active video,
.story-playing video,
.story-preview video,
.story-tile video,
.vibes-story-img,
.vibes-story-media img,
.vibes-story-media video{
  border:none !important;
  outline:none !important;
  box-shadow:none !important;
  border-radius:22px !important;
}

.story-avatar{
  border:none !important;
  box-shadow:none !important;
}

.vibes-story-replybar,
.vibes-story-replybar * {
  pointer-events: auto;
}

.vibes-story-replybar-input {
  flex: 1;
  height: 42px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 16px;
  line-height: 22px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.vibes-story-replybar-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.vibes-story-replybar-input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.vibes-story-replybar-send {
  height: 42px;
  width: 42px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.vibes-story-replybar-send.is-active {
  color: #fff;
  background: #2563eb;
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}
