:root {
  --bs-dark: #0f172a; /* slate-900 */
  --bs-dark-rgb: 15, 23, 42;
  --bs-secondary: #475569; /* slate-600 */
  --bs-secondary-bg: #334155; /* slate-700 */
  --bs-secondary-border-subtle: #475569; /* slate-600 */
  --bs-border-color: #334155; /* slate-700 */
  --bs-body-bg: #020617; /* slate-950 */
  --bs-tertiary-bg: #1e293b; /* slate-800 */

  /* Popover overwrites */
  --bs-popover-bg: #1e293b !important;
  --bs-popover-border-color: #334155 !important;
  --bs-popover-header-bg: #0f172a !important;
  --bs-popover-header-color: #f8fafc !important;
  --bs-popover-body-color: #e2e8f0 !important;
}

#renderer-form {
  display: none !important;
}

body,
html {
  margin: 0px;
  padding: 0px;
  background-color: var(--bs-body-bg);
  overflow: hidden;
}

.popover .popover-arrow::after {
  border-bottom-color: #1e293b !important;
  border-top-color: #1e293b !important;
}

.popover .popover-arrow::before {
  border-bottom-color: #334155 !important;
  border-top-color: #334155 !important;
}

.popover-header {
  border-bottom: 1px solid #334155 !important;
}

.pro-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  position: relative;
  top: -3px;
  margin-right: 1px;
  margin-left: 2px;
}

.navbar.mapNavbar {
  background-color: oklch(12.9% 0.042 264.695) !important;
  border-bottom: 1px solid #334155; /* slate-700 */
}

/* ── UI Facelift: soften aggressive outlines (Tailwind 4 palette) ──────── */

.navbar .btn-outline-light {
  --bs-btn-color: #cbd5e1; /* slate-300 */
  --bs-btn-border-color: #475569; /* slate-600 */
  --bs-btn-hover-color: #f1f5f9; /* slate-100 */
  --bs-btn-hover-bg: #33415540; /* slate-700 / 25% */
  --bs-btn-hover-border-color: #94a3b8; /* slate-400 */
  --bs-btn-active-color: #f8fafc; /* slate-50 */
  --bs-btn-active-bg: #47556940; /* slate-600 / 25% */
  --bs-btn-active-border-color: #94a3b8; /* slate-400 */
}

.navbar .btn-check:checked + .btn-outline-light {
  --bs-btn-active-color: #0f172a; /* slate-900 */
  --bs-btn-active-bg: #cbd5e1; /* slate-300 */
  --bs-btn-active-border-color: #cbd5e1; /* slate-300 */
  color: #0f172a;
  background-color: #cbd5e1;
  border-color: #cbd5e1;
}

/* Soften runfast (warning) button */
.navbar #goToMainWebsiteButton {
  --bs-btn-color: #94a3b8; /* slate-400 */
  --bs-btn-border-color: #475569; /* slate-600 */
  --bs-btn-hover-color: #fbbf24; /* amber-400 */
  --bs-btn-hover-border-color: #fbbf2466; /* amber-400 / 40% */
  --bs-btn-hover-bg: #fbbf2414; /* amber-400 / 8% */
}

/* ── Dropdown menus: match Tailwind 4 dark palette ──────────────────────── */

/* Custom badges to override ugly bootstrap colors in the map dropdown and the
   map selector button (icon-only badges). Palette shared so the button reflects
   the selected map's badge colors exactly. */
.dropdown-menu .badge.text-bg-primary,
.map-badge-icon-only.text-bg-primary {
  background-color: #451a03 !important; /* amber-950 */
  color: #fbbf24 !important; /* amber-400 */
  border: 1px solid #92400e !important; /* amber-800 */
}

.dropdown-menu .badge.text-bg-success,
.map-badge-icon-only.text-bg-success {
  background-color: #022c22 !important; /* emerald-950 */
  color: #34d399 !important; /* emerald-400 */
  border: 1px solid #065f46 !important; /* emerald-800 */
}

.dropdown-menu .badge.text-bg-info,
.map-badge-icon-only.text-bg-info {
  background-color: #083344 !important; /* cyan-950 */
  color: #22d3ee !important; /* cyan-400 */
  border: 1px solid #155e75 !important; /* cyan-800 */
}

