@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--atlas-header-h) + 24px);
}

body.has-atlas-header {
  color: var(--atlas-ink);
  font-family: var(--atlas-font-body);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 3000;
  padding: 10px 14px;
  color: #fff;
  background: var(--atlas-ink);
  border-radius: var(--atlas-radius-sm);
  transform: translateY(-150%);
  transition: transform 140ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.atlas-header.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 2000;
  min-height: var(--atlas-header-h);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  color: var(--atlas-ink);
  background: rgba(252, 251, 247, 0.94);
  border-top: 3px solid var(--atlas-ink);
  border-bottom: 1px solid var(--atlas-border);
  box-shadow: 0 4px 24px rgba(23, 40, 61, 0.06);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  font-family: var(--atlas-font-body);
}

.atlas-header.site-header::before {
  display: none;
}

.atlas-brand,
.atlas-title,
.atlas-nav a {
  color: inherit;
  text-decoration: none;
}

.atlas-brand {
  justify-self: start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.115em;
  line-height: 1.2;
  text-transform: uppercase;
}

.atlas-title {
  justify-self: center;
  font-family: var(--atlas-font-display);
  font-size: clamp(1.02rem, 1.6vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.atlas-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 18px;
}

.atlas-nav a {
  padding: 22px 0 18px;
  border-bottom: 3px solid transparent;
  color: var(--atlas-ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.atlas-nav a:hover {
  color: var(--atlas-ink);
  border-bottom-color: var(--atlas-glacier);
}

.atlas-nav a[aria-current="page"] {
  color: var(--atlas-ink);
  border-bottom-color: var(--atlas-ember);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--atlas-glacier) 75%, white);
  outline-offset: 3px;
}

.atlas-icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  padding: 4px;
  border: 0;
  border-radius: var(--atlas-radius-sm);
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.atlas-icon-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.atlas-core-controls {
  background: var(--atlas-paper);
}

#side .atlas-core-controls .sec {
  padding: 14px 14px 15px;
  border-bottom: 1px solid var(--atlas-border);
}

#side .atlas-core-controls .sec > h3 {
  cursor: default;
}

#side .atlas-core-controls .sec > h3::before {
  display: none;
}

.atlas-advanced {
  border-bottom: 1px solid var(--atlas-border);
  background: #fff;
}

.atlas-advanced > summary {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 14px;
  color: var(--atlas-ink);
  background: var(--atlas-glacier-pale);
  border-block: 1px solid color-mix(in srgb, var(--atlas-glacier) 30%, white);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.atlas-advanced > summary::-webkit-details-marker {
  display: none;
}

.atlas-advanced > summary::after {
  content: "+";
  float: right;
  font-size: 1.15rem;
  line-height: 0.8;
}

.atlas-advanced[open] > summary::after {
  content: "−";
}

.atlas-advanced-body {
  background: #fff;
}

.atlas-advanced-body > .sec {
  border-bottom-width: 1px;
}

#stats.atlas-results .shead {
  background: var(--atlas-ink);
}

#stats.atlas-results .scard .k,
#stats.atlas-results .dcc .k {
  font-size: 12px;
  line-height: 1.3;
}

#stats.atlas-results .stgrp h5,
#stats.atlas-results .dclab {
  font-size: 12px;
  line-height: 1.4;
}

#stats.atlas-results .stgrp .cv {
  height: 116px;
}

#stats.atlas-results .atlas-rgi-id {
  margin: -2px 0 10px;
  color: var(--atlas-ink-soft);
  font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-size: 11px;
  user-select: all;
}

#stats.atlas-results .atlas-primary-metrics {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-block: 8px 12px;
}

#stats.atlas-results .atlas-primary-metrics .scard {
  padding: 9px 11px;
  border-left: 3px solid var(--atlas-ember);
}

#stats.atlas-results .atlas-primary-metrics .v {
  font-size: 17px;
}

#stats.atlas-results .atlas-secondary-metrics {
  margin-top: 14px;
}

#stats.atlas-results .atlas-result-actions {
  display: flex;
  gap: 7px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--atlas-border);
}

#stats.atlas-results .atlas-result-actions .favbtn {
  flex: 1;
}

#appwrap {
  top: var(--atlas-header-h) !important;
}

main.atlas-page-main {
  min-height: calc(100vh - var(--atlas-header-h));
  padding-top: var(--atlas-header-h);
}

main.atlas-map-main {
  position: fixed;
  inset: var(--atlas-header-h) 0 0;
}

