:root {
  color-scheme: dark;
  --ink-950: #071012;
  --ink-900: #0b1518;
  --ink-850: #101c1f;
  --ink-800: #152326;
  --ink-700: #24383b;
  --paper-50: #f6f0df;
  --paper-100: #eaddc3;
  --paper-200: #d8c7a7;
  --muted: #94a4a2;
  --muted-strong: #b8c2bd;
  --sea-300: #91b9ad;
  --sea-500: #4f8078;
  --sea-700: #285451;
  --copper-300: #e0b274;
  --copper-500: #b97a46;
  --copper-700: #74442e;
  --scarlet: #a85356;
  --border: rgba(230, 216, 185, 0.15);
  --border-strong: rgba(230, 216, 185, 0.3);
  --surface: rgba(15, 27, 30, 0.86);
  --surface-solid: #101c1f;
  --surface-raised: rgba(25, 41, 43, 0.92);
  --text: var(--paper-50);
  --text-soft: var(--muted-strong);
  --page-gutter: clamp(1rem, 3vw, 3.5rem);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --micro-text: 0.75rem;
  --topbar-height: calc(4.75rem + var(--safe-top));
  --rail-width: 4.75rem;
  --radius-xs: 0.25rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --shadow-soft: 0 1.5rem 4rem rgba(0, 0, 0, 0.26);
  --font-serif: "Iowan Old Style", "Songti SC", STSong, "Noto Serif CJK SC", Georgia, serif;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(longtide-content) {
  animation: longtide-leave 180ms ease both;
}

::view-transition-new(longtide-content) {
  animation: longtide-enter 260ms ease 60ms both;
}

@keyframes longtide-leave {
  to { opacity: 0; transform: translateY(0.4rem); }
}

@keyframes longtide-enter {
  from { opacity: 0; transform: translateY(0.55rem); }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 1rem);
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--ink-950);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--copper-300);
  outline-offset: 3px;
}

::selection {
  background: var(--copper-500);
  color: var(--ink-950);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  top: 0.75rem;
  transform: translateY(-180%);
  padding: 0.7rem 1rem;
  background: var(--paper-50);
  color: var(--ink-950);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ambient__glow {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 76% 14%, rgba(79, 128, 120, 0.12), transparent 28%),
    radial-gradient(circle at 10% 66%, rgba(185, 122, 70, 0.06), transparent 24%);
}

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) max(var(--page-gutter), var(--safe-right)) 0 max(1.1rem, var(--safe-left));
  background: rgba(7, 16, 18, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(120%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 13rem;
  view-transition-name: longtide-brand;
}

.brand__mark {
  width: 2.65rem;
  height: 2.65rem;
  fill: none;
  stroke: var(--copper-300);
  stroke-width: 1.5;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 0.05rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-nav {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 1.8rem;
  transform: translateX(-50%);
  view-transition-name: longtide-navigation;
}

.site-nav a {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--copper-300);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--paper-50);
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  transform: scaleX(1);
}

.safe-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(145, 185, 173, 0.28);
  color: var(--sea-300);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.safe-badge__dot,
.footer__status span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--sea-300);
  box-shadow: 0 0 0.8rem var(--sea-300);
}

.icon-button {
  min-width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.icon-button svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.icon-button kbd {
  color: var(--muted);
  font-size: 0.65rem;
  font-family: var(--font-sans);
}

.rail {
  position: fixed;
  z-index: 40;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(7, 16, 18, 0.76);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.rail a {
  position: relative;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.18rem;
  color: var(--muted);
  transition: color 180ms ease, background 180ms ease;
}

.rail a::before {
  content: "";
  position: absolute;
  left: -1px;
  width: 2px;
  height: 0;
  background: var(--copper-300);
  transition: height 180ms ease;
}

.rail a span {
  color: color-mix(in srgb, currentColor 62%, transparent);
  font-size: 0.55rem;
  letter-spacing: 0.11em;
}

.rail a b {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.rail a:hover,
.rail a.is-active {
  color: var(--paper-50);
  background: rgba(255, 255, 255, 0.035);
}

.rail a.is-active::before {
  height: 2rem;
}

main {
  margin-left: var(--rail-width);
  padding-top: var(--topbar-height);
  view-transition-name: longtide-content;
}

.hero {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(20rem, 0.82fr) minmax(25rem, 1.18fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(3rem, 6vw, 5rem) var(--page-gutter) 2rem;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--border);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 4rem 4rem;
  mask-image: linear-gradient(90deg, #000, transparent 62%);
}

.hero__map {
  position: relative;
  min-height: clamp(21rem, 31vw, 30rem);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
}

.hero__map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 16, 18, 0.08), rgba(7, 16, 18, 0.32));
  box-shadow: inset 0 0 0 0.45rem rgba(7, 16, 18, 0.18);
}

.hero__map img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.72) contrast(1.04) brightness(0.8);
  transition: filter 180ms ease;
}

.hero__map:hover img {
  filter: saturate(0.86) contrast(1.04) brightness(0.88);
}

.hero__content {
  width: auto;
  max-width: 39rem;
  padding: 0;
}

.eyebrow,
.kicker {
  margin: 0;
  color: var(--copper-300);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero h1 {
  font-size: clamp(2.8rem, 4.5vw, 4.75rem);
  letter-spacing: -0.06em;
}

.hero__heading {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-top: 0.65rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-strong);
}

.hero__heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__lede {
  max-width: 36rem;
  margin: 1.25rem 0 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.85;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button[aria-disabled="true"] {
  opacity: 0.58;
  cursor: progress;
  transform: none;
}

.button--primary {
  background: var(--copper-300);
  color: var(--ink-950);
}

.button--primary:hover {
  background: #edc78f;
}

.button--ghost,
.button--secondary {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
}

.button--ghost:hover,
.button--secondary:hover {
  border-color: var(--copper-300);
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(6rem, 1fr));
  margin: 2rem 0 0;
  border-block: 1px solid var(--border);
}

.hero__metrics div {
  padding: 0.7rem 0.85rem;
  border-left: 1px solid var(--border);
}

.hero__metrics div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero__metrics dt {
  color: var(--paper-50);
  font-size: 0.82rem;
  font-weight: 700;
}

.hero__metrics dd {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.hero__map-label,
.hero__map-action {
  position: absolute;
  z-index: 2;
  padding: 0.45rem 0.65rem;
  background: rgba(7, 16, 18, 0.82);
  border: 1px solid rgba(230, 216, 185, 0.22);
  color: var(--paper-50);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.hero__map-label {
  top: 0.75rem;
  left: 0.75rem;
}

.hero__map-action {
  right: 0.75rem;
  bottom: 0.75rem;
}

.hero__map-action b {
  margin-left: 0.5rem;
  color: var(--copper-300);
}

.section {
  padding: clamp(2rem, 4vw, 3.5rem) var(--page-gutter);
  border-bottom: 1px solid var(--border);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(17rem, 32rem);
  align-items: end;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin-top: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.2;
}

.section-heading > p {
  margin: 0;
  color: var(--text-soft);
}

.section--atlas {
  padding-top: clamp(3rem, 5vw, 4.5rem);
  background: linear-gradient(180deg, rgba(20, 35, 38, 0.52), rgba(7, 16, 18, 0));
}

.atlas-toolbar {
  position: sticky;
  z-index: 20;
  top: calc(var(--topbar-height) + 0.5rem);
  display: grid;
  grid-template-columns: auto minmax(20rem, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem;
  background: rgba(12, 23, 26, 0.88);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.16);
}

.location-directory-trigger {
  min-width: 10.25rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0 0.55rem 0 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-strong);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.location-directory-trigger svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.35;
}

.location-directory-trigger > span:first-of-type {
  white-space: nowrap;
}

.location-directory-trigger > span:last-child {
  min-width: 2rem;
  min-height: 1.75rem;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  padding-inline: 0.35rem;
  border-left: 1px solid var(--border);
  color: var(--paper-100);
  font-variant-numeric: tabular-nums;
}

.location-directory-trigger:hover,
.location-directory-trigger.is-active {
  border-color: var(--copper-300);
  color: var(--paper-50);
}

.atlas-toolbar.is-dossier-view {
  position: relative;
  top: auto;
}

.atlas-editor-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.atlas-data-status {
  grid-column: 1 / -1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.42rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.035em;
}

.atlas-data-status::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--copper-300);
  box-shadow: 0 0 0 0.16rem rgba(224, 178, 116, 0.1);
}

.atlas-data-status[data-source="unavailable"]::before {
  background: #b96f6f;
}

.atlas-editor-tools button,
.location-editor-actions button {
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.72rem;
  cursor: pointer;
}

.atlas-editor-tools button:hover,
.atlas-editor-tools button[aria-pressed="true"],
.location-editor-actions button:hover {
  border-color: var(--copper-300);
  color: var(--paper-50);
}

#atlas-review-count {
  display: inline-grid;
  min-width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: var(--copper-300);
  color: var(--ink-950);
  font-size: 0.65rem;
  font-weight: 800;
}

.search-field {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.8rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

.search-field svg {
  width: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder,
.note-field textarea::placeholder {
  color: var(--muted);
}

.filter-scroller {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-scroller::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.75rem;
  cursor: pointer;
}

.filter-chip::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--chip-color);
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.zoom-controls {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
}

.zoom-controls button,
.zoom-controls output {
  min-width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  font-size: 0.75rem;
}

.zoom-controls button:last-child {
  border-right: 0;
  padding: 0 0.7rem;
  cursor: pointer;
}

.zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.atlas-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 25rem);
  min-height: 64rem;
  border: 1px solid var(--border);
  background: var(--ink-900);
  box-shadow: var(--shadow-soft);
}

.location-directory {
  position: fixed;
  z-index: 45;
  top: var(--location-directory-top, calc(var(--topbar-height) + 0.5rem));
  bottom: 0.75rem;
  left: var(--location-directory-left, calc(var(--rail-width) + var(--page-gutter) + 0.75rem));
  width: var(--location-directory-width, min(23rem, calc(100vw - 1.5rem)));
  height: auto;
  max-height: none;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(90deg, rgba(224, 178, 116, 0.055) 1px, transparent 1px) 0 0 / 4.2rem 100%,
    #0d1b1e;
  box-shadow: 1.4rem 1.5rem 3.5rem rgba(0, 0, 0, 0.38);
  opacity: 0;
  visibility: hidden;
  transform: translateX(calc(-100% - 1.5rem));
  transition:
    opacity 180ms ease,
    transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 340ms;
}

.location-directory.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  /* The directory is a rapid-access tool: expose it in the same frame as its
     focus target. The base rule still animates and delays visibility on exit. */
  transition: none;
}

.location-directory.is-open *,
.location-directory.is-open *::before,
.location-directory.is-open *::after {
  transition: none !important;
}

.location-directory__header {
  min-height: 4.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.8rem 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.location-directory__header .kicker {
  margin: 0;
  font-size: 0.58rem;
}

.location-directory__header h3 {
  margin: 0.05rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.location-directory__header button {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-strong);
  font-size: 1.2rem;
  cursor: pointer;
}

.location-directory__header button:hover {
  border-color: var(--copper-300);
  color: var(--paper-50);
}

.location-directory__search {
  margin: 0.8rem 0.8rem 0;
  background: rgba(255, 255, 255, 0.045);
}

.location-directory__summary {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.62rem;
}

.location-directory__summary span:last-child {
  flex: 0 0 auto;
  opacity: 0.72;
}

.location-directory__list {
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
  scrollbar-color: var(--border-strong) transparent;
}

.location-directory__item {
  position: relative;
  width: 100%;
  min-height: 5.4rem;
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr) 1rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.location-directory__item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--directory-color);
  opacity: 0;
  transform: scaleY(0.35);
  transition: opacity 160ms ease, transform 220ms ease;
}

.location-directory__item:hover,
.location-directory__item:focus-visible,
.location-directory__item[aria-current="location"] {
  background: rgba(255, 255, 255, 0.045);
}

.location-directory__item:hover::before,
.location-directory__item:focus-visible::before,
.location-directory__item[aria-current="location"]::before {
  opacity: 1;
  transform: scaleY(1);
}

.location-directory__item[aria-current="location"] {
  background: linear-gradient(90deg, color-mix(in srgb, var(--directory-color) 13%, transparent), transparent 75%);
}

