.map-actions { display: flex; flex-wrap: wrap; gap: 7px 10px; align-items: center; margin-top: 9px; pointer-events: none; }
.map-actions > button { pointer-events: auto; }
.map-shell {
  --lore-toggle-width: 88px;
  --lore-toggle-space: calc(var(--lore-toggle-width) + 6px);
}
.place-lore-dock {
  position: absolute;
  z-index: 3;
  top: 17px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: min(360px, 44%);
  max-height: calc(100% - 170px);
  pointer-events: none;
}
.place-lore-dock > * { pointer-events: auto; }
#place-lore-toggle {
  width: var(--lore-toggle-width);
  justify-content: space-between;
  gap: 6px;
  padding-inline: 8px;
  font-size: 12px;
  font-weight: 650;
}
.map-shell[data-worlds="true"] #place-lore-toggle { height: var(--worlds-control-height); }
#place-lore-toggle[aria-expanded="true"] .place-lore-indicator path:last-child { visibility: hidden; }
.place-lore {
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 19px 21px 22px;
  border: 1px solid #736b50;
  border-radius: 9px;
  background: linear-gradient(155deg, #202c33, #111a23 62%);
  box-shadow: 0 18px 44px #0008;
  color: #e9e7dc;
  scrollbar-width: thin;
}
.place-lore-context { margin: 0 0 6px; color: #e8c686; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .11em; }
.place-lore h2 { margin: 0; color: #ffedc8; font: 600 26px/1.14 var(--title); }
.place-lore-content > p { margin: 12px 0 0; color: #d3d8db; font-size: 13px; line-height: 1.52; }
.place-lore-content > .place-lore-lead { color: #f4ebd7; font-size: 15px; line-height: 1.44; }
.place-lore section { margin-top: 17px; padding-top: 11px; border-top: 1px solid #79858845; }
.place-lore section h3 { margin: 0 0 8px; font: 700 10px var(--sans); text-transform: uppercase; letter-spacing: .11em; color: #d7c49e; }
.place-lore ul { margin: 0; padding: 0 0 0 16px; }
.place-lore li { margin: 0 0 6px; font-size: 12px; line-height: 1.42; }
.place-lore li p { margin: 2px 0 6px; color: #c9d0d4; }
.place-lore nav { display: grid; gap: 5px; }
.place-lore nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #586366;
  border-radius: 4px;
  background: #202c34;
  color: #f0dbac;
}
.place-lore nav a:is(:hover, :focus-visible) { border-color: #ba9c66; background: #2c383f; }
.place-lore nav a span { color: #d9b77f; font-size: 16px; }
.place-lore-footer { display: grid; gap: 8px; margin-top: 14px; }
.place-lore-footer .place-lore-references { margin-top: 0; }
.workspace[data-cinematic] .place-lore-dock { display: none; }
@media (max-width: 780px) {
  .place-lore-dock { top: 10px; right: 10px; width: min(360px, calc(100% - 20px)); max-height: min(calc(46% + 50px), 480px); }
  .place-lore { padding: 14px 16px 17px; }
  .place-lore h2 { font-size: 22px; }
  .place-lore nav a { min-height: 40px; }
}

.lore-gallery { margin: 14px 0 0; }
.lore-gallery-art {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #79678f;
  border-radius: 6px;
  background: #0e0c18;
}
.lore-gallery-image { display: block; position: relative; width: 100%; height: 100%; object-fit: cover; }
.lore-gallery-art[data-portrait] .lore-gallery-image { object-fit: contain; }
.lore-gallery-fill {
  position: absolute;
  inset: 0;
  display: flex;
  transform: scale(1.18);
  filter: blur(24px) brightness(.67) saturate(.92);
  pointer-events: none;
}
.lore-gallery-fill img { width: 50%; height: 100%; object-fit: cover; }
.lore-gallery-fill img:first-child { transform: scaleX(-1); }
.lore-gallery figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 22px;
  padding-top: 4px;
  color: var(--chrome-muted, #bdb2c8);
  font-size: 11px;
}
.lore-gallery figcaption a { text-decoration: underline; text-underline-offset: 2px; }
.lore-gallery-controls { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.lore-gallery-controls button {
  padding: 0;
  width: 30px;
  height: 30px;
  border: 1px solid #79678f;
  border-radius: 5px;
  background: #232033;
  color: #eee8f7;
  font-size: 19px;
}
.lore-gallery-controls button:hover { background: #38274e; }
.lore-references { display: flex; flex-wrap: wrap; gap: 6px 9px; }
.lore-reference {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  color: var(--chrome-accent, #ddd0ff);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lore-reference img { object-fit: contain; }
.celestial-art-credit:not([hidden]) {
  display: block;
  margin: 4px 0;
  text-align: center;
}
.celestial-references { margin-top: 12px; }
@media (max-width: 780px) {
  .lore-gallery-art { max-height: min(18dvh, 150px); }
  .lore-gallery-controls button { width: 44px; height: 44px; }
}

.lore-art-size {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 6px;
  border: 1px solid #b294da99;
  border-radius: 6px;
  background: #211533de;
  color: #e5ceff;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.lore-art-size svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lore-art-size:is(:hover, :focus-visible) { background: #432667; color: #fff7ff; box-shadow: 0 0 14px #ba7bff9c; }
.lore-art-size:focus-visible { outline: 2px solid #e6c5ff; outline-offset: 2px; }
.lore-art-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(42px, 5vmin, 64px) clamp(12px, 3vmin, 48px) max(16px, env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
  color: #ecdcff;
}
.lore-art-dialog[open] { display: grid; }
.lore-art-dialog::backdrop { background: #0b0714f5; }
.lore-art-dialog > figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; min-height: 0; margin: 0; }
.lore-art-dialog img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.lore-art-dialog figcaption { text-align: center; font: 500 12px/1.4 var(--sans, sans-serif); }
.lore-art-dialog figcaption a { color: inherit; text-underline-offset: 2px; }
.lore-art-dialog > .lore-art-size { top: max(8px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 1; }
@media (pointer: coarse) { .lore-art-size { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .lore-art-size { transition: none; } }
