:root {
  color-scheme: dark;
  --bg: #070809;
  --surface: #0f1116;
  --surface-soft: #161a22;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f5;
  --muted: #9ca3af;
  --accent: #e8c9a8;
  --accent-strong: #d4ad82;
  --accent-dim: rgba(232, 201, 168, 0.14);
  --accent-border: rgba(232, 201, 168, 0.32);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-pill: 999px;
  --radius-xl: 1.25rem;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.bg-animated {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--bg);
  background-image: url("assets/hero-cave.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.bg-animated::before,
.bg-animated::after {
  content: "";
  position: absolute;
  inset: 0;
}

.bg-animated::before {
  background: radial-gradient(ellipse 80% 70% at 50% 40%, transparent 0%, rgba(9, 11, 16, 0.45) 100%);
  pointer-events: none;
}

.bg-animated::after {
  background: linear-gradient(
    180deg,
    rgba(9, 11, 16, 0.55) 0%,
    rgba(9, 11, 16, 0.35) 40%,
    rgba(9, 11, 16, 0.82) 100%
  );
  pointer-events: none;
}

/* Custom mod page photo: slightly lighter scrims so the image reads as the “big” background. */
.bg-animated.bg-animated--mod-page::before {
  background: radial-gradient(ellipse 85% 75% at 50% 38%, transparent 0%, rgba(9, 11, 16, 0.32) 100%);
}

.bg-animated.bg-animated--mod-page::after {
  background: linear-gradient(
    180deg,
    rgba(9, 11, 16, 0.42) 0%,
    rgba(9, 11, 16, 0.2) 42%,
    rgba(9, 11, 16, 0.72) 100%
  );
}

.bg-orb {
  display: none;
}

.orb-1 {
  width: 460px;
  height: 460px;
  left: -140px;
  top: -40px;
  background: radial-gradient(circle at 30% 30%, rgba(232, 201, 168, 0.6), rgba(232, 201, 168, 0));
  animation: orbFloatOne 22s ease-in-out infinite;
}

.orb-2 {
  width: 520px;
  height: 520px;
  right: -180px;
  top: 120px;
  background: radial-gradient(circle at 40% 40%, rgba(95, 157, 255, 0.45), rgba(95, 157, 255, 0));
  animation: orbFloatTwo 24s ease-in-out infinite;
}

.orb-3 {
  width: 380px;
  height: 380px;
  left: 40%;
  bottom: -160px;
  background: radial-gradient(circle at 50% 50%, rgba(79, 125, 212, 0.45), rgba(79, 125, 212, 0));
  animation: orbFloatThree 20s ease-in-out infinite;
}

.container {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: 1rem;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-nav {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
}

.header-nav > li {
  flex: 0 0 auto;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-toggle::after {
  content: "";
  margin-left: 0;
}

.dropdown.open .dropdown-toggle::after {
  transform: none;
}

.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0.45rem;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 220px;
  background: rgba(17, 23, 35, 0.98);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-4px);
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.dropdown-link {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.92rem;
}

.dropdown-link:hover,
.dropdown-link:focus-visible {
  background: var(--accent-dim);
}

.dropdown-link--placeholder {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

.mods-card-placeholder {
  opacity: 0.75;
}

.about-page-body {
  margin: 0 0 1.5rem;
  max-width: 42rem;
}

.about-page-body p {
  margin: 0 0 1rem;
}

.about-page-body .about-cmd-header {
  margin: 1.35rem 0 0.55rem;
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
}

.about-page-body .about-cmd-header:first-child {
  margin-top: 0;
}

.text-cmd-line,
.text-auto-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

a.text-cmd-line,
a.text-auto-link {
  cursor: pointer;
}

a.text-cmd-line:hover,
a.text-cmd-line:focus-visible,
a.text-auto-link:hover,
a.text-auto-link:focus-visible {
  color: inherit;
  opacity: 0.88;
}

.about-empty-note {
  opacity: 0.85;
  font-style: italic;
}

.hero {
  margin-top: 3rem;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -80% auto auto -15%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(232, 201, 168, 0.2), transparent 70%);
  pointer-events: none;
  animation: floatGlow 6s ease-in-out infinite;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  text-transform: none;
}

.hero-title {
  animation: titleIn 0.8s ease-out both;
}

.tagline {
  margin: 0;
  color: var(--muted);
  max-width: 56ch;
  white-space: pre-line;
  line-height: 1.55;
}

#home-about-description {
  white-space: pre-line;
  line-height: 1.55;
}

.hero-inner {
  display: grid;
  gap: 1.5rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

@media (min-width: 880px) {
  .hero-inner {
    grid-template-columns: 1fr minmax(260px, 320px);
    align-items: center;
  }
}

.discord-widget {
  margin: 0;
}

.discord-widget-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(29, 31, 35, 0.92);
  border: 1px solid rgba(88, 101, 242, 0.45);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.discord-widget-link:hover,
.discord-widget-link:focus-visible {
  border-color: #5865f2;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(88, 101, 242, 0.22);
}

.discord-widget-icon {
  flex-shrink: 0;
  color: #5865f2;
}

.discord-widget-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.discord-widget-title {
  font-weight: 700;
  font-size: 1rem;
}

.discord-widget-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.discord-widget-invite {
  font-size: 0.78rem;
  color: #949ba4;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.discord-widget-cta {
  flex-shrink: 0;
  background: #5865f2;
  color: #fff;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.page {
  flex: 1;
  padding: 1rem 0 2rem;
}

.page-picker {
  margin-top: 1.5rem;
}

.page-picker h2 {
  margin: 0 0 0.8rem;
  font-size: 1.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.card-grid-featured {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  grid-template-areas: "about mods donation";
  align-items: start;
}

.card-grid-featured .mods-card {
  grid-area: mods;
}

.card-grid-featured .about-card {
  grid-area: about;
  min-height: 100%;
}

.card-grid-featured .donation-card {
  grid-area: donation;
}

.page-card {
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  transform-style: preserve-3d;
}

.page-card h3 {
  margin: 0 0 0.5rem;
}

.page-card p {
  margin: 0;
  color: var(--muted);
}

.page-card:hover,
.page-card:focus-visible {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--accent);
  background: var(--surface-soft);
}

.page-card {
  animation: cardIn 0.5s ease both;
}

.card-grid .page-card:nth-child(2) {
  animation-delay: 0.08s;
}

.card-grid .page-card:nth-child(3) {
  animation-delay: 0.16s;
}

.mods-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: left;
}

.mods-caret {
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.mods-card.open .mods-caret {
  transform: rotate(180deg);
}

.mods-card-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.mods-card.open .mods-card-list {
  max-height: 260px;
  opacity: 1;
}

.mods-card-list a {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(232, 201, 168, 0.06);
  font-size: 0.9rem;
}

.mods-card-list a:hover,
.mods-card-list a:focus-visible {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.nav-link {
  display: inline-block;
  width: 100%;
  height: 40px;
  padding: 0 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  text-align: center;
  white-space: nowrap;
  line-height: 38px;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(232, 201, 168, 0.12);
  border-color: var(--accent);
}

.nav-link[aria-current="page"] {
  border-color: var(--accent);
  background: rgba(232, 201, 168, 0.18);
}

.subpage {
  width: min(780px, calc(100% - 2rem));
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.5rem;
}

.subpage p {
  color: var(--muted);
  line-height: 1.5;
}

.back-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 0.9rem 1rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

/* Mod public view: shell = big outer card; module = inner boxes. .site-header untouched. */
body.mod-page-panel-themed.mod-page-has-shell main.subpage {
  background: linear-gradient(0deg, var(--mod-shell-fill), var(--mod-shell-fill)), var(--surface);
  border-color: var(--mod-shell-border);
}

body.mod-page-panel-themed.mod-page-has-shell .site-footer {
  background: linear-gradient(0deg, var(--mod-shell-fill-footer), var(--mod-shell-fill-footer)), var(--bg);
  border-color: var(--mod-shell-border);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-subnav {
  background: linear-gradient(0deg, var(--mod-module-fill-nav), var(--mod-module-fill-nav)), rgba(9, 11, 16, 0.35);
  border-color: var(--mod-module-border);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-flow--framed {
  background: linear-gradient(0deg, var(--mod-module-fill), var(--mod-module-fill)), var(--surface-soft);
  border-color: var(--mod-module-border);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-flow--panel-color.mod-doc-flow--framed {
  border-width: 2px;
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-map-jump {
  background: linear-gradient(0deg, var(--mod-module-fill-jump), var(--mod-module-fill-jump)), rgba(9, 11, 16, 0.35);
  border-color: var(--mod-module-border);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-youtube-wrap {
  border-color: var(--mod-module-border);
  background: linear-gradient(0deg, var(--mod-module-youtube-bg), var(--mod-module-youtube-bg)), rgba(0, 0, 0, 0.35);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-block--paragraph .mod-doc-inline-img img,
body.mod-page-panel-themed.mod-page-has-module .mod-doc-figure:not(.mod-doc-figure--map) img,
body.mod-page-panel-themed.mod-page-has-module .mod-doc-multi-img-cell img {
  border-color: var(--mod-module-border);
  background: linear-gradient(0deg, var(--mod-module-fill), var(--mod-module-fill)), rgba(9, 11, 16, 0.35);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-map-module__head {
  border-bottom-color: var(--mod-module-border);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-map-appendix {
  border-top-color: var(--mod-module-border);
}

body.mod-page-panel-themed.mod-page-has-module .wizard-input,
body.mod-page-panel-themed.mod-page-has-module .mod-doc-filter-select,
body.mod-page-panel-themed.mod-page-has-module .mod-doc-marker-search {
  background: linear-gradient(0deg, var(--mod-module-fill), var(--mod-module-fill)), rgba(9, 11, 16, 0.55);
  border-color: var(--mod-module-border);
}

body.mod-page-panel-themed.mod-page-has-module .mod-doc-marker-sidebar {
  background: linear-gradient(0deg, var(--mod-module-fill), var(--mod-module-fill)), rgba(9, 11, 16, 0.4);
  border-color: var(--mod-module-border);
}

body.mod-page-panel-themed:is(.mod-page-has-shell, .mod-page-has-module) .mod-doc-marker-popup {
  background: linear-gradient(0deg, var(--mod-marker-popup-bg), var(--mod-marker-popup-bg)), var(--surface);
  border-color: var(--mod-marker-popup-border);
}

/* Custom text (links keep accent for contrast). */
body.mod-page-text-custom .mod-doc .mod-doc-title,
body.mod-page-text-custom .mod-doc .mod-doc-heading,
body.mod-page-text-custom .mod-doc .mod-doc-subheading,
body.mod-page-text-custom .mod-doc .mod-doc-body,
body.mod-page-text-custom .mod-doc .mod-doc-map-module__title,
body.mod-page-text-custom .mod-doc .mod-doc-marker-sidebar-name {
  color: var(--mod-page-text);
}

body.mod-page-text-custom .mod-doc .mod-doc-subnav-label,
body.mod-page-text-custom .mod-doc .mod-doc-empty-note,
body.mod-page-text-custom .mod-doc .mod-doc-missing,
body.mod-page-text-custom .mod-doc .mod-doc-marker-snippet,
body.mod-page-text-custom .mod-doc .mod-doc-marker-sidebar-title,
body.mod-page-text-custom .mod-doc figcaption,
body.mod-page-text-custom .mod-doc .mod-doc-youtube-missing {
  color: color-mix(in srgb, var(--mod-page-text) 68%, var(--bg));
}

body.mod-page-text-custom .mod-doc .mod-doc-footer {
  color: color-mix(in srgb, var(--mod-page-text) 72%, var(--bg));
}

.mod-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.mod-item {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.mod-item-link {
  display: block;
  padding: 0.8rem 0.9rem;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}

.mod-item-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mod-item h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.mod-item p {
  margin: 0;
}

.mod-item:hover {
  transform: translateX(4px);
  border-color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes titleIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

@keyframes orbFloatOne {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-28px) translateX(16px);
  }
}

@keyframes orbFloatTwo {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(30px) translateX(-18px);
  }
}

@keyframes orbFloatThree {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-22px) translateX(12px);
  }
}

@media (max-width: 640px) {
  .card-grid-featured {
    grid-template-columns: 1fr;
    grid-template-areas:
      "about"
      "mods"
      "donation";
  }

  .card-grid-featured .mods-card,
  .card-grid-featured .about-card,
  .card-grid-featured .donation-card {
    grid-area: auto;
  }

  .dropdown-menu {
    position: static;
    margin-top: 0.4rem;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
.auth-controls {
  margin-left: auto;
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.auth-user {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(88, 101, 242, 0.18);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.86rem;
}

.auth-btn:hover,
.auth-btn:focus-visible {
  border-color: #5865f2;
  background: rgba(88, 101, 242, 0.28);
}

.admin-btn-link {
  background: rgba(232, 201, 168, 0.18);
}

.admin-dashboard {
  display: grid;
  gap: 1rem;
}

.admin-status {
  margin: 0;
}

.admin-breadcrumb {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.admin-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.admin-breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

.admin-hub-links {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 0.35rem;
}

.admin-hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 23, 35, 0.7);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-hub-card:hover {
  border-color: rgba(232, 201, 168, 0.45);
  background: rgba(24, 32, 48, 0.88);
}

.admin-hub-card strong {
  font-size: 1.05rem;
}

.admin-hub-card span:last-child {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

.admin-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(17, 23, 35, 0.7);
}

.admin-form,
.admin-mod-card {
  display: grid;
  gap: 0.7rem;
}

.admin-form label,
.admin-mod-card label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-form input,
.admin-form textarea,
.admin-mod-card input,
.admin-mod-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  background: rgba(9, 11, 16, 0.6);
  color: var(--text);
  font: inherit;
}

.admin-btn {
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(232, 201, 168, 0.18);
  color: var(--text);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.admin-btn.danger {
  background: rgba(200, 70, 70, 0.24);
  border-color: rgba(200, 70, 70, 0.45);
}

.admin-mod-list {
  display: grid;
  gap: 0.8rem;
}

.admin-mod-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  background: rgba(9, 11, 16, 0.5);
}

.admin-mod-actions {
  display: flex;
  gap: 0.5rem;
}
@media (max-width: 900px) and (min-width: 641px) {
  .site-header .container {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }

  .auth-controls {
    margin-left: auto;
  }
}

.subpage--wide {
  width: min(1240px, calc(100% - 2rem));
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.map-toolbar label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-toolbar select {
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  background: rgba(9, 11, 16, 0.6);
  color: var(--text);
  font: inherit;
}

.map-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.map-calibration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.admin-inline {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin: 0;
}

.admin-inline legend {
  padding: 0 0.35rem;
  color: var(--text);
  font-size: 0.9rem;
}

.admin-inline label {
  display: inline-grid;
  gap: 0.2rem;
  margin-right: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-inline input {
  width: 100px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.4rem;
  background: rgba(9, 11, 16, 0.6);
  color: var(--text);
  font: inherit;
}

.map-editor-actions {
  margin: 0.5rem 0 0.75rem;
}

.map-canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(9, 11, 16, 0.55);
}

.map-editor-image {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
}

.map-editor-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: crosshair;
}

.map-dot {
  position: absolute;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.45);
  color: #0b1020;
  font-size: 0.7rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.marker-list-panel {
  margin: 0.75rem 0;
}

.marker-list-panel h4 {
  margin: 0 0 0.5rem;
}

.marker-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.75rem;
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.marker-toolbar-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
}

.marker-toolbar-label--grow {
  flex: 1 1 200px;
  min-width: min(100%, 180px);
}

.marker-toolbar-hint {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.marker-jump-select {
  min-width: 14rem;
}

.marker-toolbar-count {
  font-size: 0.78rem;
  color: var(--muted);
  align-self: center;
  margin-left: auto;
}

.marker-row.marker-row--highlight {
  animation: markerRowPulse 1.1s ease-out 1;
}

.marker-row.marker-row--hidden {
  display: none !important;
}

@keyframes markerRowPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 201, 168, 0.45);
  }
  35% {
    box-shadow: 0 0 0 4px rgba(232, 201, 168, 0.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(232, 201, 168, 0);
  }
}

.marker-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.marker-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(9, 11, 16, 0.45);
}

.marker-row--expanded {
  padding: 0.6rem 0.65rem;
}

.marker-row__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem 0.75rem;
}

.marker-row__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.32rem 0.55rem 0.32rem 0.4rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.marker-row__toggle:hover,
.marker-row__toggle:focus-visible {
  background: rgba(232, 201, 168, 0.14);
  border-color: rgba(232, 201, 168, 0.35);
  outline: none;
}

.marker-row--expanded .marker-row__toggle {
  background: rgba(232, 201, 168, 0.12);
  border-color: rgba(232, 201, 168, 0.4);
}

.marker-row__chevron {
  display: inline-block;
  width: 0.65rem;
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.75;
}

.marker-row__chevron::before {
  content: "▶";
  display: block;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.marker-row--expanded .marker-row__chevron::before {
  transform: rotate(90deg);
}

.marker-coord-group--inline {
  flex: 1 1 180px;
  min-width: 0;
}

.marker-row__body {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.marker-row__body[hidden] {
  display: none !important;
}

.marker-row__body:not([hidden]) {
  display: grid;
  gap: 0.45rem;
}

.marker-row label {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.marker-row input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  background: rgba(9, 11, 16, 0.6);
  color: var(--text);
  font: inherit;
}

.admin-advanced {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}

.admin-advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Admin map editor (ARK-style calibration UI) */
.map-editor-block {
  margin-top: 1.25rem;
}

.map-editor-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin-bottom: 0.85rem;
}

.map-linked-bar {
  flex: 1 1 280px;
  min-width: min(100%, 240px);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.map-linked-bar .wizard-help {
  margin: 0;
}

.map-editor-label-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-select-control {
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: rgba(9, 11, 16, 0.65);
  color: var(--text);
  font: inherit;
}

.map-select-lg {
  min-width: 220px;
}

.map-setup-drawer {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.65rem;
  background: rgba(9, 11, 16, 0.45);
}

.map-setup-drawer summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.88rem;
  user-select: none;
}

.map-setup-inner {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.map-setup-inner label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.map-setup-inner input[type="text"],
.map-setup-inner input[type="url"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  background: rgba(9, 11, 16, 0.6);
  color: var(--text);
  font: inherit;
}

.btn-outline {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.btn-outline.is-on {
  border-color: rgba(255, 100, 100, 0.65);
  color: #ffb4b4;
  background: rgba(120, 40, 40, 0.2);
}

.btn-solid {
  border: 1px solid #3d4558;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  background: #2a3142;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.btn-solid:hover {
  background: #343c50;
}

.btn-compact {
  padding: 0.4rem 0.75rem;
  justify-self: start;
}

.map-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: rgba(9, 11, 16, 0.5);
}

/* Polished “studio” map editor (admin step 2) */
.map-workspace--studio {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(232, 201, 168, 0.22);
  background: linear-gradient(168deg, #151c2e 0%, #0d111c 48%, #090b10 100%);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.map-studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1.15rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.map-studio-toolbar__title {
  min-width: 0;
}

.map-studio-toolbar__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(159, 176, 204, 0.9);
  margin-bottom: 0.2rem;
}

.map-studio-toolbar__sub {
  display: block;
  font-size: 0.8rem;
  color: rgba(237, 242, 255, 0.78);
}

image.png.map-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.map-controls-bar--studio {
  flex: 1 1 280px;
  justify-content: flex-end;
  align-items: center;
}

.map-map-label {
  font-weight: 600;
  color: var(--text);
}

.map-controls-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
}

.map-controls-bar--studio .map-controls-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
}

@media (min-width: 640px) {
  .map-workspace:not(.map-workspace--studio) .map-controls-actions {
    align-items: flex-end;
  }
}

.btn-map-tool {
  border: 1px solid rgba(232, 201, 168, 0.4);
  border-radius: 10px;
  padding: 0.48rem 0.9rem;
  background: rgba(232, 201, 168, 0.1);
  color: #e8f0ff;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.btn-map-tool:hover {
  border-color: rgba(159, 200, 255, 0.75);
  background: rgba(232, 201, 168, 0.18);
  color: #fff;
}

.btn-map-tool--ghost {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(9, 11, 16, 0.35);
  color: rgba(237, 242, 255, 0.88);
  font-weight: 500;
}

.btn-map-tool--ghost:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.btn-map-tool.is-on {
  border-color: rgba(255, 120, 120, 0.65);
  color: #ffd4d4;
  background: rgba(140, 45, 45, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 100, 100, 0.15);
}

.btn-map-tool--accent {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(45, 212, 191, 0.12);
  color: #d8fff8;
}

.btn-map-tool--accent:hover {
  border-color: rgba(110, 250, 230, 0.65);
  background: rgba(45, 212, 191, 0.2);
  color: #fff;
}

.map-workspace-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.map-hint-callout {
  margin: 0.85rem 1.15rem 0;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 201, 168, 0.2);
  border-left: 4px solid rgba(232, 201, 168, 0.75);
  background: rgba(232, 201, 168, 0.07);
  color: #c8d9f5;
  font-size: 0.84rem;
  line-height: 1.45;
}

.map-stage {
  padding: 0.85rem 1.15rem 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
  background: radial-gradient(ellipse 80% 70% at 50% 30%, rgba(30, 42, 68, 0.5) 0%, transparent 65%);
}

.map-canvas-wrap--large {
  max-height: min(72vh, 820px);
  width: 100%;
}

.map-canvas-wrap--large .map-editor-image {
  width: 100%;
  max-width: 100%;
}

/* Admin map editor: large enough to work comfortably, still capped so panels stay on screen */
.map-canvas-wrap--admin {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.map-canvas-wrap--admin .map-editor-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(70vh, 900px);
  object-fit: contain;
  margin: 0 auto;
}

.map-panels-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.28);
}

@media (max-width: 920px) {
  .map-panels-split {
    grid-template-columns: 1fr;
  }
}

.calibration-panel--studio,
.cave-editor-panel--studio {
  border: none;
  border-radius: 0;
  margin: 0;
}

.calibration-panel--studio {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 1.15rem 1.15rem;
  background: rgba(12, 16, 26, 0.65);
}

.calibration-panel--studio .btn-solid--accent {
  align-self: flex-start;
  width: auto;
  min-width: 11rem;
  margin-top: 0.25rem;
}

@media (max-width: 920px) {
  .calibration-panel--studio {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

.cave-editor-panel--studio {
  padding: 1rem 1.15rem 1.15rem;
  background: rgba(10, 13, 20, 0.55);
}

.calibration-panel__head,
.cave-editor-panel__head {
  margin-bottom: 0.65rem;
}

.cal-pairs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 520px) {
  .cal-pairs {
    grid-template-columns: 1fr;
  }
}

.cal-pair {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 11, 16, 0.45);
}

.cal-pair--a {
  border-color: rgba(232, 201, 168, 0.25);
}

.cal-pair--b {
  border-color: rgba(255, 159, 67, 0.28);
}

.cal-pair-badge {
  flex: 0 0 2rem;
  display: grid;
  place-items: center;
  align-self: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #0b1020;
}

.cal-pair--a .cal-pair-badge {
  background: linear-gradient(145deg, #8abfff, #5b8fd9);
}

.cal-pair--b .cal-pair-badge {
  background: linear-gradient(145deg, #ffb86b, #e88935);
}

.cal-pair-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.5rem;
  min-width: 0;
}

.cal-field-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(159, 176, 204, 0.85);
  margin-bottom: 0.15rem;
}

.cal-pair-fields label {
  display: block;
  margin: 0;
}

.cal-pair-fields input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  background: rgba(9, 11, 16, 0.75);
  color: var(--text);
  font: inherit;
}

.btn-solid--accent {
  border-color: rgba(232, 201, 168, 0.45);
  background: linear-gradient(180deg, #3d4f6f 0%, #2a3548 100%);
}

.btn-solid--accent:hover {
  background: linear-gradient(180deg, #4a5d82 0%, #323e54 100%);
}

.calibration-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(12, 15, 22, 0.75);
  display: grid;
  gap: 0.55rem;
}

.calibration-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.calibration-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.calibration-status {
  margin: 0;
  font-size: 0.88rem;
  color: #5ee4a0;
}

.calibration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
}

.calibration-grid label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.calibration-grid input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  background: rgba(9, 11, 16, 0.65);
  color: var(--text);
  font: inherit;
}

.calibration-panel .btn-solid {
  justify-self: start;
  margin-top: 0.25rem;
}

.cave-editor-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(12, 15, 22, 0.55);
}

.cave-editor-title {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
}

.cave-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem 0.75rem;
}

