/* Every small Spossity pop-up is one sleek glass card: a compact header (title, close), roomy body
   text, and pill buttons. Same look as the notification card (notification-sheet.css). Large workspaces
   (Spot hosting, Spot posts, cameras, studios) keep their own layouts. */
html:root body :is(dialog.host-event-preview:not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview):has(> .host-event-header), dialog.post-location-consent) {
  /* Colours come from popup-system.css (--pop-*), which switches them for dark mode. */
  --ps-glass: var(--pop-glass); --ps-edge: var(--pop-edge); --ps-ink: var(--pop-ink); --ps-soft: var(--pop-soft);
  box-sizing: border-box; width: min(440px, calc(100vw - 32px)) !important; max-width: none !important; max-height: min(80vh, 680px) !important;
  margin: auto !important; border: 0 !important; border-radius: 28px !important; color: var(--ps-ink) !important;
  background: var(--ps-glass) !important;
  box-shadow: 0 2px 6px rgba(29,25,62,.08), 0 24px 60px rgba(29,25,62,.22), inset 0 0 0 1px var(--ps-edge) !important;
  backdrop-filter: blur(28px) saturate(160%) !important; -webkit-backdrop-filter: blur(28px) saturate(160%) !important;
  overflow: auto;
}
html:root body :is(dialog.host-event-preview:not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview):has(> .host-event-header), dialog.post-location-consent)[open] { animation: sp-sheet-in var(--sp-dur-glide) var(--sp-ease-glide) backwards; }
@keyframes ps-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
html:root body :is(dialog.host-event-preview, dialog.post-location-consent)::backdrop { background: rgba(20,18,44,.28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Header-style pop-ups (shared location, previews). */
html:root body dialog.host-event-preview:not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview):has(> .host-event-header) { padding: 0 0 22px !important; display: none; }
html:root body dialog.host-event-preview:not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview):has(> .host-event-header)[open] { display: flex; flex-direction: column; gap: 10px; }
html:root body dialog.host-event-preview:has(> .host-event-header):not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview) > .host-event-header {
  display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important;
  margin: 0 !important; padding: 20px 18px 6px 22px !important; min-height: 0 !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
}
html:root body dialog.host-event-preview:has(> .host-event-header):not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview) > .host-event-header :is(h2,h3,h4) {
  margin: 0 !important; font-size: 17px !important; font-weight: 700 !important; line-height: 1.25 !important; letter-spacing: -.01em; color: var(--ps-ink) !important;
}
html:root body dialog.host-event-preview:has(> .host-event-header):not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview) > :not(.host-event-header) { margin: 0 22px !important; }
html:root body dialog.host-event-preview:has(> .host-event-header):not(.spot-host-dialog):not(.spot-post-dialog):not(.office-room-preview) p {
  margin: 0 !important; font-size: 14px !important; line-height: 1.45 !important; color: var(--ps-soft) !important;
}
html:root body dialog.host-event-preview:has(> .host-event-header) .host-event-close {
  flex: none; width: 34px !important; height: 34px !important; min-width: 0 !important; padding: 0 !important; border-radius: 50% !important; border: 0 !important;
  display: grid !important; place-items: center !important; font-size: 20px !important; line-height: 1 !important; cursor: pointer;
  color: var(--ps-soft) !important; background: var(--pop-field) !important; box-shadow: inset 0 0 0 1px var(--pop-line) !important;
}
html:root body dialog.host-event-preview:has(> .host-event-header) .host-event-close:hover { background: rgba(255,255,255,.92) !important; color: var(--ps-ink) !important; }

/* Shared live location: the place, then two pill buttons that hand off to the phone's maps. */
html:root body dialog.shared-location-dialog .shared-location-handoff { display: grid; gap: 14px; }
html:root body dialog.host-event-preview.shared-location-dialog:has(> .host-event-header) .shared-location-handoff p.shared-location-place { font-size: 18px !important; font-weight: 700 !important; color: var(--ps-ink) !important; letter-spacing: -.01em; }
html:root body dialog.shared-location-dialog [data-map-status] { font-size: 13px !important; }
html:root body dialog.shared-location-dialog .home-visit-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Pill buttons, the same in every small pop-up: the main action filled, the rest glass. */
html:root body :is(dialog.shared-location-dialog .home-visit-actions > a, dialog.post-location-consent > button) {
  flex: 1 1 0; display: inline-flex !important; align-items: center; justify-content: center; min-height: 44px !important; padding: 0 18px !important;
  border-radius: 999px !important; border: 0 !important; font-family: inherit; font-size: 14px !important; font-weight: 600 !important; text-decoration: none !important; cursor: pointer;
  color: var(--ps-ink) !important; background: var(--pop-field) !important; box-shadow: inset 0 0 0 1px var(--pop-line) !important;
}
html:root body :is(dialog.shared-location-dialog .home-visit-actions > a:first-child, dialog.post-location-consent > button:last-child) {
  color: #fff !important; background: linear-gradient(140deg,#8a5cff,#5b6cff) !important; box-shadow: 0 6px 16px rgba(110,80,255,.3) !important;
}

/* Small consent pop-ups (title, message, two buttons). */
html:root body dialog.post-location-consent { padding: 24px 22px 22px !important; }
html:root body dialog.post-location-consent[open] { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
html:root body dialog.post-location-consent > :not(button) { grid-column: 1 / -1; }
html:root body dialog.post-location-consent h3 { margin: 0 !important; font-size: 17px !important; font-weight: 700; color: var(--ps-ink) !important; }
html:root body dialog.post-location-consent p { margin: 0 0 6px !important; font-size: 14px; line-height: 1.45; color: var(--ps-soft) !important; }

/* Dark. */
html[data-theme="dark"] body :is(dialog.host-event-preview .host-event-close, dialog.shared-location-dialog .home-visit-actions > a:not(:first-child), dialog.post-location-consent > button:not(:last-child)) { background: rgba(255,255,255,.08) !important; }
/* Hover stays dark in dark mode (the light hover above is white and turned the close button white). */
html[data-theme="dark"]:root body dialog.host-event-preview:has(> .host-event-header) .host-event-close:hover { background: rgba(167,139,250,.22) !important; color: #f5f8ff !important; }
@media (prefers-reduced-motion: reduce) { html:root body :is(dialog.host-event-preview, dialog.post-location-consent)[open] { animation: none; } }

/* Keyboard focus: a soft violet ring, the same everywhere. */
html:root body :is(dialog.host-event-preview, dialog.post-location-consent, dialog.notification-sheet) :is(button, a):focus-visible { outline: 2px solid rgba(123,77,255,.55) !important; outline-offset: 2px; }
html:root body :is(dialog.host-event-preview, dialog.post-location-consent, dialog.notification-sheet) :is(button, a):focus:not(:focus-visible) { outline: none !important; }
