/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       #1a1814;
  --ink-2:     #3d3a35;
  --ink-3:     #7a756d;
  --ink-4:     #b0ab9f;
  --sand:      #f5f0e8;
  --sand-2:    #ede8df;
  --sand-3:    #e2dcd2;
  --white:     #fdfcfa;
  --accent:    #8b5e3c;
  --accent-2:  #c4895c;
  --gold:      #c9a84c;
  --teal:      #3b7d8a;
  --teal-lt:   #d4eaed;

  --c-megalith: #c4895c;
  --c-temple:   #c9a84c;
  --c-settlement: #6f8b59;
  --c-city:     #3b7d8a;
  --c-burial:   #9b6b7a;
  --c-artifact: #6b8fa8;
  --c-shipwreck: #4f6fa3;
  --c-geoglyph: #8e6aa8;
  --c-rockart:  #b15c3f;
  --c-fortification: #5e6d7d;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --r: 6px;
  --r-lg: 12px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(26,24,20,0.08);
  --shadow-md: 0 4px 16px rgba(26,24,20,0.10);
  --shadow-lg: 0 12px 40px rgba(26,24,20,0.13);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Nav ───────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2.5rem;
  height: 56px;
  background: rgba(253,252,250,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand-3);
}

.nav-logo {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.nav-links {
  display: flex; align-items: center; gap: 2rem;
}

.nav-links a {
  font-size: 13px;
  color: var(--ink-3);
  transition: color 0.15s, opacity 0.15s;
  letter-spacing: 0.02em;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.75);
  transform-origin: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  opacity: 0.65;
  transform: scaleX(1);
}
.nav-links a:focus-visible,
.nav-account-icon:focus-visible,
.nav-logout-btn:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.sidebar-random-btn:focus-visible,
.filter-clear-btn:focus-visible,
.pill:focus-visible,
.overlay-item:focus-visible,
.popup-link:focus-visible,
.detail-mini-map-link:focus-visible,
.profile-link:focus-visible {
  outline: 2px solid rgba(59,125,138,0.38);
  outline-offset: 3px;
  border-radius: 8px;
}
.nav-user-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-account-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--sand-3);
  background: rgba(253,252,250,0.95);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.nav-account-icon:hover {
  border-color: var(--ink-4);
  background: var(--sand);
}
.nav-logout-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-4);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.nav-logout-btn:hover {
  color: var(--accent);
}

.nav-cta {
  color: var(--accent) !important;
  font-weight: 500;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 11px 28px;
  background: var(--ink);
  color: var(--white) !important;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--ink-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 28, 24, 0.14);
}

.btn-ghost {
  display: inline-block;
  padding: 11px 24px;
  border: 1px solid var(--sand-3);
  border-radius: var(--r);
  font-size: 14px;
  color: var(--ink-2);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.btn-ghost:hover {
  border-color: var(--ink-4);
  background: var(--sand);
  transform: translateY(-1px);
}
.btn-compact {
  padding: 8px 14px;
  font-size: 12px;
}

/* ─── Landing Hero ──────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  padding-top: 56px;
  display: flex;
  align-items: center;
  gap: 4rem;
  padding-left: 8vw;
  padding-right: 6vw;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(253, 252, 250, 0.85), transparent 28%),
    radial-gradient(circle at 72% 28%, rgba(201, 168, 76, 0.08), transparent 26%),
    radial-gradient(circle at 40% 78%, rgba(59, 125, 138, 0.07), transparent 24%),
    linear-gradient(180deg, #fcf8f1 0%, #f7f1e8 56%, #fbf7f0 100%);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}
.hero-orb-1 {
  width: 600px; height: 600px;
  top: -150px; right: -100px;
  background: radial-gradient(circle, #c9a84c, #8b5e3c);
}
.hero-orb-2 {
  width: 400px; height: 400px;
  bottom: -100px; left: 10%;
  background: radial-gradient(circle, #3b7d8a, #1a1814);
}

.hero-content {
  position: relative; z-index: 1;
  flex: 1; max-width: 560px;
  padding: 4rem 0;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 7vw, 84px);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-3);
  max-width: 440px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex; gap: 12px; margin-bottom: 3.5rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex; align-items: center; gap: 1.5rem;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--ink); }
.stat-l { font-size: 11px; letter-spacing: 0.08em; color: var(--ink-4); text-transform: uppercase; }
.stat-div { width: 1px; height: 36px; background: var(--sand-3); }

.hero-image-col {
  position: relative; z-index: 1;
  flex: 1; max-width: 500px;
  display: flex; justify-content: center; align-items: center;
  padding: 3rem 0;
}

.hero-globe-wrap {
  position: relative;
  width: min(100%, 460px);
  display: grid;
  justify-items: center;
  gap: 1.2rem;
}

.hero-globe-shell {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.hero-globe-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 26px 50px rgba(26,24,20,0.15));
}

.hero-globe-halo {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(201,168,76,0.16), transparent 38%),
    radial-gradient(circle at 70% 68%, rgba(59,125,138,0.12), transparent 42%);
  filter: blur(16px);
  pointer-events: none;
}

.hero-globe-card {
  width: min(100%, 360px);
  margin-top: -2.5rem;
  background: rgba(253,252,250,0.92);
  border: 1px solid rgba(226,220,210,0.95);
  border-radius: 20px;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.hero-globe-card-top,
.hero-globe-links,
.hero-globe-point-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hero-globe-live,
.hero-globe-era {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-globe-live {
  color: var(--accent);
  font-weight: 600;
}

.hero-globe-count,
.hero-globe-coords,
.hero-globe-location {
  font-size: 12px;
  color: var(--ink-4);
}

.hero-globe-point-row {
  justify-content: flex-start;
  margin: 0.75rem 0 0.3rem;
}

.hero-globe-point-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(59,125,138,0.12);
  flex-shrink: 0;
}

.hero-globe-era {
  color: var(--ink-4);
}

.hero-globe-title {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 0.98;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.hero-globe-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
  margin: 0.7rem 0 0.9rem;
}

.hero-globe-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ─── Features ──────────────────────────────────────────────── */
.features {
  background: var(--sand);
  border-top: 1px solid var(--sand-3);
  padding: 5rem 8vw;
}
.features-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
}
.feat-icon { font-size: 22px; color: var(--accent); margin-bottom: 1rem; }
.feat h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.feat p { font-size: 13px; line-height: 1.7; color: var(--ink-3); }

