/* Same light-mode control contract as native VibeActionButton. Scope it to
   Vibe actions, including the home shortcuts, without changing post reactions. */
body.is-logged-in :is(.home-view, .vibe-view) .vibe-panel {
  container-type: inline-size;
  overflow: visible;
}

/* Keep the existing desktop reference. On stacked layouts the buttons stand
   on their own: do not add a surrounding card below the header. */
html body.is-logged-in[data-app-view="vibe"] .vibe-view .vibe-panel {
  padding: 6px 8px 5px;
  border: 1px solid rgba(255,255,255,0.76);
  border-radius: 18px;
  background: linear-gradient(125deg, rgba(255,255,255,0.96), rgba(239,245,255,0.9) 58%, rgba(246,240,255,0.9));
  box-shadow: 0 8px 22px rgba(10,40,88,0.1);
}

html[data-theme="dark"] body.is-logged-in[data-app-view="vibe"] .vibe-view .vibe-panel {
  border-color: rgba(151,181,226,0.2);
  background: radial-gradient(circle at 8% 0%, rgba(71,129,226,0.16), transparent 33%), linear-gradient(135deg, rgba(14,34,62,0.98), rgba(9,24,46,0.98));
  box-shadow: 0 8px 22px rgba(0,4,14,0.28);
}

@media (max-width: 1100px) {
  html body.is-logged-in[data-app-view="vibe"] .vibe-view .vibe-panel,
  html[data-theme="dark"] body.is-logged-in[data-app-view="vibe"] .vibe-view .vibe-panel {
    width: min(660px, calc(100% - 24px));
    justify-self: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
  }
}

body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

