:root {
  color-scheme: light;
  --ink: #172b27;
  --ink-soft: #536660;
  --forest: #123f36;
  --forest-2: #1b5a4c;
  --leaf: #2e7c5d;
  --mint: #dcece3;
  --coral: #eb684f;
  --coral-dark: #c94937;
  --sun: #ffc857;
  --cream: #fbf4e8;
  --paper: #fffdf8;
  --sand: #eaddc9;
  --line: rgba(23, 43, 39, 0.14);
  --shadow: 0 18px 50px rgba(18, 63, 54, 0.13);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 12% 2%, rgba(255, 200, 87, 0.18), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(235, 104, 79, 0.12), transparent 26rem),
    var(--cream);
  color: var(--ink);
  margin: 0;
  min-width: 320px;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(255, 200, 87, 0.88);
  outline-offset: 2px;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0, 0, 0, 0);
}

.app-shell {
  margin: 0 auto;
  max-width: 1600px;
  min-height: 100vh;
  padding: 0 34px 32px;
}

.topbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 86px;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--forest);
  border-radius: 50%;
  color: var(--sun);
  display: flex;
  height: 46px;
  justify-content: center;
  position: relative;
  width: 46px;
}

.brand-mark span:first-child {
  font-size: 28px;
  left: 7px;
  opacity: 0.55;
  position: absolute;
  top: 0;
}

.brand-mark span:last-child {
  font-size: 20px;
  position: relative;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand small {
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-top: 5px;
  text-transform: uppercase;
}

.top-actions,
.button-row,
.destination-actions,
.form-footer,
.section-heading {
  align-items: center;
  display: flex;
  gap: 10px;
}

.passport-button,
.primary-button,
.secondary-button,
.text-button,
.icon-button,
.file-button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.passport-button:hover,
.primary-button:hover,
.secondary-button:hover,
.file-button:hover {
  transform: translateY(-1px);
}

.passport-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  font-size: 13px;
  gap: 8px;
  padding: 10px 15px;
}

.passport-button > span:first-child {
  color: var(--coral);
}

.passport-button.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.primary-button,
.secondary-button,
.file-button {
  border-radius: 12px;
  display: inline-flex;
  justify-content: center;
  padding: 11px 16px;
}

.primary-button {
  background: var(--forest);
  color: #fff;
}

.primary-button:hover {
  background: var(--forest-2);
}

.primary-button.is-visited {
  background: var(--coral-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.secondary-button,
.file-button {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.secondary-button:hover,
.file-button:hover {
  border-color: rgba(18, 63, 54, 0.4);
}

.text-button {
  background: transparent;
  color: var(--forest-2);
  padding: 9px 3px;
}

.text-button:hover {
  color: var(--coral-dark);
}

.icon-button {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-flex;
  font-size: 20px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.intro {
  align-items: end;
  display: grid;
  gap: 42px;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.72fr);
  padding: 64px 0 42px;
}

.eyebrow {
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.17em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.intro h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(52px, 6.8vw, 94px);
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.91;
  margin: 0;
  max-width: 990px;
}

.intro-copy {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 7px;
}

.atlas {
  background: var(--paper);
  border: 1px solid rgba(23, 43, 39, 0.1);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.atlas-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) 190px 180px 42px;
  padding: 14px;
}

.atlas-toolbar input,
.atlas-toolbar select,
.data-drawer input,
.data-drawer select,
.data-drawer textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.atlas-toolbar input:hover,
.atlas-toolbar select:hover,
.data-drawer input:hover,
.data-drawer select:hover,
.data-drawer textarea:hover {
  border-color: rgba(18, 63, 54, 0.35);
}

.search-field {
  align-items: center;
  display: flex;
  position: relative;
}

.search-field > span[aria-hidden] {
  color: var(--ink-soft);
  font-size: 24px;
  left: 12px;
  position: absolute;
  top: 6px;
}

.search-field input {
  padding-left: 42px;
}

.atlas-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.72fr);
  min-height: 670px;
}

.map-panel {
  background:
    radial-gradient(circle at 50% 50%, rgba(46, 124, 93, 0.12), transparent 48%),
    #eef5f0;
  border-right: 1px solid var(--line);
  min-width: 0;
  padding: 18px;
}