.dropdown-menu .badge.text-bg-light,
.map-badge-icon-only.text-bg-light {
  background-color: #0f172a !important; /* slate-900 */
  color: #94a3b8 !important; /* slate-400 */
  border: 1px solid #1e293b !important; /* slate-800 */
}

/* Date badge generated dynamically in nav.ts uses border-info-subtle */
.dropdown-menu .badge.border-info-subtle,
.map-badge-icon-only.border-info-subtle {
  background-color: transparent !important;
  color: #64748b !important; /* slate-500 */
  border-color: #334155 !important; /* slate-700 */
  font-weight: normal;
}

/* Icon-only badges rendered inside the map selector button. Compact, no text,
   but still carry a hover popover with the full badge label. */
.map-badge-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  padding: 0;
  font-size: 0.85em;
  line-height: 1;
  border-radius: 0.3rem;
}

.map-badge-icon-only + .map-badge-icon-only {
  margin-left: 0.2rem;
}

#mapSelectorButton .map-badge-icon-only:first-of-type {
  margin-left: 0.25rem;
}

.dropdown-menu {
  --bs-dropdown-link-active-bg: var(--accent-bg);
  --bs-dropdown-link-active-color: var(--accent-color);
  background-color: oklch(15.6% 0.026 264.695); /* ~slate-900 */
  border: 1px solid #334155; /* slate-700 */
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
}

.dropdown-item,
.dropdown-menu .nav-link {
  color: #cbd5e1; /* slate-300 */
}

.dropdown-item:focus,
.dropdown-item:hover {
  background-color: #33415560; /* slate-700 / 37% */
  color: #f1f5f9; /* slate-100 */
}

/* Active state inside dropdowns (maps, language, etc.) */
.dropdown-menu .nav-link.active,
.dropdown-menu .nav-link.active:focus,
.dropdown-menu .nav-link.active:hover {
  background-color: var(--accent-bg);
  color: var(--accent-color);
}

.flex {
  display: flex;
}

.flex-col-reverse {
  flex-direction: column-reverse;
}

.full-viewport-wrapper {
  width: 100vw;
  height: 100vh;
  position: fixed;
}

#osContainer {
  height: 100%;
  width: 100%;
}

.menu img {
  float: left;
  width: 62px;
  height: 60px;
}

:root {
  /* ── Accent color: change these two values to retheme all active/selected states ── */
  --accent-color: #14b8a6; /* teal-500 */
  --accent-bg: #14b8a622; /* teal-500 / 13% */

  /* Override Bootstrap font stack so all components (popovers, tooltips, etc.) use Inter */
  --bs-body-font-family: Inter, sans-serif;
  --bs-font-sans-serif: Inter, sans-serif;
  font-family: Inter, sans-serif;
  font-feature-settings:
    "liga" 1,
    /* standard ligatures */ "calt" 1,
    /* contextual alternates */ "dlig" 1,
    /* discretionary ligatures */ "case" 1,
    /* case-sensitive forms */ "ss01" 1,
    /* open digits */ "ss02" 1,
    /* ambiguous characters */ "ss03" 1,
    /* lowercase r curves */ "ss04" 1,
    /* disambiguation */ "cv01" 1,
    /* alt 1 */ "cv02" 1,
    /* alt 2 */ "cv03" 1,
    /* alt 3 */ "cv04" 1,
    /* alt 4 */ "cv09" 1,
    /* flat-top 6/9 */ "cv10" 1,
    /* alt G */ "zero" 1,
    /* slashed zero */ "tnum" 1; /* tabular numerals */
}

@supports (font-variation-settings: normal) {
  :root {
    --bs-body-font-family: InterVariable, sans-serif;
    --bs-font-sans-serif: InterVariable, sans-serif;
    font-family: InterVariable, sans-serif;
  }
}

.coordinate {
  position: absolute;
  pointer-events: none;
  color: white;
  font-family: Inter, sans-serif;
  font-feature-settings: "tnum", "zero", "cv09", "cv02", "cv03", "cv04";
  font-weight: 400;
}

.coordinate-content {
  position: relative;
  top: 2em;
}

.loadingIndicator {
  margin-bottom: 1vw;
  margin-left: 1vw;
  position: fixed;
  bottom: 0;
}