.cave-fields-grid label {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.cave-fields-grid input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  background: rgba(9, 11, 16, 0.6);
  color: var(--text);
  font: inherit;
}

.map-dot--cal-a {
  background: var(--accent-strong);
}

.map-dot--cal-b {
  background: #ff9f43;
}

.map-dot--cave {
  background: #e63946;
  color: #fff;
  border-color: rgba(0, 0, 0, 0.55);
}

.map-dot--pin-blue {
  background: #4d9fff;
  color: #0b1020;
}

.map-dot--pin-green {
  background: #3ecf8e;
  color: #0b1020;
}

.map-dot--pin-gold {
  background: #e6c35c;
  color: #0b1020;
}

.map-dot--pin-purple {
  background: #b07cff;
  color: #0b1020;
}

.map-dot--pin-custom {
  background-color: rgba(20, 24, 32, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: transparent;
}

.marker-pin-details {
  margin: 0.35rem 0 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(9, 11, 16, 0.35);
  padding: 0 0.5rem;
}

.marker-pin-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.45rem 0.35rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.marker-pin-summary::-webkit-details-marker {
  display: none;
}

.marker-pin-summary .marker-pin-current-label {
  color: var(--text);
}

.marker-pin-panel {
  padding: 0 0.35rem 0.65rem;
}

.pin-swatch-help {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.pin-swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.pin-reuse-field {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}

.pin-reuse-field .map-select-control {
  width: 100%;
  max-width: 100%;
}

.pin-swatch {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pin-swatch:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px rgba(232, 201, 168, 0.45);
}

.pin-swatch.is-selected {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.pin-swatch--default {
  background: #e63946;
}

.pin-swatch--blue {
  background: #4d9fff;
}

.pin-swatch--green {
  background: #3ecf8e;
}

.pin-swatch--gold {
  background: #e6c35c;
}

.pin-swatch--purple {
  background: #b07cff;
}

.pin-swatch--uploaded {
  overflow: hidden;
  padding: 0;
  background-color: rgba(20, 24, 32, 0.55);
  border-color: rgba(255, 255, 255, 0.75);
}

.pin-swatch-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.pin-preset-grid {
  margin-bottom: 0.35rem;
}

.pin-library-block {
  margin: 0.5rem 0 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pin-library-heading {
  margin-bottom: 0.45rem;
}

.pin-library-heading code {
  font-size: 0.88em;
}

.pin-library-grid {
  max-height: min(300px, 42vh);
  overflow-y: auto;
  padding: 0.45rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.45);
}

.pin-custom-block {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.55rem;
}

.pin-custom-block .m-custom-url {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.45rem;
  background: rgba(9, 11, 16, 0.65);
  color: var(--text);
  font: inherit;
}

.pin-custom-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pin-file-label {
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

.pin-file-label input {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

.marker-row__summary .marker-coord-label input {
  max-width: 7rem;
}

.marker-row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.45rem;
}

.marker-coord-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
}

.marker-coord-label {
  display: grid;
  gap: 0.15rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.marker-coord-label input {
  width: 6.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
  background: rgba(9, 11, 16, 0.65);
  color: var(--text);
  font: inherit;
}

.marker-row-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem 0.65rem;
}

.marker-desc-field {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.marker-desc-field .m-desc {
  width: 100%;
  min-height: 9rem;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  background: rgba(9, 11, 16, 0.65);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.map-markers-dialog {
  width: min(96vw, 58rem);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(12, 15, 22, 0.98);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.map-markers-dialog::backdrop {
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(4px);
}

.map-markers-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(12, 15, 22, 0.98);
}

.map-markers-dialog__title {
  margin: 0;
  font-size: 1.1rem;
}

.map-markers-dialog__close {
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(9, 11, 16, 0.65);
  color: var(--text);
}

.map-markers-dialog__close:hover {
  border-color: var(--accent);
}

.map-editor-enabled-wrap--dialog {
  margin-top: 0;
  max-height: calc(92vh - 3.5rem);
  overflow: auto;
  padding: 0.75rem 1rem 1rem;
}

.map-editor-enabled-wrap {
  margin-top: 0.75rem;
}

.ws-map-marker-prompt {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.map-editor-block--embedded {
  border: none;
  padding: 0;
  background: transparent;
}

.map-editor-block--embedded .map-editor-topbar {
  margin-bottom: 0.65rem;
}

.map-controls-map-picker[hidden] ~ .map-controls-actions {
  margin-left: 0;
  width: 100%;
}

/* Admin wizard */
.admin-wizard {
  margin-top: 0.5rem;
}

.wizard-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 52rem;
}

.wizard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(9, 11, 16, 0.45);
}

.wizard-field--grow {
  flex: 1 1 220px;
  min-width: 200px;
}

.wizard-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wizard-toolbar-actions--pages {
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.55rem;
  min-width: min(100%, 12rem);
}

.wizard-toolbar-actions--pages .admin-btn {
  white-space: nowrap;
}

.wizard-select {
  width: 100%;
  max-width: 420px;
}

.wizard-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  background: rgba(9, 11, 16, 0.42);
  margin-bottom: 1rem;
}

.wizard-panel[hidden] {
  display: none !important;
}

.wizard-panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.wizard-help {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 48rem;
}

.wizard-help--tight {
  margin-bottom: 0.5rem;
}

.wizard-marker-filters #wizard-marker-filters-root {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  max-width: 52rem;
}

.marker-filter-edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.6rem;
  align-items: flex-end;
}

.marker-filter-edit-row .mf-label--grow .wizard-input {
  width: 100%;
}

.marker-filter-edit-row .mf-label--grow {
  flex: 1 1 200px;
  min-width: 160px;
}

.marker-filter-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-top: 0.35rem;
}