.map-summary {
  align-items: center;
  color: var(--ink-soft);
  display: flex;
  font-size: 12px;
  gap: 17px;
  padding: 0 4px 12px;
}

.map-summary strong {
  color: var(--forest);
  font-size: 17px;
}

.map-hint {
  margin-left: auto;
}

.map-frame {
  min-height: 606px;
  overflow: hidden;
  position: relative;
}

#world-map {
  cursor: grab;
  display: block;
  height: 606px;
  overflow: visible;
  width: 100%;
}

#world-map:active {
  cursor: grabbing;
}

.sphere {
  fill: rgba(255, 255, 255, 0.52);
  stroke: rgba(18, 63, 54, 0.09);
  stroke-width: 1;
}

.country {
  fill: #c9dbd1;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-linejoin: round;
  stroke-width: 0.7;
  transition: fill 180ms ease, stroke 180ms ease;
  vector-effect: non-scaling-stroke;
}

.country.is-selected-country {
  fill: #ffd675;
  stroke: var(--coral-dark);
  stroke-width: 2.2;
}

.graticule {
  fill: none;
  stroke: rgba(18, 63, 54, 0.08);
  stroke-width: 0.6;
}

.marker {
  cursor: pointer;
}

.marker .marker-halo {
  fill: rgba(255, 255, 255, 0.92);
  stroke: rgba(18, 63, 54, 0.16);
  stroke-width: 1.2;
}

.marker .marker-core {
  fill: var(--forest);
  stroke: #fff;
  stroke-width: 1.4;
}

.marker.candidate .marker-core {
  fill: var(--leaf);
}

.marker.research .marker-core {
  fill: #92723e;
}

.marker.flagship .marker-core {
  fill: var(--coral);
}

.marker text {
  dominant-baseline: middle;
  font-size: 12px;
  pointer-events: none;
  text-anchor: middle;
}

.marker.is-compact text:not(.marker-label) {
  font-size: 8px;
}

.marker:hover .marker-halo,
.marker:focus .marker-halo,
.marker.is-selected .marker-halo {
  fill: var(--sun);
  stroke: var(--coral-dark);
  stroke-width: 2;
}

.marker.is-selected .marker-core {
  stroke-width: 2;
}

.marker-label {
  fill: var(--forest);
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(255, 253, 248, 0.98);
  stroke-linejoin: round;
  stroke-width: 5px;
  text-anchor: middle;
}

.marker-cluster {
  cursor: zoom-in;
}

.marker-cluster .cluster-ring {
  fill: rgba(255, 255, 255, 0.95);
  stroke: rgba(18, 63, 54, 0.2);
  stroke-width: 1.5;
}

.marker-cluster .cluster-core {
  fill: var(--forest);
  stroke: var(--sun);
  stroke-width: 2;
}

.marker-cluster .cluster-count {
  dominant-baseline: middle;
  fill: #fff;
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
  text-anchor: middle;
}

.marker-cluster:hover .cluster-ring,
.marker-cluster:focus .cluster-ring,
.marker-cluster:focus-visible .cluster-ring {
  fill: var(--sun);
  stroke: var(--coral-dark);
  stroke-width: 2.5;
}

.map-loading,
.map-empty {
  color: var(--ink-soft);
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.map-tooltip {
  background: var(--ink);
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  max-width: 220px;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, calc(-100% - 14px));
  z-index: 6;
}

.zoom-controls {
  bottom: 12px;
  display: grid;
  gap: 5px;
  left: 12px;
  position: absolute;
}

.zoom-controls button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-size: 20px;
  height: 38px;
  width: 38px;
}

.destination-panel {
  background: var(--paper);
  display: grid;
  grid-template-rows: minmax(280px, 0.95fr) auto;
  min-width: 0;
}

.destination-visual {
  background: var(--forest);
  min-height: 300px;
  overflow: hidden;
  position: relative;
}

.destination-visual > img {
  display: block;
  height: 100%;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.destination-visual::after {
  background: linear-gradient(180deg, transparent 52%, rgba(18, 63, 54, 0.58));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.image-fallback {
  align-items: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 200, 87, 0.25), transparent 28%),
    var(--forest);
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  position: absolute;
  text-align: center;
}