.location-directory__marker {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--directory-color) 72%, transparent);
  border-radius: 50%;
  color: var(--paper-50);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.location-directory__copy {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.location-directory__copy strong,
.location-directory__copy > span,
.location-directory__copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-directory__copy strong {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.location-directory__copy > span {
  display: -webkit-box;
  color: var(--muted-strong);
  font-size: 0.67rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.location-directory__copy small {
  margin-top: 0.12rem;
  color: var(--directory-color);
  font-size: 0.58rem;
  white-space: nowrap;
}

.location-directory__arrow {
  color: var(--muted);
  font-size: 0.75rem;
  transform: translateX(-0.18rem);
  transition: color 160ms ease, transform 180ms ease;
}

.location-directory__item:hover .location-directory__arrow,
.location-directory__item:focus-visible .location-directory__arrow {
  color: var(--copper-300);
  transform: none;
}

.location-directory__empty {
  min-height: 18rem;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 2rem 1.2rem;
}

.location-directory__empty strong {
  font-family: var(--font-serif);
  font-size: 1rem;
}

.location-directory__empty p {
  margin: 0.35rem 0 1rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.location-directory__empty button {
  min-height: 2.75rem;
  padding-inline: 0.9rem;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--paper-100);
  font-size: 0.7rem;
  cursor: pointer;
}

.atlas-visuals {
  position: relative;
  min-width: 0;
  min-height: 64rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: clip;
  background: #0c1719;
  isolation: isolate;
}

@media (min-width: 901px) {
  .atlas-layout > .atlas-visuals {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .atlas-layout > .location-panel {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }
}

.atlas-view-switchbar {
  position: sticky;
  z-index: 20;
  top: calc(var(--topbar-height) + 0.5rem);
  align-self: start;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 3.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.55rem 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 20, 22, 0.96);
  box-shadow: 0 0.7rem 1.8rem rgba(0, 0, 0, 0.16);
}

.atlas-map-trail {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.atlas-map-trail > span {
  color: rgba(224, 178, 116, 0.64);
  font-family: var(--font-serif);
  font-size: 1rem;
}

.atlas-map-trail button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.55rem;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  letter-spacing: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.atlas-map-trail button:hover,
.atlas-map-trail button:focus-visible {
  border-bottom-color: var(--copper-300);
  color: var(--paper-50);
}

.atlas-map-trail button[aria-current="page"],
.atlas-map-trail button:disabled {
  color: var(--paper-50);
  cursor: default;
  opacity: 1;
}

.atlas-view-switchbar__actions {
  min-width: 0;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.atlas-visuals > .map-stage,
.atlas-visuals > .location-scene {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  transition:
    opacity 280ms ease,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 480ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear;
  will-change: opacity, transform;
}

.atlas-layout[data-atlas-view="dossier"][data-map-focus="compact"] .atlas-visuals > .map-stage {
  z-index: 1;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-0.65rem) scale(0.985);
  clip-path: circle(0% at var(--level-origin-x, 50%) var(--level-origin-y, 50%));
  pointer-events: none;
  transition-delay: 0s, 0s, 360ms;
}

.atlas-layout[data-atlas-view="dossier"][data-map-focus="compact"] .location-scene {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  transform: none;
  clip-path: circle(150% at var(--level-origin-x, 50%) var(--level-origin-y, 50%));
  pointer-events: auto;
  transition-delay: 55ms, 55ms, 0s;
}

.atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .atlas-visuals > .map-stage {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  transform: none;
  clip-path: circle(150% at var(--level-origin-x, 50%) var(--level-origin-y, 50%));
  pointer-events: auto;
  transition-delay: 55ms, 55ms, 0s;
}

.atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .location-scene {
  z-index: 1;
  visibility: hidden;
  opacity: 0;
  transform: translateX(0.65rem) scale(1.012);
  clip-path: circle(0% at var(--level-origin-x, 50%) var(--level-origin-y, 50%));
  pointer-events: none;
  transition-delay: 0s, 0s, 360ms;
}

.atlas-layout[data-atlas-view="dossier"] .map-stage__hint {
  max-width: calc(100% - 1.6rem);
  overflow: hidden;
  white-space: nowrap;
}

.location-scene {
  position: relative;
  min-width: 0;
  overflow: auto;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(27, 46, 48, 0.54), rgba(10, 21, 23, 0.2)),
    var(--ink-900);
  scrollbar-color: var(--border-strong) transparent;
}

.map-place-dock {
  position: sticky;
  z-index: 16;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  align-self: end;
  justify-self: center;
  bottom: 1rem;
  width: min(46rem, calc(100% - 2rem));
  max-width: 46rem;
  min-height: 5.25rem;
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr) auto;
  align-items: stretch;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(224, 178, 116, 0.42);
  background: rgba(8, 18, 20, 0.94);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  animation: map-place-dock-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.map-place-dock[hidden] {
  display: none;
}

@keyframes map-place-dock-in {
  from { opacity: 0; transform: translateY(0.7rem); }
  to { opacity: 1; transform: none; }
}

.map-place-dock__image {
  min-width: 0;
  background: var(--ink-950);
}

.map-place-dock__image img {
  width: 100%;
  height: 100%;
  min-height: 5.25rem;
  display: block;
  object-fit: cover;
}

.map-place-dock__copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.18rem;
  padding: 0.65rem 0.8rem;
}

.map-place-dock__copy small,
.map-place-dock__copy span {
  color: var(--muted);
  font-size: 0.62rem;
}

.map-place-dock__copy strong {
  overflow: hidden;
  color: var(--paper-50);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-place-dock__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(5.5rem, 1fr));
  border-left: 1px solid var(--border);
}

.map-place-dock__actions button {
  min-width: 5.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.66rem;
  cursor: pointer;
}

.map-place-dock__actions button:first-child {
  border-left: 0;
}

.map-place-dock__actions button:hover,
.map-place-dock__actions button:focus-visible {
  background: rgba(224, 178, 116, 0.1);
  color: var(--paper-50);
}

.town-map-inset {
  position: absolute;
  z-index: 15;
  top: 5.2rem;
  right: 1rem;
  width: 9.4rem;
  min-height: 4.25rem;
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem;
  border: 1px solid rgba(224, 178, 116, 0.36);
  background: rgba(8, 18, 20, 0.9);
  color: var(--paper-100);
  text-align: left;
  box-shadow: 0 0.8rem 1.8rem rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.town-map-inset:hover,
.town-map-inset:focus-visible {
  border-color: var(--copper-300);
}

.town-map-inset__map {
  position: relative;
  height: 3.45rem;
  overflow: hidden;
  background: var(--ink-950);
}

.town-map-inset__map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.84;
}

.town-map-inset__map i {
  position: absolute;
  width: 0.52rem;
  height: 0.52rem;
  border: 2px solid var(--paper-50);
  border-radius: 50%;
  background: var(--copper-500);
  box-shadow: 0 0 0 0.18rem rgba(8, 18, 20, 0.65);
  transform: translate(-50%, -50%);
}

.town-map-inset small,
.town-map-inset strong {
  display: block;
}

.town-map-inset small {
  color: var(--muted);
  font-size: 0.56rem;
}

.town-map-inset strong {
  margin-top: 0.12rem;
  font-family: var(--font-serif);
  font-size: 0.76rem;
}

.location-scene__bar {
  position: sticky;
  z-index: 12;
  top: -1rem;
  min-height: 4.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  margin: -1rem -1rem 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 23, 25, 0.92);
  backdrop-filter: blur(16px);
}

.location-scene__bar h3 {
  overflow: hidden;
  margin: 0.15rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-view-close,
.location-scene__nav button,
.local-map-controls button,
.local-map-controls output,
.location-media-tabs button {
  min-height: 2.5rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-strong);
  font-size: 0.7rem;
}

.atlas-view-close,
.location-scene__nav button,
.local-map-controls button,
.location-media-tabs button {
  cursor: pointer;
}

.atlas-view-close {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-inline: 0.7rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-strong);
  font-size: 0.68rem;
  white-space: nowrap;
  cursor: pointer;
}

.atlas-view-close:hover,
.location-scene__nav button:hover:not(:disabled),
.local-map-controls button:hover,
.location-media-tabs button[aria-selected="true"] {
  border-color: var(--copper-300);
  color: var(--paper-50);
}

.location-scene__nav {
  display: flex;
}

.location-scene__nav button {
  width: 2.5rem;
  min-width: 2.75rem;
  border-right: 0;
}

.location-scene__nav button:last-child {
  border-right: 1px solid var(--border);
}

.location-scene__nav button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.location-media-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.location-media-tabs button {
  min-width: 0;
  min-height: 3.15rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  text-align: left;
}

.location-media-tabs button + button {
  border-left: 1px solid var(--border);
}

.location-media-tabs button span {
  overflow: hidden;
  color: var(--paper-100);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-media-tabs button small {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.location-media-tabs button[aria-selected="true"] {
  border-bottom-color: var(--copper-300);
  background: rgba(255, 255, 255, 0.032);
}

.location-media-tabs button[data-asset-state="ready"] small::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--sage-300, #9dc5b2);
  box-shadow: 0 0 0 0.12rem rgba(157, 197, 178, 0.12);
}

.location-media-tabs button[data-asset-state="pending"] small::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border: 1px dashed var(--copper-300);
  border-radius: 50%;
}

.location-scene[data-media-tab="scene"] .local-map-card,
.location-scene[data-media-tab="map"] .scene-cg {
  display: none;
}

.scene-cg {
  margin: 1rem 0 0;
  scroll-margin-top: calc(var(--topbar-height) + 4.5rem);
}

.scene-cg__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.045) 48%, transparent 62%),
    #132326;
  background-size: 220% 100%;
  animation: scene-loading 2s linear infinite;
}

@keyframes scene-loading { to { background-position: -220% 0; } }

.scene-cg.is-loaded .scene-cg__frame {
  animation: none;
}

.scene-cg picture,
.scene-cg picture img {
  width: 100%;
  height: 100%;
  display: block;
}

.scene-cg picture img {
  object-fit: cover;
  opacity: 0;
  transform: scale(1.018);
  filter: saturate(1.025) contrast(1.01) brightness(1.02);
  transition: opacity 420ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scene-cg.is-loaded picture img {
  opacity: 1;
  transform: scale(1);
}

.scene-cg__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 242, 205, 0.035), transparent 64%, rgba(4, 12, 14, 0.22));
  pointer-events: none;
}

.scene-cg__status {
  position: absolute;
  z-index: 2;
  left: 0.7rem;
  bottom: 0.7rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(238, 219, 182, 0.28);
  background: rgba(7, 16, 18, 0.76);
  color: var(--paper-100);
  font-size: 0.59rem;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}

.scene-cg__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
  background:
    linear-gradient(rgba(8, 20, 22, 0.74), rgba(8, 20, 22, 0.88)),
    url("assets/saltmarsh-map.webp") center / cover;
}

.scene-cg__fallback span {
  color: var(--copper-300);
  font-size: 2rem;
}

.scene-cg__fallback strong {
  margin-top: 0.55rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.scene-cg__fallback p {
  max-width: 24rem;
  margin: 0.4rem 0 0;
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.scene-cg figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.75rem 0.1rem 0;
}

.scene-cg figcaption p,
.scene-cg figcaption small {
  margin: 0;
}

.scene-cg figcaption p {
  color: var(--paper-100);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.55;
}

.scene-cg figcaption small {
  max-width: 12rem;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.5;
  text-align: right;
}

.local-map-card {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-strong);
  scroll-margin-top: calc(var(--topbar-height) + 4.5rem);
}

.local-map-card__bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.local-map-card__bar h4 {
  margin: 0.22rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.local-map-controls {
  display: flex;
  flex: 0 0 auto;
}

.local-map-controls button,
.local-map-controls output {
  min-width: 2.5rem;
  display: grid;
  place-items: center;
  border-right: 0;
}

.local-map-controls button {
  min-width: 2.75rem;
}

.local-map-controls button:last-child {
  min-width: 3.3rem;
  border-right: 1px solid var(--border);
}

.local-map-card__note {
  margin: 0.55rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.55;
}

.local-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  margin: 0 0 0.75rem;
  color: var(--muted-strong);
  font-size: 0.57rem;
}

.local-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.local-map-legend span::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid #b7a36f;
  border-radius: 50%;
  background: #d7c28e;
}

