:root {
  --background: #f6f5f1;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #66625d;
  --line: #d9d5cc;
  --accent: #9f6b3f;
  --accent-dark: #2f241b;
  --shadow: 0 18px 45px rgba(17, 17, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 500;
}

.is-viewer-route .site-header,
.is-viewer-route .toolbar {
  display: none;
}

.brand {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: 0;
}

.site-nav {
  align-items: center;
  display: flex;
  gap: 18px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.site-nav a,
.breadcrumb a,
.button {
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.site-nav a:hover,
.breadcrumb a:hover {
  color: var(--accent);
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.toolbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 32px;
}

.breadcrumb {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.breadcrumb [aria-current="page"] {
  color: var(--muted);
  pointer-events: none;
}

.summary {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
}

.map-view {
  min-height: calc(100vh - 130px);
  position: relative;
  z-index: 1;
}

.world-contour {
  align-items: center;
  background: #f2f0e9;
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(320px, 1fr);
  min-height: calc(100vh - 130px);
  overflow: hidden;
  padding: 44px 32px;
}

.world-copy {
  max-width: 420px;
  padding-left: clamp(0px, 5vw, 48px);
}

.world-kicker {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.world-copy h1 {
  font-size: clamp(2.2rem, 6vw, 5.7rem);
  font-weight: 400;
  line-height: 0.95;
  margin: 0;
  max-width: 7ch;
}

.geojson-map {
  position: relative;
}

.continent-map {
  align-self: center;
  height: min(68vh, 620px);
  justify-self: stretch;
  min-height: 380px;
  width: 100%;
}

.geo-graticule path {
  fill: none;
  stroke: rgba(17, 17, 17, 0.09);
  stroke-width: 1;
}

.continent-polygon {
  cursor: pointer;
  fill: rgba(159, 107, 63, 0.16);
  cursor: pointer;
  outline: none;
  stroke: var(--ink);
  stroke-linejoin: round;
  stroke-width: 1.15;
  transition: fill 160ms ease, stroke 160ms ease, stroke-width 160ms ease;
  vector-effect: non-scaling-stroke;
}

.continent-polygon:hover,
.continent-polygon:focus,
.continent-polygon.is-hovered {
  fill: rgba(159, 107, 63, 0.34);
  stroke: var(--accent-dark);
  stroke-width: 3;
}

.continent-label-layer text {
  fill: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 700;
  pointer-events: none;
  text-anchor: middle;
  text-transform: uppercase;
}

.continent-tooltip {
  background: var(--ink);
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  left: 0;
  padding: 7px 9px;
  pointer-events: none;
  position: absolute;
  text-transform: uppercase;
  top: 0;
  transform: translate(0, 0);
  z-index: 5;
}

.continent-tooltip[hidden] {
  display: none;
}

.leaflet-container {
  background: #ede9df;
  font-family: Arial, Helvetica, sans-serif;
  height: 100%;
  min-height: calc(100vh - 130px);
}

.leaflet-control-attribution {
  font-size: 0.68rem;
}

.map-label {
  background: var(--ink);
  border: 0;
  border-radius: 0;
  box-shadow: var(--shadow);
  color: white;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0;
  padding: 5px 8px;
  text-transform: uppercase;
}

.region-extent {
  cursor: pointer;
}

.popup-button,
.button {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: white;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  min-height: 38px;
  padding: 0 14px;
  text-transform: uppercase;
}

.popup-button {
  display: block;
  margin-top: 10px;
  width: 100%;
}

.button:hover,
.popup-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.empty-region {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  left: 50%;
  padding: 18px 22px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 450;
}

.region-fallback {
  align-items: center;
  background: #f2f0e9;
  display: flex;
  min-height: calc(100vh - 130px);
  padding: 32px;
}

.region-fallback-inner {
  margin: 0 auto;
  max-width: 760px;
  width: 100%;
}

.region-fallback h2 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 12px;
}

.region-fallback p {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0 0 24px;
}

.panorama-list {
  border-top: 1px solid var(--line);
}

.panorama-list-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 0;
  text-align: left;
  width: 100%;
}

.panorama-list-item span {
  font-size: 1.25rem;
}

.panorama-list-item small {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
}

.panorama-list-item:hover span {
  color: var(--accent);
}

.viewer-panel {
  background: #111;
  color: white;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
}

.viewer-panel[hidden] {
  display: none;
}

.viewer-topbar {
  align-items: stretch;
  background: rgba(17, 17, 17, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: grid;
  gap: 8px;
  min-height: 82px;
  padding: 10px 18px;
  z-index: 10;
}

.viewer-navline,
.viewer-detailline {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.viewer-navline {
  overflow-x: auto;
  white-space: nowrap;
}

.viewer-detailline {
  justify-content: space-between;
}

.viewer-brand {
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  text-transform: none;
  white-space: nowrap;
}

.viewer-navline,
.viewer-breadcrumb,
.viewer-kicker {
  color: rgba(255, 255, 255, 0.72);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  margin: 0;
  text-transform: uppercase;
}

.viewer-meta {
  color: rgba(255, 255, 255, 0.72);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  margin: 0;
}

.viewer-navline a:hover,
.viewer-breadcrumb a:hover {
  color: white;
}

.viewer-breadcrumb {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 0;
}

.viewer-breadcrumb [aria-current="page"] {
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.viewer-heading {
  align-items: baseline;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.viewer-kicker {
  display: none;
}

.viewer-title {
  font-size: clamp(1.1rem, 2vw, 1.65rem);
  font-weight: 400;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.viewer {
  height: calc(100vh - 82px);
  min-height: 480px;
  position: relative;
}

.viewer.is-flat-viewer .psv-container {
  display: none;
}

.flat-viewer {
  background: #111;
  inset: 0;
  position: absolute;
}

.flat-viewer[hidden] {
  display: none;
}

.flat-controls {
  align-items: center;
  display: flex;
  gap: 8px;
  left: 14px;
  position: absolute;
  top: 14px;
  z-index: 2;
}

.flat-controls button {
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  color: #111;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  min-height: 34px;
  padding: 0 12px;
  text-transform: uppercase;
}

.flat-stage {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  overflow: auto;
  padding: 60px 24px 24px;
}

.flat-image-wrap {
  display: inline-block;
  max-height: 100%;
  max-width: 100%;
  position: relative;
  transform-origin: center center;
}

.flat-image {
  display: block;
  max-height: calc(100vh - 170px);
  max-width: 100%;
  object-fit: contain;
}

.flat-hotspots {
  inset: 0;
  position: absolute;
}

.flat-hotspot {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 17, 17, 0.35);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  height: 34px;
  justify-content: center;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 34px;
}

.flat-hotspot::before {
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--ink);
  border-top: 6px solid transparent;
  content: "";
  margin-left: 2px;
}

.sphere-link-marker {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 17, 17, 0.35);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  display: flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.sphere-link-marker::before {
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--ink);
  border-top: 7px solid transparent;
  content: "";
  margin-left: 3px;
}

.psv-marker {
  cursor: pointer;
}

.noscript {
  background: var(--ink);
  bottom: 0;
  color: white;
  left: 0;
  margin: 0;
  padding: 12px;
  position: fixed;
  right: 0;
  text-align: center;
  z-index: 1000;
}

@media (max-width: 760px) {
  .site-header,
  .toolbar,
  .viewer-topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-header,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
  }

  .viewer-topbar {
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .viewer-navline,
  .viewer-detailline {
    gap: 10px;
  }

  .viewer-heading {
    align-items: flex-start;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  .viewer-title {
    white-space: normal;
  }

  .toolbar {
    padding-bottom: 14px;
    padding-top: 14px;
  }

  .summary {
    line-height: 1.35;
  }

  .map-view,
  .leaflet-container,
  .world-contour,
  .region-fallback,
  .viewer-panel {
    min-height: calc(100vh - 190px);
  }

  .world-contour {
    grid-template-columns: 1fr;
    padding: 28px 18px;
  }

  .world-copy {
    padding-left: 0;
  }

  .world-copy h1 {
    max-width: 9ch;
  }

  .continent-map {
    height: 52vh;
    min-height: 340px;
  }

  .viewer {
    height: calc(100vh - 190px);
    min-height: 360px;
  }
}