.image-fallback span {
  font-size: 74px;
}

.image-fallback small {
  margin-top: 10px;
}

.concept-status {
  background: rgba(255, 253, 248, 0.92);
  border-radius: 999px;
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
  left: 14px;
  letter-spacing: 0.1em;
  padding: 7px 10px;
  position: absolute;
  text-transform: uppercase;
  top: 14px;
  z-index: 2;
}

.discovery-ticket {
  background: linear-gradient(120deg, #0f7790, #11556d 58%, #ee6048 59%);
  border: 3px solid var(--sun);
  border-radius: 13px 17px 17px 13px;
  bottom: 16px;
  box-shadow: 0 9px 25px rgba(8, 36, 32, 0.28);
  color: #fff;
  display: grid;
  max-width: 225px;
  min-width: 185px;
  padding: 12px 16px 11px 21px;
  position: absolute;
  right: 16px;
  transform: rotate(-2.5deg);
  z-index: 3;
}

.discovery-ticket::before {
  background: var(--paper);
  border: 2px solid var(--sun);
  border-radius: 50%;
  content: "";
  height: 10px;
  left: 5px;
  position: absolute;
  top: calc(50% - 6px);
  width: 10px;
}

.discovery-ticket::after {
  border: 1px dashed rgba(255, 255, 255, 0.6);
  border-radius: 8px 12px 12px 8px;
  content: "";
  inset: 5px;
  pointer-events: none;
  position: absolute;
}

.discovery-ticket span,
.discovery-ticket strong,
.discovery-ticket small {
  position: relative;
  z-index: 1;
}

.discovery-ticket span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.discovery-ticket strong {
  font-size: clamp(18px, 2.1vw, 25px);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 4px 0 3px;
  text-transform: uppercase;
}

.discovery-ticket small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  opacity: 0.9;
  text-transform: uppercase;
}

.destination-content {
  padding: 24px;
}

.destination-overline {
  align-items: center;
  color: var(--coral-dark);
  display: flex;
  font-size: 10px;
  font-weight: 800;
  justify-content: space-between;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

#destination-scope {
  background: rgba(46, 124, 93, 0.1);
  border-radius: 999px;
  color: var(--forest-2);
  letter-spacing: 0.06em;
  padding: 5px 8px;
}

.destination-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 3.3vw, 48px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
  margin: 11px 0 5px;
}

.scientific-name {
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
  margin: 0;
}

.fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0;
}

.fact-row span {
  background: #eef3ef;
  border-radius: 999px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 9px;
}

.local-story {
  color: #354b45;
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
}

.source-row a {
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.destination-actions {
  border-top: 1px solid var(--line);
  margin-top: 21px;
  padding-top: 18px;
}

.first-edition {
  align-items: center;
  background: var(--forest);
  border-radius: 28px;
  color: #fff;
  display: grid;
  gap: 44px;
  grid-template-columns: minmax(300px, 0.83fr) minmax(0, 1.17fr);
  margin-top: 34px;
  overflow: hidden;
  padding: 42px;
}

.first-edition .eyebrow {
  color: var(--sun);
}

.first-edition h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 66px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 0.96;
  margin: 0 0 20px;
}

.first-edition p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-bottom: 24px;
}

.first-edition .primary-button {
  background: var(--sun);
  color: var(--ink);
}

.first-edition-image {
  border-radius: 20px;
  min-height: 430px;
  overflow: hidden;
  position: relative;
}

