/* historia_world — 3D地球儀・連動地図UIスタイル */

/* ── 用語リンクの地点インジケータ ── */
.term-link[data-has-geo="1"] {
  border-bottom-color: color-mix(in srgb, var(--link) 80%, transparent);
}
.term-link[data-has-geo="1"]::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 2px;
  vertical-align: 0.45em;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.78;
}
.term-link.is-inspected {
  background: var(--accent-soft);
  color: var(--accent);
  border-bottom-color: var(--accent);
  border-bottom-style: solid;
}

/* ── earth.js コンテナ適合（HUD自体は earth.js 標準スタイルを使用） ── */
.inline-map-stage .earth-root,
.modal-mini-earth .earth-root,
.companion-globe .earth-root,
.earth-stage .earth-root {
  min-height: 0;
  height: 100%;
}

/* ── インライン地図（図解・章末・用語ページ） ── */
.map-body {
  position: relative;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.inline-map-stage {
  position: relative;
  width: 100%;
  height: 330px;
  min-height: 220px;
  background: #0b1626;
}
.modal .inline-map-stage {
  height: 210px;
  min-height: 180px;
}
.inline-map-popover {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 14px;
  font-size: 13px;
}
.inline-map-popover[hidden] {
  display: none;
}
.inline-map-pop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.inline-map-pop-head strong {
  font-size: 14.5px;
}
.inline-map-pop-coord {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
}
.inline-map-pop-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
}
.inline-map-pop-summary {
  margin: 4px 0 8px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.inline-map-pop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.inline-map-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.inline-map-bar .map-legend {
  padding: 0;
  border-top: 0;
  background: transparent;
}
.inline-map-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.inline-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11.5px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.inline-map-btn:hover {
  border-color: var(--ink-soft);
  background: var(--paper-2);
  color: var(--ink);
}

/* ── モーダル内ミニ地球儀 ── */
.modal-mini-earth-wrap {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.modal-mini-earth {
  width: 100%;
  height: 200px;
  background: #0b1626;
}
.modal-mini-coord {
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── 講義ページ 並列連動ビュー（コンパニオンパネル） ── */
.container.page.with-companion {
  max-width: min(1580px, 100%);
}
.page.with-companion .reader-grid {
  grid-template-columns: 204px minmax(420px, 1fr) minmax(360px, 43%);
  gap: 24px;
  align-items: start;
}
.page.with-companion .article {
  max-width: none;
}

.companion-panel {
  position: sticky;
  top: 68px;
  height: calc(100vh - 84px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 25;
}
.companion-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--sans);
  font-size: 12px;
}
.companion-sec-label {
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.companion-sync {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.companion-head select {
  flex: 1 1 110px;
  min-width: 90px;
  max-width: 190px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  padding: 3px 6px;
  font-size: 11.5px;
}
.companion-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.companion-icon-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 7px;
  padding: 3px 8px;
  font-family: var(--sans);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.companion-icon-btn:hover {
  border-color: var(--ink-soft);
  background: var(--paper-2);
}

.companion-tour {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--sans);
}
.companion-tour-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.companion-tour-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.companion-tour-nav {
  display: flex;
  gap: 4px;
}
.companion-tour-nav button {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.companion-tour-nav button:hover:not(:disabled) {
  border-color: var(--ink-soft);
}
.companion-tour-nav button:disabled {
  opacity: 0.45;
  cursor: default;
}
.companion-place-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.companion-place-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
}
.companion-place-chip:hover {
  border-color: var(--link);
  background: var(--link-soft);
}
.companion-place-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.companion-empty-hint {
  font-size: 11.5px;
  color: var(--muted);
}

.companion-globe-wrap {
  position: relative;
  flex: 1 1 220px;
  min-height: 180px;
  background: #0b1626;
}
.companion-globe {
  width: 100%;
  height: 100%;
}

.companion-inspector {
  flex: 0 0 auto;
  max-height: 40%;
  overflow-y: auto;
  border-top: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 10px 12px;
}
.inspector-empty {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.inspector-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}
.inspector-reading {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
}
.inspector-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.inspector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  margin: 6px 0;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
}
.inspector-coord {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--link);
  background: var(--link-soft);
  padding: 1px 7px;
  border-radius: 999px;
}
.inspector-summary {
  margin: 6px 0;
  font-size: 13.5px;
  line-height: 1.65;
}
.inspector-sig {
  margin: 6px 0;
  padding: 7px 10px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.inspector-related {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 8px 0 6px;
  font-family: var(--sans);
  font-size: 11px;
}
.inspector-rel-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--link);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
}
.inspector-rel-btn:hover {
  background: var(--link-soft);
  border-color: var(--link);
}
.inspector-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 12px;
}

