.map-page {
  color-scheme: light;
  --map-ink: #202b36;
  --map-muted: #5c6978;
  --map-line: #dce2e8;
  --map-accent: var(--blue-fr, #2f67ff);
  --map-paper: #fff;
  color: var(--map-ink);
  background: #e8eef1;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-page::before { display: none; }
.map-page.map-embed > .site-header, .map-page.map-embed > .skip-link { display: none; }
.map-page .site-header { flex: 0 0 auto; z-index: 1100; color: var(--ink); }
.map-page .header-shell { width: calc(100% - 40px); max-width: none; min-height: 70px; grid-template-columns: 1fr auto auto; }
.map-header-label { display: inline-flex; align-items: center; gap: 8px; color: #d3dce8; font-size: 12px; }
.map-header-label svg { width: 16px; height: 16px; }
.map-page .nav-toggle { justify-self: end; }
.map-page .primary-nav { max-height: calc(100dvh - 96px); overflow-y: auto; }
.map-app { position: relative; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(260px, 22%) minmax(0, 1fr); background: #e8eef1; }
.map-app:fullscreen { width: 100vw; height: 100dvh; }
.map-app.has-detail .map-sidebar { display: none; }
.map-app.has-detail .map-detail { grid-column: 1; grid-row: 1; border-left: 0; border-right: 1px solid var(--map-line); }
.map-app.has-detail .map-stage { grid-column: 2; grid-row: 1; }
.map-app :is(h1,h2,h3,p,figure) { margin: 0; }
.map-app :is(button,input,select,textarea) { font: inherit; }
.map-app :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid var(--map-accent); outline-offset: 3px; }
.map-app :is(button,input,select,textarea) { letter-spacing: 0; }
.map-app button { cursor: pointer; }
.map-app button:disabled { opacity: .48; cursor: wait; }
.map-app svg { width: 18px; height: 18px; flex-shrink: 0; }
.map-app a { text-underline-offset: 3px; }
.map-icon-button { width: 38px; height: 38px; flex: 0 0 38px; padding: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--map-ink); background: transparent; border: 0; border-radius: 5px; text-decoration: none; }
.map-icon-button:hover { background: #edf2ff; color: #1f50d6; }
.map-icon-button:active { background: #dce7ff; }
.map-button { min-height: 40px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--map-line); border-radius: 5px; padding: 9px 13px; background: white; color: var(--map-ink); font-size: 13px; font-weight: 650; text-decoration: none; }
.map-button:hover { background: #eef3ff; border-color: #a7bef5; }
.map-button.map-primary { background: var(--map-accent); border-color: var(--map-accent); color: white; }
.map-button.map-primary:hover { background: #2455da; }
.map-text-button { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 3px 0; background: transparent; color: #2455ce; font-size: 12px; font-weight: 650; text-align: left; text-decoration: none; }
.map-text-button:hover { text-decoration: underline; }
.map-danger, .map-button.map-danger { color: #ae3040; }
.map-muted { color: var(--map-muted); font-size: 12px; line-height: 1.6; }
.map-eyebrow { display: block; font-size: 10px; font-weight: 750; color: var(--map-muted); letter-spacing: 0; }
.map-sidebar { min-height: 0; display: flex; flex-direction: column; background: rgba(255,255,255,.97); border-right: 1px solid var(--map-line); z-index: 800; }
.map-sidebar-heading { padding: 22px 20px 16px; display: flex; align-items: center; justify-content: space-between; }
.map-app h1 { font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif; color: var(--map-ink); font-size: 25px; line-height: 1.3; letter-spacing: 0; margin: 3px 0 0; }
.map-search-form { position: relative; margin: 0 18px 16px; }
.map-search-form > svg { position: absolute; top: 12px; left: 11px; width: 16px; height: 16px; color: var(--map-muted); }
.map-search-form input { width: 100%; min-height: 40px; padding: 9px 10px 9px 35px; border: 1px solid #cfd8e1; border-radius: 5px; background: #f7f9fb; color: var(--map-ink); font-size: 13px; }
.map-active-filter { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: -5px 18px 10px; font-size: 12px; color: #2455ce; }
.map-active-filter > span { overflow-wrap: anywhere; }
.map-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--map-line); padding: 0 18px; }
.map-tabs button { min-height: 42px; border: 0; border-bottom: 2px solid transparent; color: var(--map-muted); background: transparent; font-size: 13px; font-weight: 650; }
.map-tabs button[aria-selected="true"] { color: #2455ce; border-bottom-color: var(--map-accent); }
.map-tabs button span { font-size: 11px; margin-left: 5px; }
.map-sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 18px; }
.map-fields { display: grid; gap: 12px; }
.map-field { display: grid; gap: 5px; min-width: 0; color: var(--map-ink); font-size: 12px; font-weight: 650; }
.map-field :is(input,select,textarea) { width: 100%; min-width: 0; min-height: 38px; border: 1px solid #cbd5df; border-radius: 4px; background: white; color: var(--map-ink); padding: 8px 10px; font-size: 13px; font-weight: 400; }
.map-field textarea { min-height: 84px; resize: vertical; }
.map-field input[type="color"] { width: 44px; padding: 4px; }
.map-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 10px; }
.map-section-heading h2 { font-size: 13px; font-weight: 750; }
.map-section-heading > div { font-size: 11px; color: var(--map-muted); white-space: nowrap; }
.map-categories { display: grid; gap: 2px; }
.map-category { display: flex; align-items: center; gap: 9px; padding: 9px 7px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.map-category:hover { background: #f1f5fa; }
.map-category { margin-left: min(calc(var(--category-depth, 0) * 12px), 48px); }
.map-category input, .map-checkbox input { flex-shrink: 0; width: 15px; height: 15px; margin: 0; accent-color: var(--map-accent); }
.map-category-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.map-category-count { color: var(--map-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.map-category-count span { color: #176347; }
.map-category-swatch { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--category-color, #2f67ff); }
.map-category svg { width: 16px; height: 16px; }
.map-filter-details { border-top: 1px solid var(--map-line); margin-top: 18px; padding-top: 14px; }
.map-filter-details summary { font-size: 12px; font-weight: 650; cursor: pointer; }
.map-filter-details .map-fields { margin-top: 12px; }
.map-reset { margin-top: 14px; }
.map-reset svg { width: 14px; height: 14px; }
.map-progress { border-bottom: 1px solid var(--map-line); margin-bottom: 18px; padding-bottom: 15px; }
.map-progress .map-section-heading { margin-top: 0; }
.map-progress .map-section-heading svg { color: #208064; width: 16px; height: 16px; }
.map-progress-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; font-size: 12px; color: var(--map-muted); }
.map-progress-total strong { font-size: 24px; color: var(--map-ink); font-variant-numeric: tabular-nums; }
#map-progress-percent { margin-left: auto; font-size: 11px; color: #176347; }
.map-progress-categories { display: grid; gap: 7px; margin: 12px 0; }
.map-progress-category { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.map-progress-category > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.map-progress-category > span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; color: #176347; }
.map-progress progress { appearance: none; display: block; width: 100%; height: 5px; border: 0; border-radius: 2px; overflow: hidden; margin: 10px 0 16px; background: #e9eef0; }
.map-progress progress::-webkit-progress-bar { background: #e9eef0; }
.map-progress progress::-webkit-progress-value { background: #208064; }
.map-progress progress::-moz-progress-bar { background: #208064; }
.map-checkbox { display: flex; align-items: center; gap: 9px; font-size: 12px; cursor: pointer; }
.map-progress .map-muted { margin-top: 10px; }
.map-progress > .map-text-button { display: flex; width: fit-content; margin-top: 7px; }
.map-progress > .map-danger { margin-top: 11px; font-size: 11px; }
.map-sidebar-footer { display: grid; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--map-line); }
.map-sidebar-footer > a { justify-content: center; }
.map-result-list { display: grid; margin: 10px -4px; }
.map-search-entities { display: grid; gap: 5px; margin-top: 10px; }
.map-search-entities:empty { display: none; }
.map-entity { display: flex; align-items: center; gap: 8px; border: 0; border-left: 2px solid #2f67ff; border-radius: 0; background: #edf3ff; color: #2455ce; padding: 9px; text-align: left; font-size: 12px; }
.map-entity span { min-width: 0; overflow-wrap: anywhere; }
.map-entity small { display: block; color: var(--map-muted); font-size: 10px; }
.map-result { display: grid; grid-template-columns: 30px minmax(0,1fr) 16px; align-items: center; gap: 8px; padding: 13px 4px; border: 0; border-bottom: 1px solid #e7ebf0; border-radius: 0; color: var(--map-ink); text-align: left; background: transparent; }
.map-result:hover { background: #eff4ff; }
.map-result strong { display: block; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.map-result small { display: block; color: var(--map-muted); font-size: 11px; margin-top: 2px; overflow-wrap: anywhere; }
.map-result > svg { width: 15px; height: 15px; color: var(--map-muted); }
.map-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; }
.map-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #dbe8ea; }
#aniimo-map { position: absolute; inset: 0; background: #dbe8ea; font-family: inherit; }
#aniimo-map .leaflet-image-layer { max-width: none; }
#aniimo-map .leaflet-control-attribution { font-size: 9px; color: #3e5661; background: rgba(255,255,255,.86); }
.map-toolbar { position: absolute; top: 16px; right: 16px; display: grid; gap: 10px; z-index: 500; }
.map-tool-group { display: grid; padding: 3px; border: 1px solid rgba(80,101,115,.2); border-radius: 6px; background: rgba(255,255,255,.97); box-shadow: 0 2px 9px #123d4a18; }
.map-tool-group .map-icon-button + .map-icon-button { border-top: 1px solid #edf0f3; border-radius: 0; }
.map-status { position: absolute; left: 14px; bottom: 27px; z-index: 500; max-width: calc(100% - 28px); display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: rgba(255,255,255,.97); border: 1px solid rgba(80,101,115,.2); border-radius: 5px; color: var(--map-ink); font-size: 12px; box-shadow: 0 2px 9px #123d4a12; }
.map-status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #218369; }
.map-status.is-loading .map-status-dot { background: #2f67ff; animation: map-pulse 1s ease-in-out infinite; }
.map-status.is-error .map-status-dot { background: #c63d4e; }
.map-status-text { overflow-wrap: anywhere; }
.map-status .map-text-button { flex-shrink: 0; }
.map-notice { position: absolute; z-index: 550; left: 24px; right: 84px; top: 24px; max-width: 460px; padding: 18px; background: white; border-left: 3px solid #bd4050; border-radius: 4px; box-shadow: 0 2px 12px #20394b20; }
.map-notice > svg { color: #bd4050; margin-bottom: 8px; }
.map-notice strong { display: block; font-size: 15px; }
.map-notice p { margin-top: 6px; font-size: 12px; color: var(--map-muted); }
.map-coordinates { position: absolute; bottom: 3px; left: 12px; color: #253d47; background: #ffffffd9; padding: 0 5px; font: 10px/1.6 Consolas, monospace; z-index: 450; }
.map-pin { background: transparent; border: 0; }
.map-pin-body { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid white; border-radius: 50% 50% 50% 6px; transform: rotate(-45deg); color: white; background: var(--category-color, #2f67ff); box-shadow: 0 2px 6px #15263870; }
.map-pin-body svg { transform: rotate(45deg); width: 16px; height: 16px; stroke-width: 2.4px; }
.map-pin.is-found .map-pin-body { background: #287c63; }
.map-pin.is-inactive .map-pin-body { opacity: .65; border-style: dashed; }
.map-pin:focus-visible { outline: 3px solid #fff; outline-offset: 5px; }
.map-cluster { display: grid; place-items: center; background: #fff; color: #244fc0; border: 3px solid #2f67ff; border-radius: 50%; box-shadow: 0 2px 8px #182f4a55; font-size: 13px; font-weight: 750; }
.map-selected-dot { background: transparent; border: 3px solid #ff5757; border-radius: 50%; box-shadow: 0 0 0 5px #fff9; }
.map-mode-bar { position: absolute; top: 16px; left: 16px; right: 76px; display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 550; padding: 11px 13px; background: #fff; border-left: 3px solid var(--map-accent); border-radius: 4px; font-size: 12px; box-shadow: 0 2px 12px #102d4e33; }
.map-mode-bar button { flex-shrink: 0; }
.map-mode-bar > span { flex: 1; min-width: 90px; }
.map-mode-bar .map-button { font-size: 12px; }
.map-admin-bar { position: absolute; top: 16px; left: 16px; z-index: 510; display: flex; align-items: center; gap: 2px; padding: 3px 6px 3px 12px; background: #fff; border-radius: 5px; box-shadow: 0 2px 12px #102d4e33; border-left: 3px solid #e55764; }
.map-admin-bar > span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; margin-right: 6px; }
.map-admin-bar > span svg { width: 14px; height: 14px; color: #ae3040; }
.map-detail-back { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: #2455ce; padding: 3px 0; font-size: 12px; cursor: pointer; }
.map-app.is-picking #aniimo-map { cursor: crosshair; }
.map-app.is-picking .map-admin-bar { display: none; }
.map-detail { min-height: 0; display: flex; flex-direction: column; z-index: 850; background: white; border-left: 1px solid var(--map-line); }
.map-detail-top { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 12px 13px 10px 20px; border-bottom: 1px solid var(--map-line); }
.map-detail-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px; scrollbar-width: thin; }
.map-detail h2 { font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif; font-size: 25px; line-height: 1.2; overflow-wrap: anywhere; letter-spacing: 0; }
.map-detail h3 { font-size: 13px; margin-bottom: 10px; }
.map-detail-kicker { display: flex; gap: 6px; align-items: center; font-size: 11px; color: #2455ce; margin-bottom: 8px; }
.map-detail-subtitle { color: var(--map-muted); font-size: 12px; margin-top: 6px !important; }
.map-detail-image { display: block; width: 100%; max-height: 210px; object-fit: contain; margin: 17px 0; background: #f4f7f9; border-radius: 4px; }
.map-detail-description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.75; margin: 16px 0 !important; }
.map-detail-section { border-top: 1px solid var(--map-line); padding-top: 16px; margin-top: 18px; }
.map-metadata { display: grid; gap: 8px; margin: 0; font-size: 12px; }
.map-metadata > div { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 10px; }
.map-metadata dt { color: var(--map-muted); }
.map-metadata dd { margin: 0; overflow-wrap: anywhere; }
.map-detail-actions { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; margin-top: 16px; }
.map-detail-actions .map-icon-button { height: 40px; width: 40px; border: 1px solid var(--map-line); }
.map-progress-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--map-line); border-radius: 4px; margin-top: 10px; }
.map-progress-options button { min-height: 44px; padding: 6px 3px; border: 0; border-right: 1px solid var(--map-line); color: var(--map-muted); background: white; font-size: 11px; }
.map-progress-options button:last-child { border: 0; }
.map-progress-options button[aria-pressed="true"] { color: #176347; background: #e6f4eb; font-weight: 700; }
.map-detail-note { padding: 10px 0; font-size: 12px; color: var(--map-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.map-source { display: block; font-size: 12px; margin: 8px 0; overflow-wrap: anywhere; color: #2455ce; }
.map-aniimo-link { display: grid; grid-template-columns: 48px minmax(0,1fr) 18px; align-items: center; gap: 10px; min-height: 58px; margin-top: 8px; border: 1px solid var(--map-line); border-radius: 6px; padding: 8px; color: #2455ce; font-size: 13px; text-decoration: none; background: white; }
.map-aniimo-link img, .map-aniimo-link .map-aniimo-fallback { width: 48px; height: 48px; object-fit: contain; }
.map-aniimo-link:hover { text-decoration: none; background: #edf3ff; }
.map-aniimo-link-copy { display: grid; gap: 4px; min-width: 0; }
.map-aniimo-link-copy strong { color: var(--map-ink); overflow-wrap: anywhere; }
.map-aniimo-link-copy small { color: var(--map-muted); font-size: 10px; font-weight: 650; overflow-wrap: anywhere; }
.map-verified { display: inline-flex; align-items: center; gap: 4px; color: #197153; font-size: 11px; margin-top: 9px; }
.map-verified.is-unverified { color: #916219; }
.map-admin-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.map-admin-actions .map-button { flex: 1 1 100px; font-size: 12px; }
.map-detail details summary { cursor: pointer; font-size: 12px; font-weight: 650; }
.map-detail details .map-metadata { margin-top: 12px; }
.map-empty { display: grid; gap: 7px; justify-items: start; padding: 18px 0; }
.map-empty svg { color: #8192a0; width: 24px; height: 24px; margin-bottom: 4px; }
.map-empty h3 { font-size: 14px; }
.map-empty p { font-size: 12px; color: var(--map-muted); }
.map-toast { position: absolute; z-index: 1200; bottom: 28px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border: 1px solid #cdd9e1; border-radius: 5px; box-shadow: 0 6px 26px #15293433; color: var(--map-ink); background: white; font-size: 13px; overflow-wrap: anywhere; }
.map-dialog { width: min(620px, calc(100% - 28px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid #cbd6df; border-radius: 7px; color: var(--map-ink); background: white; box-shadow: 0 16px 80px #10233655; }
.map-dialog::backdrop { background: #1223308a; }
.map-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--map-line); }
.map-dialog h2 { font-size: 19px; line-height: 1.3; letter-spacing: 0; }
.map-dialog-body { padding: 20px; }
.map-dialog-body > p { font-size: 13px; margin-bottom: 14px; }
.map-dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--map-line); }
.map-dialog .map-fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.map-dialog .map-span-all { grid-column: 1 / -1; }
.map-dialog details { border-top: 1px solid var(--map-line); padding-top: 14px; margin-top: 18px; }
.map-dialog details summary { font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 12px; }
.map-form-error { font-size: 13px; color: #ae3040; padding: 12px 0; white-space: pre-wrap; }
.map-editor-checks { display: flex; flex-wrap: wrap; gap: 20px; margin: 15px 0 0; }
.map-codex-selection { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.map-codex-selected { display: inline-flex; align-items: center; max-width: 100%; gap: 6px; padding: 3px 6px 3px 9px; border: 1px solid var(--map-line); border-radius: 4px; font-size: 12px; overflow-wrap: anywhere; }
.map-codex-selected .map-icon-button { width: 26px; height: 26px; flex-basis: 26px; padding: 5px; }
.map-codex-results { max-height: 170px; overflow-y: auto; display: grid; }
.map-codex-results button { text-align: left; border: 0; border-bottom: 1px solid var(--map-line); background: white; color: var(--map-ink); padding: 9px; font-size: 13px; }
.map-codex-results button:hover { background: #edf3ff; }
.map-picker { display: grid; gap: 10px; min-width: 0; border: 1px solid var(--map-line); border-radius: 6px; padding: 12px; background: rgba(255,255,255,.58); }
.map-picker-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 750; }
.map-picker-heading strong { color: var(--map-ink); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.map-picker-heading strong.is-empty, .map-picker-heading small { color: var(--map-muted); font-size: 11px; font-weight: 650; }
.map-picker-search { position: relative; display: block; }
.map-picker-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--map-muted); pointer-events: none; }
.map-picker-search input { width: 100%; min-height: 38px; border: 1px solid var(--map-line); border-radius: 5px; background: white; color: var(--map-ink); padding: 8px 10px 8px 34px; font-size: 13px; }
.map-category-choice-list, .map-aniimo-results { display: grid; gap: 6px; max-height: 214px; overflow-y: auto; overscroll-behavior: contain; padding-right: 3px; scrollbar-width: thin; }
.map-category-choice { display: grid; grid-template-columns: 8px 18px minmax(0,1fr) 18px; align-items: center; gap: 8px; min-height: 42px; margin-left: min(calc(var(--category-depth, 0) * 12px), 48px); border: 1px solid var(--map-line); border-radius: 5px; padding: 8px; color: var(--map-ink); background: white; text-align: left; }
.map-category-choice:hover, .map-category-choice.is-selected { border-color: color-mix(in srgb, var(--category-color, var(--map-accent)) 55%, var(--map-line)); background: color-mix(in srgb, var(--category-color, var(--map-accent)) 10%, white); }
.map-category-choice strong, .map-aniimo-option strong, .map-aniimo-chip strong { display: block; font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.map-category-choice small, .map-aniimo-option small, .map-aniimo-chip small { display: block; color: var(--map-muted); font-size: 10px; font-weight: 650; overflow-wrap: anywhere; }
.map-category-choice > svg, .map-aniimo-option-main > svg { width: 16px; height: 16px; color: var(--map-muted); }
.map-picker-empty { margin: 0; padding: 10px; border: 1px dashed var(--map-line); border-radius: 5px; color: var(--map-muted); font-size: 12px; line-height: 1.45; }
.map-aniimo-selected { display: flex; flex-wrap: wrap; gap: 7px; }
.map-aniimo-chip { display: inline-grid; grid-template-columns: 32px minmax(0,1fr) 26px; align-items: center; gap: 7px; max-width: 100%; border: 1px solid var(--map-line); border-radius: 6px; padding: 5px; background: white; }
.map-aniimo-chip .map-icon-button { width: 26px; height: 26px; flex-basis: 26px; padding: 5px; }
.map-aniimo-option { display: grid; gap: 8px; min-height: 62px; border: 1px solid var(--map-line); border-radius: 6px; padding: 8px; color: var(--map-ink); background: white; text-align: left; }
.map-aniimo-option-main { display: grid; grid-template-columns: 46px minmax(0,1fr) 22px; align-items: center; gap: 10px; width: 100%; border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }
.map-aniimo-option:hover, .map-aniimo-option.is-selected { border-color: rgba(47,103,255,.45); background: #edf3ff; }
.map-aniimo-option-copy { display: grid; gap: 4px; min-width: 0; }
.map-aniimo-form-list { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 56px; }
.map-aniimo-form { display: inline-grid; grid-template-columns: 26px minmax(0,1fr); align-items: center; gap: 6px; max-width: 100%; min-height: 34px; border: 1px solid var(--map-line); border-radius: 5px; padding: 4px 7px; color: var(--map-ink); background: rgba(255,255,255,.62); font-size: 10px; font-weight: 750; text-align: left; }
.map-aniimo-form:hover, .map-aniimo-form.is-selected { border-color: rgba(47,103,255,.46); background: rgba(47,103,255,.1); }
.map-aniimo-form span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-aniimo-chip img, .map-aniimo-option img, .map-aniimo-form img, .map-aniimo-fallback { width: 32px; height: 32px; border: 1px solid var(--map-line); border-radius: 6px; object-fit: contain; background: rgba(255,255,255,.72); }
.map-aniimo-option img, .map-aniimo-option .map-aniimo-fallback { width: 46px; height: 46px; }
.map-aniimo-form img, .map-aniimo-form .map-aniimo-fallback { width: 26px; height: 26px; }
.map-aniimo-fallback { display: inline-flex; align-items: center; justify-content: center; }
.map-aniimo-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.map-mini-badge { display: inline-flex; align-items: center; min-height: 20px; border: 1px solid var(--map-line); border-radius: 999px; padding: 2px 7px; color: var(--map-ink); background: #f5f8fb; font-size: 10px; font-weight: 750; }
.map-mini-badge.is-element { border-color: rgba(47,103,255,.28); background: rgba(47,103,255,.1); }
.map-mini-badge.is-role { border-color: rgba(242,165,59,.34); background: rgba(242,165,59,.12); }
.map-mobile-only, .map-mobile-bar, .map-scrim { display: none; }
.map-noscript { position: absolute; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 20px; background: white; }
@keyframes map-pulse { 50% { opacity: .25; } }
@media (max-width: 1150px) and (min-width: 901px) {
  .map-app { grid-template-columns: 260px minmax(0,1fr); }
  .map-app.has-detail { grid-template-columns: 260px minmax(0,1fr); }
  .map-app.has-detail .map-sidebar { display: none; }
  .map-app.has-detail .map-detail { grid-column: 1; grid-row: 1; border-left: 0; border-right: 1px solid var(--map-line); }
  .map-app.has-detail .map-stage { grid-column: 2; grid-row: 1; }
  .map-detail-scroll { padding: 17px; }
}
@media (max-width: 900px) {
  .map-page .header-shell { width: calc(100% - 24px); min-height: 62px; grid-template-columns: 1fr auto; }
  .map-page .brand-mark { width: 37px; height: 37px; }
  .map-page .brand-name { font-size: 16px; }
  .map-header-label { display: none; }
  .map-app, .map-app.has-detail { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: 52px minmax(0,1fr); }
  .map-mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid var(--map-line); background: white; }
  .map-mobile-bar strong { font-size: 15px; }
  .map-mobile-bar .map-button { min-height: 34px; font-size: 12px; padding: 5px 9px; }
  .map-stage, .map-app.has-detail .map-stage { grid-column: 1; grid-row: 2; }
  .map-sidebar { display: none; position: absolute; inset: 0 auto 0 0; width: min(334px, calc(100% - 40px)); z-index: 1000; box-shadow: 8px 0 32px #152d4533; }
  .map-app.filters-open .map-sidebar { display: flex; }
  .map-mobile-only { display: inline-flex; }
  .map-scrim { display: block; position: absolute; inset: 0; z-index: 990; border: 0; background: #182f4866; }
  .map-sidebar-heading { padding-top: 16px; }
  .map-sidebar-scroll { padding-top: 14px; }
  .map-toolbar { top: 12px; right: 12px; }
  .map-icon-button { width: 40px; height: 40px; flex-basis: 40px; padding: 10px; }
  .map-status { left: 10px; bottom: 27px; max-width: calc(100% - 20px); font-size: 11px; padding: 8px 10px; }
  .map-detail { position: absolute; inset: 52px 0 0; z-index: 950; border-left: 0; }
  .map-detail-scroll { padding: 18px 20px 26px; }
  .map-detail-image { max-height: 190px; }
  .map-detail h2 { font-size: 27px; }
  .map-detail .map-metadata > div { grid-template-columns: 106px minmax(0,1fr); }
  .map-mode-bar { top: 12px; left: 10px; right: 69px; flex-wrap: wrap; }
  .map-notice { top: 12px; left: 12px; right: 73px; padding: 14px; }
  .map-admin-bar { left: 10px; top: 12px; }
  .map-dialog { max-height: calc(100dvh - 24px); }
  .map-dialog-header, .map-dialog-body { padding: 16px; }
  .map-toast { bottom: 32px; }
}
@media (max-width: 400px) {
  .map-dialog .map-fields { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .map-page *, .map-page *::before, .map-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (min-width: 901px) {
  .map-app,
  .map-app.has-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .map-stage,
  .map-app.has-detail .map-stage {
    grid-column: 1;
    grid-row: 1;
  }
  .map-sidebar {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 18px;
    width: min(360px, calc(100vw - 144px));
    max-height: calc(100% - 36px);
    border: 1px solid rgba(255,255,255,.58);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,251,255,.91));
    box-shadow: 0 18px 55px rgba(12,28,53,.24);
    backdrop-filter: blur(14px);
    overflow: hidden;
  }
  .map-sidebar-heading {
    padding: 18px 18px 12px;
  }
  .map-search-form {
    margin: 0 16px 12px;
  }
  .map-tabs {
    padding: 0 16px;
  }
  .map-sidebar-scroll {
    padding: 16px;
  }
  .map-sidebar-footer {
    padding: 13px 16px;
    background: rgba(255,255,255,.84);
  }
  .map-app.has-detail .map-sidebar {
    display: none;
  }
  .map-detail {
    position: absolute;
    top: 18px;
    right: 18px;
    bottom: 18px;
    width: min(380px, calc(100vw - 430px));
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 8px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 18px 55px rgba(12,28,53,.24);
    backdrop-filter: blur(14px);
  }
  .map-app.has-detail .map-detail {
    display: flex;
    grid-column: 1;
    grid-row: 1;
  }
  .map-toolbar {
    top: 18px;
    right: 18px;
  }
  .map-tool-group,
  .map-status,
  .map-admin-bar,
  .map-mode-bar {
    border-color: rgba(255,255,255,.62);
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 36px rgba(13,33,56,.18);
    backdrop-filter: blur(12px);
  }
  .map-status {
    left: 392px;
    bottom: 30px;
  }
  .map-admin-bar,
  .map-mode-bar {
    left: 392px;
  }
  .map-mode-bar {
    right: 86px;
  }
  .map-notice {
    left: 392px;
  }
  .map-page.map-embed .map-sidebar {
    top: 12px;
    bottom: 12px;
    left: 12px;
    width: min(330px, calc(100vw - 92px));
  }
  .map-page.map-embed .map-status,
  .map-page.map-embed .map-admin-bar,
  .map-page.map-embed .map-mode-bar,
  .map-page.map-embed .map-notice {
    left: 360px;
  }
}

/* Atlas refonte: visual-only skin around the existing Leaflet map and controls. */
.map-page {
  --map-ink: #172237;
  --map-muted: #5b6877;
  --map-line: rgba(35, 54, 75, 0.18);
  --map-accent: #2f67ff;
  --map-accent-2: #159bd7;
  --map-paper: #fff8e8;
  --map-paper-2: #f1e6cc;
  --map-deep: #101a2c;
  background:
    radial-gradient(circle at 24% 22%, rgba(47, 103, 255, 0.13), transparent 30%),
    radial-gradient(circle at 76% 76%, rgba(255, 87, 87, 0.09), transparent 28%),
    linear-gradient(135deg, #d4e8ea, #edf0e8 46%, #ccdfe6);
}

.map-page .site-header {
  border-bottom-color: rgba(255, 240, 196, 0.18);
  background:
    linear-gradient(90deg, rgba(47, 103, 255, 0.12), transparent 45%, rgba(255, 87, 87, 0.09)),
    rgba(10, 21, 38, 0.97);
}

.map-page .brand-mark {
  box-shadow: 0 10px 24px rgba(68, 185, 255, 0.18);
}

.map-header-label {
  color: #eef8ff;
  font-weight: 750;
}

.map-app {
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.4), transparent 34%),
    radial-gradient(circle at 72% 18%, rgba(255, 240, 196, 0.4), transparent 22%),
    linear-gradient(135deg, #cfe3e5, #e9ede5);
}

#aniimo-map {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 240, 196, 0.16), transparent 38%),
    #d6e8e9;
}

.map-sidebar,
.map-detail,
.map-mobile-bar,
.map-dialog,
.map-toast,
.map-notice {
  color: var(--map-ink);
  border-color: rgba(69, 82, 91, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 251, 239, 0.98), rgba(241, 230, 204, 0.94)),
    repeating-linear-gradient(135deg, rgba(121, 92, 42, 0.035) 0 1px, transparent 1px 9px);
}

.map-sidebar,
.map-detail {
  box-shadow:
    0 18px 60px rgba(20, 38, 61, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.map-sidebar-heading {
  border-bottom: 1px solid rgba(35, 54, 75, 0.08);
}

.map-eyebrow,
.map-field,
.map-section-heading h2,
.map-detail h3 {
  color: #27344a;
}

.map-app h1,
.map-detail h2,
.map-dialog h2 {
  color: #172237;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.map-search-form input,
.map-field :is(input, select, textarea),
.map-dialog .map-fields :is(input, select, textarea) {
  border-color: rgba(87, 104, 118, 0.26);
  color: var(--map-ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 249, 235, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.map-search-form input::placeholder {
  color: rgba(75, 88, 102, 0.72);
}

.map-tabs {
  border-bottom-color: rgba(35, 54, 75, 0.14);
}

.map-tabs button {
  color: #667383;
}

.map-tabs button[aria-selected="true"] {
  color: #173d9d;
  border-bottom-color: var(--map-accent);
  background: linear-gradient(180deg, transparent, rgba(47, 103, 255, 0.08));
}

.map-progress,
.map-filter-details,
.map-sidebar-footer,
.map-detail-top,
.map-detail-section,
.map-dialog-header,
.map-dialog-footer {
  border-color: rgba(35, 54, 75, 0.14);
}

.map-category,
.map-result,
.map-entity,
.map-progress-category,
.map-metadata > div,
.map-progress-options,
.map-codex-selected,
.map-codex-results button {
  border-radius: 6px;
}

.map-category:hover,
.map-result:hover,
.map-codex-results button:hover {
  background: rgba(47, 103, 255, 0.08);
}

.map-button {
  border-color: rgba(31, 54, 78, 0.2);
  color: var(--map-ink);
  background:
    linear-gradient(180deg, #fffdf6, #f2e7cf);
  box-shadow: 0 5px 14px rgba(30, 47, 68, 0.09);
}

.map-button:hover {
  border-color: rgba(47, 103, 255, 0.34);
  background:
    linear-gradient(180deg, #ffffff, #eaf2ff);
}

.map-button.map-primary {
  border-color: transparent;
  color: #ffffff;
  background:
    linear-gradient(135deg, #2f67ff, #159bd7 62%, #19b68f);
  box-shadow: 0 12px 28px rgba(47, 103, 255, 0.24);
}

.map-button.map-primary:hover {
  background:
    linear-gradient(135deg, #2458e2, #118bc2 62%, #129b79);
}

.map-text-button,
.map-detail-back,
.map-source,
.map-aniimo-link {
  color: #174fbe;
}

.map-tool-group,
.map-status,
.map-admin-bar,
.map-mode-bar {
  border-color: rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.97), rgba(242, 231, 207, 0.92));
  box-shadow:
    0 14px 40px rgba(13, 33, 56, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
}

.map-icon-button {
  border-radius: 6px;
}

.map-icon-button:hover {
  color: #173d9d;
  background: rgba(47, 103, 255, 0.1);
}

.map-status-dot {
  background: #159b74;
  box-shadow: 0 0 0 4px rgba(21, 155, 116, 0.11);
}

.map-pin-body {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 4px 12px rgba(13, 28, 48, 0.36),
    0 0 0 5px rgba(255, 248, 232, 0.28);
}

.map-cluster {
  color: #173d9d;
  border-color: #2f67ff;
  background:
    radial-gradient(circle at 45% 35%, #ffffff, #eef6ff);
  box-shadow:
    0 8px 18px rgba(20, 37, 60, 0.26),
    0 0 0 5px rgba(255, 248, 232, 0.42);
}

.map-detail-image,
.map-noscript {
  background:
    radial-gradient(circle at 50% 35%, rgba(47, 103, 255, 0.08), transparent 40%),
    #fffaf0;
}

.map-progress progress,
.map-progress progress::-webkit-progress-bar {
  background: rgba(33, 51, 70, 0.11);
}

.map-progress progress::-webkit-progress-value,
.map-progress progress::-moz-progress-bar {
  background:
    linear-gradient(90deg, #159b74, #2f67ff);
}

@media (max-width: 900px) {
  .map-mobile-bar {
    border-bottom-color: rgba(35, 54, 75, 0.14);
    box-shadow: 0 8px 24px rgba(13, 33, 56, 0.12);
  }

  .map-sidebar {
    background:
      linear-gradient(180deg, rgba(255, 251, 239, 0.99), rgba(241, 230, 204, 0.97));
  }

  .map-scrim {
    background: rgba(13, 28, 48, 0.5);
    backdrop-filter: blur(3px);
  }
}

@media (min-width: 1021px) {
  .map-page .header-shell {
    width: min(calc(100% - 32px), 1360px);
    max-width: 1360px;
    min-height: 78px;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: clamp(14px, 2vw, 26px);
  }

  .map-page .nav-toggle {
    display: none;
  }

  .map-page .primary-nav,
  .map-page .primary-nav[hidden],
  .map-page .nav-open .primary-nav {
    max-height: none;
    overflow: visible;
  }

  .map-page .map-header-label {
    white-space: nowrap;
  }
}

@media (min-width: 1021px) and (max-width: 1180px) {
  .map-page .map-header-label {
    display: none;
  }
}

/* Keep the public site navigation consistent on the map page too. */
.map-page .header-shell {
  grid-template-columns: auto minmax(0, 1fr) auto !important;
}

.map-page .nav-toggle {
  display: grid !important;
  grid-column: 3;
}

.map-page .primary-nav {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  width: min(372px, calc(100vw - 28px)) !important;
  max-height: calc(100dvh - 92px) !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
  padding: 14px !important;
  overflow: auto !important;
}

.map-page .primary-nav[hidden] {
  display: none !important;
}

.map-page .nav-open .primary-nav {
  display: grid !important;
}

/* Final atlas skin: match the Discord/game portal DA without changing Leaflet behavior. */
.map-page {
  color-scheme: dark;
  --map-ink: #f7fbff;
  --map-muted: #bad2ef;
  --map-line: rgba(116, 220, 255, 0.2);
  --map-accent: #74dcff;
  --map-accent-2: #ffe8a8;
  background:
    radial-gradient(circle at 18% 12%, rgba(116, 220, 255, 0.2), transparent 30%),
    radial-gradient(circle at 88% 20%, rgba(255, 89, 109, 0.14), transparent 26%),
    linear-gradient(135deg, #06101f, #0a1830 48%, #050b18) !important;
  color: var(--map-ink);
}

.map-app {
  background:
    linear-gradient(90deg, rgba(4, 10, 23, 0.72), rgba(7, 22, 42, 0.2)),
    radial-gradient(circle at 74% 18%, rgba(116, 220, 255, 0.16), transparent 26%),
    #08172b !important;
}

#aniimo-map {
  background: #071526 !important;
}

.map-sidebar,
.map-detail,
.map-mobile-bar,
.map-dialog,
.map-toast,
.map-notice {
  color: var(--map-ink) !important;
  border-color: rgba(116, 220, 255, 0.22) !important;
  background:
    radial-gradient(circle at 16% 0%, rgba(116, 220, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(8, 23, 52, 0.92), rgba(3, 9, 23, 0.94)) !important;
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.42) !important;
  backdrop-filter: blur(18px);
}

.map-sidebar-heading,
.map-tabs,
.map-progress,
.map-filter-details,
.map-sidebar-footer,
.map-detail-top,
.map-detail-section,
.map-dialog-header,
.map-dialog-footer {
  border-color: rgba(116, 220, 255, 0.18) !important;
}

.map-eyebrow,
.map-field,
.map-section-heading h2,
.map-detail h3,
.map-muted,
.map-category-count,
.map-result small,
.map-empty p,
.map-detail-subtitle,
.map-metadata dt {
  color: var(--map-muted) !important;
}

.map-app h1,
.map-detail h2,
.map-dialog h2,
.map-progress-total strong,
.map-result strong,
.map-empty h3 {
  color: #fff7db !important;
  text-shadow: none !important;
}

.map-search-form input,
.map-field :is(input, select, textarea),
.map-dialog .map-fields :is(input, select, textarea) {
  border-color: rgba(116, 220, 255, 0.24) !important;
  color: #ffffff !important;
  background:
    linear-gradient(180deg, rgba(3, 9, 23, 0.82), rgba(7, 18, 39, 0.86)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.map-search-form input::placeholder {
  color: rgba(218, 235, 255, 0.58) !important;
}

.map-tabs button {
  color: rgba(218, 235, 255, 0.66) !important;
}

.map-tabs button[aria-selected="true"] {
  color: #fff7db !important;
  border-bottom-color: #74dcff !important;
  background: linear-gradient(180deg, transparent, rgba(116, 220, 255, 0.11)) !important;
}

.map-category,
.map-result,
.map-entity,
.map-codex-results button,
.map-aniimo-link,
.map-picker,
.map-category-choice,
.map-aniimo-option,
.map-aniimo-form,
.map-aniimo-chip,
.map-mini-badge,
.map-progress-options button {
  color: var(--map-ink) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border-color: rgba(116, 220, 255, 0.14) !important;
}

.map-category:hover,
.map-result:hover,
.map-codex-results button:hover,
.map-category-choice:hover,
.map-category-choice.is-selected,
.map-aniimo-option:hover,
.map-aniimo-option.is-selected,
.map-aniimo-form:hover,
.map-aniimo-form.is-selected,
.map-icon-button:hover {
  background: rgba(116, 220, 255, 0.12) !important;
  color: #ffffff !important;
}

.map-picker-search input {
  border-color: rgba(116, 220, 255, 0.24) !important;
  color: #ffffff !important;
  background:
    linear-gradient(180deg, rgba(3, 9, 23, 0.82), rgba(7, 18, 39, 0.86)) !important;
}

.map-picker-heading strong,
.map-category-choice strong,
.map-aniimo-option strong,
.map-aniimo-chip strong,
.map-aniimo-form span,
.map-aniimo-link-copy strong {
  color: #fff7db !important;
}

.map-aniimo-link:hover {
  background: rgba(116, 220, 255, 0.12) !important;
}

.map-picker-heading strong.is-empty,
.map-picker-heading small,
.map-picker-empty,
.map-category-choice small,
.map-aniimo-option small,
.map-aniimo-chip small,
.map-aniimo-link-copy small {
  color: rgba(218, 235, 255, 0.68) !important;
}

.map-picker-empty {
  border-color: rgba(116, 220, 255, 0.18) !important;
  background: rgba(3, 9, 23, 0.32) !important;
}

.map-aniimo-chip img,
.map-aniimo-option img,
.map-aniimo-form img,
.map-aniimo-fallback {
  border-color: rgba(116, 220, 255, 0.18) !important;
  background: rgba(3, 9, 23, 0.36) !important;
}

.map-button,
.map-tool-group,
.map-status,
.map-admin-bar,
.map-mode-bar {
  color: #ffffff !important;
  border-color: rgba(255, 232, 168, 0.24) !important;
  background:
    linear-gradient(145deg, rgba(255, 232, 168, 0.12), rgba(116, 220, 255, 0.08)),
    rgba(5, 14, 33, 0.82) !important;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32) !important;
}

.map-button:hover {
  border-color: rgba(116, 220, 255, 0.38) !important;
  background:
    linear-gradient(145deg, rgba(116, 220, 255, 0.18), rgba(255, 232, 168, 0.1)),
    rgba(8, 23, 52, 0.88) !important;
}

.map-button.map-primary {
  color: #061225 !important;
  background: linear-gradient(135deg, #fff3c4, #86e6ff 58%, #ffffff) !important;
}

.map-icon-button,
.map-text-button,
.map-detail-back,
.map-source,
.map-aniimo-link {
  color: #9fe8ff !important;
}

.map-danger,
.map-button.map-danger,
.map-form-error {
  color: #ff9eaa !important;
}

#map-progress-percent,
.map-progress-category > span:last-child,
.map-verified {
  color: #8df0bd !important;
}

.map-progress progress,
.map-progress progress::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.08) !important;
}

.map-progress progress::-webkit-progress-value,
.map-progress progress::-moz-progress-bar {
  background: linear-gradient(90deg, #74dcff, #fff3c4, #ff596d) !important;
}

#aniimo-map .leaflet-control-attribution,
.map-coordinates {
  color: #dcecff !important;
  background: rgba(4, 10, 23, 0.76) !important;
}
