/* One component boundary for public pages and workspaces. Layout belongs to the host;
   controls and suggestions must not inherit admin/form button treatments. */
#topbarSearchForm { isolation: isolate; overflow: visible; }
#topbarSearchForm #topbarSearchInput {
  box-sizing: border-box; width: 100%; height: 40px; min-height: 40px;
  margin: 0; padding: 9px 48px 9px 46px; border: 1px solid #dbe0e8;
  border-radius: 999px; background: #fff; color: #1e293b !important;
  font-family: inherit !important; font-size: 14px !important; font-weight: 500 !important;
  line-height: 1.4 !important; letter-spacing: 0 !important;
  box-shadow: 0 1px 3px #18233b0a; outline: none; appearance: none;
}
#topbarSearchForm #topbarSearchInput::placeholder { color: #64748b; opacity: 1; font: inherit; }
#topbarSearchForm #topbarSearchInput:focus {
  border-color: var(--outlo-brand-accent, #4f46e5); background: #fff; outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--outlo-brand-accent, #4f46e5) 10%, transparent);
}
#topbarSearchForm #topbarSearchInput::-webkit-search-cancel-button,
#topbarSearchForm #topbarSearchInput::-webkit-search-decoration { appearance: none; }
#topbarSearchForm > .topbar-search-icon {
  top: calc(50% - 9px); left: 17px; width: 18px; height: 18px; stroke: #64748b;
  transform: none !important;
}
#topbarSearchForm :is(.topbar-search-clear,.mobile-search-close:not(.outlo-close)) {
  position: absolute !important; top: calc(50% - 14px) !important; right: 8px;
  display: inline-grid; place-items: center; width: 28px !important; height: 28px !important;
  min-width: 28px !important; min-height: 28px !important; padding: 0 !important; margin: 0;
  border: 0 !important; border-radius: 50%; background: #f1f3f7; color: #64748b;
  box-shadow: none !important; transform: none !important; cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
#topbarSearchForm .mobile-search-close { display: none; }
#topbarSearchForm :is(.topbar-search-clear,.mobile-search-close:not(.outlo-close)):hover { background: var(--outlo-brand-soft, #eef2ff); color: var(--outlo-brand-text-hover, #3730a3); }
#topbarSearchForm :is(.topbar-search-clear,.mobile-search-close:not(.outlo-close)):focus-visible { outline: 3px solid var(--outlo-brand-accent, #4f46e5); outline-offset: 2px; }
#topbarSearchForm :is(.topbar-search-clear,.mobile-search-close:not(.outlo-close)) svg {
  width: 14px !important; height: 14px !important; stroke: currentColor; stroke-width: 2; fill: none;
}
#topbarSearchForm [hidden] { display: none !important; }
#topbarSearchForm #globalSearchSuggestions {
  --search-surface-glow: rgb(111 89 226 / 11%);
  --search-surface-glow-height: 480px;
  --search-surface-muted: #58657b;
  box-sizing: border-box; width: 100%; min-width: 0; top: calc(100% + 9px); left: 0; right: auto;
  padding: 9px 8px 7px; max-height: calc(100dvh - 110px); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #c8cddc transparent;
  overscroll-behavior: contain; border: 1px solid #dfe2ec; border-radius: 19px;
  /* Match the map filter's opaque paper and quiet indigo glow. */
  background-color: #f2f4fb;
  background-image: radial-gradient(ellipse at 100% 0%, var(--search-surface-glow), transparent 70%);
  background-position: center top; background-size: 100% var(--search-surface-glow-height);
  background-repeat: no-repeat; background-attachment: local;
  box-shadow: 0 18px 42px #0f172a26, 0 3px 10px #0f172a0d;
  color: #172033; font-family: inherit; text-transform: none; letter-spacing: 0; text-align: left;
}
@supports selector(::-webkit-scrollbar) {
  #topbarSearchForm #globalSearchSuggestions { scrollbar-width: auto; scrollbar-color: auto; }
  #globalSearchSuggestions::-webkit-scrollbar { width: 6px; height: 6px; }
  #globalSearchSuggestions::-webkit-scrollbar-track { margin-block: 12px; background: transparent; }
  #globalSearchSuggestions::-webkit-scrollbar-thumb { min-height: 36px; border: 1px solid transparent; border-radius: 999px; background: #c8cddc; background-clip: padding-box; }
  #globalSearchSuggestions::-webkit-scrollbar-thumb:hover { background-color: #a6afc3; }
  #globalSearchSuggestions::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  #globalSearchSuggestions::-webkit-scrollbar-corner { background: transparent; }
}
#globalSearchSuggestions .global-search-option {
  box-sizing: border-box; display: grid; grid-template-columns: 44px minmax(0,1fr) 18px;
  align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 60px; height: auto;
  margin: 0; padding: 6px 9px; border: 0; border-radius: 13px; background: transparent;
  color: #172033; box-shadow: none; text-align: left; text-transform: none; letter-spacing: 0;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.4; transform: none !important;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}
