.maplab-shell {
  --maplab-ink: #1e1b16;
  --maplab-muted: #6f6a62;
  --maplab-green: #14532d;
  --maplab-orange: #ea580c;
  --maplab-line: rgba(30, 27, 22, .11);
  min-height: 0;
  padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 3vw, 2.5rem) 3.5rem;
  color: var(--maplab-ink);
  background: linear-gradient(180deg, #fdf6ec 0%, #fdf6ec calc(100% - 4.5rem), #fff 100%);
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}

/* The site shell normally reserves a large white strip below every page.
   The atlas finishes with its own soft fade, so it should meet the footer. */
body:has(.maplab-shell) .odisea-main { padding-bottom: 0; }

.maplab-hero,
.maplab-toolbar,
.maplab-stage,
.maplab-status,
.maplab-destinations-toggle,
.maplab-destination-list {
  /* Match the standard wide measure used by Odisea's resource surfaces:
     ample for the map and guide, with a clear editorial margin at each side. */
  width: min(1480px, 100%);
  margin-inline: auto;
}

.maplab-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: .15rem 0 .7rem;
}

.maplab-hero__heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .3rem .8rem;
}

.maplab-eyebrow,
.maplab-panel-type {
  margin: 0 0 .45rem;
  color: var(--maplab-orange);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.maplab-hero h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
}

.maplab-hero p:not(.maplab-eyebrow) {
  max-width: 440px;
  margin: 0;
  color: var(--maplab-muted);
  font-size: .92rem;
  line-height: 1.35;
}

.maplab-compare,
.maplab-panel-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .7rem 1.15rem;
  border: 1px solid var(--maplab-line);
  border-radius: 999px;
  color: var(--maplab-ink);
  background: rgba(255, 255, 255, .78);
  font-size: .76rem;
  font-weight: 850;
  text-decoration: none;
}

.maplab-toolbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-bottom: 1rem;
}

.maplab-search-wrap {
  position: relative;
  display: flex;
  flex: 1 1 250px;
  max-width: 320px;
}

.maplab-search {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .5rem;
  min-height: 34px;
  padding: 0 .85rem;
  border: 1px solid var(--maplab-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(30, 27, 22, .05);
}

.maplab-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.maplab-search-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + .45rem);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--maplab-line);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 16px 35px rgba(30, 27, 22, .16);
}

.maplab-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .25rem .75rem;
  width: 100%;
  padding: .7rem .9rem;
  border: 0;
  border-bottom: 1px solid rgba(52, 45, 36, .08);
  color: var(--maplab-ink);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.maplab-search-result:last-child { border-bottom: 0; }