.v1-strip {
  padding: 5rem 8vw;
  background:
    radial-gradient(circle at top right, rgba(201,168,76,0.08), transparent 36%),
    linear-gradient(180deg, #fbf8f2 0%, #f7f1e8 100%);
  border-top: 1px solid var(--sand-3);
}

.v1-strip-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.section-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.9rem;
}

.v1-copy h2,
.submit-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 300;
  line-height: 1.08;
  margin-bottom: 1rem;
}

.v1-copy p,
.submit-panel p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-3);
  max-width: 620px;
}

.v1-grid {
  display: grid;
  gap: 1rem;
}

.v1-card {
  background: rgba(253,252,250,0.9);
  border: 1px solid var(--sand-3);
  border-radius: 18px;
  padding: 1.35rem 1.35rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.v1-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.v1-card p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

.submit-section {
  padding: 0 8vw 5rem;
  background: linear-gradient(180deg, #f7f1e8 0%, var(--white) 70%);
}

.submit-panel {
  max-width: 1120px;
  margin: 0 auto;
  border: 1px solid var(--sand-3);
  border-radius: 28px;
  padding: 2.2rem;
  background:
    linear-gradient(135deg, rgba(59,125,138,0.06), rgba(201,168,76,0.08)),
    var(--white);
  box-shadow: var(--shadow-md);
}

.submit-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.4rem 0 1.7rem;
}

.submit-points span {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  border: 1px solid var(--sand-3);
  background: rgba(253,252,250,0.9);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
}

/* ─── Footer ────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--sand-3); padding: 1.5rem 8vw; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--ink-4); gap: 1rem; flex-wrap: wrap;
}
.footer-inner a { color: var(--accent); }

/* ─── MAP PAGE ──────────────────────────────────────────────── */
.map-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.map-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  margin-top: 56px;
}

/* Sidebar */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at top left, rgba(201, 168, 76, 0.07), transparent 26%),
    linear-gradient(180deg, #fdfbf7 0%, #f7f2ea 100%);
  border-right: 1px solid var(--sand-3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  transition: width 0.22s ease, height 0.22s ease;
}

.sidebar-head {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(94, 109, 125, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,246,239,0.84));
}

.sidebar-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 10px;
}

.sidebar-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 0;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  padding-bottom: 0.85rem;
}

.sidebar-mobile-footer {
  display: none;
}

.map-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--sand-3);
  background: rgba(255,255,255,0.86);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.map-sidebar-toggle:hover,
.map-sidebar-toggle:focus-visible {
  border-color: rgba(110, 91, 62, 0.28);
  background: #f8f3ed;
  color: var(--ink);
  outline: none;
}

.map-sidebar-toggle-icon {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(135deg);
  transition: transform 0.15s ease;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .sidebar-body,
.sidebar.collapsed .sidebar-head .search-wrap,
.sidebar.collapsed .sidebar-head .sidebar-random-btn,
.sidebar.collapsed .sidebar-head .mobile-overlay-quick,
.sidebar.collapsed .sidebar-head .sidebar-scroll-hint,
.sidebar.collapsed .sidebar-head h2,
.sidebar.collapsed .map-sidebar-toggle-label {
  display: none;
}

.sidebar.collapsed .sidebar-head {
  padding: 1rem 0.75rem;
}

.sidebar.collapsed .sidebar-head-top {
  justify-content: center;
  margin-bottom: 0;
}

.sidebar.collapsed .map-sidebar-toggle {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

.sidebar.collapsed .map-sidebar-toggle-icon {
  transform: rotate(-45deg);
}

.search-wrap {
  position: relative;
}

.sidebar-random-btn {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--sand-3);
  background: var(--sand);
  color: var(--ink-2);
  border-radius: var(--r);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.sidebar-random-btn:hover {
  border-color: var(--ink-4);
  background: #f8f3ed;
  color: var(--ink);
}

.mobile-overlay-quick {
  display: none;
  margin-top: 0.8rem;
}

.overlay-toggle-mobile-quick {
  margin-bottom: 0;
}

.sidebar-scroll-hint {
  display: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--sand-3);
  border-radius: var(--r);
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--sand);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.search-input:focus {
  border-color: var(--ink-4);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 0 4px rgba(59,125,138,0.08);
}
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); font-size: 13px; pointer-events: none;
}
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 25;
  background: rgba(253,252,250,0.98);
  border: 1px solid var(--sand-3);
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(26,24,20,0.1);
  overflow: hidden;
}
.search-suggestion {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--sand-2);
  cursor: pointer;
  display: grid;
  gap: 2px;
}
.search-suggestion:last-child { border-bottom: 0; }
.search-suggestion:hover,
.search-suggestion:focus-visible {
  background: var(--sand);
  outline: none;
}
.search-suggestion-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.search-suggestion-meta {
  font-size: 11px;
  color: var(--ink-4);
}

/* Era slider */
.era-panel {
  margin: 0.75rem 0.9rem 0;
  padding: 0.85rem 0.95rem 0.8rem;
  border: 1px solid rgba(94, 109, 125, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,242,234,0.92));
  box-shadow: 0 14px 30px rgba(51, 34, 21, 0.045);
}
.era-panel-label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.era-panel-label span:first-child {
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-4);
}
.era-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
}

input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: transparent;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
  margin-top: -5.5px;
}
input[type=range]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 60%), var(--sand-3) var(--pct, 60%));
  height: 3px; border-radius: 2px;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: pointer;
}
input[type=range]::-moz-range-track {
  background: var(--sand-3);
  height: 3px;
  border-radius: 2px;
}

.era-year-display {
  font-size: 11px; color: var(--ink-4);
  margin-top: 5px; text-align: right;
}
.era-new-count {
  margin-top: 0.45rem;
  font-size: 11px;
  color: var(--accent);
}

.timeline-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 0.7rem;
}

.timeline-mode-btn {
  border: 1px solid var(--sand-3);
  background: var(--white);
  border-radius: 999px;
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.timeline-mode-btn:hover {
  background: var(--sand);
  color: var(--ink-2);
}
.timeline-mode-btn:focus-visible {
  outline: 2px solid rgba(59,125,138,0.38);
  outline-offset: 2px;
}

.timeline-mode-btn.active {
  background: #f8f3ed;
  border-color: rgba(139, 94, 60, 0.35);
  color: var(--ink);
}

.timeline-mode-copy {
  margin-top: 0.5rem;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-4);
}

