:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #65716b;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --line: #d8ded8;
  --sage: #4d6f5c;
  --clay: #9f5b42;
  --gold: #b48a30;
  --blue: #1d73b7;
  --teal: #168a7a;
  --shadow: 0 18px 42px rgba(23, 32, 27, 0.11);
  --map-mobile-width: 1120px;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans Thai", system-ui, sans-serif;
  letter-spacing: 0;
}

button, a { font: inherit; }

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

.atlas-shell {
  width: min(1440px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 24px;
}

.atlas-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #0b2f63;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.atlas-hero-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(11, 47, 99, 0.12);
}

.atlas-hero-copy {
  min-width: 0;
}

.site-label {
  margin: 0 0 2px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--sage);
  font-size: 14px;
  font-weight: 800;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 8px;
  font-family: "Gowun Batang", "Apple SD Gothic Neo", serif;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1.05;
  color: #0b2f63;
}

.atlas-hero-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hero-actions button,
.hero-actions .download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(77, 111, 92, 0.25);
  border-radius: 8px;
  background: #fff;
  color: var(--sage);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, color 150ms ease, background 150ms ease;
}

.hero-actions .line-share-button {
  border-color: rgba(6, 199, 85, 0.22);
  color: #fff;
  background: #fff;
}

.hero-actions .line-share-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #06c755;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.hero-actions .facebook-share-button {
  width: 52px;
  padding: 0;
}

.hero-actions .facebook-share-button span {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 999px;
  background: #1877f2;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.hero-actions .download-link {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0b2f63;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  box-shadow: none;
}

.back-link:hover,
.back-link:focus-visible,
.hero-actions button:hover,
.hero-actions button:focus-visible,
.special-topic-tabs button:hover,
.special-topic-tabs button:focus-visible,
.map-tabs button:hover,
.map-tabs button:focus-visible,
.journey-legend button:hover,
.journey-legend button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(11, 47, 99, 0.13);
}

.hero-actions .download-link:hover,
.hero-actions .download-link:focus-visible {
  color: var(--sage);
  transform: translateY(-1px);
}

.hero-actions button:disabled {
  opacity: 0.55;
  cursor: default;
}

.share-status {
  position: absolute;
  right: 28px;
  bottom: -34px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(77, 111, 92, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--sage);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(23, 32, 27, 0.12);
}

.range-tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.range-tabs button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.range-tabs button.active {
  border-color: rgba(77, 111, 92, 0.42);
  background: var(--sage);
  color: #fff;
}

.atlas-board,
.detail-panel,
.map-gallery {
  max-width: 100%;
  min-width: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.atlas-board {
  display: grid;
  gap: 20px;
  overflow: visible;
  padding: 16px;
}

.testament-stack {
  display: grid;
  gap: 26px;
}

.testament-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(77, 111, 92, 0.36) transparent;
}

.testament-scroll::-webkit-scrollbar {
  height: 8px;
}

.testament-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(77, 111, 92, 0.32);
}

.testament-board {
  min-width: var(--local-board-width, 1180px);
}

.testament-board .board-topline,
.testament-board .era-track,
.testament-board .timeline-track,
.testament-board .book-track {
  min-width: var(--local-board-width, 1180px);
}

.testament-scroll + .testament-scroll {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.testament-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.testament-heading h2 {
  margin: 0;
  color: #0b2f63;
  font-size: 24px;
}

.testament-heading span {
  color: var(--muted);
  font-weight: 800;
}

.board-topline,
.era-track,
.timeline-track {
  position: relative;
  min-width: 1180px;
}

.board-topline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  color: #78827b;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.board-topline span {
  padding: 6px 10px;
  border: 1px dashed #d9ded9;
  border-radius: 8px;
  background: #f6f7f4;
}

.era-track {
  height: 88px;
  border-bottom: 1px solid var(--line);
}

.era {
  position: absolute;
  top: 0;
  height: 74px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid rgba(23, 32, 27, 0.08);
  color: #18221c;
  font-weight: 900;
  overflow: hidden;
}

.era small {
  display: block;
  margin-top: 3px;
  color: rgba(23, 32, 27, 0.58);
  font-weight: 700;
}

