.marker-details {
  position: absolute;
  z-index: 900;
  top: 70px;
  right: 16px;
  width: min(320px, calc(100% - 32px));
  padding: 20px;
  color: var(--text);
  background: rgb(6 27 39 / 94%);
  border: 1px solid #2d7088;
  border-top: 2px solid var(--cyan);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgb(0 0 0 / 45%);
  backdrop-filter: blur(16px);
}

.marker-details[hidden] { display: none; }
.drawer-close.modal-control-close { display: none; }
.details-eyebrow { color: var(--cyan); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.marker-details h2 { margin: 8px 32px 16px 0; font-size: 23px; line-height: 1.12; }
.details-pal {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: -4px 0 16px;
  padding: 10px;
  background:
    linear-gradient(120deg, rgb(19 160 186 / 16%), transparent 55%),
    rgb(3 16 24 / 72%);
  border: 1px solid rgb(83 168 184 / 48%);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.details-pal[hidden] { display: none; }
.details-pal img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgb(0 0 0 / 72%));
}
.details-pal strong {
  display: inline-flex;
  width: fit-content;
  padding: 3px 7px;
  color: #fff1ca;
  font-size: 12px;
  letter-spacing: .035em;
  background: rgb(126 64 20 / 72%);
  border-left: 2px solid #ffb33f;
}
.details-pal p {
  margin: 7px 0 0;
  color: #b8d0d6;
  font-size: 11px;
  line-height: 1.38;
}
.marker-details dl { display: grid; gap: 10px; margin: 0; }
.marker-details dl div { display: flex; justify-content: space-between; gap: 14px; padding-top: 9px; border-top: 1px solid var(--line); }
.marker-details dt { color: var(--muted); }
.marker-details dd { margin: 0; color: #c9eef5; text-align: right; }
.marker-details #details-coordinates,
.marker-details #details-world { font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }

.map-error {
  position: absolute;
  z-index: 1000;
  inset: 50% auto auto 50%;
  display: grid;
  gap: 5px;
  width: min(400px, calc(100% - 40px));
  padding: 20px;
  color: #ffeec5;
  text-align: center;
  background: #3a2812;
  border: 1px solid var(--amber);
  border-radius: 10px;
  transform: translate(-50%, -50%);
}
.map-error[hidden] { display: none; }

.layers-fab,
.layers-backdrop { display: none; }
.layers-fab-group { display: none; }

@media (min-width: 761px) {
  .map-app { transition: grid-template-columns 240ms ease; }
  .layers-panel { transition: transform 240ms ease; }
  body.layers-collapsed .map-app { grid-template-columns: 0 minmax(0, 1fr); }
  body.layers-collapsed .layers-panel { transform: translateX(-105%); width: var(--map-sidebar-width); }
}

@media (max-width: 760px) {
  .map-app { display: block; }
  .map-stage {
    height: auto;
    min-height: min(680px, calc(100dvh - var(--app-chrome-header-height, 66px)));
  }
  .layers-panel {
    position: fixed;
    z-index: 1300;
    inset: 0 auto 0 var(--map-sidebar-gap);
    width: var(--map-sidebar-width);
    height: 100dvh;
    max-height: none;
    padding-top: var(--map-sidebar-content-top);
    transform: translateX(-102%);
    transition: transform 190ms ease;
  }
  body.app-map-page.layers-open > .layers-panel {
    width: 100vw;
    padding-top: calc(var(--map-sidebar-content-top) + var(--app-chrome-header-height, 54px) + 8px);
  }
  body.layers-open .layers-panel { transform: translateX(0); }
  body.app-map-page.layers-open > .app-header { pointer-events: none; }
  .drawer-close.modal-control-close { display: inline-grid; place-items: center; }
  .drawer-close.modal-control-close--inline {
    position: absolute;
    top: clamp(1rem, 2vw, 1.8rem);
    right: clamp(1rem, 2vw, 1.8rem);
  }
  .layers-fab-group {
    position: fixed;
    z-index: 1700;
    top: 14px;
    right: calc(8px + 46px + 6px);
    display: flex;
    gap: 6px;
  }
  .layers-fab {
    position: static;
    display: inline-flex;
    width: 2.9rem;
    min-width: 2.9rem;
    min-height: 2.9rem;
    height: 2.9rem;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: .55rem;
    font-size: 0;
    color: #c6fbff;
    font-weight: 750;
    background: linear-gradient(145deg, rgba(8, 31, 38, .96), rgba(4, 16, 22, .98));
    border: 1px solid rgba(144, 190, 195, .3);
    border-radius: 0;
    box-shadow: 0 8px 18px rgba(0, 4, 8, .28), inset 0 1px rgba(224, 253, 255, .05);
    backdrop-filter: blur(10px);
  }
  body.app-chrome-page.app-map-page .layers-fab.app-interactive-corners { position: relative; }
  .layers-fab > svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
  .layers-toggle-icon {
    opacity: .92;
  }
  .layers-toggle-icon--close { display: none !important; }
  body.app-map-page .layers-fab.app-interactive-corners:focus-visible { outline-color: #ff626b !important; }
  #layers-toggle[aria-expanded="true"] {
    color: #ff626b;
    border-color: rgb(255 98 107 / 78%);
    box-shadow: 0 8px 18px rgb(0 4 8 / 28%), inset 0 1px rgb(255 154 159 / 12%);
  }
  #layers-toggle[aria-expanded="true"] .layers-toggle-icon--layers { display: none; }
  #layers-toggle[aria-expanded="true"] .layers-toggle-icon--close {
    display: block !important;
    opacity: 1;
  }
  .layers-backdrop {
    position: fixed;
    z-index: 1250;
    inset: 0;
    display: block;
    background: rgb(0 8 13 / 68%);
    opacity: 0;
    transition: opacity 190ms ease;
    pointer-events: none;
  }
  body.layers-open .layers-backdrop { opacity: 1; pointer-events: auto; }
  body.app-map-page .map-app > .coordinate-hud,
  body.app-map-page > .coordinate-hud {
    z-index: 1600;
    top: 14px;
    right: auto;
    bottom: auto;
    left: 50%;
    height: 2.9rem;
    display: flex;
    align-items: center;
    transform: translateX(-50%);
  }
  .map-control-legend { display: none; }
  body.app-map-page > .source-notice { display: none; }
  body.app-map-page.layers-open > .source-notice { display: block; }
  body.app-map-page {
    --map-source-notice-reserve: calc(44px + 1rem + env(safe-area-inset-bottom));
  }
  body.app-map-page > .source-notice {
    bottom: calc(44px + 1rem + env(safe-area-inset-bottom));
  }
  body.app-map-page .drawer-close.modal-control-close--inline { display: none; }
  .map-status { display: none; }
  .map-buttons button { min-width: 42px; min-height: 44px; padding-inline: 10px; }
  .map-buttons button#zoom-out,
  .map-buttons button#zoom-in {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    width: 1.1rem;
    min-height: 1.1rem;
    height: 1.1rem;
    padding: 0;
    font-size: .78rem;
    line-height: 1;
  }
  body.app-map-page #reset-view {
    min-width: 7rem;
    min-height: 44px;
    padding: 12px .85rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .marker-details { top: auto; right: 10px; bottom: 14px; width: calc(100% - 20px); }
}

@media (max-width: 410px) {
  body.app-map-page { --map-sidebar-content-inline: 10px; }
  .sidebar-header { padding-inline: 10px; }
  .map-brand { font-size: 20px; }
  .filter-option {
    min-height: 62px;
    padding: 7px 42px 7px 8px;
    font-size: 11.5px;
  }
  .filter-option > span:not(.count-pill) { font-size: 11.5px; }
  .filter-option img { right: 2px; width: 40px; height: 40px; }
  .count-pill { font-size: 7.5px; letter-spacing: .035em; }
  .count-pill::after { font-size: 6.5px; }
  .filter-content { gap: 5px; padding: 5px 0 1px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