/* Filter pills */
.filter-panel {
  margin: 0.75rem 0.9rem 0;
  padding: 1rem 1rem;
  border: 1px solid rgba(94, 109, 125, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,244,237,0.9));
  box-shadow: 0 14px 30px rgba(51, 34, 21, 0.04);
}
.filter-panel-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-4);
  margin-bottom: 8px;
}
.filter-panel-title-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.filter-help-link {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(94, 109, 125, 0.22);
  background: rgba(255,255,255,0.85);
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.filter-help-link:hover {
  border-color: rgba(139, 94, 60, 0.35);
  color: var(--ink);
  background: #f8f3ed;
  transform: translateY(-1px);
}
.filter-clear-btn {
  border: 1px solid rgba(94, 109, 125, 0.14);
  background: rgba(255,255,255,0.82);
  color: var(--ink-3);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.filter-clear-btn:hover {
  color: var(--ink);
  border-color: rgba(139, 94, 60, 0.28);
  background: #f8f3ed;
  transform: translateY(-1px);
}
.filter-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pill {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--sand-3);
  font-size: 11px;
  cursor: pointer;
  background: var(--white);
  color: var(--ink-3);
  transition: all 0.15s;
  font-family: var(--font-body);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.pill.active { border-color: transparent; color: var(--ink); }
.pill.active[data-cat=megalith] { background: #fdf0e6; color: #8b4a1a; border-color: #c4895c44; }
.pill.active[data-cat=temple]   { background: #fdf8e6; color: #7a6010; border-color: #c9a84c44; }
.pill.active[data-cat=settlement] { background: #edf4e6; color: #456437; border-color: #6f8b5944; }
.pill.active[data-cat=city]     { background: #e6f2f5; color: #1f5c67; border-color: #3b7d8a44; }
.pill.active[data-cat=burial]   { background: #f5eff2; color: #6b3a4e; border-color: #9b6b7a44; }
.pill.active[data-cat=artifact] { background: #ecf3f8; color: #2f5570; border-color: #6b8fa844; }
.pill.active[data-cat=shipwreck] { background: #edf2fb; color: #35527f; border-color: #4f6fa344; }
.pill.active[data-cat=geoglyph] { background: #f2ebfa; color: #6b4690; border-color: #8e6aa844; }
.pill.active[data-cat=rockart] { background: #f8ece6; color: #8a4123; border-color: #b15c3f44; }
.pill.active[data-cat=fortification] { background: #edf1f4; color: #455563; border-color: #5e6d7d44; }

.types-shell {
  padding: 3rem 8vw 4rem;
}
.types-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.75rem;
}
.types-hero-copy,
.types-hero-card,
.types-card,
.types-footer-note-inner {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(94, 109, 125, 0.14);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(51, 34, 21, 0.08);
}
.types-hero-copy {
  padding: 2rem 2.1rem;
}
.types-hero-copy h1 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 62px);
  line-height: 0.95;
  font-weight: 400;
  color: var(--ink);
}
.types-hero-copy p,
.types-hero-card p,
.types-card p,
.types-footer-note-inner p {
  margin: 0;
  color: var(--ink-3);
  line-height: 1.65;
}
.types-hero-card {
  padding: 1.5rem 1.6rem;
  background:
    radial-gradient(circle at top right, rgba(201, 168, 76, 0.16), transparent 45%),
    rgba(255,255,255,0.9);
}
.types-hero-card-title,
.types-footer-note-inner h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
}
.types-hero-note {
  margin-top: 1rem !important;
  color: var(--ink-2) !important;
}
.types-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.types-card {
  padding: 1.4rem 1.45rem;
}
.types-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}
.types-card-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 5px rgba(248, 244, 238, 0.95);
}
.types-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--ink);
}
.types-card-count {
  margin-top: 0.2rem;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.types-card-definition {
  font-size: 14px;
}
.types-card-block {
  margin-top: 1rem;
}
.types-card-label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.types-example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.types-example-link {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 109, 125, 0.16);
  background: #fcfaf6;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12px;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.types-example-link:hover {
  border-color: rgba(139, 94, 60, 0.3);
  background: #f8f3ed;
  color: var(--ink);
  transform: translateY(-1px);
}
.types-footer-note {
  margin-top: 1.25rem;
}
.types-footer-note-inner {
  padding: 1.5rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.overlay-panel {
  margin: 0.75rem 0.9rem 0.85rem;
  padding: 0.72rem 0.8rem;
  border: 1px solid rgba(94, 109, 125, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(237,232,223,0.42), rgba(253,252,250,0.82));
  box-shadow: 0 14px 30px rgba(51, 34, 21, 0.04);
}

.overlay-panel-copy {
  font-size: 12px;
  color: var(--ink-4);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.overlay-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0.6rem 0.72rem;
  border: 1px solid rgba(94, 109, 125, 0.14);
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  color: var(--ink-2);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.overlay-toggle:hover,
.overlay-toggle:focus-within {
  border-color: rgba(110, 91, 62, 0.26);
  background: #f8f3ed;
  box-shadow: 0 10px 20px rgba(26,24,20,0.05);
}

.overlay-toggle-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.overlay-toggle-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.overlay-toggle-note {
  font-size: 10px;
  line-height: 1.35;
  color: var(--ink-4);
}

.overlay-toggle input {
  accent-color: var(--accent);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.overlay-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.overlay-item {
  width: 100%;
  border: 1px solid var(--sand-3);
  background: rgba(253,252,250,0.92);
  border-radius: 10px;
  padding: 7px 9px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, opacity 0.15s;
}

.overlay-item:hover {
  background: var(--sand);
  transform: translateY(-1px);
}

.overlay-item.inactive {
  opacity: 0.58;
}

.overlay-item.focus,
.overlay-item.active {
  border-color: rgba(139, 94, 60, 0.35);
  background: #f8f3ed;
}

.recent-panel {
  margin: 0 0.9rem 0.85rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(94, 109, 125, 0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 12px 28px rgba(51, 34, 21, 0.035);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(300px, calc(100vh - 410px));
  overflow: hidden;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(220px, calc(100vh - 500px));
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.recent-item {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(94, 109, 125, 0.12);
  background: rgba(253,252,250,0.88);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.recent-item:hover {
  border-color: rgba(139, 94, 60, 0.28);
  background: #f8f3ed;
  transform: translateX(1px);
}

.recent-item-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-item-meta {
  display: block;
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overlay-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.75);
}

.overlay-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.overlay-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

.overlay-period {
  font-size: 11px;
  color: var(--ink-4);
  line-height: 1.4;
}

/* Map area */
.map-area { flex: 1; position: relative; min-height: 0; }

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Leaflet overrides */
.leaflet-container {
  font-family: var(--font-body) !important;
  background: #c8d8c8;
}
.leaflet-control-zoom a {
  font-family: var(--font-body) !important;
  color: var(--ink) !important;
}

/* Custom marker */
.custom-marker {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s;
}
.custom-marker:hover { transform: scale(1.4); }

/* Popup */
.leaflet-popup-content-wrapper {
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--sand-3) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content {
  margin: 0 !important;
  min-width: 220px;
}
.leaflet-popup-tip { background: var(--white) !important; }
.leaflet-popup-close-button { padding: 8px 10px !important; font-size: 16px !important; color: var(--ink-3) !important; }

.popup-inner { padding: 1rem 1.1rem 1rem; }
.popup-era { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 3px; }
.popup-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.popup-loc { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.popup-desc { font-size: 12px; line-height: 1.6; color: var(--ink-3); margin-bottom: 12px; }
.popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.popup-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  font-size: 10px; padding: 5px 10px; border-radius: 999px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
}
.popup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(139, 94, 60, 0.2);
  background: #f8f3ed;
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.popup-link:hover {
  text-decoration: none;
  border-color: rgba(139, 94, 60, 0.32);
  background: #f3ece2;
  color: var(--ink);
  transform: translateY(-1px);
}

/* Site count badge */
.map-badge {
  position: absolute; top: 16px; right: 16px; z-index: 500;
  background: var(--white); border: 1px solid var(--sand-3);
  border-radius: var(--r);
  padding: 8px 14px;
  font-size: 12px; color: var(--ink-3);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.map-badge strong { color: var(--ink); font-weight: 500; }
.map-dateline-hint {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 500;
  max-width: 320px;
  background: rgba(253,252,250,0.95);
  border: 1px solid var(--sand-3);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  box-shadow: 0 12px 24px rgba(26,24,20,0.08);
}

/* ─── SITE DETAIL ───────────────────────────────────────────── */
.detail-page { padding-top: 56px; }

.detail-hero {
  background: var(--sand);
  border-bottom: 1px solid var(--sand-3);
  padding: 4rem 8vw 3rem;
}
.detail-hero-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) 300px;
  gap: 2rem;
  align-items: start;
}
.detail-hero-copy {
  min-width: 0;
}
.detail-breadcrumb {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 1rem;
}
.detail-breadcrumb a { color: var(--accent); }
.detail-hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}
.detail-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 32px;
}
.detail-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  font-size: 10px;
  line-height: 1;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.detail-era-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--ink-3);
}
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 300;
  line-height: 1.02;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
  max-width: 16ch;
  text-wrap: balance;
}
.detail-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-utility-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid rgba(110, 91, 62, 0.14);
  background: rgba(253,252,250,0.82);
  padding: 8px 13px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.2;
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.detail-utility-link:hover {
  color: var(--ink);
  border-color: rgba(110, 91, 62, 0.26);
  background: #f8f3ed;
  transform: translateY(-1px);
}
.detail-summary-strip {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--sand-3);
  border-radius: 18px;
  background: rgba(253,252,250,0.66);
}
.detail-summary-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 0.4rem;
}
.detail-location-block {
  min-width: 0;
}
.detail-location {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
}
.detail-meta-band {
  margin-top: 0.9rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--sand-3);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(253,252,250,0.92), rgba(244,239,231,0.92));
}
.detail-era-strip {
  padding: 0.95rem 1.05rem 1.15rem;
  border: 1px solid var(--sand-3);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(253,252,250,0.92), rgba(244,239,231,0.92));
}
.detail-context-band {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.35rem 8vw 0;
}
.detail-era-strip-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.detail-era-strip-current {
  font-size: 12px;
  color: var(--ink-3);
}
.detail-era-track {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 76px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(110, 91, 62, 0.12);
  background: rgba(245, 241, 234, 0.82);
}
.detail-era-segment {
  position: relative;
  min-width: 44px;
  padding: 0.8rem 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  border-right: 1px solid rgba(110, 91, 62, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(216, 202, 184, 0.12));
}
.detail-era-segment:last-child {
  border-right: none;
}
.detail-era-segment.active {
  background:
    linear-gradient(180deg, rgba(197, 154, 109, 0.26), rgba(197, 154, 109, 0.08)),
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(216, 202, 184, 0.12));
}
.detail-era-name {
  font-size: 11px;
  line-height: 1.25;
  color: var(--ink);
  min-height: 2.8em;
  display: flex;
  align-items: flex-end;
}
.detail-era-range {
  font-size: 10px;
  line-height: 1.35;
  color: var(--ink-4);
  min-height: 2.7em;
}
.detail-era-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  pointer-events: none;
}
.detail-era-marker::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -1px;
  width: 2px;
  height: calc(100% - 18px);
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.75);
}
.detail-era-marker::after {
  content: "";
  position: absolute;
  top: 3px;
  left: -6px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.96);
  box-shadow: 0 4px 10px rgba(56, 41, 24, 0.18);
}
.detail-meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  align-self: stretch;
}
.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.8rem 0.85rem;
  border: 1px solid rgba(110, 91, 62, 0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.52);
}
.detail-meta-item .label { font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-4); }
.detail-meta-item .value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  text-wrap: balance;
}
.detail-meta-subvalue {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-4);
}
.detail-mini-map-card {
  width: min(100%, 320px);
  justify-self: end;
  background: rgba(253,252,250,0.88);
  border: 1px solid var(--sand-3);
  border-radius: var(--r-lg);
  padding: 0.9rem;
  box-shadow: var(--shadow-sm);
}
.detail-mini-map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.detail-mini-map-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.detail-mini-map-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}
.detail-mini-map-link:hover { text-decoration: underline; }
.detail-mini-map {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--sand-3);
}
.detail-mini-map-caption {
  margin-top: 0.75rem;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 300px;
  align-items: start;
  gap: 2.75rem;
  max-width: 1360px;
  margin: 0 auto;
  padding: 3.5rem 8vw;
}
.detail-reader-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--sand-3);
}
.detail-reader-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.detail-reader-buttons {
  display: inline-flex;
  gap: 6px;
}
.detail-reader-btn {
  border: 1px solid var(--sand-3);
  background: var(--white);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 5px 10px;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.detail-reader-btn:hover,
.detail-reader-btn:focus-visible {
  border-color: var(--ink-4);
  color: var(--ink);
  outline: none;
}
.detail-reader-btn.active {
  background: var(--sand);
  color: var(--ink);
  border-color: rgba(59,125,138,0.18);
}

.detail-article h2 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--ink);
}
.detail-gallery,
.detail-media-stack {
  display: grid;
  gap: 1rem;
}
.detail-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.75rem;
}
.detail-media-stack {
  grid-template-columns: 1fr;
}
.detail-image-card {
  background: var(--sand);
  border: 1px solid var(--sand-3);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #e8e0d4, #f5f0e8);
}
.detail-image-card figcaption {
  padding: 0.75rem 0.9rem 0.85rem;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
}
.detail-image-sep {
  display: block;
  margin-top: 0.45rem;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.detail-article p {
  font-size: 16px; line-height: 1.8;
  color: var(--ink-2);
  margin-bottom: 1.25rem;
}
.detail-article p:first-child { font-size: 18px; line-height: 1.75; color: var(--ink); }
html[data-article-size="sm"] .detail-article p { font-size: 15px; line-height: 1.72; }
html[data-article-size="sm"] .detail-article p:first-child { font-size: 17px; line-height: 1.68; }
html[data-article-size="lg"] .detail-article p { font-size: 17px; line-height: 1.92; }
html[data-article-size="lg"] .detail-article p:first-child { font-size: 19px; line-height: 1.82; }
.detail-contributors {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--sand-3);
}
.detail-contributors-copy {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
  margin-bottom: 1rem;
}
.detail-contributor-list {
  display: grid;
  gap: 0.9rem;
}
.detail-contributor-card {
  background: var(--sand);
  border: 1px solid var(--sand-3);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem;
}
.detail-contributor-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
}
.detail-contributor-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
}
.detail-contributor-meta,
.detail-contributor-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}
.detail-contributor-role {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 0.35rem;
}
.detail-contributor-points {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.detail-sidebar {}
.detail-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
}
.detail-sidebar-card {
  background: var(--sand);
  border: 1px solid var(--sand-3);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.detail-sidebar-card:hover {
  border-color: rgba(110, 91, 62, 0.22);
  box-shadow: 0 10px 24px rgba(26,24,20,0.06);
}
.detail-sidebar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.detail-sidebar-toggle:focus-visible {
  outline: 2px solid rgba(59,125,138,0.4);
  outline-offset: 6px;
  border-radius: 8px;
}
.detail-sidebar-card h3 {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  margin-bottom: 1rem;
  color: var(--ink);
}
.detail-sidebar-toggle h3 {
  margin-bottom: 0;
}
.detail-sidebar-toggle-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  border-right: 1.5px solid var(--ink-4);
  border-bottom: 1.5px solid var(--ink-4);
  transform: rotate(45deg);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.detail-sidebar-toggle:hover .detail-sidebar-toggle-icon {
  border-color: var(--accent);
}
.detail-sidebar-content {
  margin-top: 1rem;
}
.detail-sidebar-card.collapsed .detail-sidebar-content {
  display: none;
}
.detail-sidebar-card.collapsed .detail-sidebar-toggle-icon {
  transform: rotate(-45deg);
}
.detail-sidebar-card dl {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px;
}
.detail-sidebar-card dt { font-size: 11px; color: var(--ink-4); letter-spacing: 0.05em; }
.detail-sidebar-card dd { font-size: 13px; color: var(--ink-2); }

.related-sites { display: flex; flex-direction: column; gap: 8px; }
.related-site-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--sand-3);
  cursor: pointer;
  transition: opacity 0.15s;
}
.related-site-item:last-child { border-bottom: none; }
.related-site-item:hover { opacity: 0.7; }
.rs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rs-name { font-size: 13px; font-weight: 500; }
.rs-date { font-size: 11px; color: var(--ink-4); }
.site-era-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f8f3ed;
  border: 1px solid rgba(139, 94, 60, 0.18);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Community */