.marker-filter-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
}

.marker-filter-choice input {
  accent-color: var(--accent-strong);
}

.marker-filter-group-card {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem 1rem;
}

.marker-filter-group-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.35rem;
}

.marker-filter-group-head .mf-group-title-field {
  flex: 1 1 220px;
  min-width: 180px;
}

.marker-filter-options-root {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
}

.marker-filter-assign-group {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px dashed rgba(232, 201, 168, 0.22);
}

.marker-filter-assign-legend {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 0.35rem;
  color: var(--muted);
}

.wizard-fields {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  max-width: 36rem;
}

.wizard-field {
  display: grid;
  gap: 0.3rem;
}

.wizard-label-text {
  font-size: 0.88rem;
  color: var(--muted);
}

.wizard-input,
.wizard-textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: rgba(9, 11, 16, 0.65);
  color: var(--text);
  font: inherit;
}

.wizard-textarea {
  resize: vertical;
  min-height: 5rem;
}

.wizard-file {
  font-size: 0.88rem;
}

.wizard-toggle-stack {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.wizard-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}

.wizard-check input {
  margin-top: 0.2rem;
}

.wizard-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.wizard-add-block-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(9, 11, 16, 0.35);
}

.wizard-field--inline {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 200px;
}

.wizard-add-blocks-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.wizard-add-blocks-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.wizard-add-blocks-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.wizard-sections-root {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.wizard-section-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(12, 15, 22, 0.55);
  display: grid;
  gap: 0.55rem;
}