.local-map-legend [data-source="experienced"]::before { background: #d99b57; border-color: #f1cf95; }
.local-map-legend [data-source="confirmed"]::before { background: #7fa997; border-color: #bee0cf; }
.local-map-legend [data-source="published"]::before { background: #c6b77f; border-color: #efe2b7; }
.local-map-legend [data-source="inferred"]::before { background: transparent; border-style: dashed; }

.local-map-viewport {
  position: relative;
  min-height: 18rem;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(231, 216, 181, 0.62);
  background: #c8bd92;
  box-shadow: inset 0 0 0 1px rgba(52, 69, 63, 0.16), inset 0 0 3rem rgba(76, 79, 58, 0.16);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.local-map-art {
  z-index: 1;
  overflow: hidden;
  background: #d8cda3;
}

.local-map-art picture,
.local-map-art picture img {
  width: 100%;
  height: 100%;
  display: block;
}

.local-map-art picture img {
  object-fit: fill;
  opacity: 0;
  filter: saturate(1.02) contrast(1.015) brightness(1.02);
  transition: opacity 260ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.local-map-art.is-loaded picture img {
  opacity: 1;
}

.local-map-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 0.45rem solid rgba(48, 67, 58, 0.3);
  box-shadow: inset 0 0 2.4rem rgba(62, 67, 49, 0.15);
  pointer-events: none;
}

.local-map-art__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.45rem;
  padding: clamp(1.25rem, 5vw, 3rem);
  background:
    radial-gradient(circle at 28% 22%, rgba(103, 135, 92, 0.18), transparent 34%),
    linear-gradient(135deg, #e1d5aa, #c5b987);
  color: #30423c;
  text-align: center;
}

.local-map-art__fallback[hidden] {
  display: none;
}

.local-map-art__fallback span {
  color: #a16335;
  font-size: clamp(1.6rem, 5vw, 2.5rem);
}

.local-map-art__fallback strong {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3vw, 1.35rem);
}

.local-map-art__fallback p {
  max-width: 28rem;
  margin: 0;
  color: #536059;
  font-size: clamp(0.72rem, 2vw, 0.84rem);
  line-height: 1.65;
}

.local-map-survey,
.local-map-notation {
  pointer-events: none;
}

.local-map-known-area {
  transition: opacity 180ms ease;
}

.local-map-feature-mark {
  filter: drop-shadow(0 0.2rem 0.12rem rgba(36, 47, 42, 0.18));
}

.local-map-feature-mark[data-source="inferred"],
.local-map-feature-mark[data-source="rumor"] {
  opacity: 0.68;
}

.local-map-feature-mark.is-active {
  filter: drop-shadow(0 0 0.28rem rgba(191, 129, 66, 0.68));
}

.local-map-feature-anchor {
  transition: opacity 180ms ease, filter 180ms ease;
}

.local-map-feature-anchor__wash,
.local-map-feature-anchor__point {
  transition: r 180ms ease, fill 180ms ease, stroke 180ms ease, stroke-width 180ms ease;
}

.local-map-feature-anchor:not(.is-active) {
  opacity: 0.58;
}

.local-map-feature-anchor.is-active .local-map-feature-anchor__wash {
  r: 35;
  fill: rgba(226, 174, 103, 0.25);
  stroke: #8f542e;
  stroke-width: 3;
  stroke-dasharray: none;
}

.local-map-feature-anchor.is-active .local-map-feature-anchor__point {
  r: 6;
  fill: #9d592f;
  stroke-width: 2.5;
}

.local-map-illustration text {
  paint-order: stroke fill;
  stroke: rgba(232, 220, 181, 0.75);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.local-map-viewport.is-dragging {
  cursor: grabbing;
}

.local-map-canvas {
  position: absolute;
  inset: 0;
  transform-origin: center;
  transition: transform 140ms ease-out;
  will-change: transform;
}

.local-map-viewport.is-dragging .local-map-canvas {
  transition: none;
}

#local-map-art,
.local-map-hotspots,
.local-map-leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.local-map-leaders {
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}

.local-map-hotspots {
  z-index: 3;
}

.local-map-hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  transform: translate(-50%, -50%) scale(var(--local-map-inverse-scale, 1));
  transform-origin: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.local-map-hotspot span {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border: 1px solid #f7e8bf;
  border-radius: 50%;
  background: rgba(12, 27, 28, 0.86);
  color: #fff1ca;
  font-size: 0.53rem;
  font-weight: 800;
  box-shadow: 0 0 0 0.16rem rgba(13, 26, 28, 0.32), 0 0.25rem 0.8rem rgba(0, 0, 0, 0.32);
}

.local-map-hotspot:hover span,
.local-map-hotspot:focus-visible span,
.local-map-hotspot.is-active span {
  background: var(--copper-500);
  color: var(--ink-950);
}

.local-map-hotspot--rumor span,
.local-map-hotspot--unknown span {
  border-style: dashed;
  border-color: #ebc2c2;
}

.local-map-feature {
  position: relative;
  min-height: 5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 1rem;
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem 0.8rem 4.7rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.026);
}

.local-map-feature small {
  position: absolute;
  top: 0.78rem;
  left: 0.85rem;
  width: 3.1rem;
  color: var(--copper-300);
  font-size: 0.57rem;
  line-height: 1.35;
}

.local-map-feature strong,
.local-map-feature p {
  grid-column: 2;
}

.local-map-feature strong {
  color: var(--paper-50);
  font-family: var(--font-serif);
  font-size: 0.9rem;
}

.local-map-feature p {
  margin: 0.2rem 0 0;
  color: var(--text-soft);
  font-size: 0.7rem;
  line-height: 1.55;
}

.map-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #0c1719;
}

.map-stage__hint {
  position: absolute;
  z-index: 8;
  top: 0.8rem;
  left: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: rgba(7, 16, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted-strong);
  font-size: 0.68rem;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.map-placement-hint {
  position: absolute;
  z-index: 14;
  top: 0.8rem;
  left: 50%;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  transform: translateX(-50%);
  border: 1px solid var(--copper-300);
  background: rgba(7, 16, 18, 0.94);
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.36);
  color: var(--paper-50);
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
}

.map-placement-hint span {
  color: var(--muted);
}

.map-stage__hint span {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--copper-300);
  border-radius: 50%;
  box-shadow: 0 0 0 0.2rem rgba(224, 178, 116, 0.12);
}

.map-focus-toggle {
  min-width: 7.8rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper-100);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.map-focus-toggle:hover,
.map-focus-toggle[data-map-active="true"] {
  border-color: var(--copper-300);
  background: rgba(224, 178, 116, 0.09);
  color: var(--paper-50);
}

.map-focus-toggle__arrow {
  color: var(--copper-300);
  font-size: 0.9rem;
}

.map-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-viewport.is-dragging {
  cursor: grabbing;
}

.map-viewport.is-placing {
  cursor: crosshair;
}

.map-canvas {
  --map-scale: 1;
  --pin-inverse-scale: 1;
  --pan-x: 0px;
  --pan-y: 0px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, 44rem);
  aspect-ratio: 1936 / 2577;
  transform: translate3d(calc(-50% + var(--pan-x)), calc(-50% + var(--pan-y)), 0) scale(var(--map-scale));
  transform-origin: center center;
  transition: transform 120ms ease-out;
  will-change: transform;
}

.map-viewport.is-dragging .map-canvas {
  transition: none;
}

.map-viewport.is-flying .map-canvas {
  transition-duration: 560ms;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.map-canvas > img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

#map-pins {
  position: absolute;
  inset: 0;
}

.map-pin {
  position: absolute;
  z-index: 1;
  width: calc(3.25rem * var(--pin-inverse-scale));
  height: calc(3.25rem * var(--pin-inverse-scale));
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.map-pin__face {
  position: relative;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 244, 216, 0.86);
  border-radius: 50%;
  background: rgba(8, 18, 20, 0.72);
  color: #fff4d8;
  font-size: 0.62rem;
  font-weight: 800;
  text-shadow: 0 1px 2px #000;
  box-shadow: 0 0 0 0.14rem rgba(8, 18, 20, 0.28), 0 0.2rem 0.75rem rgba(0, 0, 0, 0.36);
  transform: scale(var(--pin-inverse-scale));
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.map-pin--guide .map-pin__face {
  opacity: 0.82;
}

.map-pin--custom .map-pin__face {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border-color: rgba(145, 185, 173, 0.9);
  background: rgba(8, 18, 20, 0.76);
  color: var(--sea-300);
  font-size: 0.42rem;
  text-shadow: none;
  box-shadow:
    0 0 0 0.12rem rgba(8, 18, 20, 0.3),
    0 0 0 0.18rem rgba(145, 185, 173, 0.12),
    0 0.2rem 0.75rem rgba(0, 0, 0, 0.36);
}

.map-pin:hover,
.map-pin:focus-visible,
.map-pin.is-selected,
.map-pin.is-moving {
  z-index: 3;
  transform: translate(-50%, -50%);
}

.map-pin:hover .map-pin__face,
.map-pin:focus-visible .map-pin__face,
.map-pin.is-selected .map-pin__face,
.map-pin.is-moving .map-pin__face {
  transform: scale(var(--pin-inverse-scale)) scale(1.14);
  background: var(--copper-500);
  color: var(--ink-950);
  border-color: var(--paper-50);
  text-shadow: none;
}

.map-pin--custom:is(:hover, :focus-visible, .is-selected, .is-moving) .map-pin__face {
  box-shadow: 0 0 0 0.14rem rgba(8, 18, 20, 0.28), 0 0.2rem 0.75rem rgba(0, 0, 0, 0.36);
}

.map-viewport.is-editing-pins .map-pin--custom:not(.is-selected, .is-moving) .map-pin__face {
  animation: pin-ready 2.2s ease-in-out infinite;
}

@keyframes pin-ready {
  50% {
    box-shadow:
      0 0 0 0.12rem rgba(8, 18, 20, 0.3),
      0 0 0 0.3rem rgba(145, 185, 173, 0.14),
      0 0.2rem 0.75rem rgba(0, 0, 0, 0.36);
  }
}

.map-pin.is-muted {
  opacity: 0.12;
  pointer-events: none;
}

.map-pin.is-clustered {
  opacity: 0;
  pointer-events: none;
}

.map-pin-cluster {
  position: absolute;
  z-index: 4;
  width: calc(3.25rem * var(--pin-inverse-scale));
  height: calc(3.25rem * var(--pin-inverse-scale));
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  transform: translate(-50%, -50%);
}

.map-pin-cluster > span {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--copper-300);
  border-radius: 50%;
  background: var(--ink-850);
  color: var(--paper-50);
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 0 0 0.16rem rgba(8, 18, 20, 0.38);
  transform: scale(var(--pin-inverse-scale));
}

.map-pin__face[data-nearby-count]::before {
  content: "+" attr(data-nearby-count);
  position: absolute;
  right: -0.75rem;
  top: -0.65rem;
  min-width: 1.05rem;
  height: 1.05rem;
  display: grid;
  place-items: center;
  padding: 0 0.18rem;
  border: 1px solid rgba(255, 244, 216, 0.7);
  border-radius: 999px;
  background: var(--ink-850);
  color: var(--paper-50);
  font-family: var(--font-sans);
  font-size: 0.48rem;
  line-height: 1;
  box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.34);
  pointer-events: none;
}

.map-pin.is-bookmarked .map-pin__face::after {
  content: "";
  position: absolute;
  inset: -0.34rem;
  border: 1px dashed var(--copper-300);
  border-radius: 50%;
  animation: spin 12s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.map-tooltip {
  position: absolute;
  z-index: 30;
  width: min(18rem, calc(100% - 2rem));
  padding: 0.75rem 0.85rem;
  background: rgba(7, 16, 18, 0.94);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.32);
  pointer-events: none;
  backdrop-filter: blur(12px);
}

.map-tooltip strong,
.map-tooltip small {
  display: block;
}

.map-tooltip strong {
  font-family: var(--font-serif);
  font-size: 1rem;
}

.map-tooltip p {
  margin: 0.25rem 0 0;
  color: var(--muted-strong);
  font-size: 0.75rem;
  line-height: 1.45;
}

.map-tooltip small {
  margin-top: 0.35rem;
  color: var(--copper-300);
  font-size: 0.62rem;
}

.location-panel {
  position: relative;
  min-width: 0;
  padding: 1.4rem;
  overflow: auto;
  background: var(--surface-solid);
  border-left: 1px solid var(--border);
}

.location-panel__empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.compass {
  color: var(--copper-300);
  font-size: 3rem;
  line-height: 1;
}

.location-panel__empty h3,
.location-panel__content h3,
.faction-focus h3,
.tool-card h3,
.pulse-card h3 {
  margin: 0.45rem 0;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
}

.location-panel__empty h3 {
  font-size: 2rem;
}

.location-panel__empty > p:not(.kicker) {
  color: var(--text-soft);
}

.location-panel__suggestion {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
}

.location-panel__suggestion small,
.location-panel__suggestion button {
  display: block;
}

.location-panel__suggestion small {
  color: var(--muted);
}

.location-panel__suggestion button {
  margin-top: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--copper-300);
  cursor: pointer;
}

.location-panel__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#location-number {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--copper-300);
  border-radius: 50%;
  color: var(--copper-300);
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.bookmark-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.72rem;
  cursor: pointer;
}