.community-page { padding-top: 56px; background: linear-gradient(180deg, #fbf8f3 0%, #fdfcfa 25%, #fdfcfa 100%); }
.community-shell { max-width: 1180px; margin: 0 auto; padding: 3.5rem 8vw 4rem; }
.community-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: 2rem; align-items: stretch; margin-bottom: 2rem; }
.community-panel {
  background: rgba(253,252,250,0.92);
  border: 1px solid var(--sand-3);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.community-kicker { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.85rem; }
.community-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 300;
  line-height: 1.04;
  color: var(--ink);
  margin-bottom: 1rem;
}
.community-copy { font-size: 15px; line-height: 1.75; color: var(--ink-3); }
.community-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.4rem; }
.community-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-top: 1.25rem; }
.community-stat {
  background: var(--sand);
  border: 1px solid var(--sand-3);
  border-radius: 14px;
  padding: 1rem;
}
.community-stat strong { display: block; font-family: var(--font-display); font-size: 28px; color: var(--ink); }
.community-stat span { font-size: 12px; color: var(--ink-3); }
.community-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; }
.community-main,
.community-sidebar,
.community-feed,
.leaderboard,
.community-steps,
.community-form { display: grid; gap: 1rem; }
.community-sidebar { align-content: start; }
.community-card,
.submission-card {
  background: rgba(253,252,250,0.96);
  border: 1px solid var(--sand-3);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.community-card {
  padding: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.community-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(26,24,20,0.08);
  border-color: rgba(110, 91, 62, 0.2);
}
.community-card h2,
.community-card h3 { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--ink); margin-bottom: 0.7rem; }
.community-card p { font-size: 14px; line-height: 1.7; color: var(--ink-3); }
.submission-card { padding: 1rem 1.05rem; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 1rem; }
.submission-vote { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 0.2rem; }
.vote-btn {
  width: 34px; height: 34px; border-radius: 12px; border: 1px solid var(--sand-3);
  background: var(--white); color: var(--ink-3); font-size: 15px; cursor: pointer;
}
.vote-score { font-family: var(--font-display); font-size: 24px; color: var(--ink); }
.submission-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 0.55rem; }
.submission-pill {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4);
  padding: 4px 8px; border-radius: 999px; background: var(--sand); border: 1px solid var(--sand-3);
}
.submission-title { font-family: var(--font-display); font-size: 28px; line-height: 1.1; color: var(--ink); margin-bottom: 0.4rem; }
.submission-summary { font-size: 14px; line-height: 1.7; color: var(--ink-3); margin-bottom: 0.9rem; }
.submission-footer { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.submission-byline,
.submission-comments { font-size: 12px; color: var(--ink-4); }
.submission-source-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.75rem; }
.submission-source {
  font-size: 11px; color: var(--ink-3); padding: 5px 8px; border-radius: 999px;
  border: 1px solid var(--sand-3); background: var(--white);
}
.leaderboard-item {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  padding: 0.85rem 0; border-bottom: 1px solid var(--sand-3);
}
.leaderboard-item:last-child { border-bottom: none; }
.leaderboard-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.leaderboard-meta { font-size: 12px; color: var(--ink-3); margin-top: 0.2rem; }
.leaderboard-points { font-family: var(--font-display); font-size: 22px; color: var(--accent); white-space: nowrap; }
.community-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.community-form label { display: grid; gap: 0.45rem; font-size: 12px; color: var(--ink-2); }
.community-form input,
.community-form select,
.community-form textarea {
  width: 100%; border: 1px solid var(--sand-3); border-radius: 12px; background: var(--white);
  padding: 11px 12px; font-family: var(--font-body); font-size: 13px; color: var(--ink); outline: none;
}
.community-form textarea { min-height: 110px; resize: vertical; }
.community-form input:focus,
.community-form select:focus,
.community-form textarea:focus { border-color: var(--accent); }
.community-inline-note { font-size: 12px; color: var(--ink-4); line-height: 1.6; }
.community-form-panel {
  margin: 0.25rem 0 1rem;
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(237,232,223,0.5), rgba(253,252,250,0.98));
  border: 1px solid var(--sand-3);
  border-radius: 16px;
  box-shadow: none;
}
.community-form-panel h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.45rem;
}
.community-code-area {
  min-height: 160px;
  font-family: Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  font-size: 12px;
  line-height: 1.6;
  background: #fbf7f0;
}
.overlay-color-field {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--sand-3);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(253,252,250,0.98), rgba(245,241,234,0.98));
  padding: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.overlay-color-field input[type="color"] {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 12px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.overlay-color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.overlay-color-field input[type="color"]::-webkit-color-swatch {
  border: 2px solid rgba(255,255,255,0.92);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(56, 41, 24, 0.18);
}
.overlay-color-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.overlay-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 4px 12px rgba(56, 41, 24, 0.16);
  flex-shrink: 0;
}
.overlay-color-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.overlay-color-meta strong {
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.06em;
}
.overlay-color-meta span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-4);
}
.overlay-draw-help {
  min-height: 44px;
  border: 1px solid var(--sand-3);
  border-radius: 12px;
  background: var(--white);
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}
.overlay-draw-panel {
  display: grid;
  gap: 0.75rem;
  margin: 0.8rem 0 1rem;
}
.overlay-draw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.overlay-draw-toolbar .btn-ghost {
  padding: 9px 14px;
}
.overlay-draw-map {
  height: 360px;
  border: 1px solid var(--sand-3);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(197, 154, 109, 0.15), transparent 42%),
    linear-gradient(180deg, rgba(253,252,250,0.95), rgba(241,236,227,0.95));
}
.overlay-draw-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-4);
}
.overlay-vertex-icon {
  background: transparent;
  border: none;
}
.overlay-vertex-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.96);
  box-shadow: 0 4px 12px rgba(56, 41, 24, 0.28);
  cursor: grab;
}
.overlay-vertex-dot:active {
  cursor: grabbing;
}
.oauth-card { text-align: center; padding: 2rem 1.5rem; }
.oauth-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--sand-3);
  background: var(--white); color: var(--ink); font-family: var(--font-body); font-size: 14px; font-weight: 500;
}
.oauth-mark {
  width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fbbc05, #34a853); color: #fff; font-size: 12px; font-weight: 700;
}
.community-step { border: 1px solid var(--sand-3); border-radius: 14px; background: var(--sand); padding: 0.95rem 1rem; }
.community-step strong { display: block; font-size: 13px; color: var(--ink); margin-bottom: 0.25rem; }
.community-step span { font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.empire-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.empire-card {
  background: rgba(253,252,250,0.96);
  border: 1px solid var(--sand-3);
  border-radius: 18px;
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.empire-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
}
.empire-card h2 {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.08;
  color: var(--ink);
}
.empire-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  border: 1px solid var(--sand-3);
  background: var(--white);
  white-space: nowrap;
}
.empire-meta { font-size: 12px; color: var(--ink-4); margin-bottom: 0.6rem; }
.empire-desc { font-size: 14px; line-height: 1.7; color: var(--ink-3); margin-bottom: 0.95rem; }
.empire-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.empire-swatch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.empire-swatch-dot { width: 12px; height: 12px; border-radius: 999px; }
.profile-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) 320px; gap: 1.5rem; margin-bottom: 1.5rem; }
.profile-card {
  background: rgba(253,252,250,0.96);
  border: 1px solid var(--sand-3);
  border-radius: 22px;
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.profile-name {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.04;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.profile-handle { font-size: 13px; color: var(--ink-4); margin-bottom: 0.8rem; }
.profile-about { font-size: 15px; line-height: 1.75; color: var(--ink-3); margin-bottom: 1rem; }
.profile-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-social {
  font-size: 12px;
  color: var(--accent);
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--sand-3);
  background: var(--white);
}
.profile-social:hover { text-decoration: underline; }
.profile-editor-card h2 {
  margin-bottom: 0.25rem;
}
.profile-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.profile-social-editor {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}
.profile-social-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) auto;
  gap: 0.75rem;
  align-items: end;
}
.profile-social-input {
  width: 100%;
  border: 1px solid var(--sand-3);
  border-radius: 12px;
  background: var(--white);
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink);
  outline: none;
}
.profile-social-input:focus {
  border-color: var(--accent);
}
.profile-social-remove {
  border: 1px solid var(--sand-3);
  background: var(--white);
  color: var(--ink-3);
  border-radius: 12px;
  padding: 11px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
}
.profile-social-remove:hover {
  border-color: var(--ink-4);
  color: var(--ink);
}
.profile-stat-grid { display: grid; gap: 0.9rem; }
.profile-stat-box {
  background: var(--sand);
  border: 1px solid var(--sand-3);
  border-radius: 14px;
  padding: 1rem;
}
.profile-stat-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--ink);
}
.profile-stat-box span { font-size: 12px; color: var(--ink-3); }
.profile-link { color: inherit; }
.profile-link:hover { color: var(--accent); }