.section-fields--body,
.section-fields--media,
.section-fields--image-upload {
  display: grid;
  gap: 0.55rem;
}

.ws-image-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(9, 11, 16, 0.6);
  max-width: 100%;
}

.ws-image-preview-wrap[hidden] {
  display: none !important;
}

.ws-image-preview {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.section-fields--media[hidden] {
  display: none !important;
}

.wizard-section-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.wizard-section-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.wizard-section-card-actions .wizard-section-move-up,
.wizard-section-card-actions .wizard-section-move-down {
  min-width: 2.25rem;
  padding: 0.35rem 0.45rem;
}

.wizard-section-num {
  font-weight: 600;
  font-size: 0.92rem;
}

.wizard-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mod-item-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.mod-thumb {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(9, 11, 16, 0.6);
}

.mod-thumb--placeholder {
  background: rgba(42, 54, 73, 0.5);
}

.mod-item-text {
  flex: 1;
  min-width: 0;
}

.mod-item-open-hint {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--accent);
}

.mod-doc-container {
  max-width: min(1180px, calc(100vw - 2.5rem));
  margin: 0 auto 2rem;
}

.mod-doc {
  padding: 0 0.25rem;
}

.mod-doc--page-theme {
  position: relative;
  overflow: hidden;
  min-height: min(58vh, 680px);
  padding: 1rem 1.15rem 1.25rem;
  margin: 0 -0.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background-origin: border-box;
  box-sizing: border-box;
}