/* Switch only when the container can fit six readable controls. */
@container (min-width: 36rem) {
  body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-actions {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* The existing wide layout puts the toolbar alongside the page title. */
@media (min-width: 1101px) {
  body.is-logged-in[data-app-view="vibe"] .friends-preview > .map-page-header {
    height: auto;
    min-height: var(--vibe-toolbar-height, 85px);
  }
}

html body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action {
  min-width: 0;
  min-height: var(--sp-vibe-min-height);
  padding: 8px 6px;
  gap: 4px;
  border-radius: var(--sp-vibe-radius);
  font-family: var(--sp-font-system);
  font-size: var(--sp-vibe-font-size);
  font-weight: var(--sp-vibe-font-weight);
  letter-spacing: var(--sp-vibe-letter-spacing);
  line-height: var(--sp-vibe-line-height);
  white-space: normal;
}

html:not([data-theme="dark"]) body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action {
  border: var(--sp-vibe-border-width) solid var(--sp-vibe-border);
  color: var(--sp-vibe-text);
  background-color: transparent;
  background-image: var(--sp-vibe-glass-background);
  box-shadow: var(--sp-vibe-glass-shadow) !important;
  transform: none;
  transition: box-shadow 120ms ease;
}

html:not([data-theme="dark"]) body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action:hover {
  background-color: transparent;
}

body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action:focus-visible {
  outline: 2px solid var(--sp-vibe-selected-border);
  outline-offset: 2px;
}

html body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action i {
  box-sizing: border-box;
  flex-shrink: 0;
  width: var(--sp-vibe-icon-size);
  height: var(--sp-vibe-icon-size);
  border-radius: 50%;
}

html:not([data-theme="dark"]) body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action i {
  border: 0;
  box-shadow: none;
  color: var(--sp-color-violet);
  background: transparent;
}

html:not([data-theme="dark"]) body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action:is([data-vibe-mode="voice"], [data-vibe-mode="video"], [data-vibe-mode="visit"]) i {
  color: var(--sp-color-violet);
}

html:not([data-theme="dark"]) body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action[data-host-live] i {
  color: var(--sp-color-violet);
}

html:not([data-theme="dark"]) body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action:is([data-host-event], [data-spot-host-event]) i {
  color: var(--sp-color-violet);
}

html body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action i svg {
  width: 18px;
  height: 18px;
}

/* Like the reference's sun, use a clear, saturated glyph directly on glass. */
html:not([data-theme="dark"]) body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action i svg {
  width: var(--sp-vibe-glyph-size);
  height: var(--sp-vibe-glyph-size);
}

@media (prefers-reduced-motion: reduce) {
  body.is-logged-in :is(:is(.home-view, .vibe-view) .vibe-panel, .spot-host-actions) .vibe-action {
    transition: none;
    transform: none;
  }
}

/* One brand accent for every Vibe action on every viewport. */
html[data-theme="dark"] body.is-logged-in :is(.home-view, .vibe-view) .vibe-panel .vibe-action i {
  color: var(--sp-control-icon-dark);
  border-color: rgba(195,164,255,0.22);
  background: radial-gradient(circle at 32% 22%, rgba(208,184,255,0.26), transparent 34%), linear-gradient(155deg, #6346a9, #342665 72%);
  box-shadow: 0 10px 22px rgba(44,26,91,0.36), inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -8px 14px rgba(16,5,40,0.22);
}

/* The chosen vibe (Text, Voice Call, Video Call, Visit) is marked, same as the apps: violet ring on its icon, violet label. */
body.is-logged-in .vibe-action[aria-pressed="true"] i { box-shadow: 0 0 0 2px #9b6cff !important; }
/* #7a45f0 on the light glass reads at 4.5:1 or more (WCAG AA); the lighter brand violet did not. */
body.is-logged-in .vibe-action[aria-pressed="true"] { color: #7a45f0 !important; font-weight: 800; }
html[data-theme="dark"] body.is-logged-in .vibe-action[aria-pressed="true"] { color: #c3a4ff !important; }

/* Nobody in Family / Friends yet (or no match): message plus Invite family / Find friends. */
body.is-logged-in .friends-no-results { display: grid; gap: 6px; justify-items: start; width: min(320px, calc(100% - 32px)); font-size: 13px; line-height: 1.45; }
body.is-logged-in .friends-no-results[hidden] { display: none; }
body.is-logged-in .friends-no-results strong { color: #0b285b; font-size: 15px; }
html[data-theme="dark"] body.is-logged-in .friends-no-results strong { color: #f5f8ff; }
body.is-logged-in .friends-no-results .home-person-empty-action {
  min-height: 44px; margin-top: 4px; padding: 0 18px; border: 0; border-radius: 999px;
  color: #fff; background: #9b6cff; font: inherit; font-weight: 800; cursor: pointer;
}
body.is-logged-in .friends-no-results .home-person-empty-action[hidden] { display: none; }
body.is-logged-in .friends-no-results .home-person-empty-action:focus-visible { outline: 3px solid #397cff; outline-offset: 2px; }

/* Unread messages on the Vibe tab (side menu and phone-width bottom bar). */
body.is-logged-in [data-app-tab="vibe"] { position: relative; }
body.is-logged-in .vibe-unread-dot {
  position: absolute; top: 4px; left: 34px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center;
  border: 2px solid #fff; border-radius: 999px; background: #9b6cff; color: #fff; font-size: 9px; font-weight: 800; line-height: 1; pointer-events: none;
}
html[data-theme="dark"] body.is-logged-in .vibe-unread-dot { border-color: #08172b; }
body.is-logged-in .vibe-unread-dot[hidden] { display: none; }
body.is-logged-in .mobile-tab .vibe-unread-dot { top: 2px; left: calc(50% + 4px); }

/* Phones and iPads (as in the apps): the actions sit under the "Your vibe!" heading, with room above and below. */
@media (max-width: 1100px) {
  html body.is-logged-in[data-app-view="vibe"] .vibe-view.vibe-actions-under-heading .friends-preview > .vibe-panel {
    margin: 14px auto 14px;
  }
}