.companion-fab {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 52px;
  z-index: 35;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.companion-fab:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 1240px) {
  .page.with-companion .reader-grid {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 44%);
  }
  .page.with-companion .toc {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    display: flex;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
    margin-bottom: 4px;
    scrollbar-width: thin;
  }
  .page.with-companion .toc .toc-title,
  .page.with-companion .toc .toc-sub {
    display: none;
  }
  .page.with-companion .toc a {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    background: var(--surface);
  }
  .page.with-companion .toc a.active {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }
}

@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  .page.with-companion {
    padding-bottom: 48vh;
  }
  .page.with-companion .reader-grid {
    grid-template-columns: 1fr;
  }
  .companion-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 44vh;
    border-radius: 14px 14px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    z-index: 45;
  }
  .companion-inspector {
    max-height: 45%;
  }
  .companion-fab {
    display: inline-flex;
    align-items: center;
  }
  .page.with-companion .companion-fab,
  .stage-shell.with-companion .companion-fab {
    display: none;
  }
}

/* ── 全画面地球儀ページ #/earth ── */
#app.is-earth {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.earth-main {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - 57px);
  overflow: hidden;
}
.earth-shell {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.earth-sidebar {
  flex: 0 0 400px;
  width: 400px;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  z-index: 10;
  min-width: 0;
}
.earth-shell.panel-collapsed .earth-sidebar {
  display: none;
}
.earth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--sans);
}
.earth-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: 10px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.earth-tabs button:hover {
  color: var(--ink);
  background: var(--surface);
}
.earth-tabs button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--surface);
}
.earth-tab-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px 20px;
  min-height: 0;
}

.earth-select-row {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.earth-select-row label {
  display: grid;
  gap: 3px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
}
.earth-select-row select,
.earth-filter-input,
.earth-filter-select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 9px;
  font-family: var(--sans);
  font-size: 12.5px;
}

.earth-story-tour {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 9px 10px;
  margin-bottom: 12px;
  font-family: var(--sans);
}
.earth-story-tour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.earth-story-body {
  font-size: 14.5px;
  line-height: 1.78;
}
:root[data-font="small"] .earth-story-body { font-size: 13px; }
:root[data-font="large"] .earth-story-body { font-size: 16.5px; }
:root[data-font="xlarge"] .earth-story-body { font-size: 18.5px; }
.earth-story-body h3 {
  font-size: 16px;
  margin: 20px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.earth-story-body p {
  margin: 0 0 1em;
}
.earth-story-body .theme-question {
  padding: 10px 12px;
  margin-bottom: 12px;
}
.earth-story-body .section-overview {
  padding: 10px 12px;
  margin: 10px 0 14px;
}
.earth-story-body .section-overview p {
  font-size: 13.5px;
}
.earth-story-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12.5px;
}

.earth-filter-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.earth-count {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--muted);
  margin: 4px 0 8px;
}
.earth-era-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.earth-era-pills button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 2px 9px;
  font-family: var(--sans);
  font-size: 11.5px;
  cursor: pointer;
}
.earth-era-pills button.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.earth-list {
  display: grid;
  gap: 7px;
}
.earth-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 9px 11px;
  cursor: pointer;
  display: grid;
  gap: 3px;
}
.earth-list-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.earth-list-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.earth-list-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.earth-list-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
}

.earth-map-detail {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.earth-map-detail h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
}
.earth-map-detail p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.earth-stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  background: #0b1626;
}
.earth-stage {
  width: 100%;
  height: 100%;
}
.earth-panel-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 8;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.earth-panel-toggle:hover {
  border-color: var(--ink-soft);
}