.mod-doc-page-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}

.mod-doc-page-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.mod-doc-page-bg-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mod-doc-page-foreground {
  position: relative;
  z-index: 1;
}

.mod-doc-back-wrap {
  margin: 0 0 1rem;
}

.mod-doc-missing {
  color: var(--muted);
}

.mod-doc-hero {
  margin: 0 0 1.25rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.mod-doc-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.mod-doc-header {
  margin-bottom: 1.5rem;
}

.mod-doc-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.45);
}

.mod-doc-subnav-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.15rem;
}

.mod-doc-subnav-link {
  font-size: 0.92rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    background 0.14s ease,
    border-color 0.14s ease;
}

.mod-doc-subnav-link:hover {
  background: rgba(232, 201, 168, 0.12);
  border-color: rgba(232, 201, 168, 0.25);
}

.mod-doc-subnav-link[aria-current="page"] {
  color: var(--text);
  background: rgba(232, 201, 168, 0.22);
  border-color: rgba(232, 201, 168, 0.45);
}

.mod-doc-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.mod-doc-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.05rem;
}

.mod-doc-flow {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mod-doc-flow--framed {
  padding: 1.1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.mod-doc-flow--panel-color.mod-doc-flow--framed {
  border-width: 2px;
}

.mod-doc-block--youtube {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mod-doc-block--youtube .mod-doc-subheading {
  width: 100%;
  margin-bottom: 0;
  text-align: center;
}

.mod-doc-youtube-wrap {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.35);
}

.mod-doc-youtube-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.mod-doc-youtube-missing {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.wizard-panel-color-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.wizard-panel-color-row .wizard-input {
  flex: 1 1 10rem;
  min-width: 8rem;
}

.wizard-panel-color-row input[type="color"] {
  flex: 0 0 auto;
  width: 3rem;
  height: 2.25rem;
  padding: 0.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 11, 16, 0.65);
  cursor: pointer;
}

.mod-doc-heading {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.mod-doc-subheading {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.mod-doc-body {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
}

.mod-doc-block--paragraph .mod-doc-inline-img {
  margin: 0.75rem 0 0;
}

.mod-doc-block--paragraph .mod-doc-inline-img img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.mod-doc-figure {
  margin: 0;
}

.mod-doc-figure--multi-image {
  width: 100%;
}

.mod-doc-multi-image-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
  align-items: stretch;
}

.mod-doc-multi-img-cell {
  min-width: 0;
}

.mod-doc-multi-img-cell img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: min(42vh, 420px);
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.35);
}

@media (max-width: 720px) {
  .mod-doc-multi-image-row {
    grid-template-columns: 1fr;
  }

  .mod-doc-multi-img-cell img {
    max-height: min(50vh, 360px);
  }
}

.ws-multi-image-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
  align-items: start;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ws-multi-slot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ws-multi-preview-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(9, 11, 16, 0.6);
  width: 100%;
  max-width: 100%;
}

