/* A working atlas: the image is the surface; the index stays beside it. */
.worldAtlas {
  --atlas-brass: #c6ac72;
  --atlas-line: #b69a5f4a;
  --atlas-text: #efdfbb;
  --atlas-muted: #b8af95;
  min-width: 0;
  color: var(--atlas-text);
}
.worldAtlas [hidden] { display: none !important; }
.worldAtlasHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 15px;
}
.worldAtlasHead > div { min-width: 0; }
.worldAtlasHead .eyebrow,
.worldAtlasHead .deskEyebrow,
.worldAtlasHead > div > small {
  font-size: 9px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--atlas-brass);
}
.worldAtlasHead h2 {
  margin: 4px 0 0;
  font: 550 clamp(23px, 2.1vw, 30px)/1.2 var(--font-display, Georgia, serif);
  letter-spacing: -.02em;
}
.worldAtlasHead > button { flex: none; min-height: 42px; font-size: 12px; }
.worldAtlasLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  border: 1px solid var(--atlas-line);
  border-radius: 5px;
  background: #111b19;
  box-shadow: 0 9px 26px #0005, inset 0 1px #f6dfac17;
  overflow: hidden;
  min-width: 0;
}
.worldAtlasMain { min-width: 0; }
.atlasMapHeading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  min-height: 69px;
  background: linear-gradient(100deg, #262d24eb, #17221edf), url('/textures/leather.svg');
  border-bottom: 1px solid var(--atlas-line);
}
.atlasMapHeading > div:first-child { min-width: 0; }
.atlasMapHeading small {
  display: block;
  color: var(--atlas-muted);
  font-size: 9px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .07em;
  overflow-wrap: anywhere;
}
.atlasMapHeading h3 {
  margin: 3px 0 0;
  font: 550 23px/1.2 var(--font-display, Georgia, serif);
  color: #f0ddb3;
  overflow-wrap: anywhere;
}
.atlasMapActions { display: flex; flex: none; gap: 6px; align-items: center; }
.worldAtlas .atlasMapActions button {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.worldAtlas .atlasMapActions button svg { width: 17px; height: 17px; vertical-align: middle; }
.atlasCanvasWrap { position: relative; min-width: 0; background: #101916; }
.atlasCanvas {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(360px, 60dvh, 700px);
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  background: #16211c;
  outline: none;
}
.atlasCanvas:focus-visible { box-shadow: inset 0 0 0 2px #f1d18b; }
.atlasCanvas.isPanning { cursor: grabbing; }
.atlasCanvas.isPlacing { cursor: crosshair; }
.atlasImageLayer {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform;
}
.atlasWorldImage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  -webkit-user-drag: none;
}
.atlasPinLayer { position: absolute; inset: 0; pointer-events: none; }
.worldAtlas button.atlasPin {
  --pin-color: #e3bc66;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  width: 44px;
  min-width: 44px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  color: var(--pin-color);
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  overflow: visible;
  transition: none;
}
.atlasPinGlyph {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 50% 50% 50% 3px;
  transform: rotate(-45deg);
  background: #17231cf2;
  box-shadow: 0 2px 5px #0009, inset 0 1px 2px #fce2a938;
  transition: background 130ms, box-shadow 130ms;
}
.atlasPinGlyph svg {
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.atlasPinLabel {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 180px;
  padding: 3px 7px;
  border: 1px solid #eed0a038;
  border-radius: 3px;
  background: #102018da;
  color: #fff6e0;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 1px 5px #0005;
  font: 650 11px/1.35 var(--font-ui, sans-serif);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  pointer-events: none;
}
.worldAtlas .atlasPin:hover .atlasPinGlyph,
.worldAtlas .atlasPin:focus-visible .atlasPinGlyph,
.worldAtlas .atlasPin.isSelected .atlasPinGlyph,
.worldAtlas .atlasPin.selected .atlasPinGlyph,
.worldAtlas .atlasPin[aria-pressed="true"] .atlasPinGlyph {
  background: #34412cf5;
  box-shadow: 0 0 0 3px #f5d78b4a, 0 3px 8px #0009;
}
.worldAtlas .atlasPin:focus-visible { outline: none; }
.worldAtlas .atlasPin.isSelected,
.worldAtlas .atlasPin.selected { z-index: 2; }
.worldAtlas .atlasPin.isSelected .atlasPinLabel { border-color: var(--pin-color); }
.worldAtlas .atlasPin.selected .atlasPinLabel { border-color: var(--pin-color); }
.atlasCanvasLoading,
.atlasCanvasError {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  margin: 0;
  padding: 28px;
  text-align: center;
  background: radial-gradient(ellipse at center, #37433745, transparent 70%), #111d19;
  color: #d3c4a2;
  font-size: 13px;
  line-height: 1.6;
}
.atlasCanvasError p { margin: 0; max-width: 360px; }
.atlasMapControls {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid #c2a26687;
  border-radius: 5px;
  background: #13201aee;
  box-shadow: 0 3px 10px #0006, inset 0 1px #f2d4a825;
}
.worldAtlas .atlasMapControls button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  box-shadow: none;
  background: none;
  color: #ebd6aa;
  font-size: 21px;
  font-weight: 500;
}
.worldAtlas .atlasMapControls button svg { width: 20px; height: 20px; }
.worldAtlas .atlasMapControls button[data-atlas-fit] {
  width: auto;
  min-width: 0;
  padding: 0 9px;
  font-size: 10px;
  white-space: nowrap;
}
.worldAtlas .atlasMapControls button:hover { background: #d4b37325; }
.worldAtlas .atlasMapControls button.active,
.worldAtlas .atlasMapControls button[aria-pressed="true"] {
  background: #a5894a;
  color: #181e14;
  box-shadow: inset 0 1px #e9d4a780;
}
.atlasZoomReadout {
  min-width: 48px;
  padding: 0 4px;
  text-align: center;
  color: #d2c4a2;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.atlasCanvasHint {
  position: absolute;
  right: 14px;
  bottom: 18px;
  z-index: 5;
  max-width: calc(100% - 255px);
  padding: 5px 8px;
  border-radius: 3px;
  background: #122018d9;
  color: #f1e3c5;
  font-size: 10px;
  line-height: 1.4;
  text-shadow: 0 1px #000;
  pointer-events: none;
}
.atlasMapFooter { border-top: 1px solid var(--atlas-line); padding: 0 16px; }
.atlasMapLore summary {
  padding: 12px 0;
  cursor: pointer;
  font-size: 12px;
  color: #cbbf9e;
  overflow-wrap: anywhere;
}
.atlasMapLore p {
  margin: 0 0 15px;
  color: #c5baa0;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.worldAtlasSide {
  min-width: 0;
  align-self: stretch;
  padding: 16px;
  border-left: 1px solid var(--atlas-line);
  background: linear-gradient(100deg, #202724e6, #131d19e6), url('/textures/leather.svg');
  box-shadow: inset 5px 0 9px -8px #000b;
}
@media (min-width: 761px) {
  .worldAtlas:not(.worldAtlasFullscreen) .worldAtlasSide {
    min-height: 0;
    max-height: calc(clamp(360px, 60dvh, 700px) + 123px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-color: #8c7749 #101a16;
    scrollbar-gutter: stable;
  }
}
.atlasLibraryHeader { margin-bottom: 10px; }
.atlasLibraryHeader h4 { margin: 0 0 11px; font-size: 12px; font-weight: 650; color: #decca5; }
.atlasLibraryHeader h4 small,
.atlasPointsHead h4 small { margin-left: 5px; font-size: 10px; font-weight: 400; color: #afa68c; }
.atlasLibraryHeader > label { display: grid; gap: 7px; font-size: 10px; color: var(--atlas-muted); }
.worldAtlas .atlasLibraryHeader input,
.worldAtlas input.atlasPointSearch {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  border: 1px solid #b29a5d4f;
  border-radius: 4px;
  padding: 9px 10px;
  color: #e9ddbd;
  background: #0d1713b8;
  box-shadow: inset 0 1px 4px #0003;
  font: 12px/1.4 var(--font-ui, sans-serif);
}
.worldAtlas input::placeholder { color: #a29d87; opacity: 1; }
.atlasMapList { display: grid; gap: 5px; margin: 0 0 18px; padding: 0; list-style: none; }
.worldAtlas .atlasMapChoice {
  width: 100%;
  min-height: 45px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid transparent;
  border-left-width: 2px;
  border-radius: 3px;
  background: #07120d24;
  box-shadow: none;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  color: #d4c9ab;
  overflow-wrap: anywhere;
}
.atlasMapChoice small { color: #a7a08a; font-size: 10px; font-weight: 400; }
.worldAtlas .atlasMapChoice:hover { background: #b79b6014; border-color: #b79b6030; }
.worldAtlas .atlasMapChoice.active,
.worldAtlas .atlasMapChoice[aria-current="true"],
.worldAtlas .atlasMapChoice[aria-current="page"] {
  border-color: #bca16850;
  border-left-color: #e2c185;
  background: #bea06523;
  color: #f4e1b9;
}
.atlasPointsHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 0 10px;
  border-top: 1px solid var(--atlas-line);
}
.atlasPointsHead h4 { margin: 0; font-size: 12px; font-weight: 650; color: #decca5; }
.atlasPointsHead h4 span,
.atlasPointsHead > span { font-size: 10px; margin-left: 5px; font-weight: 400; color: #afa68c; }
.worldAtlas .atlasPointsHead button {
  min-height: 32px;
  min-width: 32px;
  padding: 5px 7px;
  font-size: 11px;
  background: none;
  box-shadow: none;
  border-color: #bca16847;
}
.atlasPointList { display: grid; margin: 9px 0 0; padding: 0; gap: 0; list-style: none; }
.worldAtlas .atlasPointRow {
  --pin-color: #e3bc66;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #b49a5e25;
  min-width: 0;
  width: 100%;
  text-align: left;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #c9b387;
}
.worldAtlas .atlasPointRow:hover { background: #c5aa6a12; }
.atlasPointRow > svg,
.atlasPointRow > .atlasPointGlyph,
.atlasPointRow > span:first-child { color: var(--pin-color); width: 23px; height: 23px; }
.atlasPointRow svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.atlasPointRow > div,
.atlasPointRow > span:nth-child(2) { min-width: 0; }
.atlasPointRow > span:last-child { font-size: 17px; color: #a89059; padding-inline: 3px; }
.atlasPointRow strong,
.atlasPointRow b { display: block; font-size: 12px; line-height: 1.45; font-weight: 550; color: #e0d3b4; overflow-wrap: anywhere; }
.atlasPointRow small { display: block; color: #aba28b; font-size: 10px; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.worldAtlas .atlasPointFocus {
  display: grid;
  place-items: center;
  min-width: 36px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  background: none;
  border-color: transparent;
  box-shadow: none;
  color: #ccb17c;
}
.worldAtlas .atlasPointFocus:hover { border-color: #c2a36555; background: #bba06216; }
.atlasNote { margin: 9px 0; color: #aaa18a; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.atlasTextPlace { margin: 0; padding: 28px 20px; min-height: 180px; }
.atlasReadonlyNote { white-space: pre-wrap; color: #d6c9ac; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.atlasSidePanel { margin-top: 18px; padding-top: 14px; border-top: 1px solid #c8a56675; }
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasPointList,
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasPointSearch,
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasPointsHead { display: none; }
.atlasMapList { max-height: 190px; overflow-y: auto; scrollbar-color: #8c7749 #101a16; }
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasMapList { max-height: 90px; }
.atlasPointEditorHead { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.atlasPointEditorHead h4 { margin: 0; font: 550 19px/1.25 var(--font-display, Georgia, serif); color: #edd6a7; }
.worldAtlas .atlasPointEditorHead button { min-width: 32px; min-height: 32px; padding: 3px; background: none; box-shadow: none; border-color: transparent; color: #c8b17d; font-size: 19px; }
.atlasPointForm { display: grid; gap: 12px; }
.atlasPointForm label { display: grid; gap: 6px; font-size: 10px; font-weight: 500; color: #bdb095; }
.worldAtlas .atlasPointForm input,
.worldAtlas .atlasPointForm select,
.worldAtlas .atlasPointForm textarea {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #b29a5d5c;
  border-radius: 4px;
  background: #0a1512;
  color: #ecddbb;
  box-shadow: inset 0 1px 4px #0003;
  font: 12px/1.5 var(--font-ui, sans-serif);
}
.worldAtlas .atlasPointForm textarea { min-height: 86px; resize: vertical; }
.worldAtlas .atlasPointForm input[type="color"] { padding: 4px; cursor: pointer; }
.atlasPointFields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.atlasPointEditorActions { display: flex; flex-wrap: wrap; gap: 7px; }
.worldAtlas .atlasPointEditorActions button { flex: 1; min-height: 40px; font-size: 11px; padding: 9px; }
.atlasPointEditTools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.worldAtlas .atlasPointEditTools button { min-height: 34px; padding: 5px 1px; font-size: 10px; background: none; border-color: transparent; box-shadow: none; color: #c7b388; }
.worldAtlas .atlasPointEditTools button:last-child { color: #d19683; }
.atlasSaveFeedback { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: #aec19c; }
.atlasSaveFeedback.isError { color: #e5a394; }
.worldAtlas input:focus-visible,
.worldAtlas textarea:focus-visible,
.worldAtlas select:focus-visible,
.worldAtlas button:focus-visible,
.atlasMapLore summary:focus-visible { outline: 2px solid #dfbd77; outline-offset: 3px; }
.worldAtlas button:disabled { opacity: .42; cursor: default; }
.worldAtlas .atlasMapActions button.active,
.worldAtlas .atlasMapActions button[aria-pressed="true"] { background: #96804b; color: #101a13; border-color: #d1b47a; }
body.atlasFullscreenOpen { overflow: hidden; }
.worldAtlasFullscreen {
  position: fixed;
  inset: 12px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid #c3a465;
  border-radius: 6px;
  background: linear-gradient(110deg, #19231f, #0a1310);
  box-shadow: 0 0 0 20px #020806d6, 0 15px 70px #000b;
  overflow: hidden;
}
.worldAtlasFullscreen .worldAtlasHead { flex: none; padding-top: 0; }
.worldAtlasFullscreen .worldAtlasLayout { flex: 1; min-height: 0; height: calc(100dvh - 110px); align-items: stretch; }
.worldAtlasFullscreen .worldAtlasMain { display: flex; flex-direction: column; min-height: 0; }
.worldAtlasFullscreen .atlasMapHeading,
.worldAtlasFullscreen .atlasMapFooter { flex: none; }
.worldAtlasFullscreen .atlasCanvasWrap { flex: 1; min-height: 0; }
.worldAtlasFullscreen .atlasCanvas { height: 100%; min-height: 0; }
.worldAtlasFullscreen .worldAtlasSide { overflow-y: auto; scrollbar-color: #8c7749 #101a16; }
.worldAtlasFullscreen .atlasMapLore p { max-height: 120px; overflow-y: auto; }
@media (max-width: 1100px) {
  .worldAtlasLayout { grid-template-columns: minmax(0, 1fr) 260px; }
  .worldAtlasSide { padding: 13px; }
  .atlasMapHeading { padding: 12px; }
  .atlasMapHeading h3 { font-size: 21px; }
  .atlasCanvasHint { display: none; }
}
.atlasCanvasWrap:has(.atlasCanvas.isPlacing) .atlasCanvasHint {
  display: block;
  top: 12px;
  bottom: auto;
  left: 12px;
  right: 12px;
  max-width: none;
  text-align: center;
  border: 1px solid #d0b17485;
  padding: 8px 10px;
  background: #152318ee;
  font-size: 12px;
}
@media (max-width: 760px) {
  .worldAtlasHead { padding: 3px 0 12px; gap: 12px; }
  .worldAtlasHead h2 { font-size: 24px; }
  .worldAtlasHead > button { min-height: 44px; max-width: 150px; padding: 10px 12px; line-height: 1.35; white-space: normal; }
  .worldAtlasLayout { grid-template-columns: minmax(0, 1fr); }
  .atlasMapHeading { min-height: 70px; gap: 8px; }
  .atlasMapHeading h3 { font-size: 20px; }
  .atlasMapActions { gap: 4px; }
  .worldAtlas .atlasMapActions button { min-height: 40px; padding: 8px; font-size: 10px; }
  .atlasCanvas { height: clamp(340px, 58dvh, 580px); }
  .atlasMapControls { bottom: 10px; left: 10px; }
  .worldAtlas .atlasMapControls button { min-width: 42px; width: 42px; min-height: 42px; height: 42px; }
  .atlasPinLabel { max-width: 135px; font-size: 10px; }
  .worldAtlasSide { padding: 15px; border-left: 0; border-top: 1px solid var(--atlas-line); }
  .worldAtlas .atlasLibraryHeader input,
  .worldAtlas input.atlasPointSearch,
  .worldAtlas .atlasPointForm input,
  .worldAtlas .atlasPointForm textarea,
  .worldAtlas .atlasPointForm select { font-size: 16px; min-height: 44px; }
  .atlasMapList { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 7px; margin-bottom: 15px; }
  .worldAtlas .atlasMapChoice { min-height: 48px; }
  .atlasPointList { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); column-gap: 16px; }
  .worldAtlas .atlasPointFocus { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .atlasPointRow { padding-block: 6px; }
  .worldAtlas .atlasPointEditorHead button { min-height: 40px; min-width: 40px; }
  .worldAtlas .atlasPointEditorActions button { min-height: 44px; font-size: 12px; }
  .worldAtlas .atlasPointEditTools button { min-height: 44px; font-size: 12px; }
  .atlasSidePanel { margin-top: 15px; scroll-margin-top: 16px; scroll-margin-bottom: 90px; }
  .worldAtlasFullscreen { inset: 5px; padding: 9px; }
  .worldAtlasFullscreen .worldAtlasLayout { display: flex; flex-direction: column; overflow-y: auto; height: auto; }
  .worldAtlasFullscreen .worldAtlasMain { flex: none; }
  .worldAtlasFullscreen .atlasCanvasWrap { flex: none; }
  .worldAtlasFullscreen .atlasCanvas { height: max(330px, 60dvh); }
  .worldAtlasFullscreen .worldAtlasSide { overflow: visible; }
}
@media (max-width: 410px) {
  .worldAtlasHead h2 { font-size: 22px; }
  .worldAtlasHead > button { font-size: 11px; max-width: 135px; }
  .atlasMapHeading { flex-wrap: wrap; }
  .atlasMapHeading > div:first-child { flex: 1 1 100%; }
  .atlasMapActions { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .worldAtlas * { scroll-behavior: auto; }
  .atlasPinGlyph { transition: none; }
}

/* Cartographic tools share one work surface; ornament never competes with the map. */
.atlasToolBar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--atlas-line);
  background: linear-gradient(#253028, #15221b);
  box-shadow: inset 0 1px #e7ca8510;
}
.worldAtlas .atlasToolBar button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  color: #cfbea0;
  font-size: 11px;
  white-space: nowrap;
}
.worldAtlas .atlasToolBar button:hover { border-color: #c6ac7242; background: #c6ac7215; }
.worldAtlas .atlasToolBar button[aria-pressed="true"],
.worldAtlas .atlasToolBar button.active {
  color: #f8e8bd;
  background: #af925334;
  border-color: #d9b8748c;
  box-shadow: inset 0 1px #ebd29a25;
}
.atlasToolBar .atlasHistoryTools { display: flex; gap: 3px; margin-left: auto; padding-left: 8px; border-left: 1px solid var(--atlas-line); }
.worldAtlas .atlasToolBar button[data-atlas-history] { min-width: 38px; font-size: 18px; }
.atlasDrawBar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 12px;
  color: #e9d5a8;
  border-bottom: 1px solid #c5a36066;
  background: #343b28;
  font-size: 11px;
}
.atlasDrawBar > span, .atlasDrawBar > output { margin-right: auto; }
.worldAtlas .atlasDrawBar button { min-height: 35px; padding: 6px 10px; font-size: 11px; }
.atlasAnnotationLayer { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.atlasAnnotationPath { pointer-events: auto; cursor: pointer; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.atlasAnnotationPath.isSelected { filter: drop-shadow(0 0 2px #ffe1a2); }
.atlasAnnotationPath:focus-visible { outline: none; filter: drop-shadow(0 0 3px #ffe1a2); }
.atlasTextLayer, .atlasHandleLayer { position: absolute; inset: 0; pointer-events: none; }
.atlasTextLayer { z-index: 2; }
.atlasPinLayer { z-index: 3; }
.atlasHandleLayer { z-index: 4; }
.worldAtlas button.atlasEditorJump { position: absolute; top: 12px; right: 12px; z-index: 6; min-height: 44px; padding: 8px 12px; font-size: 12px; background: #17231def; }
.atlasCanvasWrap:has(.atlasCanvas.isPlacing) .atlasEditorJump { display: none; }
.worldAtlas button.atlasMapLabel {
  position: absolute;
  display: grid;
  place-items: center;
  width: max-content;
  max-width: min(480px, 85%);
  min-height: 44px;
  min-width: 44px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: none;
  box-shadow: none;
  pointer-events: auto;
  cursor: pointer;
  font: 550 var(--label-size, 20px)/1.15 var(--font-display, Georgia, serif);
  color: var(--label-color, #f2e3bb);
  text-shadow: 0 1px 2px #07120c, 0 0 4px #07120c, 0 0 8px #07120c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: center;
  transition: border-color 120ms, background 120ms;
  transform-origin: center;
}
.atlasMapLabel.kind-region { padding-inline: 4px; letter-spacing: .04em; text-transform: uppercase; }
.worldAtlas button.atlasMapLabel.label-water { font-style: italic; letter-spacing: .025em; }
.atlasMapLabel.label-mountain { letter-spacing: .045em; }
.worldAtlas .atlasMapLabel:hover, .worldAtlas .atlasMapLabel.isSelected {
  border-color: #ead09a88;
  background: #17241b55;
}
.worldAtlas .atlasMapLabel:focus-visible { outline: 2px solid #f0cf85; outline-offset: 2px; }
.worldAtlas button.atlasVertexHandle,
.worldAtlas button.atlasMidpointHandle,
.worldAtlas button.atlasAnchorHandle,
.worldAtlas button.atlasDrawVertex {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  touch-action: none;
  cursor: move;
  color: #ffe3a0;
}
.atlasVertexHandle::before, .atlasDrawVertex::before,
.atlasMidpointHandle::before, .atlasAnchorHandle::before {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border: 2px solid #edd18c;
  border-radius: 50%;
  background: #183029;
  box-shadow: 0 1px 4px #000c;
}
.atlasMidpointHandle::before { width: 9px; height: 9px; border: 1px solid #e9d5a8; border-radius: 2px; background: #e9d5a833; }
.atlasAnchorHandle::before { border-radius: 2px; transform: rotate(45deg); background: #dfc382; }
.worldAtlas .atlasVertexHandle.isSelected::before { background: #f0d18b; box-shadow: 0 0 0 3px #edcf8c55; }
.worldAtlas .atlasVertexHandle:hover::before, .worldAtlas .atlasMidpointHandle:hover::before { background: #ead08d; }
.worldAtlas .atlasPin.size-small .atlasPinGlyph { width: 23px; height: 23px; }
.worldAtlas .atlasPin.size-small .atlasPinGlyph svg { width: 14px; height: 14px; }
.worldAtlas .atlasPin.size-large .atlasPinGlyph { width: 42px; height: 42px; }
.worldAtlas .atlasPin.size-large .atlasPinGlyph svg { width: 25px; height: 25px; }
.atlasObjectFilters { display: grid; gap: 8px; padding-block: 10px; }
.atlasObjectFilters > label { display: grid; gap: 5px; font-size: 10px; color: var(--atlas-muted); }
.worldAtlas .atlasObjectFilters select {
  width: 100%; min-width: 0; min-height: 38px; padding: 8px;
  border: 1px solid #b29a5d4f; border-radius: 3px;
  background: #0d1713; color: #e6d5b0; font-size: 11px;
}
.atlasLayerToggles { display: flex; flex-wrap: wrap; gap: 5px; }
.worldAtlas .atlasLayerToggles button { min-height: 30px; padding: 5px 7px; font-size: 10px; background: #0e1813; box-shadow: none; border-color: #b29a5d44; }
.worldAtlas .atlasLayerToggles button[aria-pressed="true"] { color: #f0dfb4; background: #b89c5429; border-color: #c9a76788; }
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasObjectFilters { display: none; }
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasLibraryHeader { display: none; }
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasMapList { display: none; }
.worldAtlasSide:has(.atlasSidePanel:not([hidden])) .atlasSidePanel { margin-top: 0; padding-top: 0; border-top: 0; }
.atlasPointForm .atlasFieldHint { margin: 0; color: #a89f88; font-size: 10px; line-height: 1.5; }
.atlasLayerFilters { font-size: 11px; color: #c9ba9c; }
.atlasLayerFilters summary { padding: 7px 0; cursor: pointer; }
.atlasLayerFilters > div { display: grid; padding: 4px 0; gap: 3px; }
.atlasLayerFilters label { display: flex; gap: 9px; align-items: center; min-height: 30px; }
.worldAtlas .atlasLayerFilters input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: #d0b375; }
.atlasVertexTools { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 7px; padding-block: 5px; border-block: 1px solid #c4aa6a33; }
.atlasVertexTools small { color: #c7b68e; font-size: 10px; }
.worldAtlas .atlasVertexTools button { min-height: 36px; padding: 7px 9px; font-size: 10px; }
.atlasPointForm .atlasEditHint { margin: 0; font-size: 10px; line-height: 1.5; }
.atlasObjectGlyph { display: inline-grid; place-items: center; width: 23px; height: 23px; font: 550 20px/1 var(--font-display, Georgia, serif); }
.worldAtlas .atlasPointEditorActions { position: sticky; bottom: -16px; z-index: 8; padding-block: 10px; background: #17231d; box-shadow: 0 -8px 10px #17231dd9; }
.worldAtlas .atlasPointForm input[type="range"] { padding: 0; box-shadow: none; background: none; accent-color: #d2b575; }
.worldAtlasFullscreen .atlasToolBar, .worldAtlasFullscreen .atlasDrawBar { flex: none; }
@media (max-width: 760px) {
  .atlasToolBar { gap: 4px; padding: 7px 8px; }
  .worldAtlas .atlasToolBar button { min-height: 44px; padding: 8px 10px; font-size: 11px; }
  .atlasToolBar .atlasHistoryTools { padding-left: 4px; }
  .worldAtlas .atlasToolBar button[data-atlas-history] { min-width: 44px; }
  .worldAtlas .atlasDrawBar button { min-height: 44px; }
  .atlasDrawBar > span { flex-basis: 100%; }
  .worldAtlas .atlasObjectFilters select { font-size: 16px; min-height: 44px; }
  .worldAtlas .atlasLayerToggles button { min-height: 40px; padding: 8px; font-size: 11px; }
  .atlasLayerFilters label { min-height: 44px; font-size: 13px; }
  .worldAtlas .atlasVertexTools button { min-height: 44px; }
  .worldAtlas .atlasMapLabel { max-width: 85%; }
}
@media (prefers-reduced-motion: reduce) { .worldAtlas .atlasMapLabel { transition: none; } }