.spinningIcon::before {
  animation-name: spin;
  animation-duration: 3s;
  animation-iteration-count: infinite;
  animation-timing-function: linear(
    0 0%,
    0.22 2.1%,
    0.86 6.5%,
    1.11 8.6%,
    1.3 10.7%,
    1.35 11.8%,
    1.37 12.9%,
    1.37 13.7%,
    1.36 14.5%,
    1.32 16.2%,
    1.03 21.8%,
    0.94 24%,
    0.89 25.9%,
    0.88 26.85%,
    0.87 27.8%,
    0.87 29.25%,
    0.88 30.7%,
    0.91 32.4%,
    0.98 36.4%,
    1.01 38.3%,
    1.04 40.5%,
    1.05 42.7%,
    1.05 44.1%,
    1.04 45.7%,
    1 53.3%,
    0.99 55.4%,
    0.98 57.5%,
    0.99 60.7%,
    1 68.1%,
    1.01 72.2%,
    1 86.7%,
    1 100%
  );
  /*animation-timing-function: linear;*/
  /* use this if you don't like the above */
}

.loadingIndicator::after {
  content: "L\00A0 \00A0 \00A0 ADING";
  position: absolute;
  font-size: 0.875rem;
  left: -0.25rem;
  z-index: -100;
  color: transparent;
  text-shadow:
    -1px 0 white,
    0 1px white,
    1px 0 white,
    0 -1px white;
  opacity: 0.4;
}

@-ms-keyframes spin {
  from {
    -ms-transform: rotate(0deg);
  }

  to {
    -ms-transform: rotate(360deg);
  }
}

@-moz-keyframes spin {
  from {
    -moz-transform: rotate(0deg);
  }

  to {
    -moz-transform: rotate(360deg);
  }
}

@-webkit-keyframes spin {
  from {
    -webkit-transform: rotate(0deg);
  }

  to {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

body.toggle-hidden div.osOverlayHighlight {
  display: none !important;
}

.icon-button.btn {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
}

.icon-runfast {
  background-image: url(../assets/runfast-logo.svg);
  background-size: cover;
  display: inline-block;
  height: 10px;
  width: 50px;
  margin-top: 3%;
  vertical-align: center;
}

.pixelated-image {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* Ensure OSD renders pixel-art tiles without smoothing */
.openseadragon-canvas canvas,
.openseadragon-canvas img {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* Pointer cursor when hovering over a dynamic map POI marker */
.openseadragon-canvas.poi-hover {
  cursor: pointer !important;
}

.icon-structures {
  background-image: url(../assets/icons/overlay-toggles/icon-structures.svg);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-orbs {
  background-image: url(../assets/icons/overlay-toggles/icon-orbs.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-items {
  background-image: url(../assets/icons/overlay-toggles/icon-items.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-bosses {
  background-image: url(../assets/icons/overlay-toggles/icon-bosses.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-spatialAwareness {
  background-image: url(../assets/icons/overlay-toggles/icon-spatial-awareness.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

#searchResults {
  position: absolute;
  top: 100%;
  max-width: 100%;
  background: #000a;
  height: 0;
  border: 0px solid #fff;
  border-radius: 0.25em;
  overflow: hidden;
  list-style-type: none;
  padding: 0;
}

#searchInput,
.search-input {
  background-color: #0f172a; /* slate-900 */
  border: 1px solid #475569; /* slate-600 */
  color: #e2e8f0; /* slate-200 */
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

#searchInput:focus,
.search-input:focus {
  border-color: #94a3b8; /* slate-400 */
  box-shadow: 0 0 0 2px #4755691a; /* slate-600 / 10% */
  background-color: #1e293b; /* slate-800 */
}

#searchInput::placeholder,
.search-input::placeholder {
  font-style: italic;
  font-size: 14px;
}

#search-form:focus-visible + #searchResults:has(> .search-result),
#searchResults:active,
#searchResults:focus-within {
  height: auto;
  border-width: 1px;
}

.search-result {
  padding: 0.5em;
  border-bottom: 1px solid #fff8;
  overflow: hidden;
  text-wrap: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
}

.search-result:hover {
  background: #fff2;
}

.search-result:focus {
  background: #fff2;
}

#osContainer :focus-visible {
  outline: none;
}

#spellList {
  visibility: hidden;
  position: absolute;
  top: 100%;
  background: #000a;
  backdrop-filter: blur(0.25em);
  border: 1px solid #fff8;
  border-radius: 0.25em;
  overflow-y: auto;
  max-height: calc(100vh - 100%);
  padding: 0;
}

#spellSelector:focus + #spellList,
#spellList:focus-within,
#spellList:active {
  visibility: visible;
}

#spellList li {
  list-style-type: none;
  padding: 0.5em;
  border-bottom: 1px solid #fff8;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

#spellList li:hover {
  background: #fff2;
}

#spellList li img {
  width: 2em;
}

#spellList li div {
  display: flex;
  flex-direction: column;
}

#spellList li div span:first-child {
  font-weight: bolder;
}

#spellList li div span:not(:first-child) {
  font-size: 0.75em;
}

#spellChanceInfoButton {
  & + div {
    position: absolute;
    top: 100%;
    max-height: calc(100vh - 100%);
    overflow: auto;
    background: #000a;
    border: 1px solid #fff8;
    border-radius: 0.25em;
    padding: 0.5em;
    visibility: hidden;
    backdrop-filter: blur(0.25em);

    & > blockquote {
      font-size: 0.75em;
    }
  }

  &:focus + div {
    visibility: visible;
  }
}

.icon-label-hover .label-text {
  display: none;
}

.icon-label-hover:hover .label-text,
.icon-label-hover:focus .label-text,
.icon-label-hover:focus-visible .label-text {
  display: inline;
}

#unifiedSearchResultsOverlay {
  position: absolute;
  z-index: 9999;
  background: #181a20ee;
  border-radius: 0.25em;
  box-shadow: 0 2px 16px #000a;
  padding: 0;
  margin: 0;
  min-width: 300px;
  max-width: 400px;
  overflow: visible;
}

#unifiedSearchResults {
  list-style-type: none;
  margin: 0;
  padding: 0;
  max-height: 350px;
  overflow-y: auto;
}

.navbar .btn {
  flex-shrink: 0;
}

#map-selector .dropdown-toggle {
  min-width: 180px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#overlay-selector {
  border-radius: 4px;
}