.ws-multi-preview-wrap[hidden] {
  display: none !important;
}

.ws-multi-preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .ws-multi-image-grid {
    grid-template-columns: 1fr;
  }
}

.mod-doc-map-wrap {
  position: relative;
  cursor: default;
}

.mod-doc-map-image {
  display: block;
  width: auto;
  border: 0;
  border-radius: 0;
}

.mod-doc-map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  cursor: default;
}

.mod-doc-map-dot {
  position: absolute;
  pointer-events: auto;
  z-index: 2;
}

.mod-doc-map-module {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.mod-doc-map-module__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mod-doc-map-module__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.25;
  width: 100%;
}

.mod-doc-map-module__controls {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.mod-doc-map-toolbar-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 201, 168, 0.35) transparent;
}

.mod-doc-marker-search-label {
  flex: 0 0 auto;
  width: 11.75rem;
  min-width: 10.5rem;
  max-width: 14rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mod-doc-marker-search-label::before {
  content: "Search";
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mod-doc-marker-search-label .mod-doc-marker-search,
.mod-doc-marker-search {
  width: 100%;
}

.mod-doc-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: flex-end;
}

.mod-doc-map-filters--toolbar {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
}

.mod-doc-filter-field {
  flex: 0 0 auto;
  min-width: 8.75rem;
  max-width: 14rem;
}

.mod-doc-filter-select-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
  cursor: pointer;
}