.maplab-search-result:hover,
.maplab-search-result.is-active { background: #f1fbf5; }
.maplab-search-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.maplab-search-result span { color: var(--maplab-muted); font-size: .66rem; font-weight: 700; }
.maplab-search-result em { align-self: center; color: var(--maplab-green); font-size: .58rem; font-style: normal; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }

.maplab-tabs {
  display: flex;
  gap: .2rem;
  padding: .25rem;
  border: 1px solid var(--maplab-line);
  border-radius: 999px;
  background: rgba(30, 27, 22, .045);
}

.maplab-tabs button,
.maplab-rotate {
  min-height: 34px;
  padding: .35rem .68rem;
  border: 0;
  border-radius: 999px;
  color: var(--maplab-muted);
  background: transparent;
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

.maplab-tabs button.is-active {
  color: #fff;
  background: var(--maplab-green);
}

.maplab-tabs button[data-maplab-filter="saved"] { color: var(--maplab-orange); }
.maplab-tabs button[data-maplab-filter="saved"].is-active { color: #fff; }

.maplab-legend {
  display: flex;
  align-items: center;
  gap: .9rem;
  color: var(--maplab-muted);
  font-size: .63rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.maplab-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.maplab-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.maplab-legend-dot--country { background: var(--maplab-orange); }
.maplab-legend-dot--city { background: var(--maplab-green); }
.maplab-legend-dot--capital { background: var(--maplab-orange); }

.maplab-toolbar-count {
  margin-left: auto;
  color: rgba(30, 27, 22, .34);
  font-size: .68rem;
  font-weight: 700;
}

.maplab-toolbar-count strong { color: inherit; }

.maplab-rotate {
  position: absolute;
  z-index: 4;
  bottom: .8rem;
  left: .8rem;
  margin: 0;
  border: 1px solid var(--maplab-line);
  background: #fff;
}

.maplab-rotate.is-active {
  color: var(--maplab-green);
  border-color: rgba(20, 83, 45, .28);
  background: rgba(20, 83, 45, .08);
}

.maplab-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
  min-height: min(680px, 72vh);
}

.maplab-map-wrap,
.maplab-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--maplab-line);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 20px 60px rgba(30, 27, 22, .11);
}

.maplab-map-wrap,
.maplab-map,
.maplab-map .maplibregl-canvas-container,
.maplab-map canvas {
  background: #e1f1f8;
}

.maplab-map {
  position: absolute;
  inset: 0;
}

.maplab-map canvas {
  outline: 0;
}

.maplab-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: var(--maplab-green);
  background: radial-gradient(circle at 50% 45%, #edf8fc, #d9edf7);
  font-size: .78rem;
  font-weight: 800;
  transition: opacity .35s ease;
}

.maplab-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.maplab-loading span {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(20, 83, 45, .18);
  border-top-color: var(--maplab-green);
  border-radius: 50%;
  animation: maplab-spin .8s linear infinite;
}

@keyframes maplab-spin { to { transform: rotate(360deg); } }

.maplab-tip {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: .8rem;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: .45rem .8rem;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  color: rgba(30, 27, 22, .72);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  font-size: .66rem;
  font-weight: 750;
  text-align: center;
  pointer-events: none;
}

.maplab-panel {
  min-height: 420px;
}

.maplab-panel-empty,
.maplab-panel-content {
  height: 100%;
  padding: 1.25rem;
}

.maplab-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.maplab-panel-empty > span {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: .75rem;
  place-items: center;
  border-radius: 50%;
  color: var(--maplab-green);
  background: rgba(20, 83, 45, .1);
  font-size: 2rem;
}

.maplab-panel h2 {
  margin: 0 0 .6rem;
  font-size: 1.45rem;
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.15;
}

.maplab-panel-content[data-maplab-destination-type="country"] h2 {
  font-size: 1.25rem;
}

.maplab-panel-empty p,
.maplab-panel-copy {
  margin: 0;
  color: var(--maplab-muted);
  font-size: .9rem;
  line-height: 1.6;
}

.maplab-panel-content[data-maplab-destination-type="country"] .maplab-panel-copy {
  font-size: .78rem;
  line-height: 1.5;
}

.maplab-panel-content {
  display: flex;
  flex-direction: column;
}

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

.maplab-panel-image {
  min-height: 190px;
  margin: -1.25rem -1.25rem 1.2rem;
  background: #e8e0d8 center / cover no-repeat;
}

.maplab-panel-meta {
  display: grid;
  gap: .45rem;
  margin: 1rem 0;
}

.maplab-panel-meta span {
  padding: .55rem .7rem;
  border-radius: .7rem;
  color: #4c4842;
  background: #f0f2f1;
  font-size: .78rem;
}

.maplab-panel-save {
  display: inline-flex;
  width: 100%;
  min-height: 40px;
  justify-content: center;
  margin: 0 0 .65rem;
  border-color: #e6d98a;
  background: #f6c948;
  color: #21190c;
  font-size: .72rem;
}

.maplab-panel-save:not(.is-saved) {
  border-color: #e4e7e5;
  background: #f0f2f1;
  color: var(--maplab-ink);
}

.maplab-panel-link {
  margin-top: auto;
  color: #fff;
  border-color: var(--maplab-green);
  background: var(--maplab-green);
}

.maplab-status {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: .8rem .35rem 0;
  color: var(--maplab-muted);
  font-size: .72rem;
}

.maplab-destinations-toggle {
  display: flex;
  justify-content: center;
  padding: 1.25rem 0 .2rem;
}

.maplab-destinations-toggle button {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 42px;
  padding: .6rem 1rem;
  border: 1px solid rgba(20, 83, 45, .25);
  border-radius: 999px;
  color: #fff;
  background: var(--maplab-green);
  font: 800 .72rem/1 "Plus Jakarta Sans", Inter, sans-serif;
  letter-spacing: .045em;
  text-transform: uppercase;
  cursor: pointer;
}

.maplab-destination-list {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--maplab-line);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, .72);
}