/* ─── ERAS PAGE ─────────────────────────────────────────────── */
.eras-page { padding-top: 56px; }

.eras-header {
  padding: 4rem 8vw 3rem;
  border-bottom: 1px solid var(--sand-3);
  max-width: 1080px;
}
.eras-header h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 300;
  margin-bottom: 1rem;
}
.eras-header p {
  font-size: 16px; color: var(--ink-3); line-height: 1.7;
}

.eras-list { padding: 2rem 8vw 4rem; max-width: 1480px; }

.era-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1.2fr) 100px;
  align-items: start;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--sand-2);
  transition: opacity 0.15s;
  cursor: pointer;
}
.era-card:hover { opacity: 0.75; }

.era-card-date {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  padding-top: 4px;
}
.era-card-date small {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  margin-top: 4px;
}

.era-card-body h3 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600;
  margin-bottom: 6px;
}
.era-card-body p {
  font-size: 14px; color: var(--ink-3); line-height: 1.6;
  max-width: 780px; margin-bottom: 1rem;
}
.era-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.era-tag {
  font-size: 10px; padding: 3px 10px; border-radius: 20px;
  background: var(--sand); border: 1px solid var(--sand-3);
  color: var(--ink-3); letter-spacing: 0.06em;
}

.era-card-count {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 300;
  color: var(--sand-3);
  white-space: nowrap;
  padding-top: 0;
}