.mod-doc-filter-group-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.mod-doc-filter-select {
  display: block;
  width: 100%;
  min-width: 9rem;
  max-width: 16rem;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--text);
  background-color: rgba(9, 11, 16, 0.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  border: 1px solid var(--border);
  border-radius: 10px;
  appearance: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.mod-doc-filter-select:hover {
  border-color: rgba(232, 201, 168, 0.4);
}

.mod-doc-filter-select:focus {
  outline: none;
  border-color: rgba(232, 201, 168, 0.65);
  box-shadow: 0 0 0 2px rgba(232, 201, 168, 0.18);
}

.mod-doc-filter-select option {
  background: #0f1419;
  color: var(--text);
}

.mod-doc-map-module__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(208px, 260px);
  gap: 0.95rem;
  align-items: start;
}

@media (max-width: 760px) {
  .mod-doc-map-module__grid {
    grid-template-columns: 1fr;
  }

  .mod-doc-marker-sidebar {
    max-height: 42vh;
  }

  .mod-doc-subnav {
    gap: 0.3rem 0.45rem;
    padding: 0.5rem 0.55rem;
  }

  .mod-doc-subnav-label {
    flex: 0 0 100%;
    margin-right: 0;
    margin-bottom: 0.1rem;
  }

  .mod-doc-map-module__head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .mod-doc-map-toolbar-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }
}