.bookmark-button svg {
  width: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.bookmark-button[aria-pressed="true"] {
  border-color: var(--copper-300);
  color: var(--copper-300);
}

.bookmark-button[aria-pressed="true"] svg {
  fill: currentColor;
}

.bookmark-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.location-panel__category {
  margin: 1.2rem 0 0;
  color: var(--category-color, var(--copper-300));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.location-panel__content h3 {
  margin-top: 0.45rem;
  font-size: clamp(2rem, 3vw, 3.1rem);
}

.location-panel__en {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-style: italic;
  letter-spacing: 0.06em;
}

.location-panel__summary {
  margin-top: 1.35rem;
  color: var(--paper-100);
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.6;
}

.location-panel__content > p:not(.location-panel__category, .location-panel__en, .location-panel__summary) {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.location-panel__use {
  margin-top: 1.2rem;
  padding: 0.9rem;
  border-left: 2px solid var(--category-color, var(--copper-300));
  background: rgba(255, 255, 255, 0.035);
}

.location-panel__use small {
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.location-panel__use p {
  margin: 0.3rem 0 0;
  font-size: 0.83rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tag-list span {
  padding: 0.24rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--muted-strong);
  font-size: 0.65rem;
}

.location-panel__source {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.compact-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.compact-heading h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
}

.compact-heading span {
  color: var(--muted);
  font-size: 0.67rem;
}

#location-fact-list {
  position: relative;
  display: grid;
  gap: 0.7rem;
  margin-top: 0.65rem;
  padding-left: 1rem;
}

#location-fact-list:not(:empty)::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  bottom: 0.45rem;
  left: 0.22rem;
  width: 1px;
  background: linear-gradient(var(--copper-300), rgba(224, 178, 116, 0.12));
}

.location-fact {
  position: relative;
  padding: 0.8rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.location-fact::before {
  content: "";
  position: absolute;
  top: 0.95rem;
  left: -1.12rem;
  width: 0.42rem;
  height: 0.42rem;
  border: 2px solid var(--ink-900);
  border-radius: 50%;
  background: var(--copper-300);
  box-shadow: 0 0 0 1px rgba(224, 178, 116, 0.52);
}
.location-fact.is-routed,
.is-routed-document { outline: 2px solid var(--copper, #c7955b); outline-offset: 3px; scroll-margin-top: 6rem; }

.location-fact > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--copper-300);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.location-facts__heading {
  flex-wrap: wrap;
}

.location-facts__heading h4 {
  margin-right: auto;
}

.location-facts__heading button,
.location-fact__edit,
.person-dossier__edit {
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  cursor: pointer;
}

.location-fact__edit {
  min-height: 1.75rem;
  margin-left: auto;
  padding-inline: 0.5rem;
  color: var(--sea-300);
  letter-spacing: 0;
}

.location-facts__heading button:hover,
.location-fact__edit:hover,
.person-dossier__edit:hover {
  border-color: var(--copper-300);
  color: var(--paper-50);
}

.location-facts__empty {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.location-fact h5 {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.location-fact p {
  margin: 0.3rem 0 0;
  color: var(--text-soft);
  font-size: 0.74rem;
  line-height: 1.55;
}

.location-fact__source {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.58rem;
}

.location-editor-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 1rem;
}

.location-editor-actions button:last-child {
  color: #d69d9d;
}

.note-field {
  display: block;
  margin-top: 1.35rem;
}

.note-field > span {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
}

.note-field small {
  color: var(--muted);
  font-weight: 400;
}

.note-field textarea {
  width: 100%;
  margin-top: 0.5rem;
  resize: vertical;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0;
  outline: none;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.5;
}

.note-field textarea:focus {
  border-color: var(--copper-300);
}

.note-field textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.map-note-conflict {
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--copper-300) 70%, var(--border));
  background: rgba(157, 92, 49, 0.09);
}

.map-note-conflict strong,
.map-note-conflict p,
.map-note-conflict blockquote {
  display: block;
  margin: 0;
}

.map-note-conflict strong {
  color: var(--copper-300);
  font-family: var(--font-serif);
  font-size: 0.9rem;
}

.map-note-conflict p {
  margin-top: 0.35rem;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.map-note-conflict blockquote {
  max-height: 6rem;
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  overflow: auto;
  border-left: 2px solid var(--copper-300);
  background: rgba(0, 0, 0, 0.15);
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.map-note-conflict > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.map-note-conflict button {
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.map-note-conflict button:disabled {
  cursor: default;
  opacity: 0.6;
}

.map-note-conflict #map-conflict-confirm {
  border-color: var(--copper-300);
  background: var(--copper-300);
  color: var(--ink-950);
  font-weight: 700;
}

.bookmark-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-top: 0;
  overflow-x: auto;
}

.bookmark-strip > span {
  flex: 0 0 auto;
  color: var(--copper-300);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

#bookmark-list {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#bookmark-list em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
}

.bookmark-pill {
  flex: 0 0 auto;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.7rem;
  cursor: pointer;
}

.bookmark-pill:hover {
  border-color: var(--copper-300);
}

.unplaced-strip {
  display: grid;
  grid-template-columns: minmax(14rem, 0.65fr) minmax(0, 1.35fr);
  gap: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(126, 185, 194, 0.26);
  border-top: 0;
  background: rgba(126, 185, 194, 0.045);
}

.unplaced-strip strong,
.unplaced-strip small {
  display: block;
}

.unplaced-strip strong {
  color: var(--sea-300);
  font-size: 0.75rem;
}

.unplaced-strip small {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.65rem;
}

#unplaced-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#unplaced-list button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  cursor: pointer;
}

#unplaced-list button:hover {
  border-color: var(--sea-300);
}

#unplaced-list button span {
  color: var(--sea-300);
  font-size: 0.65rem;
}

.section--currents {
  position: relative;
  overflow: hidden;
  background: #e5d7b9;
  color: #182224;
}

.section--currents::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.42' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.section-heading--light {
  position: relative;
}

.section-heading--light .kicker {
  color: #8d5034;
}

.section-heading--light > p {
  color: #53605d;
}

.currents-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(24rem, 1fr) minmax(22rem, 0.8fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.current-diagram svg {
  width: 100%;
  max-height: 38rem;
}

.current-diagram__orbit {
  fill: none;
  stroke: rgba(24, 34, 36, 0.22);
  stroke-width: 1.2;
  stroke-dasharray: 7 9;
}

.current-diagram__flow {
  fill: none;
  stroke: rgba(40, 84, 81, 0.24);
  stroke-width: 1.5;
}

.faction-node {
  cursor: pointer;
  outline: none;
}

.faction-node circle {
  fill: #d7c5a3;
  stroke: rgba(24, 34, 36, 0.45);
  stroke-width: 1.5;
  transition: fill 180ms ease, stroke-width 180ms ease, transform 180ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

.faction-node text,
.town-core text {
  fill: #182224;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}

.faction-node .node-sub,
.town-core .node-sub {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.faction-node:hover circle,
.faction-node:focus-visible circle,
.faction-node.is-active circle {
  fill: #f2e7d1;
  stroke: #8d5034;
  stroke-width: 3;
  transform: scale(1.05);
}

.town-core circle {
  fill: #1d3838;
  stroke: #f0d39e;
  stroke-width: 2;
}

.town-core text {
  fill: #f6f0df;
}

.faction-focus {
  min-height: 0;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(24, 34, 36, 0.18);
}

.faction-focus__code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6b4b37;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.faction-focus__code span:last-child {
  width: 2rem;
  height: 2px;
  background: var(--faction-color);
}

.faction-focus h3 {
  margin-top: 0;
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
}

.faction-focus__en {
  margin: -0.15rem 0 1.6rem;
  color: #65706d;
  font-family: var(--font-serif);
  font-style: italic;
}

.faction-focus__stance {
  margin: 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--faction-color);
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.faction-focus dl {
  margin: 1.6rem 0 0;
}

.faction-focus dl div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(24, 34, 36, 0.14);
}

.faction-focus dt {
  color: #7b4d35;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.faction-focus dd {
  margin: 0;
  color: #3e4c49;
  font-size: 0.84rem;
}

.faction-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 2rem;
  border-top: 1px solid rgba(24, 34, 36, 0.2);
  border-bottom: 1px solid rgba(24, 34, 36, 0.2);
}

.faction-tabs button {
  min-height: 3.7rem;
  border: 0;
  border-right: 1px solid rgba(24, 34, 36, 0.2);
  background: transparent;
  color: #51605d;
  cursor: pointer;
}

.faction-tabs button:last-child {
  border-right: 0;
}

.faction-tabs button.is-active {
  color: #182224;
  box-shadow: inset 0 -3px var(--faction-color);
}

.pulse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  background: var(--border);
  gap: 1px;
}

.pulse-card {
  position: relative;
  min-height: 0;
  padding: 1.4rem;
  overflow: hidden;
  background: var(--surface-solid);
}

.pulse-card__index {
  position: absolute;
  right: 1rem;
  top: 0.4rem;
  color: rgba(255, 255, 255, 0.05);
  font-family: var(--font-serif);
  font-size: 7rem;
  line-height: 1;
}

.pulse-card h3 {
  margin-top: 0.5rem;
  font-size: 1.75rem;
}

.pulse-card > p:not(.kicker) {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.population-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 9.5rem;
  align-items: stretch;
  gap: 0.7rem;
  margin-top: 2rem;
}

.population-bar__item {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.55rem;
  min-width: 0;
  height: 100%;
}

.population-bar__scale {
  display: block;
  align-self: end;
  width: 100%;
  min-height: 1.15rem;
  height: var(--bar-height);
  background: rgba(145, 185, 173, 0.18);
  border-top: 2px solid var(--sea-300);
  box-shadow: inset 0 0 0 1px rgba(145, 185, 173, 0.04);
}

.population-bar__label {
  display: block;
  min-width: 0;
  min-height: 2.1em;
  color: var(--muted-strong);
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.signal-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.signal-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}

.signal-list span {
  color: var(--muted-strong);
}

.signal-list b {
  color: var(--copper-300);
  font-size: 0.72rem;
  font-weight: 700;
}

.defense-readout {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin: 2rem 0;
}

.defense-readout strong {
  color: var(--sea-300);
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 1;
}

.defense-readout span {
  color: var(--muted);
  font-size: 0.75rem;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(10rem, 1fr));
  margin-top: 3rem;
  overflow-x: auto;
  scrollbar-color: var(--copper-700) transparent;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 1.15rem;
  height: 1px;
  background: var(--border-strong);
}

.timeline-item {
  position: relative;
  min-width: 12rem;
  padding: 3rem 1.3rem 0 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0.85rem;
  width: 0.65rem;
  height: 0.65rem;
  border: 1px solid var(--copper-300);
  border-radius: 50%;
  background: var(--ink-950);
}

.timeline-item span {
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.timeline-item h3 {
  margin: 0.45rem 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 500;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.section--people {
  background: rgba(16, 28, 31, 0.64);
}

.people-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.segmented {
  display: flex;
  border: 1px solid var(--border);
}

.segmented button {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:hover,
.segmented button.is-active {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.search-field--compact {
  width: min(20rem, 100%);
}

.people-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 0.38fr) minmax(0, 1fr);
  min-height: 43rem;
  border: 1px solid var(--border);
  background: var(--surface-solid);
}

.people-list {
  max-height: 54rem;
  overflow: auto;
  border-right: 1px solid var(--border);
  background: #0d191c;
}

.person-index-item {
  width: 100%;
  min-height: 4.55rem;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.person-index-item:hover,
.person-index-item[data-selected="true"] {
  background: rgba(255, 255, 255, 0.05);
}

.person-index-item[data-selected="true"] {
  box-shadow: inset 2px 0 var(--person-color, var(--copper-300));
}

.person-index-item > span:first-child {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--person-color, var(--border-strong));
  border-radius: 50%;
  color: var(--person-color, var(--copper-300));
  font-family: var(--font-serif);
}

.person-index-item strong,
.person-index-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-index-item strong {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
}

.person-index-item small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.person-index-item em {
  color: var(--sea-300);
  font-size: 0.58rem;
  font-style: normal;
}

.person-dossier {
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 2rem);
  overflow: auto;
}

.person-graph-overview__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.person-graph-overview__header h3 {
  margin: 0.18rem 0 0;
}

.person-graph-overview__count,
.person-graph-overview__lead {
  color: var(--muted);
  font-family: var(--font-sans);
}

.person-graph-overview__count {
  flex: 0 0 auto;
  margin: 0 0 0.35rem;
  font-size: max(var(--lt-text-xs, 0.75rem), 12px);
}

.person-graph-overview__lead {
  max-width: 48rem;
  margin: 0.65rem 0 0;
  font-size: max(var(--lt-text-sm, 0.875rem), 14px);
  line-height: 1.6;
}

.person-dossier__empty {
  min-height: 38rem;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.person-dossier__empty > span {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--copper-300);
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

.person-dossier__empty h3 {
  margin: 1rem 0 0;
  color: var(--paper-50);
  font-family: var(--font-serif);
}

.person-dossier__empty p {
  max-width: 28rem;
  margin: 0.5rem 0 0;
}

#person-content > header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.person-dossier__edit {
  margin-left: 0;
  flex: 0 0 auto;
}

.person-dossier__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.person-dossier__graph-back {
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sea-300);
  font: 650 max(var(--lt-text-sm, 0.875rem), 14px)/1 var(--font-sans);
  cursor: pointer;
}

.person-dossier__graph-back:hover {
  border-color: var(--copper-300);
  color: var(--paper-50);
}

.person-dossier__sigil {
  width: 4rem;
  height: 4rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--copper-300);
  border-radius: 50%;
  color: var(--copper-300);
  font-family: var(--font-serif);
  font-size: 1.45rem;
}

.person-dossier__meta,
.person-dossier__aliases {
  margin: 0;
  color: var(--muted);
  font-size: 0.65rem;
}

#person-content h3 {
  margin: 0.12rem 0;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 500;
  line-height: 1.1;
}