#globalSearchSuggestions .global-search-option + .global-search-option { margin-top: 4px; }
#globalSearchSuggestions .global-search-option:is(:hover,.is-active,.is-previewing) { background: var(--outlo-brand-soft, #eef2ff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--outlo-brand-accent, #4f46e5) 7%, transparent); }
#globalSearchSuggestions .global-search-option.is-previewing { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--outlo-brand-accent, #4f46e5) 55%, transparent); }
#globalSearchSuggestions :is(.global-search-option,a):focus-visible { outline: 3px solid var(--outlo-brand-accent, #4f46e5); outline-offset: -2px; }
#globalSearchSuggestions .global-search-option--events {
  grid-template-columns: 112px minmax(0,1fr) 18px;
  /* Reserve the outline without changing row height or shifting late-loaded badges. */
  padding: 5px 8px; border: 1px solid transparent;
}
/* The shared primary badge determines one treatment for the entire result. */
#globalSearchSuggestions .global-search-option--events:has(.event-status-badge) {
  --search-card-accent: #6366f1;
  border-color: color-mix(in srgb, var(--search-card-accent) 45%, #dfe2ec);
  background-color: transparent;
  background-image: linear-gradient(90deg,
    color-mix(in srgb, var(--search-card-accent) 12%, transparent), transparent 76%);
}
#globalSearchSuggestions .global-search-option--events:has(.event-status-badge.is-outlo-tip) { --search-card-accent: #059669; }
#globalSearchSuggestions .global-search-option--events:has(.event-status-badge.is-paid-top) { --search-card-accent: #dfb43b; }
#globalSearchSuggestions .global-search-option--events:has(.event-status-badge):hover {
  border-color: color-mix(in srgb, var(--search-card-accent) 65%, #dfe2ec);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--outlo-brand-accent, #4f46e5) 18%, transparent);
}
#globalSearchSuggestions .global-search-option--events:has(.event-status-badge):is(.is-active,.is-previewing) {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--outlo-brand-accent, #4f46e5) 65%, transparent);
}
#globalSearchSuggestions .global-search-option-media { box-sizing: border-box; width: 44px; height: 44px; padding: 0; }
#globalSearchSuggestions .global-search-option-media.is-category {
  background: color-mix(in srgb, var(--search-category-color) 10%, #fff);
  border-color: color-mix(in srgb, var(--search-category-color) 20%, #dbe4ef);
  color: var(--search-category-color);
}
#globalSearchSuggestions .is-category .category-art { width: 24px; height: 24px; }
#globalSearchSuggestions .global-search-option--events .global-search-option-media { position: relative; width: 112px; height: 70px; aspect-ratio: 16 / 10; border: 0; border-radius: 10px; overflow: hidden; }
#globalSearchSuggestions .global-search-option-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
/* Match current-event thumbnails: constrain the image itself, not just its clipped wrapper. */
#globalSearchSuggestions .global-search-option-media.is-event img {
  position: absolute; inset: 0; width: 100%; height: 100% !important;
  min-width: 0; min-height: 0; aspect-ratio: auto; object-fit: cover; object-position: center;
  background-color: #f1f3f7;
}
#globalSearchSuggestions .global-search-option-media.is-event-fallback { --event-thumbnail-icon-size: 48px; }
#globalSearchSuggestions .global-search-option--localities .global-search-option-media svg { width: var(--outlo-icon-lg, 20px); height: var(--outlo-icon-lg, 20px); }
#globalSearchSuggestions .global-search-section-icon { width: 14px; height: 14px; }
#globalSearchSuggestions .global-search-section-icon svg { width: var(--outlo-icon-xs, 14px); height: var(--outlo-icon-xs, 14px); }
#globalSearchSuggestions .global-search-all-copy svg { flex: 0 0 var(--outlo-icon-sm, 16px); width: var(--outlo-icon-sm, 16px); height: var(--outlo-icon-sm, 16px); }
#globalSearchSuggestions .global-search-option-arrow { width: var(--outlo-icon-sm, 16px); height: var(--outlo-icon-sm, 16px); }
#globalSearchSuggestions .global-search-option-copy { display: grid; min-width: 0; gap: 5px; }
#globalSearchSuggestions .global-search-option-copy strong { display: flex; align-items: center; gap: 4px; min-width: 0; color: #172033; font-size: 14px; font-weight: 600; line-height: 1.35; }
#globalSearchSuggestions .global-search-option-title-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; color: inherit; }
#globalSearchSuggestions .global-search-option--events .global-search-option-title-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; overflow-wrap: anywhere; }
#globalSearchSuggestions .global-search-option--events .global-search-option-title-text { flex: 1 1 auto; }
/* Status belongs with the metadata, leaving the full text column for the title. */
#globalSearchSuggestions .global-search-option-status { display: inline-flex; flex: 0 0 auto; max-width: 100%; }
#globalSearchSuggestions .global-search-option-status:empty { display: none; }
#globalSearchSuggestions .global-search-option-status .event-status-badge {
  --badge-surface: #eef0ff; --badge-ink: #4f46e5; --badge-border: #6366f1;
  box-sizing: border-box; position: static; display: inline-flex; align-items: center; gap: 3px;
  max-width: 100%; min-height: 20px; margin: 0; padding: 2px 6px;
  border: 1px solid var(--badge-border); border-radius: 999px;
  background: var(--badge-surface); color: var(--badge-ink) !important;
  font-size: 9.5px !important; font-weight: 650; line-height: 13px;
  letter-spacing: 0; white-space: nowrap; box-shadow: none;
}
#globalSearchSuggestions .global-search-option-status .event-status-badge.is-outlo-tip {
  --badge-surface: #e7f8ef; --badge-ink: #065f46; --badge-border: #059669;
}
#globalSearchSuggestions .global-search-option-status .event-status-badge.is-paid-top {
  --badge-surface: #0f172a; --badge-ink: #fff; --badge-border: #facc15; --search-badge-symbol: #facc15;
}
#globalSearchSuggestions .global-search-option-status .event-status-badge.is-top-event {
  --badge-surface: #0b0b0d; --badge-ink: #fff; --badge-border: #6366f1;
}
#globalSearchSuggestions .global-search-option-status .event-status-badge > span {
  color: var(--search-badge-symbol, var(--badge-ink)) !important; font-size: 10px; line-height: 1;
}
#globalSearchSuggestions .global-search-match { display: inline; padding: 0; margin: 0; color: var(--outlo-brand-text, #4338ca); font: inherit; }
#globalSearchSuggestions .global-search-option-copy > span { display: block; min-width: 0; color: var(--search-surface-muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
#globalSearchSuggestions .global-search-option-copy > .global-search-option-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  overflow: visible; white-space: normal;
}
#globalSearchSuggestions .global-search-option-meta .global-search-option-subtitle {
  flex: 1 1 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#globalSearchSuggestions :is(.global-search-section-count,.global-search-all) {
  background: transparent; color: var(--outlo-brand-text, #4338ca); font-weight: 500;
  text-decoration: none; box-shadow: none; transform: none;
}
#globalSearchSuggestions :is(.global-search-section-count,.global-search-all):is(:hover,:focus-visible) {
  background: transparent; color: var(--outlo-brand-text-hover, #3730a3); box-shadow: none;
  text-decoration: underline; text-underline-offset: 3px;
}
#globalSearchSuggestions .global-search-section + .global-search-section { margin-top: 10px; }
#globalSearchSuggestions .global-search-section-heading { margin: 0 9px 4px; gap: 8px; min-height: 32px; }
#globalSearchSuggestions .global-search-section-label { margin: 0; color: var(--search-surface-muted); font-size: 12px; font-weight: 600; line-height: 1.3; text-transform: none; letter-spacing: 0; }
#globalSearchSuggestions .global-search-state { color: var(--search-surface-muted); }
#globalSearchSuggestions .global-search-section-count { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; margin: 0 -5px 0 0; padding: 0 5px; border-radius: 6px; font-size: 12px; line-height: 1.3; white-space: nowrap; }
#globalSearchSuggestions .global-search-all { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin: 8px -8px -7px; padding: 0 17px; border-top-color: #dfe2ec; font-size: 13px; }

