:root {
  --atlas-forest: #16483d;
  --atlas-text: #263d36;
  --atlas-paper: #f8f7ed;
  --atlas-line: #c7d7cb;
  --atlas-accent: #f8d56b;
}

.atlas-page {
  margin: 0;
  min-height: 100vh;
  background: var(--atlas-paper);
  color: var(--atlas-text);
  font: 16px/1.55 "Atkinson Hyperlegible Next", system-ui, sans-serif;
}
.atlas-page * { box-sizing: border-box; }
.atlas-page-header {
  background: var(--atlas-forest);
  color: #fffdf3;
  border-bottom: 5px solid var(--atlas-accent);
}
.atlas-page-header > div, .atlas-page-main {
  width: min(100% - 48px, 1260px);
  margin-inline: auto;
}
.atlas-page-header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 16px;
  min-height: 65px;
}
.atlas-page-header a {
  color: inherit;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.atlas-page-main { padding: clamp(20px, 4vw, 47px) 0 42px; }
.atlas-page-main > h1 {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.04;
  margin: 0 0 .25em;
  letter-spacing: -.045em;
}
.atlas-page-main > p, .atlas-dialog-heading p { margin: 0 0 17px; font-size: 1.04rem; }

.atlas {
  color: var(--atlas-text);
  text-align: left;
  font: 16px/1.45 "Atkinson Hyperlegible Next", system-ui, sans-serif;
}
.atlas *, .atlas-dialog * { box-sizing: border-box; }
.atlas-grid { display: grid; grid-template-columns: minmax(0, 2.8fr) minmax(220px, 1fr); gap: 16px; align-items: start; }
.atlas-board {
  position: relative;
  border: 1px solid #9db8ab;
  border-radius: 15px;
  background: #d6e9df;
  box-shadow: 0 4px 0 #264d4015;
  overflow: hidden;
}
.atlas-drawing { display: block; width: 100%; height: auto; touch-action: manipulation; }
.ski-atlas .atlas-drawing { cursor: pointer; }
.atlas-controls { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.atlas button, .atlas select, .atlas a { touch-action: manipulation; }
.atlas-tab, .atlas-trail-button, .atlas-link, .atlas-field select {
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--atlas-line);
  border-radius: 10px;
  background: #fffef7;
  color: var(--atlas-forest);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.atlas-tab[aria-pressed="true"], .atlas-link {
  border-color: var(--atlas-forest);
  background: var(--atlas-forest);
  color: #fffef1;
}
.atlas button:focus-visible, .atlas select:focus-visible, .atlas a:focus-visible,
.atlas-dialog button:focus-visible, .atlas-page-header a:focus-visible {
  outline: 3px solid #b46d09;
  outline-offset: 2px;
}
.atlas button:hover, .atlas a:hover { filter: brightness(.94); }
.atlas-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  text-align: center;
  text-decoration: none;
}
.atlas-pins { position: absolute; inset: 0; pointer-events: none; }
.atlas-pin {
  --pin-color: #346652;
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  transform: translate(-50%,-50%);
  border: 0;
  background: transparent;
  border-radius: 100%;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
}
.atlas-pin[aria-pressed="true"], .atlas-pin:focus-visible { z-index: 3; }
.atlas-pin-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--pin-color);
  border: 2px solid #fffefa;
  border-radius: 50%;
  box-shadow: 0 2px 4px #17352d73;
  color: white;
  font-size: 16px;
  line-height: 1;
}
.atlas-pin-remote { --pin-color: #365272; }
.atlas-pin-train { --pin-color: #855337; }
.atlas-pin-heli { --pin-color: #235a73; }
.atlas-pin[aria-pressed="true"] .atlas-pin-icon { outline: 3px solid #f9d86c; background: #203e37; }
.atlas-pin-name {
  position: absolute;
  top: 50%;
  left: 39px;
  transform: translateY(-50%);
  max-width: clamp(75px, 10vw, 126px);
  width: max-content;
  padding: 3px 5px;
  color: #1c3f36;
  background: #fffcf0f5;
  border-radius: 4px;
  box-shadow: 0 1px 3px #274b3629;
  text-align: left;
  font: 750 clamp(10px, 1.05vw, 14px)/1.12 system-ui, sans-serif;
  pointer-events: none;
}
.atlas-pin-edge .atlas-pin-name { left: auto; right: 39px; text-align: right; }
.atlas-pin[data-place="amusement"] .atlas-pin-name,
.atlas-pin[data-place="waterpark"] .atlas-pin-name { left: auto; right: 39px; text-align: right; }
.atlas-pin[data-place="square"] .atlas-pin-name { top: 38px; left: 50%; transform: translateX(-50%); text-align: center; }

.atlas-station {
  position: absolute;
  transform: translate(-50%,-50%);
  font: 900 15px/1 system-ui,sans-serif;
  color: #784a31;
  background: #fff5d9;
  border-radius: 3px;
  padding: 1px 2px;
}
.atlas-detail {
  padding: 14px;
  background: #fffef6;
  border: 1px solid var(--atlas-line);
  border-radius: 15px;
}
.atlas-field { display: grid; gap: 5px; font-size: .91rem; font-weight: 750; }
.atlas-field select { width: 100%; min-width: 0; font-weight: 650; }
.atlas-description h3 { font-size: 1.38rem; line-height: 1.15; margin: 16px 0 7px; letter-spacing: -.025em; color: #16483d; }
.atlas-description p { margin: 7px 0; line-height: 1.45; }
.atlas-instructions { color: #48645b; font-size: .92rem; }
.atlas-transit { font-weight: 750; font-size: .9rem; color: #784a31; }
.atlas-legend { display: flex; flex-wrap: wrap; gap: 6px 17px; padding: 9px 3px 0; font-size: .91rem; font-weight: 750; }
.atlas-rail-key { color: #785037; }
.atlas-heli-key { color: #215e7a; }
.atlas-rating-green { color: #157348; }
.atlas-rating-blue { color: #1b55a0; }
.atlas-rating-black { color: #232d3c; }
.atlas-trail-list { display: grid; gap: 11px; }
.atlas-trail-group { display: grid; gap: 5px; }
.atlas-trail-group h3 { margin: 0 0 2px; font-size: .96rem; color: #355b62; }
.atlas-lift-board { margin: 0 0 3px; text-align: center; justify-content: center; }
.atlas-trail-button { display: flex; align-items: center; gap: 8px; text-align: left; }
.atlas-trail-button[aria-pressed="true"] { background: #ecf3e6; border-color: #5d8c76; }
.atlas-ski-description { border-top: 1px solid var(--atlas-line); margin-top: 11px; padding-top: 4px; }
.atlas-ski-gear { margin: 7px 0; }
.atlas-facilities { margin: 9px 0 0; font-size: .92rem; color: #456455; }

.atlas-dialog, #panel[data-kind="trail-map"] {
  width: min(1080px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  border: 1px solid #8ea99c;
  border-radius: 18px;
  padding: clamp(14px, 2.5vw, 24px);
  background: #f8f7ed;
  color: var(--atlas-text);
  overscroll-behavior: contain;
  overflow-y: auto;
}
.atlas-dialog::backdrop { background: #122b25bd; }
.atlas-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  color: var(--atlas-forest);
  text-align: left;
  font: 16px/1.45 system-ui,sans-serif;
}
.atlas-dialog-heading h2, #panel[data-kind="trail-map"] h2 { margin: 0 0 5px; font-size: clamp(23px,4vw,35px); line-height: 1.13; text-align: left; }
.atlas-dialog-close {
  min-width: 44px;
  min-height: 44px;
  padding: 5px;
  border: 1px solid var(--atlas-line);
  border-radius: 50%;
  background: white;
  color: var(--atlas-forest);
  font: 700 23px/1 system-ui,sans-serif;
  cursor: pointer;
}
#panel[data-kind="trail-map"] #panel-content > p { text-align: left; padding-right: 34px; margin: 0 0 13px; }
#panel[data-kind="trail-map"] #panel-content > h2 { padding-right: 38px; }
#village-map-menu {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid #a6bd9d;
  border-radius: 11px;
  background: #e8f1d9;
  color: #194a3e;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
#village-map-menu:focus-visible { outline: 3px solid #d99c31; outline-offset: 2px; }
.mountain-active #village-map-menu, .travel-active #village-map-menu { display: none; }

@media (max-width: 820px) {
  .atlas-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .atlas-page-header > div, .atlas-page-main { width: min(100% - 28px,1260px); }
  .atlas-trail-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .atlas-tab { padding: 6px 8px; font-size: .81rem; }
  .atlas-controls { gap: 4px; }
  .atlas-pin { width: 42px; }
  .atlas-pin-icon { width: 23px; height: 23px; font-size: 11px; }
  .atlas-pin-name { display: none; }
  .atlas-pin[aria-pressed="true"] .atlas-pin-name { display: block; left: 31px; }
  .atlas-pin-edge[aria-pressed="true"] .atlas-pin-name { left: auto; right: 31px; }
  .atlas-station { font-size: 10px; }
  .atlas-detail { padding: 10px; }
  .atlas-legend, .atlas-facilities { font-size: .81rem; }
  .atlas-trail-group h3 { font-size: .86rem; }
  #village-map-menu { font-size: 12px; padding-inline: 6px; }
}
