.atlas-page {
  --atlas-panel: #16171d;
  --atlas-line: #30333d;
  --atlas-water: #092529;
  padding-block: 30px 45px;
}

.atlas-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}
.atlas-heading h1 { font: 900 clamp(3.25rem, 7vw, 5.8rem)/.84 var(--display); letter-spacing: -.025em; }
.atlas-heading em { color: var(--lime); font-style: normal; }
.atlas-heading p { margin-top: 10px; color: var(--muted); }
.atlas-map-source { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.atlas-map-source svg { color: var(--lime); }

.atlas-workspace {
  display: grid;
  grid-template-columns: minmax(255px, 312px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.atlas-panel, .atlas-map {
  min-width: 0;
  height: clamp(560px, calc(100svh - 235px), 780px);
  border: 1px solid var(--atlas-line);
  border-radius: 13px;
  background: var(--atlas-panel);
  overflow: hidden;
}
.atlas-panel { display: flex; flex-direction: column; }
.atlas-panel-head { padding: 15px; }
.atlas-panel-title, .atlas-layer-head, .atlas-progress > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.atlas-panel-title h2 { font: 800 2rem/.9 var(--display); letter-spacing: .01em; }
.atlas-panel-title > span { color: var(--muted); font-size: .8rem; }
.atlas-search {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 0 10px;
  border: 1px solid var(--atlas-line);
  border-radius: 7px;
  background: #0e1015;
  color: var(--muted);
}
.atlas-search:focus-within { border-color: var(--lime); }
.atlas-search svg { flex: none; width: 17px; }
.atlas-search input { width: 100%; min-width: 0; outline: 0; border: 0; padding: 9px 0; background: transparent; color: var(--ink); font-size: .875rem; }
.atlas-layer-section { margin-top: 8px; }
.atlas-layer-head h3 { font-size: .84rem; }
.atlas-layer-head button {
  min-height: 35px;
  padding: 4px 0 4px 12px;
  border: 0;
  background: transparent;
  color: var(--lime);
  font-size: .8rem;
  font-weight: 750;
}
.atlas-layers { display: flex; flex-wrap: wrap; gap: 5px; }
.atlas-layers button, .atlas-presets button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--atlas-line);
  border-radius: 6px;
  background: #15171c;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
}
.atlas-layers button svg { flex: none; width: 15px; height: 15px; color: var(--layer); }
.atlas-layers button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--layer) 9%, var(--atlas-panel));
  border-color: color-mix(in srgb, var(--layer) 33%, var(--atlas-line));
  color: var(--ink);
}
.atlas-layers button[aria-pressed="false"] svg { opacity: .45; }
.atlas-layers button:hover, .atlas-presets button:hover { border-color: var(--lime); }
.atlas-progress-filter { display: block; margin-top: 10px; }
.atlas-progress-filter select {
  width: 100%;
  min-height: 39px;
  padding: 6px 34px 6px 9px;
  appearance: none;
  border: 1px solid var(--atlas-line);
  border-radius: 6px;
  color: var(--ink);
  background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 15px center / 5px 5px, linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 10px center / 5px 5px, #111319;
  background-repeat: no-repeat;
  font-size: .83rem;
}
.atlas-results-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  border-block: 1px solid var(--atlas-line);
  background: #111319;
}
.atlas-results-count { flex: none; padding: 7px 15px; color: var(--muted); font-size: .78rem; }
.atlas-results { overflow: auto; overscroll-behavior: contain; padding: 0 8px 8px; scrollbar-color: #4a4b55 transparent; }
.atlas-results li + li { margin-top: 2px; }
.atlas-result {
  display: grid;
  width: 100%;
  min-height: 47px;
  grid-template-columns: 25px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  text-align: left;
}
.atlas-result:hover, .atlas-result[aria-current="location"] { border-color: var(--atlas-line); background: #1c2027; }
.atlas-result[aria-current="location"] { border-color: #899f48; }
.atlas-result-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; background: color-mix(in srgb, var(--layer) 15%, #181d22); color: var(--layer); }
.atlas-result-icon svg { width: 15px; height: 15px; }
.atlas-result strong, .atlas-result small { display: block; }
.atlas-result strong { font-size: .86rem; line-height: 1.2; }
.atlas-result small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.atlas-result[data-visited]::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.atlas-empty { padding: 9px 7px 14px; color: var(--muted); font-size: .9rem; }
.atlas-progress { padding: 10px 14px 12px; color: var(--muted); font-size: .78rem; }
.atlas-progress strong { color: var(--ink); }
.atlas-progress progress { display: block; width: 100%; height: 5px; margin-top: 7px; appearance: none; overflow: hidden; border: 0; border-radius: 9px; background: #31333d; accent-color: var(--lime); }
.atlas-progress progress::-webkit-progress-bar { background: #31333d; }
.atlas-progress progress::-webkit-progress-value { background: var(--lime); }
.atlas-progress progress::-moz-progress-bar { background: var(--lime); }

.atlas-map { display: flex; flex-direction: column; position: relative; isolation: isolate; }
.atlas-toolbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 6px 9px; border-bottom: 1px solid var(--atlas-line); }
.atlas-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.atlas-presets button { padding-inline: 11px; min-height: 36px; }
.atlas-presets button[aria-pressed="true"] { border-color: #82954a; background: #222b1b; color: var(--lime); }
.atlas-tools { display: flex; gap: 4px; }
#atlas-jump-search { display: none; }
#atlas-fullscreen { position: relative; flex: none; min-width: 40px; min-height: 40px; padding: 7px; }
.atlas-view { position: relative; flex: 1; min-height: 0; }
.atlas-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background:
    linear-gradient(#91f7e20b 1px, transparent 1px) center / 35px 35px,
    linear-gradient(90deg, #91f7e20b 1px, transparent 1px) center / 35px 35px,
    radial-gradient(ellipse at center, #163c3b, var(--atlas-water) 73%);
}
.atlas-stage.is-panning { cursor: grabbing; }
.atlas-stage:focus-visible { outline-offset: -3px; }
.atlas-sheet { position: absolute; inset: 0; transform-origin: 0 0; pointer-events: none; }
.atlas-sheet img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  clip-path: inset(2.4% 3.2% 2.4% 3.2%);
  user-select: none;
}
.atlas-markers { position: absolute; inset: 0; pointer-events: none; }
.atlas-marker, .atlas-cluster {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 0;
  pointer-events: auto;
}
.atlas-marker i, .atlas-cluster i {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid var(--layer);
  border-radius: 50%;
  background: #142326;
  color: var(--layer);
  box-shadow: 0 2px 7px #030e12b3;
  font-style: normal;
}
.atlas-marker svg { width: 13px; height: 13px; }
.atlas-marker[data-visited] i, .atlas-marker[aria-current="location"] i { color: #12191b; background: var(--layer); }
.atlas-marker[aria-current="location"] { z-index: 2; }
.atlas-marker[aria-current="location"] i { outline: 2px solid #102021; outline-offset: 2px; box-shadow: 0 0 0 5px #f9fff848; }
.atlas-marker:hover, .atlas-marker:focus-visible { z-index: 3; }
.atlas-marker:hover i, .atlas-marker:focus-visible i { width: 26px; height: 26px; }
.atlas-marker::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% - 4px);
  width: max-content;
  max-width: 190px;
  padding: 4px 7px;
  border-radius: 4px;
  background: #10181de8;
  color: white;
  font-size: .75rem;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
}
.atlas-marker:hover::after, .atlas-marker:focus-visible::after { opacity: 1; }
.atlas-cluster i { width: 28px; height: 28px; border-color: #d3f1ee; color: #e8fffc; font: 750 .78rem/1 var(--body); }
.atlas-cluster:hover i, .atlas-cluster:focus-visible i { border-color: var(--lime); color: var(--lime); }
.atlas-zoom {
  position: absolute;
  top: 11px;
  right: 11px;
  display: grid;
  overflow: hidden;
  border: 1px solid #d0f8f059;
  border-radius: 8px;
  background: #102024ed;
  box-shadow: 0 4px 13px #09151452;
}
.atlas-zoom button { display: grid; place-items: center; width: 43px; height: 43px; border: 0; background: transparent; color: #edf8f8; }
.atlas-zoom button + button { border-top: 1px solid #d0f8f033; }
.atlas-zoom button:hover:not(:disabled) { color: var(--lime); background: #253632; }
.atlas-zoom button:focus-visible { outline-offset: -3px; }
.atlas-zoom button:disabled { color: #a9b4b5; cursor: default; opacity: .55; }
.atlas-scale, .atlas-attribution { position: absolute; bottom: 9px; padding: 3px 7px; border-radius: 4px; background: #142326eb; color: #e5eced; font-size: .72rem; pointer-events: none; }
.atlas-scale { left: 9px; font-variant-numeric: tabular-nums; }
.atlas-attribution { right: 9px; }
.atlas-minimap { position: absolute; bottom: 35px; right: 11px; width: 89px; aspect-ratio: 2924 / 4000; overflow: hidden; padding: 0; border: 1px solid #d0f8f095; border-radius: 6px; background: #102024ed; box-shadow: 0 3px 10px #0b1b1baa; }
.atlas-minimap img { width: 100%; height: 100%; object-fit: contain; opacity: .75; }
.atlas-minimap:hover img { opacity: 1; }
#atlas-minimap-area { position: absolute; border: 2px solid var(--lime); background: #d0ff4a28; box-shadow: 0 0 0 1px #13252a; pointer-events: none; }

.atlas-detail {
  position: absolute;
  inset: auto 10px 32px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  max-width: 640px;
  margin-inline: auto;
  padding: 11px 12px 12px;
  border: 1px solid #55726c;
  border-left: 3px solid var(--layer);
  border-radius: 9px;
  background: #11181cf5;
  box-shadow: 0 8px 25px #06101065;
}
.atlas-detail h2 { margin-block: 1px 3px; font: 800 1.8rem/.92 var(--display); }
#atlas-detail-meta { color: var(--layer); font-size: .75rem; font-weight: 750; }
#atlas-detail-description { color: #ccd8d8; font-size: .85rem; }
.atlas-detail-actions { display: flex; align-items: center; gap: 5px; }
.atlas-detail-actions .btn { padding-inline: 10px; min-height: 44px; gap: 5px; font-size: .8rem; }
.atlas-detail-actions .btn[aria-pressed="true"] { border-color: #9bbd52; background: #263222; color: var(--lime); }
.atlas-detail-actions .icon-button { background: #172025; }
#atlas-share-status:not(.sr-only) { grid-column: 1 / -1; color: var(--lime); font-size: .8rem; }
.atlas-notes { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 15px; margin-top: 9px; }
.atlas-notes p { color: var(--muted); font-size: .84rem; }
.atlas-notes > div { display: flex; flex-wrap: wrap; gap: 0 16px; }
.atlas-map:fullscreen, .atlas-map.is-expanded { width: 100%; height: 100%; border: 0; border-radius: 0; background: var(--atlas-panel); }
.atlas-map.is-expanded { position: fixed; inset: 0; z-index: 6; }
.atlas-map:fullscreen #atlas-jump-search, .atlas-map.is-expanded #atlas-jump-search { display: none; }
body:has(.atlas-map.is-expanded) { overflow: hidden; }

@media (max-width: 850px) {
  .atlas-workspace { grid-template-columns: minmax(215px, 255px) minmax(0, 1fr); gap: 8px; }
  .atlas-panel-head { padding: 11px; }
  .atlas-detail { grid-template-columns: 1fr; }
}

@media (max-width: 690px) {
  .atlas-page { padding-block: 20px 28px; }
  .atlas-heading { margin-bottom: 13px; }
  .atlas-heading p { margin-top: 7px; font-size: .92rem; }
  .atlas-map-source { display: none; }
  .atlas-workspace { display: flex; flex-direction: column; }
  .atlas-map, .atlas-panel { width: 100%; }
  .atlas-map { order: -1; height: clamp(405px, 64svh, 600px); }
  .atlas-panel { height: min(495px, 76svh); min-height: 375px; }
  .atlas-layers button, .atlas-presets button { min-height: 41px; }
  .atlas-presets { flex-wrap: nowrap; gap: 3px; }
  .atlas-presets button { padding-inline: 7px; }
  #atlas-jump-search { display: inline-flex; min-width: 40px; min-height: 40px; padding: 7px; }
  .atlas-minimap { display: none; }
  .atlas-detail { inset: auto 8px 30px; padding: 9px; }
  .atlas-detail h2 { font-size: 1.62rem; }
  #atlas-detail-description { font-size: .82rem; }
  .atlas-zoom { top: 8px; right: 7px; }
  .atlas-zoom button { width: 41px; height: 42px; }
  .atlas-marker, .atlas-cluster { width: 44px; height: 44px; }
}

@media (max-width: 350px) {
  .atlas-toolbar { padding-inline: 6px; gap: 3px; }
  .atlas-presets button { padding-inline: 4px; }
  #atlas-jump-search, #atlas-fullscreen { min-width: 34px; }
}