/* ─── Scrollbar ─────────────────────────────────────────────── */
.overlay-list::-webkit-scrollbar { width: 4px; }
.overlay-list::-webkit-scrollbar-track { background: transparent; }
.overlay-list::-webkit-scrollbar-thumb { background: var(--sand-3); border-radius: 2px; }
.recent-list::-webkit-scrollbar { width: 4px; }
.recent-list::-webkit-scrollbar-track { background: transparent; }
.recent-list::-webkit-scrollbar-thumb { background: var(--sand-3); border-radius: 2px; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav {
    padding: 0.55rem 1rem 0.45rem;
    height: auto;
    min-height: 56px;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .nav-logo {
    line-height: 1;
    padding-top: 0.1rem;
  }
  .nav-links {
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .nav-links a {
    font-size: 12px;
    line-height: 1.15;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
    padding: 96px 6vw 3.5rem;
    gap: 2rem;
  }
  .hero-content {
    max-width: none;
    padding: 1rem 0 0;
  }
  .hero-sub { max-width: none; font-size: 15px; }
  .hero-stats {
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .hero-image-col {
    display: flex;
    width: 100%;
    max-width: none;
    padding: 0;
  }
  .hero-globe-wrap {
    width: 100%;
    max-width: 380px;
    justify-items: stretch;
  }
  .hero-globe-shell {
    width: min(100%, 360px);
    margin: 0 auto;
  }
  .hero-globe-card {
    width: 100%;
    max-width: 360px;
    margin: -2rem auto 0;
  }

  .features,
  .v1-strip,
  .submit-section,
  .detail-hero,
  .detail-body,
  .eras-header,
  .eras-list,
  .footer {
    padding-left: 6vw;
    padding-right: 6vw;
  }

  .v1-strip-inner {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .submit-panel {
    padding: 1.4rem;
    border-radius: 20px;
  }

  .map-page { height: auto; overflow: auto; }
  .map-layout {
    flex-direction: column;
    margin-top: 56px;
    min-height: calc(100vh - 56px);
  }
  .sidebar {
    width: 100%;
    height: auto;
    max-height: min(62vh, 560px);
    border-right: none;
    border-bottom: 1px solid var(--sand-3);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-body {
    overflow: visible;
    flex: 0 0 auto;
    padding-top: 0.35rem;
    padding-bottom: 0.5rem;
    scroll-padding-top: 0.5rem;
    scroll-padding-bottom: 4.75rem;
    touch-action: pan-y;
  }
  .sidebar:not(.collapsed) .sidebar-head .map-sidebar-toggle {
    display: none;
  }
  .sidebar-mobile-footer {
    display: block;
    position: static;
    padding: 0.35rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
    background: rgba(247,242,234,0.98);
    border-top: 1px solid rgba(94, 109, 125, 0.08);
  }
  .map-sidebar-toggle-mobile {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }
  #timeSlider {
    height: 28px;
    margin: 0.15rem 0;
    touch-action: pan-x;
  }
  #timeSlider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -8px;
  }
  #timeSlider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
  }
  #timeSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
  #timeSlider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
  }
  .sidebar.collapsed .sidebar-mobile-footer {
    display: none;
  }
  .sidebar.collapsed {
    width: 100%;
    height: 74px;
  }
  .map-sidebar-toggle-icon {
    transform: rotate(-135deg);
  }
  .sidebar.collapsed .sidebar-head {
    padding: 0 !important;
    min-height: 74px;
    width: 100%;
    display: grid;
    place-items: center;
  }
  .sidebar.collapsed .sidebar-head-top {
    width: 100%;
    height: 74px;
    display: grid;
    place-items: center;
    margin-bottom: 0;
  }
  .sidebar.collapsed .map-sidebar-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    justify-content: center;
    align-items: center;
    justify-self: center;
    align-self: center;
  }
  .sidebar.collapsed .map-sidebar-toggle-icon {
    transform: rotate(45deg);
  }
  .sidebar-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(94, 109, 125, 0.1);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(122, 117, 109, 0.9);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
  }
  .sidebar-scroll-hint.visible {
    opacity: 1;
    transform: translateY(0);
  }
  .sidebar-scroll-hint.intro {
    animation: sidebarScrollHintIntro 1.4s ease;
  }
  .sidebar-scroll-hint-icon {
    font-size: 11px;
    line-height: 1;
    color: rgba(139, 94, 60, 0.72);
  }
  .era-panel,
  .filter-panel,
  .overlay-panel,
  .recent-panel {
    margin-left: 0.8rem;
    margin-right: 0.8rem;
    position: relative;
  }
  .era-panel { order: 1; }
  .filter-panel { order: 2; }
  .recent-panel { order: 3; }
  .mobile-overlay-quick {
    display: block;
  }
  .overlay-panel-desktop {
    display: none !important;
  }
  .overlay-toggle {
    padding: 0.8rem 0.9rem;
    gap: 12px;
    align-items: flex-start;
  }
  .overlay-toggle-title {
    font-size: 13px;
  }
  .overlay-toggle-note {
    font-size: 10px;
  }
  .overlay-toggle input {
    width: 24px;
    height: 24px;
    margin-top: 1px;
  }
  .overlay-list {
    display: none;
  }
  .mobile-overlay-quick .filter-panel-label,
  .overlay-toggle {
    display: flex !important;
  }
  .overlay-item {
    padding: 9px 10px;
    gap: 10px;
    background: rgba(253,252,250,0.98);
  }
  .overlay-item.inactive {
    opacity: 0.78;
  }
  .overlay-name {
    font-size: 13px;
    line-height: 1.3;
  }
  .overlay-period {
    font-size: 11px;
    line-height: 1.45;
  }
  .recent-panel {
    max-height: none;
    overflow: visible;
    margin-top: 0;
  }
  .recent-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .recent-item {
    padding: 0.65rem 0.7rem;
  }
  .recent-item-name {
    font-size: 13px;
  }
  .map-area {
    min-height: 52vh;
    height: 52vh;
  }
  .popup-link {
    min-height: 36px;
    padding: 7px 12px;
  }
  .popup-tag {
    min-height: 32px;
    padding: 6px 11px;
  }
  .map-badge {
    top: 12px;
    right: 12px;
    padding: 7px 12px;
  }
  .map-dateline-hint {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
  .sidebar {
    scrollbar-width: auto;
    scrollbar-color: rgba(139, 94, 60, 0.6) rgba(237, 232, 223, 0.9);
  }
  .sidebar::-webkit-scrollbar { width: 8px; }
  .sidebar::-webkit-scrollbar-track {
    background: rgba(237, 232, 223, 0.9);
    border-radius: 999px;
  }
  .sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(139, 94, 60, 0.72), rgba(110, 91, 62, 0.82));
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.75);
  }

  @keyframes sidebarScrollHintIntro {
    0% {
      opacity: 0;
      transform: translateY(-5px);
    }
    30% {
      opacity: 1;
      transform: translateY(0);
    }
    55% {
      opacity: 1;
      transform: translateY(0);
    }
    72% {
      opacity: 1;
      transform: translateY(3px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .detail-body {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
  }
  .detail-reader-controls {
    gap: 0.75rem;
    align-items: flex-start;
    flex-direction: column;
  }
  .detail-sidebar {
    position: static;
  }
  .detail-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .detail-mini-map-card {
    width: 100%;
    justify-self: stretch;
  }
  .detail-context-band {
    padding-left: 6vw;
    padding-right: 6vw;
  }
  .detail-title {
    max-width: none;
  }
  .detail-era-strip-head {
    align-items: flex-start;
  }
  .detail-era-track {
    min-height: 0;
    display: grid;
    gap: 0;
  }
  .detail-era-segment {
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid rgba(110, 91, 62, 0.12);
  }
  .detail-era-segment:last-child {
    border-bottom: none;
  }
  .detail-era-marker {
    display: none;
  }
  .detail-mini-map {
    height: 200px;
  }
  .detail-meta-row {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .detail-gallery {
    grid-template-columns: 1fr;
  }
  .community-hero,
  .community-grid,
  .community-form-grid,
  .empire-grid,
  .types-hero,
  .profile-hero {
    grid-template-columns: 1fr;
  }
  .submission-card {
    grid-template-columns: 1fr;
  }
  .profile-social-row {
    grid-template-columns: 1fr;
  }
  .overlay-draw-map {
    height: 300px;
  }
  .overlay-color-field {
    grid-template-columns: 1fr;
  }
  .submission-vote {
    flex-direction: row;
    justify-content: flex-start;
  }
  .detail-location,
  .detail-article p {
    font-size: 15px;
  }

  .eras-header {
    padding-top: 3rem;
    padding-bottom: 2.25rem;
  }
  .era-card {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem 0;
  }
  .era-card-date {
    font-size: 24px;
    padding-top: 0;
  }
  .era-card-count { display: none; }
}

@media (min-width: 1500px) {
  .features-inner {
    max-width: 1480px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .v1-strip-inner,
  .submit-panel {
    max-width: 1480px;
  }

  .types-shell {
    max-width: 1500px;
    margin: 0 auto;
  }

  .types-hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.8fr);
    gap: 1.75rem;
  }

  .types-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-hero-grid {
    max-width: 1360px;
    grid-template-columns: minmax(0, 1.22fr) 320px;
  }

  .community-shell {
    max-width: 1500px;
  }

  .community-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  }

  .community-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.75rem;
  }

  .empire-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-hero {
    grid-template-columns: minmax(0, 1.2fr) 380px;
    gap: 1.75rem;
  }
}

