/* Live and Timeline consume the same glass material as Vibe. Scoped to
   action controls and their status badge, not navigation or media. */
html {
  --sp-action-background: var(--sp-vibe-glass-background);
  --sp-action-shadow: var(--sp-vibe-glass-shadow);
  --sp-action-border: var(--sp-vibe-border);
  --sp-action-ink: var(--sp-vibe-text);
  --sp-action-selected: linear-gradient(155deg, #f8fbff, #ccdfff 76%);
  --sp-action-icon: var(--sp-color-violet);
}
html[data-theme="dark"] {
  --sp-action-background: radial-gradient(at 50% -24%, rgba(255,255,255,0.16), transparent 54%), linear-gradient(rgba(17,38,68,0.8), rgba(17,38,68,0.8));
  --sp-action-shadow: 0 3px 9px rgba(14,50,105,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
  --sp-action-border: rgba(145,190,255,0.48);
  --sp-action-ink: #ffffff;
  --sp-action-selected: linear-gradient(155deg, #284f7b, #122d51 76%);
  --sp-action-icon: var(--sp-control-icon-dark);
}

html body.is-logged-in[data-app-view] :is(
  .live-filter-button, .live-count, .live-view .event-action, .live-map-event-actions .event-action, .live-watch-close,
  .timeline-action, .timeline-keep-up, .timeline-more, .timeline-heading-plus, .timeline-heading-keep-ups,
  .timeline-search-toggle, .timeline-heading-history, .timeline-heading-sections,
  .timeline-mobile-map-back, .timeline-keep-map-search-toggle,
  .timeline-composer-media-button, .timeline-composer-actions button,
  .comments-close, .comments-form button
) {
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  height: auto;
  padding: 10px 12px;
  border: var(--sp-vibe-border-width) solid var(--sp-action-border) !important;
  border-radius: var(--sp-vibe-radius);
  background: var(--sp-action-background) !important;
  box-shadow: var(--sp-action-shadow) !important;
  color: var(--sp-action-ink) !important;
  font-family: var(--sp-font-system);
  font-size: var(--sp-vibe-font-size);
  font-weight: var(--sp-vibe-font-weight);
  line-height: var(--sp-vibe-line-height);
  letter-spacing: var(--sp-vibe-letter-spacing);
  white-space: normal;
  text-align: center;
  text-shadow: none !important;
  backdrop-filter: none;
  filter: none;
  transform: none;
  gap: 7px;
  transition: opacity 120ms ease;
}

/* The count is status text, not a pressable control. It keeps the same glass
   and font at every layout size, without a blue lower edge. */
html body.is-logged-in[data-app-view] .live-view .live-count {
  min-height: 34px; min-width: 0; max-width: 100%; padding: 7px 12px;
  flex-shrink: 0; text-align: left; cursor: default;
}
html body.is-logged-in[data-app-view] .live-count::before { flex-shrink: 0; }

html body.is-logged-in[data-app-view] :is(.live-filter-button.active,
  .timeline-action[aria-pressed="true"], .timeline-keep-up[aria-pressed="true"],
  .live-view .event-action[aria-pressed="true"], .live-view .event-action.attending,
  .live-map-event-actions .event-action.attending, .timeline-composer-actions button[type="submit"]
) { background: var(--sp-action-selected) !important; }

html body.is-logged-in[data-app-view] :is(.live-filter-button, .event-action, .timeline-action,
  .timeline-keep-up, .timeline-more, .timeline-heading-plus, .timeline-heading-keep-ups,
  .timeline-composer-media-button, .timeline-composer-actions button, .comments-form button
):focus-visible { outline: 2px solid var(--sp-action-icon); outline-offset: 3px; }

html body.is-logged-in[data-app-view] :is(.live-filter-button, .event-action, .timeline-action,
  .timeline-keep-up, .timeline-more, .timeline-heading-plus, .timeline-heading-keep-ups,
  .timeline-composer-media-button, .timeline-composer-actions button, .comments-form button
):disabled { opacity: 0.48; cursor: not-allowed; }

html body.is-logged-in[data-app-view] :is(.live-view .event-action, .live-map-event-actions .event-action, .timeline-action) svg {
  width: 22px; height: 22px; flex-shrink: 0; color: var(--sp-action-icon); filter: none;
}
html body.is-logged-in[data-app-view] :is(.event-action.event-keep, .event-action.event-watch, .timeline-action.timeline-keep) svg { color: var(--sp-action-icon); }
html body.is-logged-in[data-app-view] :is(.event-action.event-share, .timeline-action.timeline-share) svg { color: var(--sp-action-icon); width: 44px; }
html[data-theme="dark"] body.is-logged-in[data-app-view] :is(.event-action.event-keep, .event-action.event-watch, .timeline-action.timeline-keep) svg { color: var(--sp-action-icon); }
html[data-theme="dark"] body.is-logged-in[data-app-view] :is(.event-action.event-share, .timeline-action.timeline-share) svg { color: var(--sp-action-icon); }
html body.is-logged-in[data-app-view] :is(.timeline-action, .event-action) small { color: inherit; font-size: inherit; line-height: inherit; font-weight: inherit; }

html body.is-logged-in[data-app-view] .live-event-filters {
  flex-wrap: wrap; padding: 0; gap: 8px; border: 0; background: transparent;
  box-shadow: none !important; overflow: visible;
}
html body.is-logged-in[data-app-view] :is(.live-view-controls, .timeline-composer-footer,
  .timeline-composer-actions, .timeline-composer-media-actions) { flex-wrap: wrap; gap: 8px; }
html body.is-logged-in[data-app-view] :is(.timeline-post, .live-map-event-panel) { container-type: inline-size; }
html body.is-logged-in[data-app-view] :is(.timeline-actions, .live-map-event-actions) {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
html body.is-logged-in[data-app-view] :is(.timeline-actions .timeline-action, .live-map-event-actions .event-social-action) {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: 64px; padding: 8px 4px; gap: 4px;
}
html body.is-logged-in[data-app-view] .live-map-event-actions > :is(.event-attend, .event-watch) { grid-column: span 2; }
/* Big enough to tap without sight or with low vision (WCAG 2.2 target size). */
html body.is-logged-in[data-app-view] .live-map-event-actions > .event-action { min-height: 44px; min-width: 44px; }
html body.is-logged-in[data-app-view] .live-map-event-actions:has(> .event-attend + .event-attend) > .event-watch { grid-column: 1 / -1; }
html body.is-logged-in[data-app-view] .timeline-actions .timeline-action span {
  white-space: normal; overflow-wrap: anywhere;
}
html body.is-logged-in[data-app-view] .timeline-actions .timeline-action svg { max-width: 100%; }
/* A roomy post uses a slim inline toolbar; narrow posts keep four touchable
   buttons in the same row, with the glyph above its label. */
@container (min-width: 32.5rem) {
  html body.is-logged-in[data-app-view] .timeline-actions .timeline-action {
    flex-direction: row; min-height: 44px; padding: 8px; gap: 6px;
  }
  html body.is-logged-in[data-app-view] .timeline-actions .timeline-action svg {
    width: 18px; height: 18px;
  }
  html body.is-logged-in[data-app-view] .timeline-actions .timeline-share svg { width: 36px; }
  html body.is-logged-in[data-app-view] .timeline-actions .timeline-action span,
  html body.is-logged-in[data-app-view] .timeline-actions .timeline-action small {
    display: inline; white-space: nowrap;
  }
}
html body.is-logged-in[data-app-view] .timeline-heading-plus {
  font-size: 24px; line-height: 24px;
}
@media (prefers-reduced-motion: reduce) {
  html body.is-logged-in[data-app-view] :is(.live-filter-button, .event-action, .timeline-action,
    .timeline-keep-up, .timeline-more, .timeline-heading-plus, .timeline-heading-keep-ups,
    .timeline-composer-media-button, .timeline-composer-actions button) { transition: none; transform: none; }
}

/* Timeline section links are text actions, without glass cards. */
html body.is-logged-in[data-app-view] .timeline-map-see-all {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--sp-color-violet);
  font-size: 12px;
  font-weight: 700;
}

/* Share uses a square share icon (it replaced the wide "Pass On" figure): same footprint as the other action icons. */
html body :is(.event-share, .timeline-share, [data-core-viewer-action="share"]) svg { width: auto !important; height: 20px; aspect-ratio: 1 / 1; }
html body.is-logged-in.timeline-open .timeline-share svg { height: 18px; }

/* Web on a phone: the quick menu (Home, Vibe, Live, Timeline, Me) sits on a solid rounded card, like the app's tab bar,
   so the page never shows through it. Colours from design/tokens.json. */
html body.is-logged-in .mobile-bottom-nav {
  left: max(12px, env(safe-area-inset-left)) !important; right: max(12px, env(safe-area-inset-right)) !important;
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
  background: #ffffff !important; border: 1px solid rgba(11, 40, 91, .08) !important; border-radius: 26px !important;
  box-shadow: 0 14px 34px rgba(11, 40, 91, .16), 0 2px 6px rgba(11, 40, 91, .06) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; overflow: hidden;
}
html[data-theme="dark"] body.is-logged-in .mobile-bottom-nav {
  background: #08172b !important; border-color: rgba(145, 190, 255, .16) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45) !important;
}

/* Timeline header controls share one surface; History keeps its text label. */
html body.is-logged-in[data-app-view] :is(.timeline-primary-actions, .timeline-heading-actions) :is(.timeline-search-toggle, .timeline-heading-history, .timeline-heading-plus, .timeline-heading-sections) {
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html body.is-logged-in[data-app-view] :is(.timeline-primary-actions, .timeline-heading-actions) :is(.timeline-search-toggle, .timeline-heading-plus, .timeline-heading-sections) {
  width: 44px;
  padding: 0;
  color: var(--sp-action-icon) !important;
}
html body.is-logged-in[data-app-view] :is(.timeline-primary-actions, .timeline-heading-actions) :is(.timeline-search-toggle, .timeline-heading-sections) svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
html body.is-logged-in[data-app-view] :is(.timeline-primary-actions, .timeline-heading-actions) :is(.timeline-search-toggle, .timeline-heading-history, .timeline-heading-sections):focus-visible {
  outline: 2px solid var(--sp-action-icon);
  outline-offset: 3px;
}
html body.is-logged-in[data-app-view] .timeline-primary-actions :is(.timeline-heading-history, .timeline-heading-plus, .timeline-heading-sections)[hidden] { display: none; }
html body.is-logged-in[data-app-view] .timeline-primary-actions .timeline-heading-history {
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: normal;
}