/* Public search shares the remaining grid space, reserving a gap to both sides. */
@media (min-width: 901px) {
  body:not(.map-page) .topbar.app-topbar > #topbarSearchForm {
    position: relative !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    justify-self: center !important;
    align-self: center !important;
    width: min(420px, 100%) !important;
    min-width: 0;
  }
}
@media (min-width: 901px) and (max-width: 1120px) {
  .map-page .topbar.app-topbar > #topbarSearchForm {
    position: relative !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    justify-self: center !important;
    align-self: center !important;
    width: min(420px, 100%) !important;
    min-width: 0;
  }
}

/* Keep the desktop panel restrained; follow the input without shrinking its content. */
@media (min-width: 901px) {
  .app-topbar #topbarSearchForm #globalSearchSuggestions,
  .global-search-host #topbarSearchForm #globalSearchSuggestions {
    width: 100%; min-width: 0;
    max-width: calc(100vw - 32px);
    left: 0; transform: none; margin-left: var(--search-panel-shift, 0px);
  }
  #globalSearchSuggestions .global-search-option--events {
    grid-template-columns: 104px minmax(0,1fr) 16px; gap: 8px; padding-inline: 6px;
  }
  #globalSearchSuggestions .global-search-option--events .global-search-option-media {
    width: 104px; height: 65px;
  }
}
@media (max-width: 1200px) {
  .global-search-host #topbarSearchForm.is-mobile-open #globalSearchSuggestions {
    width: 100%; min-width: 0; left: 0; transform: none; margin-left: 0;
  }
}
/* Give map results room without widening dropdowns beyond their header host. */
@media (min-width: 1121px) {
  .map-page .topbar.app-topbar .topbar-search { width: min(460px,100%) !important; }
}
@media (max-width: 900px) {
  #topbarSearchForm #topbarSearchInput,
  #topbarSearchForm #topbarSearchInput::placeholder { font-weight: 400 !important; }
  #topbarSearchForm #topbarSearchInput::placeholder { font-size: 13px !important; }
  #topbarSearchForm.is-mobile-open #globalSearchSuggestions {
    width: 100%; min-width: 0; left: 0; transform: none; margin-left: 0;
  }
  #topbarSearchForm.is-mobile-open { grid-column: auto !important; grid-row: auto !important; justify-self: auto !important; left: 12px !important; right: 12px !important; width: auto !important; }
  #topbarSearchForm.is-mobile-open #topbarSearchInput,
  .rs-search-host #topbarSearchForm #topbarSearchInput { height: 46px !important; min-height: 46px !important; padding: 9px 52px 9px 42px !important; border-radius: 15px !important; }
  #topbarSearchForm.is-mobile-open > .topbar-search-icon,
  .rs-search-host #topbarSearchForm > .topbar-search-icon { left: 14px; }
  #topbarSearchForm.is-mobile-open :is(.topbar-search-clear,.mobile-search-close),
  .rs-search-host #topbarSearchForm .topbar-search-clear { top: calc(50% - 22px) !important; width: 44px !important; height: 44px !important; background: transparent; }
  #topbarSearchForm.is-mobile-open .topbar-search-clear { display: none !important; }
  #topbarSearchForm.is-mobile-open .mobile-search-close { display: inline-grid !important; right: 2px; }
  #topbarSearchForm.is-mobile-open #globalSearchSuggestions,
  .rs-search-host #topbarSearchForm #globalSearchSuggestions { top: calc(100% + 7px); max-height: calc(100dvh - var(--topbar-height) - 82px); border-radius: 14px; }
  #globalSearchSuggestions .global-search-section-count { min-height: 40px; }
  #globalSearchSuggestions .global-search-all { min-height: 44px; }
}
@media (max-width: 1120px) {
  #topbarSearchForm #globalSearchSuggestions {
    --search-surface-glow: rgb(111 89 226 / 9%);
    --search-surface-glow-height: 440px;
  }
}
@media (max-width: 380px) {
  #globalSearchSuggestions .global-search-option { gap: 8px; padding-inline: 7px; }
  #globalSearchSuggestions .global-search-option--events { grid-template-columns: 96px minmax(0,1fr) 14px; padding-inline: 6px; }
  #globalSearchSuggestions .global-search-option--events .global-search-option-media { width: 96px; height: 60px; }
  #globalSearchSuggestions .global-search-option--events .global-search-option-arrow { width: 14px; }
  #globalSearchSuggestions .global-search-option-media.is-event-fallback { --event-thumbnail-icon-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  #topbarSearchForm *, #globalSearchSuggestions * { transition: none !important; }
}
@media (forced-colors: active) {
  #topbarSearchForm #globalSearchSuggestions { background: Canvas; }
  #globalSearchSuggestions .global-search-option--events:has(.event-status-badge) {
    background: Canvas !important; border-color: CanvasText !important;
  }
  #globalSearchSuggestions .global-search-option--events:has(.event-status-badge):is(:hover,.is-active,.is-previewing):not(:focus-visible) {
    outline: 2px solid Highlight; outline-offset: -2px;
  }
  #globalSearchSuggestions .global-search-option-status .event-status-badge {
    --badge-ink: CanvasText; --search-badge-symbol: CanvasText;
    background: Canvas; color: CanvasText !important; border-color: CanvasText;
  }
}