@media (max-width: 560px) {
  .nav-cta { display: none; }
  .hero-title { font-size: clamp(42px, 14vw, 58px); }
  .types-grid {
    grid-template-columns: 1fr;
  }
  .types-footer-note-inner {
    align-items: flex-start;
  }
  .hero-actions {
    width: 100%;
    flex-direction: column;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost,
  .submit-panel .btn-primary {
    width: 100%;
    text-align: center;
  }
  .hero-globe-title {
    font-size: 29px;
  }
  .hero-globe-links {
    flex-direction: column;
    align-items: flex-start;
  }
  .overlay-list {
    max-height: 180px;
  }
  .popup-inner { padding: 0.9rem 1rem; }
  .popup-name { font-size: 17px; }
  .detail-sidebar-card {
    padding: 1.1rem;
    margin-bottom: 1rem;
  }
}

/* ─── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content > * {
  animation: fadeUp 0.6s ease both;
}
.hero-eyebrow  { animation-delay: 0.05s; }
.hero-title    { animation-delay: 0.12s; }
.hero-sub      { animation-delay: 0.2s; }
.hero-actions  { animation-delay: 0.27s; }
.hero-stats    { animation-delay: 0.34s; }
.hero-image-col { animation: fadeUp 0.7s 0.4s ease both; }