.first-edition-image img {
  display: block;
  height: 100%;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

footer {
  color: var(--ink-soft);
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  padding: 24px 4px 0;
}

.drawer-backdrop {
  background: rgba(5, 24, 20, 0.42);
  inset: 0;
  position: fixed;
  z-index: 50;
}

.data-drawer {
  background: var(--cream);
  box-shadow: -24px 0 70px rgba(5, 24, 20, 0.23);
  height: 100vh;
  max-width: min(780px, 92vw);
  overflow-y: auto;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform 220ms ease, visibility 0s linear 220ms;
  visibility: hidden;
  width: 780px;
  z-index: 60;
}

.data-drawer.is-open {
  pointer-events: auto;
  transform: translateX(0);
  transition: transform 220ms ease, visibility 0s linear 0s;
  visibility: visible;
}

.drawer-header {
  align-items: center;
  background: var(--forest);
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 28px 30px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.drawer-header .eyebrow {
  color: var(--sun);
  margin-bottom: 5px;
}

.drawer-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.04em;
  margin: 0;
}

.drawer-header .icon-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.drawer-body {
  padding: 26px 30px 44px;
}

.backup-section,
.editor-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

.editor-section {
  margin-top: 18px;
}

.backup-section h3,
.editor-section h3 {
  font-size: 18px;
  margin: 0 0 6px;
}

.backup-section > p,
.section-heading p,
.safety-note {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 15px;
}

.restore-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(150px, 1fr) minmax(175px, 1fr) auto;
  margin-top: 17px;
  padding-top: 17px;
}

.file-button {
  overflow: hidden;
  position: relative;
}

.file-button input {
  inset: 0;
  opacity: 0;
  position: absolute;
}

.safety-note {
  margin: 10px 0 0;
}

.section-heading {
  align-items: start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p {
  margin: 3px 0 0;
}

.data-drawer label {
  color: var(--ink-soft);
  display: grid;
  font-size: 11px;
  font-weight: 700;
  gap: 6px;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  gap: 0 12px;
  grid-template-columns: 1fr 1fr;
}

.data-drawer textarea {
  min-height: 105px;
  resize: vertical;
}

.form-footer {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 17px;
}

#form-status {
  color: var(--ink-soft);
  font-size: 12px;
  margin-right: auto;
}

.toast {
  background: var(--ink);
  border-radius: 12px;
  bottom: 24px;
  box-shadow: 0 10px 34px rgba(5, 24, 20, 0.22);
  color: #fff;
  font-size: 13px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 12px 17px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 80;
}

@media (max-width: 1120px) {
  .atlas-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.75fr);
  }

  .map-frame,
  #world-map {
    min-height: 540px;
    height: 540px;
  }

  .destination-panel {
    grid-template-rows: 270px auto;
  }
}

@media (max-width: 880px) {
  .app-shell {
    padding: 0 18px 24px;
  }

  .intro {
    align-items: start;
    gap: 22px;
    grid-template-columns: 1fr;
    padding-top: 48px;
  }

  .intro-copy {
    max-width: 660px;
  }

  .atlas-toolbar {
    grid-template-columns: 1fr 1fr 42px;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .atlas-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .destination-panel {
    grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
    grid-template-rows: none;
  }

  .destination-visual {
    min-height: 430px;
  }

  .first-edition {
    padding: 30px;
  }
}

@media (max-width: 660px) {
  .topbar {
    align-items: flex-start;
    gap: 18px;
    padding: 18px 0;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .passport-button {
    justify-content: center;
  }

  .brand small {
    display: none;
  }

  .atlas {
    border-radius: 20px;
  }

  .atlas-toolbar {
    grid-template-columns: 1fr 42px;
  }

  .atlas-toolbar label:not(.search-field) {
    grid-column: 1;
  }

  .atlas-toolbar .icon-button {
    grid-column: 2;
    grid-row: 2 / span 2;
    height: 100%;
  }

  .map-panel {
    padding: 12px;
  }

  .map-summary {
    gap: 11px;
  }

  .map-hint {
    display: none;
  }

  .map-frame,
  #world-map {
    height: 420px;
    min-height: 420px;
  }

  .destination-panel {
    grid-template-columns: 1fr;
  }

  .destination-visual {
    min-height: 360px;
  }

  .first-edition {
    grid-template-columns: 1fr;
    padding: 28px 24px 24px;
  }

  .first-edition-image {
    min-height: 430px;
  }

  footer {
    flex-direction: column;
    gap: 6px;
  }

  .form-grid,
  .restore-row {
    grid-template-columns: 1fr;
  }

  .data-drawer {
    max-width: 100vw;
    width: 100vw;
  }

  .drawer-header,
  .drawer-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