#person-content .person-graph-overview__header h3 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.person-dossier__lead {
  max-width: 50rem;
  margin: 1.5rem 0 0;
  color: var(--paper-100);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
}

.person-dossier__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.25rem 0 0;
  border: 1px solid var(--border);
}

.person-dossier__facts > div {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.person-dossier__facts dt {
  color: var(--muted);
  font-size: 0.65rem;
}

.person-dossier__facts dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.person-dossier__facts button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sea-300);
  cursor: pointer;
}

.relation-map {
  margin-top: 0.7rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  background: radial-gradient(circle at center, rgba(79, 128, 120, 0.08), transparent 55%);
}

.relation-map svg {
  width: 100%;
  min-width: 34rem;
  height: auto;
}

.relation-map line {
  stroke: rgba(230, 216, 185, 0.25);
  stroke-width: 1.2;
}

.relation-map line[data-stance="positive"] { stroke: var(--sea-300); }
.relation-map line[data-stance="strained"],
.relation-map line[data-stance="hostile"] { stroke: var(--scarlet); stroke-dasharray: 5 5; }

.relation-map > svg > text {
  fill: var(--muted);
  font-size: 8px;
  text-anchor: middle;
}

.relation-node {
  cursor: pointer;
  outline: none;
}

.relation-node circle {
  fill: #152326;
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.relation-node:hover circle,
.relation-node:focus-visible circle,
.relation-node.is-center circle {
  stroke: var(--copper-300);
  stroke-width: 2;
}

.relation-node text {
  fill: var(--paper-50);
  text-anchor: middle;
  pointer-events: none;
}

.relation-node__initial { font-family: var(--font-serif); font-size: 15px; }
.relation-node__name { fill: var(--muted) !important; font-size: 8px; }

.relation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.relation-list button {
  min-height: 5.2rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.relation-list button:hover { border-color: var(--sea-300); }
.relation-list button[data-stance="strained"],
.relation-list button[data-stance="hostile"] { border-left-color: var(--scarlet); }

.relation-list span {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.relation-list small { color: var(--copper-300); }
.relation-list p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.69rem; line-height: 1.5; }

.person-dossier__source {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 4rem 1rem;
  background: var(--surface-solid);
  text-align: center;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tool-card {
  min-height: 32rem;
  padding: 1.4rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
}

.tool-card__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.tool-card h3 {
  font-size: 2rem;
}

.tool-card__seal {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.law-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.6rem;
  border: 1px solid var(--border);
}

.law-tabs button {
  min-height: 3rem;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.law-tabs button:last-child {
  border-right: 0;
}

.law-tabs button.is-active {
  background: rgba(168, 83, 86, 0.14);
  color: #e5a5a8;
  box-shadow: inset 0 -2px var(--scarlet);
}

.law-result {
  min-height: 15rem;
  padding: 1.2rem 0;
}

.law-result small {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.law-result h4 {
  margin: 0.35rem 0;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
}

.law-result p {
  color: var(--text-soft);
}

.law-result output {
  display: block;
  margin-top: 1rem;
  color: #e5a5a8;
  font-family: var(--font-serif);
  font-size: 2rem;
}

.activity-list {
  margin-top: 1.4rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 2.7rem 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
}

.activity-item__icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  color: var(--copper-300);
}

.activity-item h4,
.activity-item p {
  margin: 0;
}

.activity-item h4 {
  font-family: var(--font-serif);
  font-weight: 500;
}

.activity-item p {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.activity-item > span:last-child {
  color: var(--copper-300);
  font-size: 0.68rem;
}

.downtime-calculator {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.downtime-calculator label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.downtime-calculator input {
  width: 100%;
  min-height: 2.75rem;
  margin: 0.9rem 0 0.5rem;
  accent-color: var(--copper-300);
}

.downtime-calculator p {
  margin: 0.2rem 0 0.7rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.text-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--copper-300);
  cursor: pointer;
}

#carousing-cost {
  margin-left: 0.7rem;
  color: var(--paper-50);
  font-family: var(--font-serif);
}

.footer {
  min-height: 13rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem var(--page-gutter);
}

.footer strong {
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.footer p {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.footer__status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--sea-300);
  font-size: 0.7rem;
  white-space: nowrap;
}

.atlas-dialog {
  width: min(46rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border-strong);
  background: #101c1f;
  color: var(--text);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.58);
}

.atlas-dialog::backdrop {
  background: rgba(3, 8, 9, 0.76);
  backdrop-filter: blur(7px);
}

.atlas-dialog form {
  padding: 1.2rem;
}

.atlas-dialog header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.atlas-dialog h2 {
  margin: 0.2rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
}

.atlas-dialog header > button {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.atlas-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.atlas-form-grid__wide {
  grid-column: 1 / -1;
}

.atlas-form-grid label > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted-strong);
  font-size: 0.7rem;
}

.atlas-form-grid input,
.atlas-form-grid textarea,
.atlas-form-grid select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.2);
  color: var(--paper-50);
  outline: 0;
}

.atlas-form-grid input:focus,
.atlas-form-grid textarea:focus,
.atlas-form-grid select:focus {
  border-color: var(--copper-300);
}

.atlas-form-position {
  margin: 0.85rem 0 0;
  color: var(--sea-300);
  font-size: 0.68rem;
}

.atlas-dialog form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.atlas-dialog form > footer button,
.atlas-review-item button {
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.atlas-dialog form > footer button[type="submit"] {
  border-color: var(--copper-300);
  background: var(--copper-300);
  color: var(--ink-950);
}

.atlas-review-dialog {
  width: min(50rem, calc(100vw - 2rem));
}

.atlas-review-intro {
  color: var(--text-soft);
  font-size: 0.78rem;
}

#atlas-review-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.atlas-review-item {
  padding: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.atlas-review-item > div:first-child,
.atlas-review-item > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.atlas-review-item > div:first-child {
  flex-wrap: wrap;
  color: var(--copper-300);
  font-size: 0.62rem;
}

.atlas-review-item h3 {
  margin: 0.45rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.atlas-review-item p,
.atlas-review-item li {
  color: var(--text-soft);
  font-size: 0.73rem;
}

.atlas-review-item ul {
  padding-left: 1.2rem;
}

.atlas-review-item > div:last-child {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0.7rem;
}

.atlas-review-item .atlas-review-reject {
  color: #d69d9d;
}

.atlas-review-item .atlas-review-apply {
  border-color: var(--copper-300);
  background: var(--copper-300);
  color: var(--ink-950);
  font-weight: 700;
}

.atlas-review-item[aria-busy="true"] {
  opacity: 0.72;
}

.atlas-review-item button:disabled {
  cursor: wait;
}

.atlas-form-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.8rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 0.72rem;
}

.atlas-form-feedback[data-type="error"],
.atlas-form-feedback[data-type="conflict"] {
  border-color: color-mix(in srgb, var(--copper-300) 70%, var(--border));
  background: rgba(157, 92, 49, 0.1);
  color: var(--paper-100);
}

.atlas-form-feedback button {
  min-height: 2.4rem;
  flex: 0 0 auto;
  padding: 0 0.7rem;
  border: 1px solid var(--copper-300);
  background: transparent;
  color: var(--copper-300);
  cursor: pointer;
}

.atlas-workbench {
  width: min(74rem, calc(100vw - 2rem));
  height: min(48rem, calc(100vh - 2rem));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, 0.62);
}

.atlas-workbench::backdrop {
  background: rgba(3, 8, 9, 0.78);
  backdrop-filter: blur(8px);
}

.atlas-workbench__shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.atlas-workbench__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(64, 105, 100, 0.08), transparent 55%);
}

.atlas-workbench__header h2,
.atlas-record-form h3,
.atlas-workbench__empty h3 {
  margin: 0.12rem 0 0;
  font-family: var(--font-serif);
  font-weight: 500;
}

.atlas-workbench__header h2 {
  font-size: 1.65rem;
}

.atlas-workbench__header p:last-child {
  max-width: 44rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.atlas-workbench__header > button {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-strong);
  font-size: 1.2rem;
  cursor: pointer;
}

.atlas-workbench__tabs {
  display: flex;
  min-height: 3rem;
  padding-inline: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.atlas-workbench__tabs button {
  position: relative;
  min-width: 7rem;
  min-height: 3rem;
  padding: 0 1rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  cursor: pointer;
}

.atlas-workbench__tabs button[aria-selected="true"] {
  color: var(--paper-50);
}

.atlas-workbench__tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  bottom: -1px;
  left: 0.75rem;
  height: 2px;
  background: var(--copper-300);
}

.atlas-workbench__body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
}

.atlas-workbench__index {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.09);
}

.atlas-workbench__index-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.atlas-workbench__index-tools input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0;
  outline: 0;
  background: rgba(0, 0, 0, 0.18);
  color: var(--paper-50);
}

.atlas-workbench__index-tools button {
  min-height: 2.75rem;
  padding: 0 0.7rem;
  border: 1px solid var(--copper-300);
  background: transparent;
  color: var(--copper-300);
  font-size: 0.68rem;
  cursor: pointer;
}

.atlas-workbench__list {
  min-height: 0;
  padding: 0.45rem;
  overflow: auto;
}

.atlas-workbench__list-item {
  width: 100%;
  min-height: 4.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
}

.atlas-workbench__list-item:hover,
.atlas-workbench__list-item[data-selected="true"] {
  background: rgba(107, 154, 147, 0.08);
}

.atlas-workbench__list-item[data-selected="true"] {
  box-shadow: inset 2px 0 var(--copper-300);
}