#overlay-selector .btn {
  min-height: 31px; /* Match other btn-sm heights */
  padding: 0.25rem 0; /* Remove horizontal padding since we set fixed width */
  width: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -1px !important;
  border-left: 1px solid var(--bs-border-color) !important;
  border-right: 1px solid var(--bs-border-color) !important;
}

#overlay-selector .btn:first-of-type {
  margin-left: 0 !important;
}

/* Fix inconsistent gaps between menu elements */
.navbar .d-flex > * {
  margin: 0.25rem !important;
}

/* Make search form wider to prevent placeholder clipping */
#search-form {
  min-width: 280px;
}

/* Fix renderer info button to show popover */
#renderer-form .btn:first-child {
  cursor: pointer;
}

/* Make overlay button images grayscale when disabled */
#overlay-selector input:disabled + label i,
#overlay-selector input[disabled] + label i,
#overlay-selector .btn:disabled i,
#overlay-selector .btn[disabled] i,
#overlay-selector .btn.disabled i {
  filter: brightness(0.5) contrast(0.5) saturate(0) !important;
  opacity: 0.6 !important;
}

#unifiedSearchResults .search-result {
  padding: 0.5em;
  border-bottom: 1px solid #fff8;
  overflow: hidden;
  text-wrap: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
  background: none;
}

.btn-custom {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
}

#unifiedSearchResults .search-result:hover,
#unifiedSearchResults .search-result:focus {
  background: #fff2;
}

#spellModalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

#spellModalOverlay[style*="display: flex"] {
  display: flex !important;
}

#spellModalContent {
  background: #222933;
  padding: 2em;
  border-radius: 0.5em;
  min-width: 300px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  color: #fff;
  box-shadow: 0 2px 32px #000a;
}

#closeSpellModal {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  font-size: 1.5em;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s;
}

#closeSpellModal:hover {
  color: #ffc107;
}

#unifiedSearchResultsOverlay {
  min-width: 600px;
  max-width: 600px;
  width: 600px;
}

/* Ensure result rows can't push the panel wider than its fixed width:
   long children (wand sprite + spell row, item icon strips) must wrap. */
#unifiedSearchResults .search-result,
#unifiedSearchResults .search-result > * {
  min-width: 0;
  max-width: 100%;
}
#unifiedSearchResults .container-items-row {
  flex-wrap: wrap;
  max-width: 100%;
}