.atlas-mobile-summary,
.atlas-sheet-toggle,
.atlas-mobile-result-close {
  display: none;
}

.atlas-result-buttons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

@media (max-width: 780px) {
  html,
  body.has-atlas-header {
    overflow: hidden;
  }

  #appwrap {
    overflow: hidden;
  }

  #map {
    left: 0 !important;
    right: 0 !important;
  }

  #side,
  #side.hidden {
    position: absolute;
    inset: auto 0 0 !important;
    z-index: 20;
    display: block;
    width: 100% !important;
    max-width: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--atlas-paper);
    border: 0;
    border-top: 1px solid var(--atlas-border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 36px rgba(23, 40, 61, 0.18);
    transform: none !important;
    transition: height 180ms ease;
  }

  #side[data-sheet="collapsed"] {
    height: min(26dvh, 220px);
    min-height: 154px;
    overflow: hidden;
  }

  #side[data-sheet="half"] {
    height: 54dvh;
    max-height: calc(100% - 12px);
  }

  #side[data-sheet="full"] {
    height: calc(100% - 8px);
  }

  #side > .head {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 15px 15px 0 0;
  }

  #side > .head::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    width: 38px;
    height: 3px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.45);
    transform: translateX(-50%);
  }

  .atlas-sheet-toggle,
  .atlas-mobile-result-close {
    display: inline-grid;
  }

  #hide {
    display: none;
  }

  .atlas-mobile-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 11px 14px 13px;
    color: var(--atlas-ink-soft);
    background: var(--atlas-paper);
    border-bottom: 1px solid var(--atlas-border);
    font-size: 11px;
    font-weight: 700;
  }

  .atlas-mobile-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .atlas-mobile-summary span + span {
    padding-left: 8px;
    border-left: 1px solid var(--atlas-border);
  }

  #side[data-sheet="collapsed"] .atlas-core-controls,
  #side[data-sheet="collapsed"] .atlas-seasonal-controls,
  #side[data-sheet="collapsed"] .atlas-advanced {
    display: none;
  }

  #side > .head > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #side > .head .atlas-sheet-toggle {
    flex: none;
    margin-left: auto;
  }

  #side[data-sheet="half"] .atlas-mobile-summary,
  #side[data-sheet="full"] .atlas-mobile-summary {
    display: none;
  }

  #side[data-sheet="half"] .atlas-advanced-body {
    display: none !important;
  }

  #side[data-sheet="full"] .atlas-advanced > summary {
    position: static;
  }

  #rTabs {
    position: absolute;
    inset: auto 0 min(68dvh, calc(100% - 44px)) !important;
    z-index: 32;
    width: 100%;
    height: 40px;
    border-left: 0;
  }

  body.rpanel #stats,
  body.rpanel #depCurves,
  body.rpanel #compare,
  #stats.open {
    position: absolute;
    inset: auto 0 0 !important;
    z-index: 31;
    width: 100% !important;
    height: min(68dvh, calc(100% - 44px));
    max-height: min(68dvh, calc(100% - 44px));
    overflow-y: auto;
    border: 0;
    border-top: 1px solid var(--atlas-border);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -14px 42px rgba(23, 40, 61, 0.24);
  }

  #stats .shead,
  #depCurves .dch,
  #compare .dch {
    position: sticky;
    top: 0;
    z-index: 4;
  }

  body[data-mobile-results="closed"] #rTabs,
  body[data-mobile-results="closed"] #stats,
  body[data-mobile-results="closed"] #depCurves,
  body[data-mobile-results="closed"] #compare {
    display: none !important;
  }

  body.dc-expanded #depCurves {
    height: calc(100% - 8px);
    max-height: calc(100% - 8px);
  }
}

@media (max-width: 980px) {
  .atlas-header.site-header {
    grid-template-columns: auto 1fr;
    gap: 12px 20px;
    padding-inline: 18px;
  }

  .atlas-title {
    justify-self: start;
  }

  .atlas-brand {
    display: none;
  }

  .atlas-nav {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .atlas-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 620px) {
  .atlas-header.site-header {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 0;
    padding: 7px 12px 0;
  }

  .atlas-title {
    justify-self: center;
    font-size: 1rem;
  }

  .atlas-nav {
    justify-self: stretch;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    gap: 5px;
    overflow: hidden;
  }

  .atlas-nav a {
    flex: none;
    padding: 9px 0 7px;
    font-size: 0.6rem;
    letter-spacing: 0.045em;
  }
}

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