.atlas-workbench__list-item > span:first-child,
.atlas-workbench__flags {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.atlas-workbench__list-item strong {
  overflow: hidden;
  color: var(--paper-50);
  font-family: var(--font-serif);
  font-size: 0.86rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-workbench__list-item small {
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-workbench__flags {
  align-items: flex-end;
}

.atlas-workbench__flags small:first-child {
  color: var(--sea-300);
}

.atlas-workbench__no-results {
  margin: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.atlas-workbench__editor {
  min-width: 0;
  min-height: 0;
  padding: 1rem 1.1rem;
  overflow: auto;
}

.atlas-workbench__empty {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.atlas-workbench__empty > span {
  width: 3.5rem;
  height: 3.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--copper-300);
}

.atlas-workbench__empty h3 {
  margin-top: 0.8rem;
}

.atlas-workbench__empty p {
  max-width: 27rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.atlas-record-form > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.atlas-record-form h3 {
  font-size: 1.35rem;
}

.atlas-record-form > header > small {
  color: var(--muted);
  font-size: 0.62rem;
}

.atlas-record-form__back {
  display: none;
}

.atlas-record-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.atlas-record-form__wide {
  grid-column: 1 / -1;
}

.atlas-record-form label > span {
  display: flex;
  justify-content: space-between;
  color: var(--muted-strong);
  font-size: 0.68rem;
}

.atlas-record-form input,
.atlas-record-form textarea,
.atlas-record-form select {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.62rem 0.68rem;
  border: 1px solid var(--border);
  border-radius: 0;
  outline: 0;
  background: rgba(0, 0, 0, 0.2);
  color: var(--paper-50);
  font: inherit;
}

.atlas-record-form textarea {
  resize: vertical;
  line-height: 1.55;
}

.atlas-record-form__feedback {
  margin-top: 0.8rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 0.72rem;
}

.atlas-record-form__feedback[data-type="error"],
.atlas-record-form__feedback[data-type="auth"],
.atlas-record-form__feedback[data-type="conflict"] {
  border-color: color-mix(in srgb, var(--copper-300) 70%, var(--border));
  background: rgba(157, 92, 49, 0.1);
}

.atlas-record-form__feedback p {
  margin: 0;
}

.atlas-record-form__feedback > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.atlas-record-form__feedback button {
  min-height: 2.6rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.atlas-record-form__feedback button:last-child {
  border-color: var(--copper-300);
  color: var(--copper-300);
}

.atlas-record-form > footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.atlas-record-form > footer > span {
  flex: 1;
}

.atlas-record-form > footer button {
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.atlas-record-form > footer button[type="submit"] {
  border-color: var(--copper-300);
  background: var(--copper-300);
  color: var(--ink-950);
  font-weight: 700;
}

.atlas-record-form > footer .atlas-record-form__archive {
  color: #d69d9d;
}

.atlas-record-form[aria-busy="true"] {
  opacity: 0.72;
}

.atlas-record-form :disabled {
  cursor: wait;
}

.atlas-workbench__status {
  min-height: 2.2rem;
  padding: 0.55rem 1.1rem;
  border-top: 1px solid var(--border);
  color: var(--muted-strong);
  font-size: 0.68rem;
}

.atlas-workbench__status[data-type="success"] {
  color: var(--sea-300);
}

.atlas-workbench__status[data-type="warning"] {
  color: var(--copper-300);
}

.atlas-workbench button:focus-visible,
.atlas-workbench input:focus-visible,
.atlas-workbench textarea:focus-visible,
.atlas-workbench select:focus-visible,
.atlas-form-feedback button:focus-visible,
.location-fact__edit:focus-visible,
.location-facts__heading button:focus-visible,
.person-dossier__edit:focus-visible,
.person-dossier__graph-back:focus-visible {
  outline: 2px solid var(--copper-300);
  outline-offset: 2px;
}

.command-palette {
  width: min(44rem, calc(100% - 2rem));
  max-height: min(42rem, calc(100vh - 3rem));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--ink-850);
  color: var(--text);
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, 0.55);
}

.command-palette::backdrop {
  background: rgba(4, 9, 10, 0.76);
  backdrop-filter: blur(9px);
}

.command-palette form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.command-palette header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.command-palette header svg {
  width: 1.2rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
}

.command-palette input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.command-palette header button {
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
}

.command-results {
  min-height: 10rem;
  overflow-y: auto;
  padding: 0.5rem;
}

.command-group-title {
  padding: 0.55rem 0.65rem 0.3rem;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.command-result {
  width: 100%;
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.command-result:hover,
.command-result.is-active {
  background: rgba(255, 255, 255, 0.06);
}

.command-result__icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  color: var(--copper-300);
  font-family: var(--font-serif);
  font-size: 0.75rem;
}

.command-result strong,
.command-result small {
  display: block;
}

.command-result strong {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
}

.command-result small {
  color: var(--muted);
  font-size: 0.68rem;
}

.command-result > span:last-child {
  color: var(--muted);
  font-size: 0.64rem;
}

.command-palette footer {
  display: flex;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.62rem;
}

.command-palette footer span:last-child {
  margin-left: auto;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  max-width: min(23rem, calc(100% - 2rem));
  padding: 0.75rem 1rem;
  background: var(--paper-50);
  color: var(--ink-950);
  border-left: 3px solid var(--copper-500);
  box-shadow: var(--shadow-soft);
  font-size: 0.8rem;
}

html[data-theme="chart"] {
  color-scheme: light;
  --ink-950: #eee4cf;
  --ink-900: #e5d8bc;
  --ink-850: #dbcbab;
  --ink-800: #cfbc98;
  --ink-700: #b49b73;
  --paper-50: #172527;
  --paper-100: #263738;
  --paper-200: #42504d;
  --muted: #66716d;
  --muted-strong: #475654;
  --border: rgba(42, 51, 49, 0.18);
  --border-strong: rgba(42, 51, 49, 0.34);
  --surface: rgba(237, 228, 208, 0.88);
  --surface-solid: #e3d5b8;
  --surface-raised: rgba(226, 212, 183, 0.94);
  --text: #172527;
  --text-soft: #475654;
}

html[data-theme="chart"] .topbar,
html[data-theme="chart"] .rail {
  background: rgba(235, 225, 204, 0.83);
}

html[data-theme="chart"] .hero__map::after {
  background: linear-gradient(180deg, rgba(229, 216, 188, 0.05), rgba(23, 37, 39, 0.22));
  box-shadow: inset 0 0 0 0.45rem rgba(232, 221, 198, 0.16);
}

html[data-theme="chart"] .hero__map img {
  filter: saturate(0.8) contrast(1.04) brightness(0.88);
}

html[data-theme="chart"] .hero::after {
  opacity: 0.22;
}

html[data-theme="chart"] .hero__map-label,
html[data-theme="chart"] .hero__map-action,
html[data-theme="chart"] .map-stage__hint {
  background: rgba(231, 219, 193, 0.82);
  color: #172527;
}

html[data-theme="chart"] .atlas-toolbar {
  background: rgba(232, 221, 198, 0.9);
}

html[data-theme="chart"] .location-directory {
  background:
    linear-gradient(90deg, rgba(42, 51, 49, 0.045) 1px, transparent 1px) 0 0 / 4.2rem 100%,
    #e3d5b8;
}

html[data-theme="chart"] .location-directory__item:hover,
html[data-theme="chart"] .location-directory__item:focus-visible {
  background: rgba(23, 37, 39, 0.055);
}

html[data-theme="chart"] .map-stage,
html[data-theme="chart"] .map-tooltip {
  background: #263638;
  color: #f6f0df;
}

html[data-theme="chart"] .map-tooltip p {
  color: #c0ccc9;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(19rem, 0.9fr) minmax(22rem, 1.1fr);
    gap: 2rem;
  }

  .atlas-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .filter-scroller {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .zoom-controls {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .atlas-layout {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem);
  }

  .scene-cg figcaption {
    grid-template-columns: 1fr;
  }

  .scene-cg figcaption small {
    max-width: none;
    text-align: left;
  }

  .currents-grid {
    gap: 2rem;
  }
}

  @media (max-width: 900px) {
  :root {
    --rail-width: 0px;
    --topbar-height: calc(4.25rem + var(--safe-top));
  }

  .topbar {
    padding-right: max(0.85rem, var(--safe-right));
    padding-left: max(0.85rem, var(--safe-left));
  }

  .site-nav {
    gap: 1.1rem;
  }

  .safe-badge {
    display: none;
  }

  .rail {
    top: auto;
    right: 0;
    width: auto;
    height: calc(4rem + var(--safe-bottom));
    padding-right: var(--safe-right);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    flex-direction: row;
    align-items: stretch;
    border-top: 1px solid var(--border);
    border-right: 0;
  }

  .rail a {
    flex: 1;
    min-height: 0;
    gap: 0;
  }

  .rail a span {
    display: none;
  }

  .rail a b {
    font-size: 0.76rem;
    letter-spacing: 0.04em;
  }

  .rail a::before {
    top: 0;
    left: 50%;
    width: 0;
    height: 2px;
    transform: translateX(-50%);
    transition: width 180ms ease;
  }

  .rail a.is-active::before {
    width: 2rem;
    height: 2px;
  }

  body {
    padding-bottom: calc(4rem + var(--safe-bottom));
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 3rem;
  }

  .hero__map {
    min-height: 24rem;
  }

  .section-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .atlas-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .atlas-visuals {
    min-height: 52rem;
  }

  .map-stage {
    min-height: 42rem;
  }

  .location-panel {
    min-height: 25rem;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .location-directory {
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px) + 0.5rem);
  }

  .currents-grid {
    grid-template-columns: 1fr;
  }

  .current-diagram {
    max-width: 38rem;
    margin-inline: auto;
  }

  .faction-focus {
    min-height: 0;
  }

  .pulse-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .pulse-card {
    min-height: 0;
  }

  .people-list {
    max-height: 18rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .people-layout {
    grid-template-columns: 1fr;
  }

  .person-dossier__empty {
    min-height: 18rem;
  }
}

@media (max-width: 640px) {
  .map-pin,
  .map-pin-cluster {
    width: calc(3.25rem * var(--pin-inverse-scale));
    height: calc(3.25rem * var(--pin-inverse-scale));
  }

  .map-pin:hover,
  .map-pin:focus-visible,
  .map-pin.is-selected,
  .map-pin.is-moving {
    transform: translate(-50%, -50%);
  }

  .site-nav {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand__mark {
    width: 2.2rem;
    height: 2.2rem;
  }

  .brand small,
  .icon-button kbd {
    display: none;
  }

  .topbar__actions {
    gap: 0.4rem;
  }

  .hero {
    gap: 1.5rem;
    padding-block: 2.25rem 1.25rem;
  }

  .hero__map {
    min-height: 19rem;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 14vw, 3.75rem);
  }

  .hero__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .hero__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero__actions .button {
    justify-content: space-between;
  }

  .hero__metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__metrics div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .hero__metrics div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .section {
    padding-block: 4.5rem;
  }

  .section-heading h2 {
    font-size: clamp(1.8rem, 9vw, 2.55rem);
  }

  .atlas-toolbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .filter-scroller,
  .zoom-controls {
    grid-column: 1;
    grid-row: auto;
  }

  .location-directory-trigger {
    width: 100%;
    min-height: 44px;
  }

  .zoom-controls {
    justify-self: start;
  }

  .location-directory {
    top: calc(var(--topbar-height) + 0.5rem);
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px) + 0.5rem);
    left: 0.5rem;
    width: calc(100vw - 1rem);
    height: auto;
    max-height: none;
  }

  .location-directory__item {
    min-height: 5.15rem;
    padding-inline: 0.75rem;
  }

  .map-stage {
    min-height: 34rem;
  }

  .atlas-visuals {
    min-height: 34rem;
  }

  .location-scene {
    padding: 0.85rem;
    overflow: visible;
  }

  .location-scene__bar {
    top: var(--topbar-height);
    margin: -0.85rem -0.85rem 0;
    padding: 0.65rem 0.85rem;
  }

  .location-scene__bar > div .kicker {
    display: none;
  }

  .location-scene__bar h3 {
    margin: 0;
    font-size: 0.98rem;
  }

  .location-scene__nav button,
  .atlas-view-close,
  .local-map-controls button,
  .location-media-tabs button {
    min-height: 44px;
  }

  .location-media-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 0.85rem;
  }

  .location-media-tabs button:first-child {
    border-right: 0;
  }

  .location-scene[data-media-tab="scene"] .local-map-card,
  .location-scene[data-media-tab="map"] .scene-cg {
    display: none;
  }

  .scene-cg,
  .local-map-card {
    margin-top: 0.85rem;
  }

  .scene-cg figcaption {
    gap: 0.35rem;
  }

  .local-map-card {
    padding-top: 0;
    border-top: 0;
  }

  .local-map-card__bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .local-map-controls {
    width: 100%;
  }

  .local-map-controls button,
  .local-map-controls output {
    flex: 1;
  }

  .local-map-viewport {
    min-height: 0;
  }

  .map-canvas {
    top: 50%;
    width: max(145%, 36rem);
  }

  .bookmark-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .unplaced-strip,
  .atlas-form-grid {
    grid-template-columns: 1fr;
  }

  .atlas-form-grid__wide {
    grid-column: 1;
  }

  .atlas-editor-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .atlas-editor-tools button {
    flex: 0 0 auto;
  }

  .filter-chip,
  .zoom-controls button,
  .segmented button,
  .atlas-editor-tools button {
    min-height: 44px;
  }

  .currents-grid {
    gap: 1rem;
  }

  .current-diagram {
    margin-inline: -1rem;
  }

  .faction-focus {
    padding: 1.2rem;
  }

  .faction-focus dl div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .faction-tabs {
    grid-template-columns: 1fr;
  }

  .faction-tabs button {
    border-right: 0;
    border-bottom: 1px solid rgba(24, 34, 36, 0.2);
  }

  .people-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    overflow-x: auto;
  }

  .segmented button {
    flex: 0 0 auto;
  }

  .search-field--compact {
    width: 100%;
  }

  .person-dossier__facts,
  .relation-list {
    grid-template-columns: 1fr;
  }

  .tool-card {
    padding: 1rem;
  }

  .tool-card__heading {
    flex-direction: column;
  }

  .activity-item {
    grid-template-columns: 2.5rem 1fr;
  }

  .activity-item > span:last-child {
    grid-column: 2;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer__status {
    white-space: normal;
  }

  .command-palette footer span:last-child {
    display: none;
  }

  .atlas-form-feedback {
    align-items: stretch;
    flex-direction: column;
  }

  .atlas-form-feedback button {
    width: 100%;
    min-height: 44px;
  }

  .location-facts__heading button,
  .person-dossier__edit,
  .person-dossier__graph-back {
    min-height: 44px;
  }

  #person-content > header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .person-graph-overview__header {
    align-items: flex-start;
  }

  .person-graph-overview__count {
    width: 100%;
    margin: 0;
  }

  .person-dossier__actions {
    width: 100%;
    margin-left: 0;
  }

  .person-dossier__actions > button {
    flex: 1 1 0;
  }

  .atlas-workbench {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border: 0;
  }

  .atlas-workbench__header {
    padding: 0.8rem;
  }

  .atlas-workbench__header p:last-child {
    display: none;
  }

  .atlas-workbench__tabs {
    padding-inline: 0;
  }

  .atlas-workbench__tabs button {
    min-width: 0;
    min-height: 44px;
    flex: 1;
    padding-inline: 0.35rem;
  }

  .atlas-workbench__body {
    position: relative;
    display: block;
    overflow: hidden;
  }

  .atlas-workbench__index,
  .atlas-workbench__editor {
    position: absolute;
    inset: 0;
  }

  .atlas-workbench__index {
    border-right: 0;
  }

  .atlas-workbench__editor {
    padding: 0.8rem;
    background: var(--surface-solid);
    transform: translateX(102%);
    transition: transform 180ms ease;
  }

  .atlas-workbench__body[data-editor-active="true"] .atlas-workbench__editor {
    transform: translateX(0);
  }

  .atlas-workbench__body[data-editor-active="true"] .atlas-workbench__index {
    visibility: hidden;
  }

  .atlas-workbench__index-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .atlas-workbench__index-tools input,
  .atlas-workbench__index-tools button,
  .atlas-workbench__list-item {
    min-height: 44px;
  }

  .atlas-record-form > header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .atlas-record-form__back {
    grid-column: 1 / -1;
    width: max-content;
    min-height: 44px;
    display: block;
    padding: 0 0.65rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted-strong);
  }

  .atlas-record-form__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .atlas-record-form__wide {
    grid-column: 1;
  }

  .atlas-record-form input,
  .atlas-record-form select {
    min-height: 44px;
  }

  .atlas-record-form > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .atlas-record-form > footer > span {
    display: none;
  }

  .atlas-record-form > footer button,
  .atlas-record-form__feedback button {
    width: 100%;
    min-height: 44px;
  }

  .atlas-workbench__status {
    min-height: 2.75rem;
  }
}

.map-stage[data-map-density="compact"] .map-pin__face,
.map-stage[data-map-density="compact"] .map-pin--custom .map-pin__face {
  width: 1.9rem;
  height: 1.9rem;
}

.map-stage[data-map-density="compact"] .map-pin.is-selected .map-pin__face {
  width: 2.05rem;
  height: 2.05rem;
}

@media (max-width: 640px) {
  .atlas-view-switchbar {
    min-height: 3.65rem;
    padding-inline: 0.65rem;
  }

  .atlas-map-trail {
    font-size: 0.62rem;
  }

  .atlas-map-trail button {
    max-width: 7.5rem;
    padding-inline: 0.35rem;
  }

  .atlas-view-close {
    min-height: 2.75rem;
    padding-inline: 0.6rem;
    font-size: 0.62rem;
  }

  .atlas-layout[data-atlas-view="dossier"][data-map-focus="compact"] .atlas-visuals {
    min-height: 0;
  }

  .atlas-layout[data-atlas-view="dossier"][data-map-focus="compact"] .atlas-visuals > .map-stage {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  .atlas-layout[data-atlas-view="dossier"][data-map-focus="compact"] .location-scene {
    min-height: 0;
  }

  .atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .atlas-visuals,
  .atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .atlas-visuals > .map-stage {
    min-height: clamp(30rem, 70svh, 42rem);
  }

  .atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .location-scene {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  .map-place-dock {
    position: fixed;
    z-index: 39;
    right: 0.65rem;
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px) + 0.65rem);
    left: 0.65rem;
    grid-template-columns: 4.6rem minmax(0, 1fr);
  }

  .map-place-dock__image img {
    min-height: 4.5rem;
  }

  .map-place-dock__actions {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .town-map-inset {
    position: static;
    width: 100%;
    margin-top: 0.7rem;
    grid-template-columns: 4.8rem minmax(0, 1fr);
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .map-place-dock {
    position: fixed;
    z-index: 39;
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px) + 0.75rem);
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    max-width: 46rem;
  }
}

@media (max-width: 360px) {
  .atlas-map-trail button {
    max-width: 6.35rem;
  }

  .atlas-view-switchbar__actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
  }
}