.color-stone { background: #eef0ed; }
.color-olive { background: #edf2df; }
.color-teal { background: #e5f4f0; }
.color-sage { background: #edf4ef; }
.color-gold { background: #f7efd9; }
.color-clay { background: #f6e7df; }
.color-brick { background: #f4e5e0; }
.color-mist { background: #f3f4f2; }
.color-blue { background: #e7f0fa; }
.color-cyan { background: #e5f4f7; }

.timeline-track {
  min-height: 190px;
  background-image: linear-gradient(to right, rgba(77, 111, 92, 0.12) 1px, transparent 1px);
  background-size: 90px 100%;
}

body:not(.simple) .timeline-track {
  min-height: 200px;
  background-size: 100px 100%;
}

.book-track {
  position: relative;
  min-width: var(--local-board-width, 1180px);
  min-height: 190px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  background-image: linear-gradient(to right, rgba(77, 111, 92, 0.08) 1px, transparent 1px);
  background-size: 90px 100%;
}

.book-chip {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: var(--width);
  min-width: 62px;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(77, 111, 92, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(23, 32, 27, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  z-index: 1;
}

.book-chip::after {
  content: attr(data-date);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translate(-50%, 5px);
  min-width: max-content;
  max-width: 190px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(11, 47, 99, 0.96);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(23, 32, 27, 0.16);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 10;
}

.book-chip:hover,
.book-chip:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(11, 47, 99, 0.32);
  box-shadow: 0 12px 22px rgba(23, 32, 27, 0.13);
  overflow: visible;
  z-index: 20;
}

.book-chip:hover::after,
.book-chip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.book-chip[data-inline-date="true"]::after,
.book-chip[data-inline-date="true"]:hover::after,
.book-chip[data-inline-date="true"]:focus-visible::after {
  display: none;
}

.book-chip[data-era="exile-return"],
.book-chip[data-era="divided"] {
  background: #fff8f4;
}

.book-chip[data-genre="law"],
.mobile-book-group[data-genre="law"] { border-color: rgba(160, 126, 54, 0.24); }

.book-chip[data-genre="history"],
.mobile-book-group[data-genre="history"] { border-color: rgba(77, 111, 92, 0.24); }

.book-chip[data-genre="poetry"],
.mobile-book-group[data-genre="poetry"] { border-color: rgba(196, 151, 68, 0.24); }

.book-chip[data-genre="majorProphet"],
.book-chip[data-genre="minorProphet"],
.mobile-book-group[data-genre="majorProphet"],
.mobile-book-group[data-genre="minorProphet"] { border-color: rgba(157, 91, 67, 0.24); }

.book-chip[data-genre="gospel"],
.mobile-book-group[data-genre="gospel"] { border-color: rgba(45, 138, 168, 0.24); }

.book-chip[data-genre="acts"],
.mobile-book-group[data-genre="acts"] { border-color: rgba(77, 111, 92, 0.22); }

.book-chip[data-genre="pauline"],
.mobile-book-group[data-genre="pauline"] { border-color: rgba(81, 98, 148, 0.22); }

.book-chip[data-genre="general"],
.mobile-book-group[data-genre="general"] { border-color: rgba(113, 94, 139, 0.2); }

.book-chip[data-genre="apocalyptic"],
.mobile-book-group[data-genre="apocalyptic"] { border-color: rgba(100, 86, 68, 0.22); }

.book-chip[data-prophet-focus="north"],
.book-chip[data-prophet-focus="north-related"] {
  border-color: rgba(31, 126, 156, 0.38);
  background: #eef8fb;
  color: #123848;
}

.event[data-prophet-focus="north"] .event-dot {
  background: #2d8aa8;
  box-shadow: 0 0 0 2px rgba(45, 138, 168, 0.42);
}

.mobile-book-chip[data-prophet-focus="north"],
.mobile-book-chip[data-prophet-focus="north-related"] {
  border-color: rgba(31, 126, 156, 0.42);
  background: #eef8fb;
  color: #123848;
}

.mobile-books {
  margin-top: 16px;
}

.mobile-book-list {
  display: grid;
  gap: 8px;
}

.mobile-book-group {
  border: 1px solid rgba(77, 111, 92, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.mobile-book-group summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.mobile-book-group summary::-webkit-details-marker { display: none; }

.mobile-book-group summary::after {
  content: "+";
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.mobile-book-group[open] summary::after { content: "-"; }

.mobile-book-group summary em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mobile-book-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 12px 12px;
}

.mobile-book-chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(77, 111, 92, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.event {
  position: absolute;
  top: var(--top);
  transform: translateX(-50%);
  display: grid;
  gap: 3px;
  justify-items: center;
  width: max-content;
  min-width: 112px;
  max-width: 220px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.event-dot {
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--sage);
  box-shadow: 0 0 0 1.5px rgba(77, 111, 92, 0.55);
}

.event[data-type="map"] .event-dot { background: var(--blue); }
.event[data-type="empire"] .event-dot { background: var(--gold); }
.event[data-type="person"] .event-dot { background: var(--clay); }

.event span:last-child {
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(23, 32, 27, 0.08);
}

.mobile-timeline {
  display: none;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.mobile-chart {
  position: relative;
  min-height: 230px;
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8faf7);
}

.mobile-era-track,
.mobile-chart-track {
  position: relative;
  min-width: var(--mobile-chart-width, 720px);
}

.mobile-era-track {
  height: 54px;
  border-bottom: 1px solid var(--line);
}

.mobile-era {
  position: absolute;
  top: 8px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(23, 32, 27, 0.08);
  border-radius: 8px;
  color: #1b251f;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mobile-chart-track {
  height: 170px;
  background-image: linear-gradient(to right, rgba(77, 111, 92, 0.1) 1px, transparent 1px);
  background-size: 70px 100%;
}

.mobile-chart-event {
  position: absolute;
  top: var(--top);
  left: var(--left);
  transform: translateX(-50%);
  display: grid;
  gap: 5px;
  justify-items: center;
  width: 72px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.mobile-chart-event i {
  width: 13px;
  height: 13px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--sage);
  box-shadow: 0 0 0 2px rgba(77, 111, 92, 0.48);
}

.mobile-chart-event span {
  max-width: 78px;
  padding: 4px 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(23, 32, 27, 0.08);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
}

.mobile-timeline-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mobile-event-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.mobile-event-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 16px;
  line-height: 1.3;
}

.mobile-event-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-event-card i {
  display: inline-grid;
  place-items: center;
  min-width: 68px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: #edf4ef;
  color: var(--sage);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.mobile-event-card.active {
  border-color: rgba(77, 111, 92, 0.52);
  background: #f7faf6;
  box-shadow: 0 10px 24px rgba(23, 32, 27, 0.09);
}

.inline-detail-panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(77, 111, 92, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f4f8f5);
}

.inline-detail-panel h2 {
  margin-bottom: 10px;
  color: #0b2f63;
  font-size: 22px;
  line-height: 1.28;
}

.inline-detail-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 100%;
  min-width: 0;
}

.special-topic-shell {
  display: grid;
  gap: 12px;
}

.special-topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.special-topic-tabs button {
  border: 1px solid rgba(77, 111, 92, 0.24);
  border-radius: 999px;
  background: #fff;
  color: var(--sage);
  font-size: 14px;
  font-weight: 900;
  padding: 9px 14px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.special-topic-tabs button.active {
  border-color: rgba(77, 111, 92, 0.45);
  background: var(--sage);
  color: #fff;
}

.special-topic-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  padding: 18px 20px;
  box-shadow: 0 12px 26px rgba(23, 32, 27, 0.08);
}

.special-topic-panel h2 {
  margin: 0 0 8px;
  color: #0b2f63;
}

.special-topic-body {
  display: grid;
  gap: 14px;
}

.special-topic-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.special-topic-section {
  border-top: 1px solid rgba(77, 111, 92, 0.16);
  padding-top: 13px;
}

.special-topic-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.special-topic-section h3 {
  margin: 0 0 6px;
  color: var(--sage);
  font-size: 15px;
  font-weight: 900;
}

.detail-panel {
  align-self: start;
  padding: 22px;
}

.detail-panel h2 {
  margin-bottom: 10px;
  color: #0b2f63;
}

.detail-panel p {
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.source-list a {
  color: var(--sage);
  font-weight: 800;
  text-decoration: none;
}

.map-gallery {
  padding: 22px;
  overflow: hidden;
}

.section-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

.section-title .module-status {
  flex: 1 0 100%;
}

.map-gallery .section-title {
  justify-content: center;
  text-align: center;
}

.map-gallery .section-title h2 {
  margin: 0;
  color: #17201b;
  font-size: clamp(28px, 2.4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.module-status {
  display: inline-flex;
  max-width: 760px;
  margin: -4px 0 0;
  border: 1px solid rgba(179, 90, 60, 0.22);
  border-radius: 6px;
  background: rgba(179, 90, 60, 0.055);
  color: #7a4936;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  padding: 7px 10px;
  text-align: left;
}

.map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
  max-width: 100%;
}

.map-tabs button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.map-tabs button.active {
  background: var(--sage);
  color: #fff;
}

.map-canvas {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 25% 35%, rgba(77, 111, 92, 0.12), transparent 24%),
    linear-gradient(150deg, #f5f7f3 0%, #ffffff 48%, #eef4f6 100%);
}

.map-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.map-scroll::-webkit-scrollbar {
  display: none;
}

.map-complete-image {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 1800 / 1013;
}

.map-image-layer {
  position: relative;
  width: 88%;
  margin: 0 auto;
}

.map-mode-overview .map-image-layer {
  width: min(100%, 1560px);
  min-width: 0;
  cursor: zoom-in;
}

.map-mode-overview .journey-legend {
  display: none;
}

.map-mode-overview {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: clamp(520px, 56vw, 920px);
  cursor: zoom-in;
}

.map-zoom-hint {
  margin: 0;
  color: rgba(77, 111, 92, 0.78);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.map-mode-journey {
  min-height: clamp(460px, 56vw, 760px);
  padding-bottom: 12px;
}

.map-mode-journey .map-image-layer {
  width: 100%;
  min-width: 0;
}

.map-detail-panel {
  display: none;
  margin-top: 14px;
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(23, 32, 27, 0.08);
}

.back-to-top-button {
  display: block;
  margin: 14px auto 0;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(77, 111, 92, 0.22);
  border-radius: 999px;
  background: #fff;
  color: var(--sage);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 32, 27, 0.07);
}

.back-to-top-button:hover,
.back-to-top-button:focus-visible {
  border-color: rgba(77, 111, 92, 0.45);
  background: #f7faf6;
}

.journey-legend {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 7px;
  border: 1px solid rgba(216, 222, 216, 0.86);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 22px rgba(23, 32, 27, 0.1);
  backdrop-filter: blur(8px);
}

.journey-legend button {
  min-height: 29px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.journey-legend button.active {
  border-color: rgba(77, 111, 92, 0.45);
  background: var(--sage);
  color: #fff;
}

.journey-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.journey-legend i {
  display: inline-block;
  width: 15px;
  height: 4px;
  border-radius: 99px;
}

.map-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-stop {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 900;
}

.map-stop i {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: #fff;
  font-style: normal;
  font-size: 13px;
}

.map-stop span {
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 16px rgba(23, 32, 27, 0.08);
}

.map-hotspot {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  background: transparent;
  outline: 0;
  z-index: 4;
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  background: rgba(11, 47, 99, 0.12);
  box-shadow: 0 0 0 3px rgba(11, 47, 99, 0.18);
  z-index: 30;
}

.map-hotspot.is-open {
  z-index: 40;
}

.map-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  display: grid;
  gap: 5px;
  width: max-content;
  max-width: 260px;
  padding: 11px 13px;
  border: 1px solid rgba(216, 222, 216, 0.95);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #17201b;
  box-shadow: 0 16px 34px rgba(23, 32, 27, 0.2);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: normal;
}

.map-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(216, 222, 216, 0.95);
  border-bottom: 1px solid rgba(216, 222, 216, 0.95);
  background: rgba(255, 255, 255, 0.96);
  transform: translate(-50%, -5px) rotate(45deg);
}

.map-tooltip strong {
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
}

.map-tooltip em {
  color: #4d6f5c;
  font-style: normal;
  font-weight: 850;
}

.map-tooltip small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-hotspot:hover .map-tooltip,
.map-hotspot:focus-visible .map-tooltip,
.map-hotspot.is-open .map-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.map-stop-region,
.map-stop-transit,
.map-stop-attempted {
  color: #526258;
  opacity: 0.82;
}

.map-stop-region span,
.map-stop-transit span,
.map-stop-attempted span {
  border: 1px solid rgba(77, 111, 92, 0.18);
  background: rgba(245, 247, 243, 0.78);
  color: #526258;
  font-size: 12px;
}

.map-stop-attempted span {
  border-style: dashed;
  color: #8a5b42;
}

body.simple .event.optional,
body.simple .era:not(.featured) small {
  display: none;
}

body.simple .timeline-track {
  min-height: 235px;
}

body.simple .event {
  min-width: 108px;
}

body.simple .event span:last-child {
  font-size: 13px;
}

@media (max-width: 860px) {
  .atlas-shell { padding: 14px; }
  .atlas-hero {
    grid-template-columns: auto auto 1fr;
    padding: 18px;
  }
  .atlas-hero-logo {
    width: 50px;
    height: 50px;
  }
  .atlas-hero-copy,
  .hero-actions,
  .share-status {
    grid-column: 1 / -1;
  }
  .hero-actions { justify-content: flex-start; }
  .hero-actions {
    gap: 7px;
  }
  .hero-actions button,
  .hero-actions .download-link {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 13px;
  }
  .hero-actions .line-share-button span {
    min-width: 48px;
    min-height: 23px;
    padding: 0 8px;
    font-size: 12px;
  }
  .hero-actions .facebook-share-button {
    width: 40px;
  }
  .hero-actions .facebook-share-button span {
    width: 25px;
    height: 25px;
    font-size: 19px;
  }
  .hero-actions .download-link {
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
  }
  .share-status { position: static; }
  h1 { font-size: 32px; line-height: 1.14; }
  .atlas-hero-copy p:last-child { font-size: 15px; line-height: 1.62; }
  .atlas-board {
    display: grid;
    gap: 16px;
    overflow: visible;
    padding: 12px;
  }
  .testament-scroll {
    margin-inline: -2px;
    padding-inline: 2px;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
  }
  .testament-scroll::-webkit-scrollbar {
    display: none;
  }
  .testament-board { min-width: var(--local-board-width, 1180px); }
  .board-topline,
  .era-track,
  .timeline-track,
  .book-track { min-width: var(--local-board-width, 1180px); }
  .timeline-track { min-height: 190px; }
  .event { min-width: 106px; }
  .event span:last-child { font-size: 12px; }
  .mobile-timeline { display: none; }
  .detail-panel { display: none; }
  .content-layout { grid-template-columns: 1fr; }
  .detail-panel,
  .map-gallery { padding: 18px; }
  .map-gallery {
    width: 100%;
    max-width: 100%;
  }
  .map-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .map-tabs::-webkit-scrollbar {
    display: none;
  }
  .map-tabs button {
    flex: 0 0 auto;
  }
  .map-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 10px;
  }

  .map-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .map-image-layer {
    width: 100%;
    max-width: none;
  }

  .map-mode-overview {
    min-height: 220px;
  }

  .map-mode-overview .map-scroll {
    overflow-x: hidden;
  }

  .map-mode-overview .map-image-layer {
    width: 100%;
    min-width: 0;
  }

  .map-zoom-hint {
    font-size: 11px;
  }

  .map-mode-journey {
    min-height: 620px;
    padding-bottom: 10px;
  }

  .map-mode-journey .map-image-layer {
    width: 300%;
    min-width: 0;
    margin: 0;
  }

  .journey-legend {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: min(100%, calc(100vw - 60px));
    margin-top: 10px;
    z-index: 2;
    overflow: hidden;
  }
  .journey-legend button {
    min-height: 27px;
    padding: 0 7px;
    font-size: 12px;
  }
  .map-tooltip {
    max-width: min(210px, 58vw);
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 10px;
    z-index: 60;
  }
  .map-tooltip strong {
    font-size: 12px;
  }
  .map-tooltip em,
  .map-tooltip small {
    font-size: 10px;
  }
  .map-hotspot.tooltip-right .map-tooltip {
    left: 0;
    transform: translateX(0) translateY(4px);
  }
  .map-hotspot.tooltip-right .map-tooltip::after {
    left: 16px;
  }
  .map-hotspot.tooltip-left .map-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(4px);
  }
  .map-hotspot.tooltip-left .map-tooltip::after {
    left: auto;
    right: 16px;
  }
  .map-hotspot.tooltip-right:hover .map-tooltip,
  .map-hotspot.tooltip-right:focus-visible .map-tooltip,
  .map-hotspot.tooltip-right.is-open .map-tooltip,
  .map-hotspot.tooltip-left:hover .map-tooltip,
  .map-hotspot.tooltip-left:focus-visible .map-tooltip,
  .map-hotspot.tooltip-left.is-open .map-tooltip {
    transform: translateX(0) translateY(0);
  }
  .map-hotspot.tooltip-below .map-tooltip {
    top: calc(100% + 10px);
    bottom: auto;
  }
  .map-hotspot.tooltip-below .map-tooltip::after {
    top: auto;
    bottom: 100%;
    transform: translate(-50%, 5px) rotate(225deg);
  }
  .map-hotspot.tooltip-above .map-tooltip {
    top: auto;
    bottom: calc(100% + 10px);
  }
  .map-hotspot.tooltip-above .map-tooltip::after {
    top: 100%;
    bottom: auto;
    transform: translate(-50%, -5px) rotate(45deg);
  }
  .map-detail-panel {
    display: none;
  }
  .map-title-card { right: 14px; max-width: none !important; font-size: 14px; }
  .map-stop { gap: 4px; }
  .map-stop i { width: 28px; height: 28px; font-size: 13px; }
  .map-stop span { max-width: 108px; font-size: 13px; line-height: 1.2; }
  .map-hotspot {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 520px) {
  .atlas-shell { padding: 10px; }
  .atlas-hero {
    padding: 14px;
    gap: 12px;
  }
  .back-link {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
  h1 { font-size: 29px; }
  .atlas-hero-copy p:last-child {
    font-size: 13px;
    line-height: 1.5;
  }
  .hero-actions {
    gap: 6px;
  }
  .hero-actions button,
  .hero-actions .download-link {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }
  .hero-actions .line-share-button span {
    min-width: 42px;
    min-height: 20px;
    font-size: 11px;
  }
  .hero-actions .facebook-share-button {
    width: 34px;
  }
  .hero-actions .facebook-share-button span {
    width: 22px;
    height: 22px;
    font-size: 17px;
  }
  .atlas-board { margin-top: 12px; }
  .board-topline,
  .era-track,
  .timeline-track,
  .book-track { min-width: var(--local-board-width, 1180px); }
  .board-topline { font-size: 12px; }
  .era-track { height: 80px; }
  .era { height: 66px; padding: 8px 8px; font-size: 12px; }
  .era small { font-size: 11px; }
  .book-chip[data-book-id="genesis"],
  .book-chip[data-book-id="job"],
  .book-chip[data-book-id="judges"],
  .book-chip[data-book-id="2chronicles"],
  .book-chip[data-book-id="psalms"],
  .book-chip[data-book-id="matthew"],
  .book-chip[data-book-id="mark"],
  .book-chip[data-book-id="luke"],
  .book-chip[data-book-id="john"],
  .book-chip[data-book-id="acts"] {
    min-height: 16px;
    padding: 1px 4px;
    font-size: 7px;
    font-weight: 760;
    line-height: 1.05;
    letter-spacing: -0.035em;
  }
  .event { min-width: 106px; }
  .event span:last-child { font-size: 11px; padding: 5px 6px; }
  .detail-panel h2,
  .map-gallery h2 { font-size: 22px; }
  .map-mode-overview { min-height: 220px; }
  .map-mode-journey { min-height: 620px; }
}


@media (max-width: 430px) {
  .map-stop { gap: 0; }
  .map-stop > span:not(.map-tooltip) {
    display: none;
  }
  .map-hotspot.is-open {
    z-index: 20;
  }
  .map-stop i {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 5px 14px rgba(23, 32, 27, 0.14);
  }
}