/* Multi-line search result styles */
.search-result-content,
.spell-search-content,
.overlay-search-content {
  line-height: 1.3;
}

.search-result-name,
.spell-main-line,
.overlay-main-line {
  font-weight: 500;
  color: #fff;
}

.search-result-english,
.spell-english-line,
.overlay-english-line {
  font-size: 0.85em;
  color: #888;
  font-style: italic;
  margin-top: 2px;
}

.search-result-aliases,
.spell-info-line,
.overlay-aliases-line {
  font-size: 0.85em;
  color: #666;
  margin-top: 2px;
}

.spell-info-line .spell-availability-line {
  margin-left: 1em;
}

/* Override text wrapping for multi-line search results */
#unifiedSearchResults .search-result {
  text-wrap: wrap;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.easter-egg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1050;
  overflow: hidden;
}

.easter-egg-item {
  position: absolute;
}

.icon-hiddenMessages {
  background-image: url(../assets/icons/overlay-toggles/icon-hidden-messages.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

/* ── Dynamic map toolbar ─────────────────────────────────────────────────── */

#dynamicDailySeedButton {
  color: #0d9488; /* teal-600 */
  border-color: #0d948873; /* teal-600 / 45% */
}

#dynamicDailySeedButton:hover,
#dynamicDailySeedButton:focus {
  background-color: #0d948833; /* teal-600 / 20% */
  border-color: #0d9488b3; /* teal-600 / 70% */
  color: #5eead4; /* teal-300 */
}

/* Seed input -- daily seed colored, custom seed white */
#dynamicSeedInput {
  width: auto !important;
  font-feature-settings:
    "tnum" 1,
    "zero" 1,
    "ss01" 1,
    "ss02" 1,
    "cv01" 1,
    "cv02" 1,
    "cv03" 1,
    "cv04" 1,
    "cv09" 1;
  letter-spacing: 0.5px;
}

#dynamicSeedInput.seed-daily {
  color: #14b8a6; /* teal-500 */
}

/* Generate button: match sidebar disabled styling */
#dynamicGenerateButton {
}

#dynamicGenerateButton:disabled {
  --bs-btn-disabled-border-color: #33415580; /* slate-700 / 50% */
  --bs-btn-disabled-color: #64748b; /* slate-500 */
  --bs-btn-disabled-opacity: 0.5;
}

/* ── Non-blocking loading strip ──────────────────────────────────────────── */

#map-loading-strip {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1; /* sits below Bootstrap dropdowns (1000) so menus open over it */
  pointer-events: none;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#map-loading-strip.visible {
  display: block;
  opacity: 1;
}

#map-loading-strip.fade-out {
  opacity: 0;
}

.loading-strip-inner {
  position: relative;
}

.loading-strip-bar-track {
  position: relative;
  height: 0.2rem;
  display: flex;
  background: rgba(148, 163, 184, 0.08); /* slate-400 @ 8% */
  overflow: hidden;
}

.loading-strip-bar {
  position: relative;
  height: 100%;
  max-width: 33.34%;
  background: linear-gradient(90deg, #0891b2 0%, #22d3ee 100%); /* cyan-600 → cyan-400 */
  box-shadow: 0 0 0.375rem rgba(34, 211, 238, 0.55);
  transition: width 0.25s ease;
  overflow: hidden;
}

/* The three phases share the same look — the strip reads as a single fill. */
.seg-download,
.seg-generation,
.seg-items {
  background: linear-gradient(90deg, #0891b2 0%, #22d3ee 100%);
}

/* Shimmer sweeping inside each filled bar segment — clipped to the fill width
   so no glow bleeds into the empty track. */
.loading-strip-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: loading-strip-shimmer 1.4s linear infinite;
  pointer-events: none;
}

/* Shimmer on the empty track (subtle) for the indeterminate-gap phase. */
.loading-strip-bar-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(34, 211, 238, 0.18) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: loading-strip-shimmer 2.2s linear infinite;
  pointer-events: none;
}

@keyframes loading-strip-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Legacy "indeterminate" class from JS — no-op now, shimmer is always on. */
.loading-strip-bar-track.indeterminate::after {
  /* handled by base rule */
}