.maplab-destination-list[hidden] { display: none; }

.maplab-destination-list.is-revealed { animation: maplab-list-reveal .42s ease-out both; }

@keyframes maplab-list-reveal {
  from { opacity: 0; transform: translateY(.85rem); }
  to { opacity: 1; transform: translateY(0); }
}

.maplab-destination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: .75rem;
}

.maplab-destination-card {
  overflow: hidden;
  border: 1px solid var(--maplab-line);
  border-radius: .9rem;
  color: var(--maplab-ink);
  background: #fff;
  text-decoration: none;
  transition: opacity .45s ease, transform .45s ease, box-shadow .2s ease;
}

.maplab-destination-card.is-pending { opacity: 0; transform: translateY(.9rem); }
.maplab-destination-card.is-visible { opacity: 1; transform: translateY(0); }
.maplab-destination-card:hover { box-shadow: 0 10px 22px rgba(30, 27, 22, .10); transform: translateY(-.15rem); }

.maplab-destination-card img,
.maplab-destination-card-fallback {
  display: block;
  width: 100%;
  height: 105px;
  object-fit: cover;
  background: #dceef6;
}

.maplab-destination-card-body { display: grid; gap: .25rem; padding: .72rem; }
.maplab-destination-card small { color: var(--maplab-green); font-size: .6rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.maplab-destination-card strong { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.maplab-destination-card span { overflow: hidden; color: var(--maplab-muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }

.maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid var(--maplab-line);
  border-radius: .8rem;
  box-shadow: 0 6px 22px rgba(30, 27, 22, .1);
}

.maplibregl-popup-content {
  padding: .42rem .65rem;
  color: #fff;
  background: var(--maplab-green);
  border-radius: .75rem;
  font: 700 .78rem/1.4 "Plus Jakarta Sans", Inter, sans-serif;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--maplab-green); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--maplab-green); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--maplab-green); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--maplab-green); }

@media (max-width: 900px) {
  .maplab-shell { padding: .85rem; }
  .maplab-hero { align-items: flex-start; }
  .maplab-hero__heading { display: block; }
  .maplab-hero h1 { font-size: clamp(1.85rem, 9vw, 2.5rem); }
  .maplab-hero p:not(.maplab-eyebrow) { margin-top: .3rem; font-size: .84rem; }
  .maplab-compare { display: none; }
  .maplab-toolbar { flex-wrap: wrap; }
  .maplab-search-wrap { max-width: none; order: 1; }
  .maplab-tabs { order: 2; width: 100%; overflow-x: auto; }
  .maplab-tabs button { flex: 1 0 auto; }
  .maplab-legend { order: 3; }
  .maplab-toolbar-count { order: 4; margin-left: auto; }
  .maplab-stage { grid-template-columns: 1fr; min-height: 0; }
  .maplab-map-wrap { min-height: min(66vh, 560px); border-radius: 1.15rem; }
  .maplab-panel { min-height: 0; border-radius: 1.15rem; }
  .maplab-panel-empty { min-height: 180px; }
  .maplab-panel-image { min-height: 155px; }
  .maplab-panel-link { margin-top: 1rem; }
  .maplab-status { flex-direction: column; }
  .maplab-destination-list { padding: .75rem; }
}

@media (max-width: 520px) {
  .maplab-map-wrap .maplab-rotate { width: auto; }
  .maplab-legend { display: none; }
  .maplab-toolbar-count { display: none; }
  .maplab-tip {
    right: .55rem;
    left: auto;
    bottom: .55rem;
    width: auto;
    max-width: calc(100% - 10.75rem);
    transform: none;
    font-size: .58rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maplab-loading span { animation: none; }
  .maplab-destination-list.is-revealed,
  .maplab-destination-card { animation: none; transition: none; }
}