/* 非画布控件统一保留至少 44px 的触控面积；地图图钉与局部图热点维持各自缩放逻辑。 */
.brand,
.site-nav a,
.icon-button,
.button,
.filter-chip,
.zoom-controls button,
.atlas-editor-tools button,
.location-editor-actions button,
.location-directory__header button,
.location-directory__empty button,
.location-scene__nav button,
.local-map-controls button,
.location-media-tabs button,
.map-focus-toggle,
.atlas-map-trail button,
.map-place-dock__actions button,
.town-map-inset,
.atlas-view-close,
.location-panel__suggestion button,
.bookmark-button,
.location-facts__heading button,
.person-dossier__facts button,
.person-dossier__edit,
#unplaced-list button,
.segmented button,
.law-tabs button,
.text-button,
.atlas-dialog header > button,
.atlas-dialog form > footer button,
.atlas-review-item button,
.atlas-form-feedback button,
.atlas-workbench__header > button,
.atlas-workbench__tabs button,
.atlas-workbench__index-tools button,
.atlas-record-form__feedback button,
.atlas-record-form > footer button,
.command-palette header button {
  min-height: 2.75rem;
}

.bookmark-button,
.atlas-dialog header > button,
.atlas-workbench__header > button,
.command-palette header button {
  min-width: 2.75rem;
}

/* 桌边浏览时，说明文字不再收缩成难以辨认的 8–10px 微型字。 */
.brand small,
.rail a span,
.eyebrow,
.kicker,
.hero__heading p,
.hero__metrics dd,
.hero__map-label,
.hero__map-action,
.atlas-editor-tools button,
.location-editor-actions button,
.location-directory__summary,
.location-directory__item small,
.atlas-map-trail,
.atlas-view-close,
.person-index-item small,
.person-index-item em,
.person-dossier__meta,
.person-dossier__aliases,
.person-dossier__facts dt,
.person-dossier__source,
.relation-list small,
.tool-card__seal,
.activity-item small,
.atlas-workbench__status,
.atlas-record-form__feedback,
.atlas-form-feedback {
  font-size: var(--micro-text);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(longtide-content),
  ::view-transition-new(longtide-content),
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}

/* --------------------------------------------------------------------------
   Atlas workspace v2 — one bounded stage, one view switch, one detail surface
   -------------------------------------------------------------------------- */

.section--atlas {
  --atlas-brass: var(--lt-brass-bright, var(--copper-300));
  --atlas-sea: var(--lt-sea-900, var(--ink-900));
  --atlas-sea-raised: var(--lt-sea-850, var(--ink-850));
  --atlas-paper: var(--lt-paper-100, var(--paper-50));
  --atlas-text-soft: var(--lt-text-soft, var(--muted-strong));
  --atlas-divider: var(--lt-divider, var(--border));
  --atlas-divider-strong: var(--lt-divider-strong, var(--border-strong));
}