.earth-inspector {
  position: absolute;
  right: 12px;
  bottom: 36px;
  z-index: 9;
  width: min(370px, calc(100% - 24px));
  max-height: min(48vh, 360px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(10px);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.earth-inspector[hidden] {
  display: none;
}

@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  .earth-main {
    height: calc(100vh - 88px);
  }
  .earth-shell {
    flex-direction: column-reverse;
  }
  .earth-sidebar {
    flex: 0 0 46%;
    width: 100%;
    height: 46%;
    border-right: 0;
    border-top: 1px solid var(--line-strong);
  }
  .earth-stage-wrap {
    flex: 1 1 54%;
    height: 54%;
  }
  .earth-inspector {
    left: 8px;
    right: 8px;
    bottom: 28px;
    width: auto;
    max-height: 42%;
  }
}

@media print {
  .companion-panel,
  .companion-fab,
  .inline-map-actions,
  .inline-map-popover,
  .earth-hud,
  .earth-statusbar,
  .earth-sidebar,
  .earth-panel-toggle,
  .earth-inspector {
    display: none !important;
  }
  .page.with-companion {
    max-width: none;
    padding-bottom: 0;
  }
  .page.with-companion .reader-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 地図ステップツアーバー＆常設ガイドパネル ── */
.map-tour-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--sans);
}
.map-tour-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}
.map-tour-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
}
.map-tour-pill:hover {
  border-color: var(--link);
  background: var(--link-soft);
}
.map-tour-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.map-step-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 10.5px;
  font-weight: 700;
}
.map-tour-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.map-tour-nav-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.map-tour-nav-btn:hover {
  border-color: var(--ink-soft);
  background: var(--paper-2);
}

.inline-map-guide {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
}
.map-guide-overview {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}
.map-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .map-guide-grid {
    grid-template-columns: 1fr;
  }
}
.map-guide-card {
  text-align: left;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 8px 10px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  align-content: start;
  color: var(--ink);
}
.map-guide-card:hover {
  border-color: var(--link);
  background: var(--link-soft);
}
.map-guide-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-guide-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.map-guide-card-title {
  font-size: 13px;
  line-height: 1.35;
}
.map-guide-where,
.map-guide-where-row,
.inspector-where,
.companion-overview-where {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.map-guide-where-row,
.inspector-where {
  margin: 6px 0;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.map-where-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--link-soft);
  color: var(--link);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.map-guide-card-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.map-guide-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.map-guide-detail-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 14.5px;
}
.map-step-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.map-guide-desc {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
}
.map-guide-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}
.map-guide-foot-terms,
.map-guide-foot-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.map-legend-interactive {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.map-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--sans);
  font-size: 11px;
  cursor: pointer;
}
.map-legend-pill i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}
.map-legend-pill:hover {
  border-color: var(--link);
  background: var(--link-soft);
}
.map-legend-pill.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

/* ── #/visuals 右ペイン地図プレビュー ── */
.visual-preview-map-host {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
}
.visual-map-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  overflow: visible;
}
.visual-map-stage {
  position: relative;
  width: 100%;
  height: 310px;
  flex: 0 0 auto;
  background: #0b1626;
}
.visual-map-stage .earth-root {
  min-height: 0;
  height: 100%;
}
.visual-map-guide-wrap {
  flex: 0 0 auto;
  overflow: visible;
}
.visual-map-guide-wrap .inline-map-guide {
  border-top: 1px solid var(--line-strong);
}

/* ── コンパニオン初期一覧 ── */
.companion-overview-box {
  display: grid;
  gap: 6px;
}
.companion-overview-list {
  display: grid;
  gap: 5px;
}
.companion-overview-item {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 6px 8px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  color: var(--ink);
}
.companion-overview-item:hover {
  border-color: var(--link);
  background: var(--link-soft);
}
.companion-overview-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.earth-map-detail .map-tour-bar {
  margin: 6px -12px 0;
  border-top: 1px solid var(--line);
}
.earth-map-detail .inline-map-guide {
  margin: 0 -12px;
  border-top: 0;
  padding: 8px 12px;
}
.earth-map-detail .map-guide-grid {
  grid-template-columns: 1fr;
}
.earth-map-detail .inline-map-bar {
  margin: 0 -12px -10px;
  padding: 8px 12px;
}