.mod-doc-map-module .mod-doc-map-pane {
  justify-self: stretch;
  width: 100%;
}

.mod-doc-map-module .mod-doc-map-pane.mod-doc-map-canvas {
  display: block;
  width: 100%;
  max-width: none;
  max-height: none;
  min-height: min(320px, 48vh);
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(5, 7, 12, 0.65);
}

.mod-doc-map-module .mod-doc-map-canvas .mod-doc-map-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  margin: 0 auto;
  vertical-align: top;
}

.mod-doc-map-module .mod-doc-map-pane .map-editor-overlay {
  cursor: default;
}

.mod-doc-marker-sidebar {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(9, 11, 16, 0.5);
  padding: 0.5rem 0.55rem 0.6rem;
  max-height: min(70vh, 720px);
  overflow: auto;
  min-height: 6rem;
}

.mod-doc-marker-sidebar-title {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.mod-doc-marker-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mod-doc-marker-sidebar-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0.35rem 0.4rem;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}

.mod-doc-marker-sidebar-btn:hover {
  background: rgba(232, 201, 168, 0.08);
  border-color: rgba(232, 201, 168, 0.2);
}

.mod-doc-marker-sidebar-btn.is-flash {
  background: rgba(232, 201, 168, 0.18);
  border-color: rgba(232, 201, 168, 0.35);
}

.mod-doc-marker-sidebar-index {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  min-width: 1.35rem;
  padding: 0.1rem 0;
  text-align: center;
  border-radius: 6px;
  background: rgba(232, 201, 168, 0.15);
  color: var(--accent);
}

.mod-doc-marker-sidebar-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mod-doc-marker-sidebar-name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  word-break: break-word;
}

.mod-doc-marker-snippet {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  display: block;
}

.mod-doc-map-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.35);
}

.mod-doc-map-jump-link {
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.mod-doc-map-jump-link:hover {
  text-decoration: underline;
  background: rgba(232, 201, 168, 0.1);
}

.mod-doc-map-appendix {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mod-doc-figure--map-appendix {
  margin-top: 1rem;
}

.mod-doc-figure--map .mod-doc-map-image {
  border-radius: 10px;
}

.mod-doc-figure--map > .mod-doc-map-module {
  max-width: 100%;
}

/* Map figures: full-width image, no inner scroll on the map pane */
.mod-doc-figure--map > .mod-doc-map-module .mod-doc-map-image {
  max-height: none;
}

.mod-doc-marker-popup {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 1.25rem));
  max-height: 72%;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(8, 12, 18, 0.97);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  padding: 0.7rem 0.8rem;
  z-index: 3;
}

.mod-doc-marker-popup[hidden] {
  display: none !important;
}

.mod-doc-marker-popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.mod-doc-marker-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  width: 1.8rem;
  height: 1.8rem;
  cursor: pointer;
}

.mod-doc-marker-popup-body p {
  margin: 0 0 0.45rem;
  line-height: 1.45;
}

.mod-doc-marker-popup-body p:last-child {
  margin-bottom: 0;
}

.mod-doc-marker-media {
  margin: 0.55rem 0 0;
}

.mod-doc-marker-media img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 120px;
  margin: 0 auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 11, 16, 0.45);
}

.marker-media-field {
  margin-top: 0.35rem;
}

.marker-media-preview {
  margin: 0.45rem 0 0.5rem;
  max-width: 11rem;
}

.marker-media-preview img {
  display: block;
  width: 100%;
  max-height: 5.5rem;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 11, 16, 0.45);
}

.marker-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: flex-end;
  margin-top: 0.4rem;
}

.mod-doc-figure:not(.mod-doc-figure--map) img {
  display: block;
  width: 100%;
  max-height: min(70vh, 520px);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.4);
}

.mod-doc-figure figcaption {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.mod-doc-empty-note {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.mod-doc-footer {
  margin: 2rem 0 0;
}

.mod-item-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.mod-item-types {
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mod-block-type-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(9, 11, 16, 0.45);
}