.atlas-toolbar {
  border: 0;
  border-radius: var(--lt-radius-md, 0.5rem);
  background: color-mix(in srgb, var(--lt-sea-900, #0a1719) 92%, transparent);
  box-shadow:
    inset 0 0 0 1px var(--atlas-divider),
    0 0.8rem 2rem rgba(0, 0, 0, 0.18);
}

.location-directory-trigger,
.filter-chip,
.zoom-controls button,
.zoom-controls output,
.atlas-editor-tools button,
.atlas-data-status {
  font-size: max(var(--lt-text-sm, 0.875rem), 14px);
}

.location-directory__header .kicker,
.location-directory__summary,
.location-directory__copy > span,
.location-directory__copy small,
.location-directory__empty p,
.map-tooltip p,
.map-tooltip small,
.scene-cg__status,
.scene-cg__fallback p,
.scene-cg figcaption small,
.local-map-card__note,
.local-map-legend,
.local-map-art__fallback p,
.local-map-hotspot span,
.local-map-feature small,
.local-map-feature p,
.map-stage__hint,
.map-placement-hint,
.map-pin__face,
.map-pin--custom .map-pin__face,
.map-pin-cluster > span,
.map-pin__face[data-nearby-count]::before {
  font-size: max(var(--lt-text-xs, 0.75rem), 12px);
}

.location-directory__empty button {
  font-size: max(var(--lt-text-sm, 0.875rem), 14px);
}

.atlas-layout {
  min-height: 0;
  overflow: clip;
  border: 0;
  border-radius: var(--lt-radius-md, 0.5rem);
  background: var(--atlas-sea);
  box-shadow:
    inset 0 0 0 1px var(--atlas-divider),
    var(--lt-shadow-float, var(--shadow-soft));
}

.atlas-visuals {
  min-height: 0;
  height: 100%;
  background:
    radial-gradient(circle at 30% 15%, rgba(121, 169, 159, 0.08), transparent 42%),
    var(--lt-sea-950, #071214);
}

.atlas-view-switchbar {
  position: relative;
  top: auto;
  grid-template-columns: minmax(8rem, 1fr) auto auto;
  min-height: 4.25rem;
  padding: 0.5rem 0.6rem 0.5rem 0.9rem;
  border-bottom: 1px solid var(--atlas-divider);
  background: color-mix(in srgb, var(--lt-sea-950, #071214) 94%, transparent);
  box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.12);
}

.atlas-view-switchbar__context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.atlas-view-switchbar__context > span {
  flex: 0 0 auto;
  color: var(--atlas-brass);
  font-size: var(--lt-text-xs, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.atlas-current-place {
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: grid;
  min-inline-size: 0;
  align-content: center;
  justify-items: start;
  padding: 0.25rem 0.55rem;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--atlas-paper);
  text-align: left;
  cursor: pointer;
  font-size: max(var(--lt-text-sm, 0.875rem), 14px);
}

.atlas-current-place span,
.atlas-current-place small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-current-place span {
  font-family: var(--font-serif);
  font-size: var(--lt-text-base, 0.9375rem);
}

.atlas-current-place small {
  color: var(--lt-text-muted, var(--muted));
  font-size: var(--lt-text-xs, 0.75rem);
}

.atlas-current-place:hover:not(:disabled),
.atlas-current-place:focus-visible {
  color: var(--atlas-brass);
}

.atlas-current-place:disabled {
  cursor: default;
  opacity: 1;
}

.atlas-view-segmented {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(5rem, 1fr));
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--atlas-divider-strong);
  border-radius: var(--lt-radius-sm, 0.25rem);
  background: rgba(255, 255, 255, 0.025);
}

.atlas-view-segmented > .location-media-tabs {
  display: contents;
  margin: 0;
  border: 0;
}

.atlas-view-segmented button {
  min-width: 5rem;
  min-height: 2.75rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.05rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-left: 1px solid var(--atlas-divider);
  background: transparent;
  color: var(--atlas-text-soft);
  font-size: var(--lt-text-sm, 0.875rem);
  cursor: pointer;
  transition:
    background var(--lt-motion-fast, 150ms) ease,
    color var(--lt-motion-fast, 150ms) ease;
}

.atlas-view-segmented button:first-child {
  border-left: 0;
}

.atlas-view-segmented button small {
  color: var(--lt-text-muted, var(--muted));
  font-size: var(--lt-text-xs, 0.75rem);
  font-weight: 400;
  white-space: nowrap;
}

.atlas-view-segmented button:hover:not(:disabled),
.atlas-view-segmented button:focus-visible {
  background: rgba(224, 184, 116, 0.08);
  color: var(--atlas-paper);
}

.atlas-view-segmented button.is-active,
.atlas-view-segmented button[aria-pressed="true"],
.atlas-view-segmented button:disabled {
  background: rgba(199, 154, 88, 0.18);
  color: var(--atlas-brass);
  cursor: default;
  opacity: 1;
}

.atlas-view-segmented button.is-active small,
.atlas-view-segmented button[aria-pressed="true"] small,
.atlas-view-segmented button:disabled small {
  color: var(--lt-paper-300, var(--paper-200));
}

.atlas-view-close {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  border-radius: var(--lt-radius-sm, 0.25rem);
  background: transparent;
  font-size: var(--lt-text-sm, 0.875rem);
}

.atlas-view-close:hover,
.atlas-view-close:focus-visible {
  background: rgba(255, 255, 255, 0.055);
}

.atlas-visuals > .map-stage,
.atlas-visuals > .location-scene {
  min-height: 0;
  transition:
    opacity var(--lt-motion-page, 220ms) ease,
    transform var(--lt-motion-page, 220ms) var(--lt-ease-out, cubic-bezier(0.22, 1, 0.36, 1)),
    visibility 0s linear;
  will-change: opacity, transform;
}

.atlas-layout[data-atlas-view="dossier"][data-map-focus="compact"] .atlas-visuals > .map-stage,
.atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .location-scene {
  clip-path: none;
  transition-delay: 0s;
}

.atlas-layout[data-atlas-view="dossier"][data-map-focus="compact"] .location-scene,
.atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .atlas-visuals > .map-stage {
  clip-path: none;
  transition-delay: 0s;
}

.map-stage {
  min-height: 0;
  background: var(--lt-sea-950, #071214);
}

.map-stage__hint,
.map-placement-hint {
  border: 0;
  border-radius: var(--lt-radius-sm, 0.25rem);
  background: var(--lt-glass, rgba(7, 18, 20, 0.82));
  box-shadow: inset 0 0 0 1px var(--atlas-divider);
  font-size: var(--lt-text-xs, 0.75rem);
}

.map-viewport.is-flying .map-canvas {
  transition-duration: var(--lt-motion-page, 220ms);
}

.map-pin__face,
.map-pin--custom .map-pin__face {
  font-size: var(--lt-text-xs, 0.75rem);
}

.location-scene {
  min-height: 0;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(121, 169, 159, 0.06), transparent 32%),
    var(--atlas-sea);
  overscroll-behavior: contain;
}

.location-scene__bar {
  min-height: 3.75rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  background: color-mix(in srgb, var(--lt-sea-900, #0a1719) 94%, transparent);
}

.location-scene__bar h3 {
  font-size: var(--lt-title-sm, clamp(1.45rem, 1.24rem + 0.72vw, 2rem));
}

.location-scene__nav button,
.local-map-controls button,
.local-map-controls output {
  min-width: 2.75rem;
  min-height: 2.75rem;
  font-size: var(--lt-text-sm, 0.875rem);
}

.town-map-inset {
  position: static;
  z-index: 2;
  top: auto;
  right: auto;
  width: min(8.7rem, 100%);
  margin: 0;
  border: 0;
  border-radius: var(--lt-radius-sm, 0.25rem);
  background: var(--lt-glass, rgba(7, 18, 20, 0.82));
  box-shadow:
    inset 0 0 0 1px var(--atlas-divider-strong),
    0 0.65rem 1.5rem rgba(0, 0, 0, 0.2);
}

.town-map-inset small,
.town-map-inset strong,
.scene-cg__status,
.scene-cg figcaption small,
.local-map-card__note,
.local-map-legend,
.local-map-feature p {
  font-size: var(--lt-text-xs, 0.75rem);
}

.town-map-inset strong,
.scene-cg figcaption p,
.local-map-feature strong {
  font-size: var(--lt-text-sm, 0.875rem);
}

.scene-cg__frame,
.local-map-viewport {
  border: 0;
  border-radius: var(--lt-radius-sm, 0.25rem);
  box-shadow:
    inset 0 0 0 1px rgba(231, 216, 181, 0.42),
    var(--lt-shadow-paper, 0 0.9rem 2.5rem rgba(0, 0, 0, 0.22));
}

.local-map-card {
  margin-top: 1rem;
  padding-top: 0;
  border-top: 0;
}

.map-place-dock {
  overflow: hidden;
  border: 0;
  border-radius: var(--lt-radius-md, 0.5rem);
  background: color-mix(in srgb, var(--lt-sea-950, #071214) 94%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(224, 184, 116, 0.34),
    var(--lt-shadow-float, 0 1.5rem 4rem rgba(0, 0, 0, 0.34));
  animation-duration: var(--lt-motion-page, 220ms);
}

.map-place-dock__copy {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.map-place-dock__copy:hover,
.map-place-dock__copy:focus-visible {
  background: rgba(224, 184, 116, 0.07);
}

.map-place-dock__copy small,
.map-place-dock__copy span {
  font-size: var(--lt-text-xs, 0.75rem);
}

.map-place-dock__copy strong {
  font-size: var(--lt-text-base, 0.9375rem);
}

.map-place-dock__actions button {
  min-height: 2.75rem;
  font-size: var(--lt-text-sm, 0.875rem);
}

.location-panel {
  min-height: 0;
  height: 100%;
  padding: 1.25rem;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, rgba(199, 154, 88, 0.045), transparent 14rem),
    var(--lt-sea-850, var(--surface-solid));
  border-left: 1px solid var(--atlas-divider);
  scrollbar-color: var(--atlas-divider-strong) transparent;
}

.location-sheet-controls {
  display: none;
}

.location-panel__content h3 {
  font-size: clamp(1.75rem, 2.2vw, 2.35rem);
}

.location-panel__category,
.location-panel__en,
.location-panel__source,
.location-panel__use small,
.tag-list span,
.compact-heading span,
.location-fact > div,
.location-fact__source,
.location-facts__empty {
  font-size: max(var(--lt-text-xs, 0.75rem), 12px);
}

.location-panel__summary {
  font-size: var(--lt-text-lg, 1.0625rem);
}

.location-panel__content > p:not(.location-panel__category, .location-panel__en, .location-panel__summary),
.location-panel__use p,
.location-fact p {
  font-size: var(--lt-text-sm, 0.875rem);
}

.location-fact h5 {
  font-size: var(--lt-text-base, 0.9375rem);
}

.location-fact {
  padding: 0.75rem 0.75rem 0.8rem;
  border: 0;
  border-radius: var(--lt-radius-sm, 0.25rem);
  background: rgba(255, 255, 255, 0.028);
  box-shadow: inset 2px 0 0 rgba(224, 184, 116, 0.26);
}

.location-fact[data-fact-collapsed="true"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  box-shadow: none;
}

.location-facts__heading button,
.location-fact__edit {
  min-height: 2.75rem;
  padding-inline: 0.7rem;
  border: 0;
  border-radius: var(--lt-radius-sm, 0.25rem);
  background: rgba(255, 255, 255, 0.04);
  color: var(--atlas-text-soft);
  font-size: max(var(--lt-text-sm, 0.875rem), 14px);
}

#toggle-location-facts[aria-expanded="true"] {
  color: var(--atlas-brass);
}

@media (min-width: 901px) {
  .atlas-layout {
    height: min(58rem, calc(100dvh - var(--topbar-height) - 1rem));
    grid-template-rows: minmax(0, 1fr);
  }

  .atlas-layout > .atlas-visuals,
  .atlas-layout > .location-panel {
    height: 100%;
    min-height: 0;
  }

  .atlas-visuals > .map-stage,
  .atlas-visuals > .location-scene {
    min-height: 0;
  }
}

@media (max-width: 1180px) {
  .atlas-view-switchbar {
    grid-template-columns: minmax(6.5rem, 1fr) auto auto;
  }

  .atlas-view-switchbar__context > span,
  .atlas-view-segmented button small {
    display: none;
  }

  .atlas-view-segmented {
    grid-template-columns: repeat(3, minmax(4rem, 1fr));
  }

  .atlas-view-segmented button {
    min-width: 4rem;
  }
}

@media (max-width: 900px) {
  .section--atlas {
    position: relative;
  }

  .atlas-layout {
    height: calc(100svh - var(--topbar-height) - 4.75rem - var(--safe-bottom));
    min-height: 30rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .atlas-visuals,
  .atlas-visuals > .map-stage,
  .atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .atlas-visuals,
  .atlas-layout[data-atlas-view="dossier"][data-map-focus="expanded"] .atlas-visuals > .map-stage {
    height: 100%;
    min-height: 0;
  }

  .atlas-view-switchbar {
    grid-template-columns: minmax(5rem, 1fr) auto auto;
    min-height: 3.75rem;
    padding: 0.35rem 0.4rem 0.35rem 0.65rem;
  }

  .atlas-current-place {
    max-width: 8rem;
  }

  .atlas-current-place small,
  .atlas-view-close span:last-child {
    display: none;
  }

  .atlas-view-segmented {
    grid-template-columns: repeat(3, minmax(3.35rem, 1fr));
  }

  .atlas-view-segmented button {
    min-width: 3.35rem;
    padding-inline: 0.4rem;
  }

  .location-scene {
    min-height: 0;
    overflow: auto;
    padding-bottom: 5rem;
  }

  .location-scene__bar {
    grid-template-columns: minmax(0, 1fr) 2.75rem auto;
  }

  .location-scene__bar > .town-map-inset {
    width: 2.75rem;
    min-width: 2.75rem;
    grid-template-columns: 1fr;
    padding: 0.25rem;
  }

  .location-scene__bar > .town-map-inset > span:last-child {
    display: none;
  }

  .location-scene__bar > .town-map-inset .town-map-inset__map {
    height: 2.2rem;
  }

  .atlas-layout[data-atlas-view="overview"] > .location-panel {
    display: none;
  }

  .atlas-layout[data-atlas-view="dossier"] > .location-panel {
    --sheet-visible: 3.75rem;
    position: fixed;
    z-index: 38;
    right: max(0.5rem, var(--safe-right));
    bottom: calc(4rem + var(--safe-bottom));
    left: max(0.5rem, var(--safe-left));
    width: auto;
    height: calc(100svh - var(--topbar-height) - 4.5rem - var(--safe-bottom));
    max-height: none;
    padding: 0 1rem 1rem;
    overflow-y: auto;
    border: 0;
    border-radius: var(--lt-radius-md, 0.5rem) var(--lt-radius-md, 0.5rem) 0 0;
    background: color-mix(in srgb, var(--lt-sea-850, #0d1c1f) 97%, transparent);
    box-shadow:
      inset 0 0 0 1px var(--atlas-divider-strong),
      0 -1.2rem 3.5rem rgba(0, 0, 0, 0.4);
    transform: translateY(calc(100% - var(--sheet-visible)));
    transition: transform var(--lt-motion-page, 220ms) var(--lt-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  }

  .atlas-layout[data-location-sheet="half"] > .location-panel {
    --sheet-visible: min(48svh, 28rem);
  }

  .atlas-layout[data-location-sheet="full"] > .location-panel {
    --sheet-visible: 100%;
  }

  .location-sheet-controls {
    position: sticky;
    z-index: 4;
    top: 0;
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-inline: -1rem;
    padding: 0.45rem 0.65rem 0.45rem 0.85rem;
    background: color-mix(in srgb, var(--lt-sea-850, #0d1c1f) 97%, transparent);
    border-bottom: 1px solid var(--atlas-divider);
    backdrop-filter: blur(16px);
  }

  .location-sheet-controls__handle {
    width: 2.25rem;
    height: 0.22rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--atlas-divider-strong);
  }

  .location-sheet-controls > div {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    border-radius: var(--lt-radius-sm, 0.25rem);
    background: rgba(255, 255, 255, 0.035);
  }

  .location-sheet-controls button {
    min-width: 3.3rem;
    min-height: 2.75rem;
    padding-inline: 0.55rem;
    border: 0;
    border-left: 1px solid var(--atlas-divider);
    background: transparent;
    color: var(--atlas-text-soft);
    font-size: var(--lt-text-sm, 0.875rem);
    cursor: pointer;
  }

  .location-sheet-controls button:first-child {
    border-left: 0;
  }

  .location-sheet-controls button[aria-pressed="true"] {
    background: rgba(199, 154, 88, 0.18);
    color: var(--atlas-brass);
  }

  .location-panel__content,
  .location-panel__empty {
    padding-top: 1rem;
  }

  .map-place-dock {
    bottom: calc(4rem + var(--safe-bottom) + 3.75rem);
    transition:
      opacity var(--lt-motion-fast, 150ms) ease,
      transform var(--lt-motion-page, 220ms) var(--lt-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
  }

  .atlas-layout:is([data-location-sheet="half"], [data-location-sheet="full"]) > .map-place-dock {
    opacity: 0;
    transform: translateY(0.65rem);
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .atlas-toolbar {
    border-radius: var(--lt-radius-sm, 0.25rem);
  }

  .atlas-view-switchbar__context > span {
    display: none;
  }

  .atlas-current-place {
    max-width: 5.4rem;
    padding-inline: 0.25rem;
  }

  .atlas-current-place span,
  .atlas-current-place small {
    font-size: var(--lt-text-xs, 0.75rem);
  }

  .atlas-view-segmented button,
  .atlas-view-close {
    font-size: var(--lt-text-sm, 0.875rem);
  }

  .atlas-view-segmented {
    grid-template-columns: repeat(3, minmax(2.9rem, 1fr));
  }

  .atlas-view-segmented button {
    min-width: 2.9rem;
    padding-inline: 0.3rem;
  }

  .map-place-dock {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  }

  .map-place-dock__actions {
    grid-column: auto;
    grid-template-columns: 1fr;
    border-top: 0;
    border-left: 1px solid var(--atlas-divider);
  }

  .map-place-dock__actions button {
    min-width: 4.8rem;
    padding-inline: 0.45rem;
  }

  .map-place-dock__image img {
    min-height: 5.25rem;
  }

  .town-map-inset {
    width: 100%;
  }

  .location-facts__heading {
    align-items: center;
  }

  .location-facts__heading h4 {
    flex-basis: calc(100% - 7rem);
  }
}

/* Final atlas legibility floor: later than all responsive overrides. */
.location-directory__header .kicker,
.location-directory__summary,
.location-directory__marker,
.location-directory__copy > span,
.location-directory__copy small,
.location-directory__arrow,
.location-directory__empty p,
.atlas-view-switchbar__context > span,
.atlas-current-place small,
.atlas-view-segmented button small,
.map-stage__hint,
.map-placement-hint,
.map-pin__face,
.map-pin--custom .map-pin__face,
.map-pin-cluster > span,
.map-pin__face[data-nearby-count]::before,
.town-map-inset small,
.scene-cg__status,
.scene-cg figcaption small,
.local-map-card__note,
.local-map-legend,
.local-map-feature p,
.map-place-dock__copy small,
.map-place-dock__copy span,
.location-panel__category,
.location-panel__en,
.location-panel__source,
.location-panel__use small,
.tag-list span,
.compact-heading span,
.location-fact > div,
.location-fact > div small,
.location-fact__source,
.location-facts__empty {
  font-size: max(var(--lt-text-xs, 0.75rem), 12px);
}

.location-directory-trigger,
.location-directory__search input,
.location-directory__empty button,
.filter-chip,
.zoom-controls button,
.zoom-controls output,
.atlas-editor-tools button,
.atlas-view-segmented button,
.atlas-view-close,
.atlas-current-place,
.location-scene__nav button,
.local-map-controls button,
.local-map-controls output,
.map-place-dock__actions button,
.location-sheet-controls button,
.location-facts__heading button,
.location-fact__edit {
  font-size: max(var(--lt-text-sm, 0.875rem), 14px);
}