/* Floating pill label. Anchored by its RIGHT edge to a fixed offset from
   center, so the percent (which sits at the pill's right edge) never shifts
   horizontally when the phase label changes width — the phase grows leftward
   into the pill instead. */
.loading-strip-label {
  position: absolute;
  top: 1rem;
  right: calc(50% - 8rem);
  display: inline-flex;
  align-items: baseline;
  gap: 0.625rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.72rem;
  line-height: 1.1;
  color: #cbd5e1; /* slate-300 */
  background: rgba(9, 13, 20, 0.82);
  border: 1px solid #22d3ee; /* cyan-400 — matches loading bar */
  border-radius: 999px;
  white-space: nowrap;
  backdrop-filter: blur(0.375rem);
  -webkit-backdrop-filter: blur(0.375rem);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.35);
}

.loading-strip-phase {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.loading-strip-pct {
  color: #22d3ee; /* cyan-400 */
  font-feature-settings:
    "tnum" 1,
    "zero" 1,
    "ss01" 1,
    "ss02" 1,
    "cv01" 1,
    "cv02" 1,
    "cv03" 1,
    "cv04" 1,
    "cv09" 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  min-width: 3ch;
  text-align: right;
}

/* ── Search indexing placeholder ─────────────────────────────────────────── */

.search-indexing-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #999;
  font-size: 0.85rem;
}

.search-indexing-notice .spinner-border {
  width: 14px;
  height: 14px;
  border-width: 2px;
  flex-shrink: 0;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-pulse {
  background: linear-gradient(90deg, #2a2d35 25%, #3a3d45 50%, #2a2d35 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
  border-radius: 3px;
}

/* Prevent auth/drawing buttons from covering navbar dropdown menus */
#auth-container,
#auth-button-wrapper,
#drawing-ui-wrapper {
  position: relative;
  z-index: auto;
}

/* Force every navbar dropdown menu above the right-edge sidebars (Seed
 * Report at z-index 990, Drawing at 990). Bootstrap's default
 * --bs-dropdown-zindex of 1000 should be enough but Popper-positioned menus
 * sometimes end up in a different stacking context — pin them explicitly. */
.navbar .dropdown-menu,
#auth-container .dropdown-menu,
#auth-button-wrapper .dropdown-menu {
  z-index: 1100 !important;
}

/* Bootstrap popovers default to z-index 1070, but the POI tooltip card
 * (`.marker-tooltip`) is fixed at z-index 10000 — so popovers triggered
 * from controls inside the POI card (lock toggle, share button hover,
 * etc.) get painted *behind* the card itself and become unreachable.
 * Pin popovers above the tooltip. */
.popover {
  z-index: 10100 !important;
}

/* Ensure navbar dropdowns paint above sibling buttons */
#map-selector {
  position: relative;
  z-index: 1050;
}

/* "Nothing found" empty-state message */
.search-no-results {
  padding: 16px;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Auth dropdown: ensure it renders above other navbar elements ────────── */
/* (intentionally left blank — #auth-button-wrapper is handled above with
   z-index: auto so it doesn't cover navbar dropdown menus.) */

/* ── Bootstrap switches inside dropdown items (perf mode menu) ───────────── */
/* Bootstrap's .form-check-input[type=checkbox] on a switch has margin-left:-2.5em
   by default, which bleeds left past the dropdown edge. Reset both margins and
   use flexbox so the thumb sits fully inside the menu. */
#perfModeDropdown .dropdown-item.form-check.form-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1rem;
}

#perfModeDropdown .dropdown-item.form-check.form-switch .form-check-input {
  margin-top: 0;
  margin-left: 0; /* cancel Bootstrap's -2.5em that causes left-side clipping */
  flex-shrink: 0;
  position: static;
}

/* Mobile: perf-mode menu would otherwise extend past the right edge of the
   viewport because it's left-aligned to a button that sits in the middle of
   the wrapped navbar. Anchor it to the .navbar (closest positioned ancestor)
   with safe horizontal insets so the full menu stays on-screen. */
@media (max-width: 575px) {
  #perfModeDropdown {
    position: static;
  }
  #perfModeDropdown .dropdown-menu {
    left: 0.5rem;
    right: 0.5rem;
    top: 100%;
    width: auto;
    max-width: calc(100vw - 1rem);
    margin-top: 0.25rem;
  }
}
